> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://www.respan.ai/docs/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://www.respan.ai/docs/_mcp/server.

# List prompt versions

GET https://api.respan.ai/api/prompts/{prompt_id}/versions/

Results are ordered newest first.

Reference: https://www.respan.ai/docs/apis/prompts/list-prompt-versions

## Authentication

- `Authorization` header (bearer token, required) — Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer \<RESPAN\_API\_KEY>. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -> Providers or respan\_params.credential\_override in the request body, not in this authentication field.
- `Authorization` header (bearer token, required) — Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

## Request

### Path parameters

- `prompt_id` (string, required) — The unique prompt identifier.

### Query parameters

- `page` (integer, optional, default: 1) — Page number.
- `page_size` (integer, optional, default: 200) — Number of prompt versions per page. Maximum is 500.

## Response

### 200

Paginated list of prompt versions.

- `count` (integer, optional) — Number of results on this page, not the total. Request pages until `next` is null to get every result.
- `next` (string, optional, nullable) — Next page URL.
- `previous` (string, optional, nullable) — Previous page URL.
- `results` (list of ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItems, optional)

## Errors

### 403 Forbidden Error

The API key is missing, invalid or expired.

- `detail` (string, required)

### 404 Not Found Error

Prompt not found

- `detail` (string, required)

## Types

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItems

- `id` (string, optional)
- `prompt_version_id` (string, optional)
- `version` (integer, optional)
- `description` (string, optional, nullable)
- `messages` (list of map from string to any, optional)
- `thinking` (ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsThinking, optional, nullable)
- `model` (string, optional)
- `stream` (boolean, optional)
- `temperature` (double, optional, nullable)
- `max_tokens` (integer, optional, nullable)
- `top_p` (double, optional, nullable)
- `frequency_penalty` (double, optional, nullable)
- `presence_penalty` (double, optional, nullable)
- `reasoning_effort` (string, optional, nullable)
- `verbosity` (string, optional, nullable)
- `seed` (integer, optional, nullable)
- `variables` (ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsVariables, optional)
- `fallback_models` (list of string, optional, nullable)
- `load_balance_models` (list of ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsLoadBalanceModelsItems, optional, nullable)
- `tools` (list of ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsToolsItems, optional, nullable)
- `tool_choice` (ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsToolChoice, optional)
- `response_format` (ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsResponseFormat, optional, nullable)
- `json_schema` (ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsJsonSchema, optional, nullable)
- `is_enforcing_response_format` (boolean, optional)
- `readonly` (boolean, optional)
- `is_deployed` (boolean, optional)
- `edited_by` (ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsEditedBy, optional)
- `created_at` (datetime, optional)
- `updated_at` (datetime, optional)

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsThinking

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsVariables

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsLoadBalanceModelsItems

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsToolsItems

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsToolChoice

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsResponseFormat

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsJsonSchema

### ApiPromptsPromptIdVersionsGetResponsesContentApplicationJsonSchemaResultsItemsEditedBy

- `id` (integer, optional)
- `email` (string, optional)
- `first_name` (string, optional)
- `last_name` (string, optional)

## Examples

**Response**

```json
{
  "count": 5,
  "next": null,
  "previous": null,
  "results": [
    {
      "id": "pv_abc123",
      "prompt_version_id": "pv_abc123",
      "version": 3,
      "description": "Added context variable",
      "messages": [
        {
          "role": "system",
          "content": "You are a helpful assistant. Context: {{context}}"
        },
        {
          "role": "user",
          "content": "{{user_query}}"
        }
      ],
      "thinking": null,
      "model": "gpt-4o",
      "stream": false,
      "temperature": 0.7,
      "max_tokens": 2048,
      "top_p": 1,
      "frequency_penalty": 0,
      "presence_penalty": 0,
      "reasoning_effort": null,
      "verbosity": null,
      "seed": null,
      "variables": {
        "context": "",
        "user_query": ""
      },
      "fallback_models": [
        "gpt-4o-mini"
      ],
      "load_balance_models": [
        {
          "model": "gpt-4o",
          "weight": 0.8
        },
        {
          "model": "gpt-4o-mini",
          "weight": 0.2
        }
      ],
      "tools": [
        {
          "type": "function",
          "function": {
            "name": "search_knowledge_base"
          }
        }
      ],
      "tool_choice": "auto",
      "response_format": null,
      "json_schema": null,
      "is_enforcing_response_format": false,
      "readonly": false,
      "is_deployed": false,
      "edited_by": {
        "id": 123,
        "email": "user@example.com",
        "first_name": "John",
        "last_name": "Doe"
      },
      "created_at": "2026-01-20T10:30:00Z",
      "updated_at": "2026-01-20T10:30:00Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.respan.ai/api/prompts/prompt_id/versions/"

querystring = {"page":"1","page_size":"200"}

headers = {"Authorization": "Bearer <respanApiKey>"}

response = requests.get(url, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.respan.ai/api/prompts/prompt_id/versions/?page=1&page_size=200';
const options = {method: 'GET', headers: {Authorization: 'Bearer <respanApiKey>'}};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"net/http"
	"io"
)

func main() {

	url := "https://api.respan.ai/api/prompts/prompt_id/versions/?page=1&page_size=200"

	req, _ := http.NewRequest("GET", url, nil)

	req.Header.Add("Authorization", "Bearer <respanApiKey>")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.respan.ai/api/prompts/prompt_id/versions/?page=1&page_size=200")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <respanApiKey>'

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.get("https://api.respan.ai/api/prompts/prompt_id/versions/?page=1&page_size=200")
  .header("Authorization", "Bearer <respanApiKey>")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.respan.ai/api/prompts/prompt_id/versions/?page=1&page_size=200', [
  'headers' => [
    'Authorization' => 'Bearer <respanApiKey>',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.respan.ai/api/prompts/prompt_id/versions/?page=1&page_size=200");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <respanApiKey>");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Authorization": "Bearer <respanApiKey>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.respan.ai/api/prompts/prompt_id/versions/?page=1&page_size=200")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "GET"
request.allHTTPHeaderFields = headers

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```