Prompts

Create a prompt version checkpoint

POST
/api/prompts/{promptId}/versions

Snapshots the prompt text into a new immutable version. If prompt text is omitted, the current prompt body is used. Returns the new version document; if the text is unchanged from the latest version, the request is treated as a no-op and skipped is true.

Authorization

bearerAuth
AuthorizationBearer <token>

In: header

Path Parameters

promptId*string

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

application/json

application/json

application/json

curl -X POST "https://example.com/api/prompts/string/versions" \  -H "Content-Type: application/json" \  -d '{    "label": "Pre-launch checkpoint",    "displayVersion": "v1.4",    "title": "Pre-launch",    "description": "Snapshot before rolling out to production.",    "source": "manual_save"  }'
{  "message": "Version saved",  "skipped": false,  "version": 5,  "versionId": "65f9b1c2e8a1d4e001a0b1c4"}