Publish the draft
Publish the current draft so the next live call uses it. Runs the full validator first (same rules the editor's Health page surfaces), then checks whether this version's test suite has run green on THIS version. On a validator failure the result is `{ ok: false, diagnostics }`, read them, fix them, retry. On a suite warning it is `{ ok: false, code: "suite_not_green", suite: { untested, failing, inconclusive } }`, show the operator the scenario names, then either run them with `run_all_tests`, or if the operator chooses to publish anyway, retry with `acknowledgeSuite: true`. Don't publish without explicit user intent.
Authorization
bearerAuth A personal access token from Settings > API tokens.
In: header
Path Parameters
Workspace slug (GET /me lists yours).
Agent slug within the workspace.
Header Parameters
A key you choose, such as a UUID, that makes this POST safe to retry. Within 24 hours the same key and request answers with the first successful answer and runs nothing, the same key with a different request answers 422 idempotency_key_reused, and a key whose request is still running answers 409 idempotency_key_in_use. A failed request keeps nothing, so the same key runs it again.
1 <= length <= 255Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
application/problem+json
curl -X POST "https://example.com/workspaces/string/agents/string/versions/publish" \ -H "Content-Type: application/json" \ -d '{}'{
"versionId": "string",
"versionNumber": 0,
"property1": null,
"property2": null
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}{
"type": "http://example.com",
"title": "string",
"status": 0,
"detail": "string",
"code": "string",
"errors": [
{
"path": "string",
"message": "string"
}
],
"estimate": {},
"retryAfterSeconds": 0
}Delete a version DELETE
Delete an old draft or retired version of this agent. The API refuses three cases: (1) the published/live version (publish a different version first), (2) the agent's only remaining version (archive the agent instead), (3) a version that handled real calls, every session records the version that served it, and deleting the version would erase the record of which prompt and tools produced those calls' scores. Editor test chats do not count, so a draft you only tried in the text tester stays deletable. Tools and test-run history for that version cascade; call transcripts themselves stay.
Discard the draft's changes POST
Discard the current draft's changes by re-copying the live published version onto it, prompt, tools, voice and model config all revert to exactly what is published. Use when the operator wants to throw away the draft's edits and start again from the live version. Only works when there is a draft above a published version.