---
title: "Rollback a Prompt"
method: POST
path: "/v1/prompts/{id}/rollback"
tags: ["Prompts"]
---

# Rollback a Prompt

`POST /v1/prompts/{id}/rollback`

Instantly demotes the active live version and promotes a target historical version in a single atomic transaction.

## Path parameters

- `id` string, uuid, required

## Request body

- object
  - `target_version` integer, required — The historical version number to promote to live.
  - `rollback_reason` string, required — The reason for rolling back.

## Response `200`

Prompt successfully rolled back

- 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 UUID format or request body
- `401` — Unauthorized
- `403` — Forbidden
- `404` — Prompt or target version not found

---

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