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

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

## Path parameters

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

## Headers

- `Authorization` string, required

## Request body

- object
  - `description` string — Version description.
  - `messages` ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaMessagesItems[] — Messages for this version. Use `{{variable_name}}` placeholders for template variables.
    - `role` string, required
    - `content` union
      - string
      - unknown[]
        - unknown
  - `thinking` ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaThinking — Optional provider-specific reasoning configuration.
  - `model` string — Primary model for this version.
  - `stream` boolean — Whether to stream responses.
  - `temperature` number, double — Sampling temperature (0-2).
  - `max_tokens` integer — Maximum tokens to generate.
  - `top_p` number, double — Nucleus sampling parameter.
  - `frequency_penalty` number, double — Frequency penalty (-2 to 2).
  - `presence_penalty` number, double — Presence penalty (-2 to 2).
  - `reasoning_effort` string, nullable
  - `verbosity` string, nullable
  - `seed` integer, nullable
  - `variables` ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaVariables — Template variables and their default values.
  - `fallback_models` string[] — Fallback models if the primary model fails.
  - `load_balance_models` ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaLoadBalanceModelsItems[] — Weighted load-balancing model configuration.
  - `tools` ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaToolsItems[] — Tools available to the model.
  - `tool_choice` union
    - string
    - object
  - `response_format` ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaResponseFormat — Structured output / response format configuration.
  - `json_schema` ApiPromptsPromptIdVersionsVersionPatchRequestBodyContentApplicationJsonSchemaJsonSchema — 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.

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

## Other responses

- `400` — Bad Request
- `401` — Unauthorized - Missing/invalid authentication
- `404` — Prompt version not found

---

[API](https://skmtc.net/keywordsai/apis/api-reference.md) · [All operations](https://skmtc.net/keywordsai/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/keywordsai/api-reference/revisions/4e064cf81dae/schema)
