---
title: "Update a prompt version"
method: PATCH
path: "/api/prompts/{prompt_id}/versions/{version}/"
tags: ["Prompts"]
---

# Update a prompt version

`PATCH /api/prompts/{prompt_id}/versions/{version}/`

## Request

- Base URL: `https://api.respan.ai`
- URL: `https://api.respan.ai/api/prompts/{prompt_id}/versions/{version}/`
- Auth: one of:
  - HTTP bearer
  - HTTP bearer

Set `deploy: true` to make this version live immediately.

## Path parameters

- `prompt_id` string, required
- `version` integer, required

## Request body

- object
  - `description` string: Version description.
  - `messages` object[]: Messages for this version. Use `{{variable_name}}` placeholders for template variables.
    - `role` string, required
    - `content` union
      - string, nullable
      - unknown[]
        - unknown
  - `thinking` object, nullable: Optional provider-specific reasoning configuration.
  - `model` string: Primary model for this version.
  - `stream` boolean: Whether to stream responses.
  - `temperature` number: Sampling temperature (0-2).
  - `max_tokens` integer: Maximum tokens to generate.
  - `top_p` number: Nucleus sampling parameter.
  - `frequency_penalty` number: Frequency penalty (-2 to 2).
  - `presence_penalty` number: Presence penalty (-2 to 2).
  - `reasoning_effort` string, nullable
  - `verbosity` string, nullable
  - `seed` integer, nullable
  - `variables` object: Template variables and their default values.
  - `fallback_models` string[]: Fallback models if the primary model fails.
  - `load_balance_models` object[]: Weighted load-balancing model configuration.
  - `tools` object[]: Tools available to the model.
  - `tool_choice` union
    - string, nullable
    - object
  - `response_format` object, nullable: Structured output / response format configuration.
  - `json_schema` object, nullable: JSON schema used for structured outputs when configured.
  - `is_enforcing_response_format` boolean: Whether to strictly enforce the response format.
  - `deploy` boolean: Deploy this version as the live version immediately.

## Response `200`

Prompt version updated successfully.

- object
  - `id` string
  - `prompt_version_id` string
  - `version` integer
  - `description` string, nullable
  - `messages` object[]
    - `role` string, required
    - `content` union
      - string, nullable
      - unknown[]
        - unknown
  - `thinking` object, nullable
  - `model` string
  - `stream` boolean
  - `temperature` number, nullable
  - `max_tokens` integer, nullable
  - `top_p` number, nullable
  - `frequency_penalty` number, nullable
  - `presence_penalty` number, nullable
  - `reasoning_effort` string, nullable
  - `verbosity` string, nullable
  - `seed` integer, nullable
  - `variables` object
  - `fallback_models` string[], nullable
  - `load_balance_models` object[], nullable
  - `tools` object[], nullable
  - `tool_choice` union
    - string, nullable
    - object
  - `response_format` object, nullable
  - `json_schema` object, nullable
  - `is_enforcing_response_format` boolean
  - `readonly` boolean
  - `edited_by` object
    - `id` integer
    - `email` string
    - `first_name` string
    - `last_name` string
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400`: Validation failed: the version is read-only, or `deploy` targets a draft.
- `403`: The API key is missing, invalid or expired.
- `404`: Version not found

## Changes

- **2026-10-21** `c30bcb383ee8`: 33 breaking, 21 info
  - request body became required
  - removed `#/components/schemas/ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaJsonSchema, subschema #2` from the `json_schema` request property `oneOf` list
  - removed `#/components/schemas/ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaResponseFormat, subschema #2` from the `response_format` request property `oneOf` list
  - removed `#/components/schemas/ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaThinking, subschema #2` from the `thinking` request property `oneOf` list
  - …50 more
- **2026-10-02** `b830b79cfd52`: 3 warning, 3 info
  - removed the optional property `error` from the response with the `400` status
  - removed the optional property `error` from the response with the `404` status
  - removed the optional property `is_deployed` from the response with the `200` status
  - added the non-success response with the status `403`
  - …2 more
- **2026-09-17** `6fa8242da8c2`: 1 warning, 1 info
  - deleted the `header` request parameter `Authorization`
  - the endpoint scheme security `RespanApiKey` was added to the API
- **2026-09-12** `22b868ef3f22`: 1 info
  - api operation id `update-prompt-version` removed and replaced with `prompts_updatePromptVersion`
- …earlier changes not shown

[Operation history](https://skmtc.dev/keywordsai/apis/respan-api/changes/api/prompts/:prompt_id/versions/:version/patch.md)

---

[API](https://skmtc.dev/keywordsai/apis/respan-api.md) - [All operations](https://skmtc.dev/keywordsai/apis/respan-api/llms.txt) - [OpenAPI document](https://skmtc.dev/keywordsai/apis/respan-api/revisions/900841387635?raw)
