> 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 prompts

POST https://api.respan.ai/api/prompts/list/
Content-Type: application/json

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

## 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

### Query parameters

- `page` (integer, optional, default: 1) — Page number.
- `page_size` (integer, optional, default: 25) — Number of prompts per page. Maximum is 100.
- `sort_by` (enum, optional, default: -id) — Sort field. Prefix with `-` for descending. Common values are `-id` and `-current_version__updated_at`.
  - Allowed values: `-id`, `id`, `-current_version__updated_at`, `current_version__updated_at`

### Body (application/json)

This endpoint expects an object.

- `filters` (ApiPromptsListPostRequestBodyContentApplicationJsonSchemaFilters, optional) — Each key is a field to filter on, and each value is a condition: `{"<field>": {"operator": "<operator>", "value": [...]}}`. A prompt must match every condition. To set two conditions on one field, such as a range, pass a list of conditions. **Operators:** `""` (equals, the default), `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains` (ignores case), `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`. Put values in a list: `""` and `in` match any of the listed values, and `not` and `not_in` match none of them. Other operators take one value; for `empty` and `not_empty`, send `[""]`. **Fields:** `prompt_id`, `prompt_slug`, `name`, `description`, `starred`, `commit_count`, `creator_email`, version fields through `current_version__<field>` or `live_version__<field>` (for example `current_version__model` or `current_version__updated_at`), `tags` (prompts with any of the given tag IDs), and `is_deleted` (send `"value": true` to get deleted prompts instead of active ones). Unsupported fields return a 400 error. **Example:** ```json { "name": {"operator": "icontains", "value": ["support"]}, "current_version__model": {"operator": "in", "value": ["gpt-5.5", "claude-sonnet-4-5-20250929"]} } ```

## Response

### 200

Paginated list of prompts.

- `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 ApiPromptsListPostResponsesContentApplicationJsonSchemaResultsItems, optional)

## Errors

### 403 Forbidden Error

The API key is missing, invalid or expired.

- `detail` (string, required)

## Types

### ApiPromptsListPostRequestBodyContentApplicationJsonSchemaFilters

Each key is a field to filter on, and each value is a condition: `{"<field>": {"operator": "<operator>", "value": [...]}}`. A prompt must match every condition. To set two conditions on one field, such as a range, pass a list of conditions. **Operators:** `""` (equals, the default), `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains` (ignores case), `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`. Put values in a list: `""` and `in` match any of the listed values, and `not` and `not_in` match none of them. Other operators take one value; for `empty` and `not_empty`, send `[""]`. **Fields:** `prompt_id`, `prompt_slug`, `name`, `description`, `starred`, `commit_count`, `creator_email`, version fields through `current_version__<field>` or `live_version__<field>` (for example `current_version__model` or `current_version__updated_at`), `tags` (prompts with any of the given tag IDs), and `is_deleted` (send `"value": true` to get deleted prompts instead of active ones). Unsupported fields return a 400 error. **Example:** ```json { "name": {"operator": "icontains", "value": ["support"]}, "current_version__model": {"operator": "in", "value": ["gpt-5.5", "claude-sonnet-4-5-20250929"]} } ```

- `prompt_id` (FilterValue, optional) — A filter condition with an operator and value.
- `prompt_slug` (FilterValue, optional) — A filter condition with an operator and value.
- `name` (FilterValue, optional) — A filter condition with an operator and value.
- `description` (FilterValue, optional) — A filter condition with an operator and value.
- `starred` (FilterValue, optional) — A filter condition with an operator and value.
- `tags` (FilterValue, optional) — A filter condition with an operator and value.
- `current_version__updated_at` (FilterValue, optional) — A filter condition with an operator and value.
- `current_version__created_at` (FilterValue, optional) — A filter condition with an operator and value.
- `is_deleted` (FilterValue, optional) — A filter condition with an operator and value.

### ApiPromptsListPostResponsesContentApplicationJsonSchemaResultsItems

- `id` (string, optional)
- `name` (string, optional)
- `description` (string, optional, nullable)
- `prompt_slug` (string, optional, nullable)
- `tags` (list of ApiPromptsListPostResponsesContentApplicationJsonSchemaResultsItemsTagsItems, optional)
- `current_version` (ApiPromptsListPostResponsesContentApplicationJsonSchemaResultsItemsCurrentVersion, optional, nullable) — The prompt's current version, as the full version object that Get a prompt version returns.
- `live_version` (ApiPromptsListPostResponsesContentApplicationJsonSchemaResultsItemsLiveVersion, optional, nullable) — The deployed version, as the full version object that Get a prompt version returns. `null` until a version is deployed.

### FilterValue

A filter condition with an operator and value.

- `value` (list of any, required) — Value(s) to filter by.
- `operator` (enum, optional, default: ) — Comparison operator. An empty string means equals.
  - Allowed values: ``, `not`, `in`, `not_in`, `lt`, `lte`, `gt`, `gte`, `contains`, `not_contains`, `icontains`, `startswith`, `not_startswith`, `endswith`, `not_endswith`, `empty`, `not_empty`

### ApiPromptsListPostResponsesContentApplicationJsonSchemaResultsItemsTagsItems

- `id` (string, optional)
- `name` (string, optional)
- `color` (string, optional)
- `created_at` (datetime, optional)
- `updated_at` (datetime, optional)

### ApiPromptsListPostResponsesContentApplicationJsonSchemaResultsItemsCurrentVersion

The prompt's current version, as the full version object that Get a prompt version returns.

- `version` (integer, optional)
- `model` (string, optional)
- `updated_at` (datetime, optional)

### ApiPromptsListPostResponsesContentApplicationJsonSchemaResultsItemsLiveVersion

The deployed version, as the full version object that Get a prompt version returns. `null` until a version is deployed.

- `version` (integer, optional)
- `model` (string, optional)
- `updated_at` (datetime, optional)

## Examples

**Request**

```json
{
  "filters": {
    "name": {
      "value": [
        "support"
      ],
      "operator": "icontains"
    },
    "starred": {
      "value": [
        true
      ],
      "operator": ""
    }
  }
}
```

**Response**

```json
{
  "count": 42,
  "next": "https://api.respan.ai/api/prompts/list/?page=2",
  "previous": null,
  "results": [
    {
      "id": "prompt_abc123",
      "name": "Customer Support Assistant",
      "description": "Handles customer support queries with empathy",
      "prompt_slug": "customer-support-assistant",
      "tags": [
        {
          "id": "tag_abc123",
          "name": "support",
          "color": "#3B82F6",
          "created_at": "2026-01-01T00:00:00Z",
          "updated_at": "2026-01-01T00:00:00Z"
        }
      ],
      "current_version": {
        "version": 3,
        "model": "gpt-4o",
        "updated_at": "2026-01-20T10:30:00Z"
      },
      "live_version": {
        "version": 2,
        "model": "gpt-4o-mini",
        "updated_at": "2026-01-15T08:00:00Z"
      },
      "created_at": "2026-01-01T00:00:00Z",
      "updated_at": "2026-01-20T10:30:00Z"
    }
  ]
}
```

**SDK Code**

```python
import requests

