curl --request POST \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"publishedVersion": {
"id": "0d4e5f60-1a2b-4c3d-9e8f-7a6b5c4d3e21",
"agent_id": "3f0c6a52-8d7e-4b8a-9a43-0f2b5c1e9d11",
"version_number": 4,
"status": "published",
"created_at": 1760090000000,
"created_by": "org-token:42",
"first_published_at": 1760093600000,
"published_at": 1760093600000,
"published_by": "org-token:42",
"greeting_message": "Hello! You've reached Acme billing. What can I do for you today?",
"tools_snapshot": [],
"dictionaries_snapshot": []
},
"outdatedVersion": {
"id": "9a8b7c6d-1234-4f56-8a90-abcdef012345",
"agent_id": "3f0c6a52-8d7e-4b8a-9a43-0f2b5c1e9d11",
"version_number": 3,
"status": "outdated",
"created_at": 1760000000000,
"created_by": "org-token:42",
"first_published_at": 1760000000000,
"published_at": 1760000000000,
"published_by": "org-token:42",
"tools_snapshot": [],
"dictionaries_snapshot": []
}
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "no_draft_to_publish",
"message": "No draft to publish"
}{
"error": "schema_validation_failed",
"message": "agent_model_config.tts_dialect: required for ar",
"details": [
{
"path": "agent_model_config.tts_dialect",
"message": "required for ar"
}
]
}Publish the draft
Makes the agent’s draft the live version: new calls use it from now on. The previously published version becomes outdated and stays available for rollback (POST .../versions/{versionId}/republish). The draft is validated in full first; a draft that fails is refused with 422 and nothing changes. No request body. Needs the publish permission, which organization API keys carry.
curl --request POST \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/publish \
--header 'Authorization: Bearer <token>'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/publish"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/publish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"publishedVersion": {
"id": "0d4e5f60-1a2b-4c3d-9e8f-7a6b5c4d3e21",
"agent_id": "3f0c6a52-8d7e-4b8a-9a43-0f2b5c1e9d11",
"version_number": 4,
"status": "published",
"created_at": 1760090000000,
"created_by": "org-token:42",
"first_published_at": 1760093600000,
"published_at": 1760093600000,
"published_by": "org-token:42",
"greeting_message": "Hello! You've reached Acme billing. What can I do for you today?",
"tools_snapshot": [],
"dictionaries_snapshot": []
},
"outdatedVersion": {
"id": "9a8b7c6d-1234-4f56-8a90-abcdef012345",
"agent_id": "3f0c6a52-8d7e-4b8a-9a43-0f2b5c1e9d11",
"version_number": 3,
"status": "outdated",
"created_at": 1760000000000,
"created_by": "org-token:42",
"first_published_at": 1760000000000,
"published_at": 1760000000000,
"published_by": "org-token:42",
"tools_snapshot": [],
"dictionaries_snapshot": []
}
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "no_draft_to_publish",
"message": "No draft to publish"
}{
"error": "schema_validation_failed",
"message": "agent_model_config.tts_dialect: required for ar",
"details": [
{
"path": "agent_model_config.tts_dialect",
"message": "required for ar"
}
]
}Authorizations
Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.
Response
The draft is now live. warnings is present only when the agent's language model could not be confirmed as currently available; the publish still succeeded.
The full configuration of one agent version, with the tools and dictionaries attached to it as they were when the version was saved. Fields not listed here may also be present.
Show child attributes
Show child attributes
The version that was live before, now outdated; null when there was none.
Show child attributes
Show child attributes
Present only when there is something to report. The publish succeeded.
Show child attributes
Show child attributes