---
title: List Prompt Versions
description: "List the versions of a Prompt, newest first, with each version type (Live, Candidate, Draft, Archive) and model settings."
product: general
lang: en
token_estimate: 1670
---
# List Prompt Versions

> For AI agents: a documentation index is available at [/llms.txt](/llms.txt). Append `.md` to any page URL for markdown, or send `Accept: text/markdown`.

## List Prompt Versions

**GET** `/console/v1/prompts/{id}/versions`

Full URL: `https://statsigapi.net/console/v1/prompts/{id}/versions`

List Prompt Versions

List the versions of a Prompt, newest first, with each version type (Live, Candidate, Draft, Archive) and model settings.

## Authorizations

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| STATSIG-API-KEY | string | Yes | — | apiKey (header) |

## Path parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| id (path) | string | Yes | — | id |

## Query parameters

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| limit (query) | integer | No | 10 | Results per page Constraints: string, number |
| page (query) | integer | No | 1 | Page number Constraints: string, number |

## Response (application/json)

**200** — List Prompt Versions Success

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object[] | Yes | — | — |
| data.id | string | Yes | — | Constraints: min length: 3, max length: 100 |
| data.name | string | Yes | — | Constraints: min length: 3, max length: 100 |
| data.type | string | No | — | Live is served to users; Candidate is served to code for shadow runs; Draft and Archive are not served. Allowed values: Live, Candidate, Archive, Draft |
| data.version | number | No | — | Constraints: format: double |
| data.prompts | object[] | No | — | — |
| data.prompts.role | string | Yes | — | — |
| data.prompts.content | string | Yes | — | — |
| data.model | string | No | — | — |
| data.provider | string | No | — | — |
| data.eval_model | string | No | — | — |
| data.temperature | number | No | — | Constraints: format: double |
| data.top_p | number | No | — | Constraints: format: double |
| data.max_tokens | number | No | — | Constraints: format: double |
| data.frequency_penalty | number | No | — | Constraints: format: double |
| data.presence_penalty | number | No | — | Constraints: format: double |
| data.workflow_url | string | No | — | Constraints: nullable |
| data.createdTime | number | No | — | Constraints: format: double |
| data.lastModifiedTime | number | No | — | Constraints: format: double |
| data.eval_run_id | string | No | — | Set only by Start Prompt Version Evaluation Job: the eval run it started. Poll it with List Prompt Version Eval Runs. |
| pagination | object | Yes | — | Pagination metadata for checking if there is next page for example. |
| pagination.itemsPerPage | number | Yes | — | Constraints: format: double |
| pagination.pageNumber | number | Yes | — | Constraints: format: double |
| pagination.nextPage | string | Yes | — | Constraints: nullable |
| pagination.previousPage | string | Yes | — | Constraints: nullable |
| pagination.totalItems | number | No | — | Constraints: format: double |
| pagination.all | string | No | — | — |

```json
{
  "message": "string",
  "data": [
    {
      "id": "string",
      "name": "string",
      "type": "Live",
      "version": 0,
      "prompts": [
        {
          "role": "string",
          "content": "string"
        }
      ],
      "model": "string",
      "provider": "string",
      "eval_model": "string",
      "temperature": 0,
      "top_p": 0,
      "max_tokens": 0,
      "frequency_penalty": 0,
      "presence_penalty": 0,
      "workflow_url": "string",
      "createdTime": 0,
      "lastModifiedTime": 0,
      "eval_run_id": "string"
    }
  ],
  "pagination": {
    "itemsPerPage": 0,
    "pageNumber": 0,
    "nextPage": "string",
    "previousPage": "string",
    "totalItems": 0,
    "all": "string"
  }
}
```

**404** — Not Found. The requested resource could not be found.

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| status | integer | Yes | — | Allowed values: 404 |
| message | string | Yes | — | — |

```json
{
  "status": 404,
  "message": "Not Found. The requested resource could not be found."
}
```

## Code samples

### cURL

```bash
curl -X GET "https://statsigapi.net/console/v1/prompts/{id}/versions?limit=10&page=1" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.get(
    "https://statsigapi.net/console/v1/prompts/{id}/versions?limit=10&page=1",
    headers={
        "Content-Type": "application/json",
        "STATSIG-API-KEY": "YOUR_API_KEY"
    }
)
data = response.json()
```

### JavaScript

```javascript
const response = await fetch("https://statsigapi.net/console/v1/prompts/{id}/versions?limit=10&page=1", {
  method: "GET",
  headers: {
    "Content-Type": "application/json",
    "STATSIG-API-KEY": "YOUR_API_KEY"
  }
});
const data = await response.json();
```

### PHP

```php
<?php
$ch = curl_init("https://statsigapi.net/console/v1/prompts/{id}/versions?limit=10&page=1");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "GET");
curl_setopt($ch, CURLOPT_HTTPHEADER, [
    "Content-Type: application/json",
    "STATSIG-API-KEY: YOUR_API_KEY"
]);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
```

### Go

```go
package main

import (
  "bytes"
  "net/http"
)

func main() {
req, _ := http.NewRequest("GET", "https://statsigapi.net/console/v1/prompts/{id}/versions?limit=10&page=1", nil)
req.Header.Set("Content-Type", "application/json")
req.Header.Set("STATSIG-API-KEY", "YOUR_API_KEY")
  client := &http.Client{}
  resp, _ := client.Do(req)
  defer resp.Body.Close()
}
```

### Java

```java
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
      .uri(URI.create("https://statsigapi.net/console/v1/prompts/{id}/versions?limit=10&page=1"))
      .method("GET", HttpRequest.BodyPublishers.noBody())
.header("Content-Type", "application/json")
      .header("STATSIG-API-KEY", "YOUR_API_KEY")
      .build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
```

### Ruby

```ruby
require "net/http"
require "json"

uri = URI("https://statsigapi.net/console/v1/prompts/{id}/versions?limit=10&page=1")
request = Net::HTTP::Get.new(uri)
request["Content-Type"] = "application/json"
request["STATSIG-API-KEY"] = "YOUR_API_KEY"
response = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == "https") do |http|
  http.request(request)
end
```

