Commit a prompt version

Atomically commits the current draft version. This creates a new readonly snapshot of the draft content and bumps the draft version number by 1. - `description` *string*: Commit message describing the changes. ```Python Python import requests url = "https://api.respan.ai/api/prompts/{prompt_id}/commits/" api_key = "YOUR_RESPAN_API_KEY" headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } data = { "description": "Improved system prompt for better context handling" } response = requests.post(url, headers=headers, json=data) print(response.json()) ``` ```TypeScript TypeScript fetch('https://api.respan.ai/api/prompts/{prompt_id}/commits/', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_RESPAN_API_KEY' }, body: JSON.stringify({ description: 'Improved system prompt for better context handling' }) }) .then(response => response.json()) .then(data => console.log(data)); ```

Authentication

AuthorizationBearer
API key authentication. Get your API key from https://platform.respan.ai/platform/api-keys

Path parameters

prompt_idstringRequired
The unique prompt identifier

Request

This endpoint expects an object.
descriptionstringOptional
Commit description to store on the committed version

Response

Committed version created

Errors

400
Bad Request Error
401
Unauthorized Error