Retrieve prompts
This endpoint allows you to get a list of prompts that you have created.
## Get prompt list
Send a GET request to the `/prompts/` endpoint to get a list of prompts that you have created.
```python example.py
url = "https://api.respan.ai/api/prompts/"
api_key = "YOUR_RESPAN_API_KEY" # Replace with your actual Respan API key
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
```
```typescript example.ts
fetch('https://api.respan.ai/api/prompts/',
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_RESPAN_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));
```
## Get a single prompt
You can get a single prompt by sending a GET request to the `/prompts/{prompt_id}/` endpoint.
```python example.py
url = "https://api.respan.ai/api/prompts/{prompt_id}/"
api_key = "YOUR_RESPAN_API_KEY" # Replace with your actual Respan API key
headers = {
"Authorization": f"Bearer {api_key}",
"Content-Type": "application/json"
}
response = requests.get(url, headers=headers)
print(response.json())
```
```typescript example.ts
fetch('https://api.respan.ai/api/prompts/{prompt_id}/',
{
method: 'GET',
headers: {
'Content-Type': 'application/json',
'Authorization': 'Bearer YOUR_RESPAN_API_KEY'
}
})
.then(response => response.json())
.then(data => console.log(data));
```
Authentication
AuthorizationBearer
API key authentication. Get your API key from https://platform.respan.ai/platform/api-keys
Response
Successful response for Retrieve prompts
Errors
401
Unauthorized Error