> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Helicone/helicone/llms.txt
> Use this file to discover all available pages before exploring further.

# Update Prompt

> Create a new version of an existing prompt

## Endpoint

<ParamField path="method" type="string" default="POST">
  POST
</ParamField>

<ParamField path="endpoint" type="string">
  `/v1/prompt/version/{promptVersionId}/subversion`
</ParamField>

## Authentication

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

```bash theme={null}
Authorization: Bearer YOUR_API_KEY
```

## Path Parameters

<ParamField path="promptVersionId" type="string" required>
  The ID of the prompt version to create a new version from
</ParamField>

## Request Body

<ParamField body="newHeliconeTemplate" type="object" required>
  The new prompt template content
</ParamField>

<ParamField body="isMajorVersion" type="boolean">
  Whether this should be a major version bump (e.g., 1.0 -> 2.0) or minor (e.g., 1.0 -> 1.1)
</ParamField>

<ParamField body="metadata" type="object">
  Additional metadata for this version
</ParamField>

<ParamField body="experimentId" type="string">
  Associated experiment ID if this version is part of an experiment
</ParamField>

<ParamField body="bumpForMajorPromptVersionId" type="string">
  Reference to the major version to bump from
</ParamField>

## Response

<ResponseField name="data" type="object">
  New prompt version details

  <ResponseField name="id" type="string">
    Unique identifier for the new version
  </ResponseField>

  <ResponseField name="minor_version" type="number">
    Minor version number
  </ResponseField>

  <ResponseField name="major_version" type="number">
    Major version number
  </ResponseField>

  <ResponseField name="prompt_v2" type="string">
    Prompt ID
  </ResponseField>

  <ResponseField name="model" type="string">
    Model specified in the template
  </ResponseField>

  <ResponseField name="helicone_template" type="string">
    The template content as JSON string
  </ResponseField>

  <ResponseField name="created_at" type="string">
    Version creation timestamp
  </ResponseField>

  <ResponseField name="metadata" type="object">
    Version metadata
  </ResponseField>
</ResponseField>

<ResponseField name="error" type="string | null">
  Error message if the request failed, null otherwise
</ResponseField>

## Example Request

```bash theme={null}
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

```json theme={null}
{
  "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
