---
title: "List prompt versions"
description: "Results are ordered newest first."
---

<a id="playground-button:docs/apis/prompts/list-prompt-versions"></a>

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

Results are ordered newest first.

## Servers

`https://api.respan.ai`: Respan API Server

<a id="request.auth"></a>

## Authentication

<a id="request.auth.Authorization"></a>

### RespanApiKey

Use your Respan API key for Respan API authentication. Enter only the Respan API key value; clients send Authorization: Bearer &lt;RESPAN_API_KEY&gt;. For /api/responses, provider credentials such as Perplexity, OpenAI, or Azure OpenAI go in Settings -&gt; Providers or respan_params.credential_override in the request body, not in this authentication field.

HTTP scheme: `bearer`; format: `Respan API key`.


```http
Authorization: Bearer $RESPAN_API_KEY
```


**Or:**

### DashboardJwt

Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.

HTTP scheme: `bearer`; format: `Dashboard JWT`.


```http
Authorization: Bearer $RESPAN_DASHBOARD_JWT
```


<a id="request.path"></a>

## Path parameters


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| <a id="request.path.prompt_id"></a>`prompt_id` | `string` | Required | The unique prompt identifier. |


<a id="request.query"></a>

## Query parameters


| Parameter | Type | Required | Description and constraints |
| --- | --- | --- | --- |
| <a id="request.query.page"></a>`page` | `integer` | Optional | Page number.<br />Default: `1`<br />Example: `1` |
| <a id="request.query.page_size"></a>`page_size` | `integer` | Optional | Number of prompt versions per page. Maximum is 500.<br />Default: `200`<br />Maximum: `500`<br />Example: `200` |


<a id="response"></a>

## Responses

### 200

Paginated list of prompt versions.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | Example: `{"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":""},"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"}]}` |
| <a id="response.body.count"></a>`count` | `integer` | Optional | Number of results on this page, not the total. Request pages until `next` is null to get every result. |
| <a id="response.body.next"></a>`next` | `string or null` | Optional | Next page URL. |
| <a id="response.body.previous"></a>`previous` | `string or null` | Optional | Previous page URL. |
| <a id="response.body.results"></a>`results` | `array<object>` | Optional | - |
| `results[]` | `object` | Array item | Example: `{"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":""},"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"}` |
| `results[].id` | `string` | Optional | - |
| `results[].prompt_version_id` | `string` | Optional | - |
| `results[].version` | `integer` | Optional | - |
| `results[].description` | `string or null` | Optional | - |
| `results[].messages` | `array<object>` | Optional | - |
| `results[].messages[]` | `object` | Array item | Message object with at least `role` and `content`.<br />Additional properties are allowed |
| `results[].thinking` | `object or null` | Optional | - |
| `results[].model` | `string` | Optional | - |
| `results[].stream` | `boolean` | Optional | - |
| `results[].temperature` | `number or null` | Optional | - |
| `results[].max_tokens` | `integer or null` | Optional | - |
| `results[].top_p` | `number or null` | Optional | - |
| `results[].frequency_penalty` | `number or null` | Optional | - |
| `results[].presence_penalty` | `number or null` | Optional | - |
| `results[].reasoning_effort` | `string or null` | Optional | - |
| `results[].verbosity` | `string or null` | Optional | - |
| `results[].seed` | `integer or null` | Optional | - |
| `results[].variables` | `object` | Optional | - |
| `results[].tools` | `array<object> or null` | Optional | - |
| `results[].tools[]` | `object` | Array item | - |
| `results[].tool_choice` | `string or null or object` | Optional | - |
| `results[].tool_choice (oneOf 1)` | `string or null` | Schema variant | - |
| `results[].tool_choice (oneOf 2)` | `object` | Schema variant | - |
| `results[].response_format` | `object or null` | Optional | - |
| `results[].json_schema` | `object or null` | Optional | - |
| `results[].is_enforcing_response_format` | `boolean` | Optional | - |
| `results[].readonly` | `boolean` | Optional | - |
| `results[].is_deployed` | `boolean` | Optional | - |
| `results[].edited_by` | `object` | Optional | - |
| `results[].edited_by.id` | `integer` | Optional | - |
| `results[].edited_by.email` | `string` | Optional | - |
| `results[].edited_by.first_name` | `string` | Optional | - |
| `results[].edited_by.last_name` | `string` | Optional | - |
| `results[].created_at` | `string` | Optional | Format: `date-time` |
| `results[].updated_at` | `string` | Optional | Format: `date-time` |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "properties": {
    "count": {
      "type": "integer",
      "description": "Number of results on this page, not the total. Request pages until `next` is null to get every result."
    },
    "next": {
      "type": "string",
      "nullable": true,
      "description": "Next page URL."
    },
    "previous": {
      "type": "string",
      "nullable": true,
      "description": "Previous page URL."
    },
    "results": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "prompt_version_id": {
            "type": "string"
          },
          "version": {
            "type": "integer"
          },
          "description": {
            "type": "string",
            "nullable": true
          },
          "messages": {
            "type": "array",
            "items": {
              "type": "object",
              "description": "Message object with at least `role` and `content`.",
              "additionalProperties": true
            }
          },
          "thinking": {
            "type": "object",
            "nullable": true
          },
          "model": {
            "type": "string"
          },
          "stream": {
            "type": "boolean"
          },
          "temperature": {
            "type": "number",
            "nullable": true
          },
          "max_tokens": {
            "type": "integer",
            "nullable": true
          },
          "top_p": {
            "type": "number",
            "nullable": true
          },
          "frequency_penalty": {
            "type": "number",
            "nullable": true
          },
          "presence_penalty": {
            "type": "number",
            "nullable": true
          },
          "reasoning_effort": {
            "type": "string",
            "nullable": true
          },
          "verbosity": {
            "type": "string",
            "nullable": true
          },
          "seed": {
            "type": "integer",
            "nullable": true
          },
          "variables": {
            "type": "object"
          },
          "tools": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "nullable": true
          },
          "tool_choice": {
            "oneOf": [
              {
                "type": "string",
                "nullable": true
              },
              {
                "type": "object"
              }
            ]
          },
          "response_format": {
            "type": "object",
            "nullable": true
          },
          "json_schema": {
            "type": "object",
            "nullable": true
          },
          "is_enforcing_response_format": {
            "type": "boolean"
          },
          "readonly": {
            "type": "boolean"
          },
          "is_deployed": {
            "type": "boolean"
          },
          "edited_by": {
            "type": "object",
            "properties": {
              "id": {
                "type": "integer"
              },
              "email": {
                "type": "string"
              },
              "first_name": {
                "type": "string"
              },
              "last_name": {
                "type": "string"
              }
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        },
        "example": {
          "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": ""
          },
          "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"
        }
      }
    }
  },
  "example": {
    "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": ""
        },
        "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"
      }
    ]
  }
}
```

</details>

<a id="response.error"></a>

### 403

The API key is missing, invalid or expired.

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
}
```


