Deploy a prompt version

Sets a committed version as the live (deployed) version. The version must be committed (readonly) first. Deploying a new version automatically un-deploys the previous live version. - `version` *integer* **required**: The version number to deploy. ```Python Python import requests url = "https://api.respan.ai/api/prompts/{prompt_id}/deployments/" api_key = "YOUR_RESPAN_API_KEY" headers = { "Authorization": f"Bearer {api_key}", "Content-Type": "application/json" } data = { "version": 3 } response = requests.post(url, headers=headers, json=data) print(response.json()) ``` ```TypeScript TypeScript fetch('https://api.respan.ai/api/prompts/{prompt_id}/deployments/', { method: 'POST', headers: { 'Content-Type': 'application/json', 'Authorization': 'Bearer YOUR_RESPAN_API_KEY' }, body: JSON.stringify({ version: 3 }) }) .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.
versionintegerRequired
The committed version number to deploy

Response

Version deployed successfully

Errors

400
Bad Request Error
401
Unauthorized Error
404
Not Found Error