url = "https://api.respan.ai/api/prompts/list/"

querystring = {"page":"1","page_size":"25","sort_by":"-current_version__updated_at"}

payload = { "filters": {
        "name": {
            "value": ["support"],
            "operator": "icontains"
        },
        "starred": {
            "value": [True],
            "operator": ""
        }
    } }
headers = {
    "Authorization": "Bearer <respanApiKey>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers, params=querystring)

print(response.json())
```

```javascript
const url = 'https://api.respan.ai/api/prompts/list/?page=1&page_size=25&sort_by=-current_version__updated_at';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <respanApiKey>', 'Content-Type': 'application/json'},
  body: '{"filters":{"name":{"value":["support"],"operator":"icontains"},"starred":{"value":[true],"operator":""}}}'
};

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"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.respan.ai/api/prompts/list/?page=1&page_size=25&sort_by=-current_version__updated_at"

	payload := strings.NewReader("{\n  \"filters\": {\n    \"name\": {\n      \"value\": [\n        \"support\"\n      ],\n      \"operator\": \"icontains\"\n    },\n    \"starred\": {\n      \"value\": [\n        true\n      ],\n      \"operator\": \"\"\n    }\n  }\n}")

	req, _ := http.NewRequest("POST", url, payload)

	req.Header.Add("Authorization", "Bearer <respanApiKey>")
	req.Header.Add("Content-Type", "application/json")

	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/list/?page=1&page_size=25&sort_by=-current_version__updated_at")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <respanApiKey>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"filters\": {\n    \"name\": {\n      \"value\": [\n        \"support\"\n      ],\n      \"operator\": \"icontains\"\n    },\n    \"starred\": {\n      \"value\": [\n        true\n      ],\n      \"operator\": \"\"\n    }\n  }\n}"

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.post("https://api.respan.ai/api/prompts/list/?page=1&page_size=25&sort_by=-current_version__updated_at")
  .header("Authorization", "Bearer <respanApiKey>")
  .header("Content-Type", "application/json")
  .body("{\n  \"filters\": {\n    \"name\": {\n      \"value\": [\n        \"support\"\n      ],\n      \"operator\": \"icontains\"\n    },\n    \"starred\": {\n      \"value\": [\n        true\n      ],\n      \"operator\": \"\"\n    }\n  }\n}")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.respan.ai/api/prompts/list/?page=1&page_size=25&sort_by=-current_version__updated_at', [
  'body' => '{
  "filters": {
    "name": {
      "value": [
        "support"
      ],
      "operator": "icontains"
    },
    "starred": {
      "value": [
        true
      ],
      "operator": ""
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <respanApiKey>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("https://api.respan.ai/api/prompts/list/?page=1&page_size=25&sort_by=-current_version__updated_at");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <respanApiKey>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"filters\": {\n    \"name\": {\n      \"value\": [\n        \"support\"\n      ],\n      \"operator\": \"icontains\"\n    },\n    \"starred\": {\n      \"value\": [\n        true\n      ],\n      \"operator\": \"\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "Authorization": "Bearer <respanApiKey>",
  "Content-Type": "application/json"
]
let parameters = ["filters": [
    "name": [
      "value": ["support"],
      "operator": "icontains"
    ],
    "starred": [
      "value": [true],
      "operator": ""
    ]
  ]] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.respan.ai/api/prompts/list/?page=1&page_size=25&sort_by=-current_version__updated_at")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

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()
```