### 404

Prompt not found

#### application/json


| Field | Type | Requirement | Description and constraints |
| --- | --- | --- | --- |
| `$` | `object` | Body | - |
| `detail` | `string` | Required in parent | - |


<details class="api-schema-source">
<summary>OpenAPI response schema</summary>


```json
{
  "type": "object",
  "required": [
    "detail"
  ],
  "properties": {
    "detail": {
      "type": "string"
    }
  }
}
```

</details>

##### Example


```json
{
  "detail": "Prompt not found"
}
```


## OpenAPI source

The operation and referenced components below retain the complete OpenAPI definitions, including constraints and examples.

<!-- openapi-operation:start -->
<details class="api-schema-source">
<summary>OpenAPI operation</summary>


```json
{
  "summary": "List prompt versions",
  "operationId": "listPromptVersions",
  "tags": [
    "Prompts"
  ],
  "description": "Results are ordered newest first.",
  "parameters": [
    {
      "name": "prompt_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "string"
      },
      "description": "The unique prompt identifier."
    },
    {
      "name": "page",
      "in": "query",
      "schema": {
        "type": "integer",
        "default": 1
      },
      "description": "Page number.",
      "example": 1
    },
    {
      "name": "page_size",
      "in": "query",
      "schema": {
        "type": "integer",
        "default": 200,
        "maximum": 500
      },
      "description": "Number of prompt versions per page. Maximum is 500.",
      "example": 200
    }
  ],
  "responses": {
    "200": {
      "description": "Paginated list of prompt versions.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "properties": {
              "count": {
                "type": "integer",
                "description": "Number of results on this page, not the total. Request pages until `next` is null to get every result."
              },
              "next": {
                "type": "string",
                "nullable": true,
                "description": "Next page URL."
              },
              "previous": {
                "type": "string",
                "nullable": true,
                "description": "Previous page URL."
              },
              "results": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "prompt_version_id": {
                      "type": "string"
                    },
                    "version": {
                      "type": "integer"
                    },
                    "description": {
                      "type": "string",
                      "nullable": true
                    },
                    "messages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "Message object with at least `role` and `content`.",
                        "additionalProperties": true
                      }
                    },
                    "thinking": {
                      "type": "object",
                      "nullable": true
                    },
                    "model": {
                      "type": "string"
                    },
                    "stream": {
                      "type": "boolean"
                    },
                    "temperature": {
                      "type": "number",
                      "nullable": true
                    },
                    "max_tokens": {
                      "type": "integer",
                      "nullable": true
                    },
                    "top_p": {
                      "type": "number",
                      "nullable": true
                    },
                    "frequency_penalty": {
                      "type": "number",
                      "nullable": true
                    },
                    "presence_penalty": {
                      "type": "number",
                      "nullable": true
                    },
                    "reasoning_effort": {
                      "type": "string",
                      "nullable": true
                    },
                    "verbosity": {
                      "type": "string",
                      "nullable": true
                    },
                    "seed": {
                      "type": "integer",
                      "nullable": true
                    },
                    "variables": {
                      "type": "object"
                    },
                    "tools": {
                      "type": "array",
                      "items": {
                        "type": "object"
                      },
                      "nullable": true
                    },
                    "tool_choice": {
                      "oneOf": [
                        {
                          "type": "string",
                          "nullable": true
                        },
                        {
                          "type": "object"
                        }
                      ]
                    },
                    "response_format": {
                      "type": "object",
                      "nullable": true
                    },
                    "json_schema": {
                      "type": "object",
                      "nullable": true
                    },
                    "is_enforcing_response_format": {
                      "type": "boolean"
                    },
                    "readonly": {
                      "type": "boolean"
                    },
                    "is_deployed": {
                      "type": "boolean"
                    },
                    "edited_by": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "integer"
                        },
                        "email": {
                          "type": "string"
                        },
                        "first_name": {
                          "type": "string"
                        },
                        "last_name": {
                          "type": "string"
                        }
                      }
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "updated_at": {
                      "type": "string",
                      "format": "date-time"
                    }
                  },
                  "example": {
                    "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": ""
                    },
                    "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"
                  }
                }
              }
            },
            "example": {
              "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": ""
                  },
                  "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"
                }
              ]
            }
          }
        }
      }
    },
    "403": {
      "$ref": "#/components/responses/InvalidApiKey"
    },
    "404": {
      "description": "Prompt not found",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Prompt not found"
          }
        }
      }
    }
  },
  "security": [
    {
      "RespanApiKey": []
    },
    {
      "DashboardJwt": []
    }
  ]
}
```

