Skip to main content

Endpoint

method
string
default:"POST"
POST
endpoint
string
/v1/prompt/version/{promptVersionId}/subversion

Authentication

This endpoint requires API key authentication. Include your API key in the request headers:
Authorization: Bearer YOUR_API_KEY

Path Parameters

promptVersionId
string
required
The ID of the prompt version to create a new version from

Request Body

newHeliconeTemplate
object
required
The new prompt template content
isMajorVersion
boolean
Whether this should be a major version bump (e.g., 1.0 -> 2.0) or minor (e.g., 1.0 -> 1.1)
metadata
object
Additional metadata for this version
experimentId
string
Associated experiment ID if this version is part of an experiment
bumpForMajorPromptVersionId
string
Reference to the major version to bump from

Response

data
object
New prompt version details
id
string
Unique identifier for the new version
minor_version
number
Minor version number
major_version
number
Major version number
prompt_v2
string
Prompt ID
model
string
Model specified in the template
helicone_template
string
The template content as JSON string
created_at
string
Version creation timestamp
metadata
object
Version metadata
error
string | null
Error message if the request failed, null otherwise

Example Request

curl -X POST https://api.helicone.ai/v1/prompt/version/pv_xyz789/subversion \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "newHeliconeTemplate": {
      "model": "gpt-4",
      "messages": [
        {
          "role": "system",
          "content": "You are an expert customer support assistant with detailed product knowledge."
        },
        {
          "role": "user",
          "content": "{{user_question}}"
        }
      ]
    },
    "isMajorVersion": false,
    "metadata": {
      "changelog": "Enhanced system prompt with product expertise"
    }
  }'

Example Response

{
  "data": {
    "id": "pv_xyz790",
    "minor_version": 2,
    "major_version": 1,
    "prompt_v2": "prompt_abc123",
    "model": "gpt-4",
    "helicone_template": "{...}",
    "created_at": "2024-01-15T10:30:00Z",
    "metadata": {
      "changelog": "Enhanced system prompt with product expertise"
    }
  },
  "error": null
}

Notes

  • Setting isMajorVersion: true increments the major version (1.x -> 2.0)
  • Setting isMajorVersion: false or omitting it increments the minor version (1.1 -> 1.2)
  • All prompt versions are immutable once created

Build docs developers (and LLMs) love