---
title: Update Prompt Version (partial)
description: "Change the messages, model or settings of a version, or set its type: Live promotes it, Candidate serves it to code for shadow runs, Archive retires it. Only…"
product: general
lang: en
token_estimate: 1864
---
# Update Prompt Version (partial)

> 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`.

## Update Prompt Version (partial)

**PATCH** `/console/v1/prompts/{id}/versions/{versionId}`

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

Update Prompt Version (partial)

Change the messages, model or settings of a version, or set its type: Live promotes it, Candidate serves it to code for shadow runs, Archive retires it. Only the fields you include are changed.

## Authorizations

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

## Path parameters

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

## Body (application/json)

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| prompts | object[] | No | — | — |
| prompts.content | string | Yes | — | — |
| prompts.role | string | Yes | — | Allowed values: system, user, assistant |
| temperature | number | No | — | Constraints: format: double |
| model | string | No | — | — |
| name | string | No | — | — |
| provider | string | No | — | — |
| workflow_body | object | No | — | — |
| workflow_body.type | string | Yes | — | Allowed values: JSON |
| workflow_body.value | string | Yes | — | — |
| workflow_url | string | No | — | Offline-eval workflow URL. Empty or null removes it. Changing it clears the stored workflow_headers and auth_workflow_headers unless they are sent in the same request. Constraints: nullable |
| workflow_headers | object[] | No | — | — |
| workflow_headers.name | string | Yes | — | — |
| workflow_headers.value | string | Yes | — | — |
| auth_workflow_headers | object[] | No | — | — |
| auth_workflow_headers.name | string | Yes | — | — |
| auth_workflow_headers.value | string | Yes | — | — |
| eval_model | string | No | — | — |
| top_p | number | No | — | Constraints: format: double |
| frequency_penalty | number | No | — | Constraints: format: double |
| presence_penalty | number | No | — | Constraints: format: double |
| max_tokens | number | No | — | Constraints: format: double |
| type | string | No | — | Set to Live to promote the version, Candidate to serve it to code for shadow runs, Archive to retire it, or Draft to stop serving it. Allowed values: Live, Candidate, Archive, Draft |

## Response (application/json)

**200** — Update Prompt Version

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

```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"
  }
}
```

**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 PATCH "https://statsigapi.net/console/v1/prompts/{id}/versions/{versionId}" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

response = requests.patch(
    "https://statsigapi.net/console/v1/prompts/{id}/versions/{versionId}",
    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/{versionId}", {
  method: "PATCH",
  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/{versionId}");
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PATCH");
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("PATCH", "https://statsigapi.net/console/v1/prompts/{id}/versions/{versionId}", 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/{versionId}"))
      .method("PATCH", 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/{versionId}")
request = Net::HTTP::Patch.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
```

