---
title: "Update Prompt Version Draft"
method: PUT
path: "/v1/prompts/{id}/versions/{version}"
tags: ["Prompt Versions"]
---

# Update Prompt Version Draft

`PUT /v1/prompts/{id}/versions/{version}`

Updates the draft template code of a specific version.
Only versions currently in the 'draft' status may be modified.

## Path parameters

- `id` string, uuid, required
- `version` string, required

## Request body

- UpdateVersionRequest
  - `template` string
  - `model` string, nullable — Optional `provider/model` identifier intended to execute this prompt version.
  - `model_params` object, nullable — Optional provider-specific model parameters. Nested values are supported.

## Response `200`

Version updated successfully

- object
  - `version` PromptVersion, required
    - `id` string, uuid, required — Unique version identifier.
    - `prompt_id` string, uuid, required — Reference to parent Prompt ID.
    - `version` integer, required — Incrementing sequence number of the version.
    - `template` string, required — The template syntax code with Go template parameters.
    - `status` 'draft' | 'stable' | 'live' | 'archived', required — Active lifecycle status of this template version.
    - `model` string, nullable, required — Optional `provider/model` identifier intended to execute this prompt version.
    - `model_params` object, nullable, required — Optional provider-specific model parameters. Nested values are supported.
    - `created_at` string, date-time, required
    - `published_at` string, date-time, nullable, required — Timestamp when status was set to live. Null if draft.
    - `tags` string[], required — List of tag strings attached to this version.

## Other responses

- `400` — Invalid syntax or missing template
- `401` — Unauthorized
- `404` — Version not found
- `422` — Only draft versions can be modified

## Changes

- **2026-07-19** `4260a250ce25` — 2 info
  - the request property `model` became nullable
  - the request property `model_params` became nullable
- **2026-07-14** `bed7a47c6f25` — 5 info
  - added the new optional request property `model`
  - added the new optional request property `model_params`
  - the request property `template` became optional
  - added the required property `version/model` to the response with the `200` status
  - …1 more
- **2026-07-02** `e500bc0895c5` — 1 info
  - the endpoint scheme security `ApiKeyAuth` was removed from the API
- **2026-06-29** `162c1e986d3a` — 2 info
  - api tag `Prompt Versions` added
  - api tag `Prompts` removed
- **2026-06-29** `27457b167aec` — 1 warning, 2 info
  - added the new `stable` enum value to the `version/status` response property for the response status `200`
  - for the `path` request parameter `version`, the type was generalized from `integer` to `string`
  - added the required property `version/tags` to the response with the `200` status

[Full history](https://skmtc.dev/px0-ai/apis/px0-api/changes/v1/prompts/:id/versions/:version/put.md)

---

[API](https://skmtc.dev/px0-ai/apis/px0-api.md) · [All operations](https://skmtc.dev/px0-ai/apis/px0-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/px0-ai/px0-api/revisions/3ed72443989d/schema)