</details>
<!-- openapi-operation:end -->

<!-- openapi-path-item:start -->
<details class="api-schema-source">
<summary>OpenAPI path metadata</summary>


```json
{}
```

</details>
<!-- openapi-path-item:end -->

<!-- openapi-components:start -->
<details class="api-schema-source">
<summary>Referenced OpenAPI components</summary>


```json
{
  "responses": {
    "InvalidApiKey": {
      "description": "The API key is missing, invalid or expired.",
      "content": {
        "application/json": {
          "schema": {
            "type": "object",
            "required": [
              "detail"
            ],
            "properties": {
              "detail": {
                "type": "string"
              }
            }
          },
          "example": {
            "detail": "Your API key is invalid or expired, please check your API key in the platform settings."
          }
        }
      }
    }
  },
  "securitySchemes": {
    "DashboardJwt": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Dashboard JWT",
      "description": "Use a dashboard JWT only for dashboard-authenticated endpoints. Respan API-key endpoints use the respanApiKey auth field instead.",
      "x-fern-bearer": {
        "name": "dashboardJwt",
        "env": "RESPAN_DASHBOARD_JWT"
      }
    },
    "RespanApiKey": {
      "type": "http",
      "scheme": "bearer",
      "bearerFormat": "Respan API key",
      "description": "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.",
      "x-fern-bearer": {
        "name": "respanApiKey",
        "env": "RESPAN_API_KEY"
      }
    }
  }
}
```

</details>
<!-- openapi-components:end -->
