---
title: Create Prompt Version
description: Create Prompt Version
product: general
token_estimate: 1721
---
# Create Prompt Version

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

## Create Prompt Version

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

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

Create Prompt Version

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

## 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 | Yes | my_config | The Prompt Version display name Constraints: min length: 3, max length: 100, pattern: ^[a-zA-Z0-9_\-. ]*$ |
| provider | string | No | — | — |
| workflow_body | object | No | — | — |
| workflow_body.type | string | Yes | — | Allowed values: JSON |
| workflow_body.value | string | Yes | — | — |
| 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 |
| id | string | No | — | The Prompt Version name ID Constraints: min length: 3, max length: 100, pattern: ^[a-zA-Z0-9_\-.]*$ |
| description | string | No | — | Constraints: max length: 1000 |

## Response (application/json)

**201** — Create Prompt Version

| Name | Type | Required | Default | Description |
| --- | --- | --- | --- | --- |
| message | string | Yes | — | A simple string explaining the result of the operation. |
| data | object | Yes | — | — |
| data.prompts | object[] | No | — | — |
| data.prompts.content | string | Yes | — | — |
| data.prompts.role | string | Yes | — | Allowed values: system, user, assistant |
| data.temperature | number | No | — | Constraints: format: double |
| data.model | string | No | — | — |
| data.name | string | Yes | my_config | The Prompt Version display name Constraints: min length: 3, max length: 100, pattern: ^[a-zA-Z0-9_\-. ]*$ |
| data.provider | string | No | — | — |
| data.workflow_body | object | No | — | — |
| data.workflow_body.type | string | Yes | — | Allowed values: JSON |
| data.workflow_body.value | string | Yes | — | — |
| data.workflow_headers | object[] | No | — | — |
| data.workflow_headers.name | string | Yes | — | — |
| data.workflow_headers.value | string | Yes | — | — |
| data.auth_workflow_headers | object[] | No | — | — |
| data.auth_workflow_headers.name | string | Yes | — | — |
| data.auth_workflow_headers.value | string | Yes | — | — |
| data.eval_model | string | No | — | — |
| data.top_p | number | No | — | Constraints: format: double |
| data.frequency_penalty | number | No | — | Constraints: format: double |
| data.presence_penalty | number | No | — | Constraints: format: double |
| data.max_tokens | number | No | — | Constraints: format: double |
| data.id | string | No | — | The Prompt Version name ID Constraints: min length: 3, max length: 100, pattern: ^[a-zA-Z0-9_\-.]*$ |
| data.description | string | No | — | Constraints: max length: 1000 |

```json
{
  "message": "string",
  "data": {
    "prompts": [
      {
        "content": "string",
        "role": "system"
      }
    ],
    "temperature": 0,
    "model": "string",
    "name": "my_config",
    "provider": "string",
    "workflow_body": {
      "type": "JSON",
      "value": "string"
    },
    "workflow_headers": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "auth_workflow_headers": [
      {
        "name": "string",
        "value": "string"
      }
    ],
    "eval_model": "string",
    "top_p": 0,
    "frequency_penalty": 0,
    "presence_penalty": 0,
    "max_tokens": 0,
    "id": "string",
    "description": "string"
  }
}
```

## Code samples

### cURL

```bash
curl -X POST "https://statsigapi.net/console/v1/prompts/{id}/versions" \
  -H "Content-Type: application/json" \
  -H "STATSIG-API-KEY: YOUR_API_KEY"
```

### Python

```python
import requests

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

