---
title: "Commit a prompt version"
method: POST
path: "/api/prompts/{prompt_id}/commits/"
tags: ["Prompts"]
---

# Commit a prompt version

`POST /api/prompts/{prompt_id}/commits/`

## Request

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

Commits the current draft as a read-only version. No new draft is created; create a version to keep editing.

## Path parameters

- `prompt_id` string, required

## Request body

- object
  - `description` string: Optional commit message describing the changes.

## Response `201`

Committed version created.

- object
  - `id` string
  - `prompt_version_id` string
  - `version` integer
  - `description` string, nullable
  - `messages` object[]
  - `model` string
  - `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`: There is no draft to commit.
- `403`: The API key is missing, invalid or expired.
- `404`: Prompt not found

## Changes

- **2026-10-21** `c30bcb383ee8`: 1 breaking, 4 info
  - the response property `description` became nullable for the status `201`
  - api operation id `prompts_commitPromptVersion` removed and replaced with `commitPromptVersion`
  - the endpoint scheme security `DashboardJwt` was added to the API
  - api tag `Prompts` added
  - …1 more
- **2026-10-02** `b830b79cfd52`: 3 warning, 4 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 `201` status
  - added the non-success response with the status `403`
  - …3 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 `commit-prompt-version` removed and replaced with `prompts_commitPromptVersion`

[Operation history](https://skmtc.dev/respan/apis/respan-api/changes/api/prompts/:prompt_id/commits/post.md)

---

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