Retrieve versions
This endpoint allows you to get a list of versions of a prompt.
## Get prompt versions
```python example.py
url = "https://api.respan.ai/api/prompts/{prompt_id}/versions/"
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}/versions/',
{
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 version
You can get a single prompt version by sending a GET request to the `api/prompts/{prompt_id}/versions/{version}/` endpoint.
```python example.py
url = "https://api.respan.ai/api/prompts/{prompt_id}/versions/{version}/"
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}/versions/{version}/',
{
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
Path parameters
prompt_id
Prompt Id
Response
Successful response for Retrieve versions
Errors
401
Unauthorized Error