---
title: "Checkout a specific version of a prompt template from history"
method: POST
path: "/api/prompt-templates/{id}/checkout"
tags: ["PromptTemplates"]
---

# Checkout a specific version of a prompt template from history

`POST /api/prompt-templates/{id}/checkout`

## Path parameters

- `id` string, required

## Request body

- object
  - `version` number, required

## Response `200`

Checked-out template

- object
  - `template` PromptTemplateResponse, required
    - `id` string, required
    - `eventType` string, required
    - `scope` 'global' | 'agent' | 'repo', required
    - `scopeId` string, nullable, required
    - `state` 'enabled' | 'default_prompt_fallback' | 'skip_event', required
    - `body` string, required
    - `isDefault` boolean, required
    - `version` number, required
    - `createdBy` string, nullable, required
    - `createdAt` string, required
    - `updatedAt` string, required
    - `defaultDrifted` boolean, required

## Other responses

- `400` — Validation error
- `404` — Template or version not found

## Changes

- **2026-08-20** `d06bca6c3ff5` — 12 breaking, 1 info
  - the `template` response's property type changed from `object` to no type for status `200`
  - removed the required property `template/body` from the response with the `200` status
  - removed the required property `template/createdAt` from the response with the `200` status
  - removed the required property `template/createdBy` from the response with the `200` status
  - …9 more
- **2026-08-07** `06cac6a7c5bc` — 3 info
  - added the media type `application/json` for the response with the status `200`
  - added the media type `application/json` for the response with the status `400`
  - added the media type `application/json` for the response with the status `404`

[Change history](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/changes/api/prompt-templates/:id/checkout/post.md)

---

[API](https://skmtc.dev/desplega-ai/apis/agent-swarm-api.md) · [All operations](https://skmtc.dev/desplega-ai/apis/agent-swarm-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/desplega-ai/agent-swarm-api/revisions/5469c949fc12/schema)
