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

Commit the current draft version. This creates a readonly snapshot and advances the draft workflow.

## Path parameters

- `prompt_id` string, required

## Headers

- `Authorization` string, required

## Request body

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

## Response `201`

Committed version created.

- PromptsCommitPromptVersionResponse201
  - `id` string
  - `prompt_version_id` string
  - `version` integer
  - `description` string, nullable
  - `messages` object[]
  - `model` string
  - `readonly` boolean
  - `is_deployed` boolean
  - `edited_by` ApiPromptsPromptIdCommitsPostResponsesContentApplicationJsonSchemaEditedBy
    - `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 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)
