curl --request POST \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/versions/{versionId}/republish \
--header 'Authorization: Bearer <token>'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/versions/{versionId}/republish"
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}/versions/{versionId}/republish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"publishedVersion": {
"id": "9a8b7c6d-1234-4f56-8a90-abcdef012345",
"agent_id": "3f0c6a52-8d7e-4b8a-9a43-0f2b5c1e9d11",
"version_number": 3,
"status": "published",
"created_at": 1760000000000,
"created_by": "org-token:42",
"first_published_at": 1760000000000,
"published_at": 1760200000000,
"published_by": "org-token:42",
"tools_snapshot": [],
"dictionaries_snapshot": []
},
"outdatedVersion": {
"id": "0d4e5f60-1a2b-4c3d-9e8f-7a6b5c4d3e21",
"agent_id": "3f0c6a52-8d7e-4b8a-9a43-0f2b5c1e9d11",
"version_number": 4,
"status": "outdated",
"created_at": 1760090000000,
"created_by": "org-token:42",
"first_published_at": 1760093600000,
"published_at": 1760093600000,
"published_by": "org-token:42",
"tools_snapshot": [],
"dictionaries_snapshot": []
}
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "draft_exists",
"message": "A draft exists for this agent — publish or discard it first"
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": [
"<unknown>"
]
}Roll back to an earlier version
Makes an outdated version live again; the currently published version becomes outdated. Refused while the agent has a draft (publish or discard it first). The version is re-validated against today’s rules, so a very old version may be refused with 422. 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}/versions/{versionId}/republish \
--header 'Authorization: Bearer <token>'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/versions/{versionId}/republish"
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}/versions/{versionId}/republish', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"publishedVersion": {
"id": "9a8b7c6d-1234-4f56-8a90-abcdef012345",
"agent_id": "3f0c6a52-8d7e-4b8a-9a43-0f2b5c1e9d11",
"version_number": 3,
"status": "published",
"created_at": 1760000000000,
"created_by": "org-token:42",
"first_published_at": 1760000000000,
"published_at": 1760200000000,
"published_by": "org-token:42",
"tools_snapshot": [],
"dictionaries_snapshot": []
},
"outdatedVersion": {
"id": "0d4e5f60-1a2b-4c3d-9e8f-7a6b5c4d3e21",
"agent_id": "3f0c6a52-8d7e-4b8a-9a43-0f2b5c1e9d11",
"version_number": 4,
"status": "outdated",
"created_at": 1760090000000,
"created_by": "org-token:42",
"first_published_at": 1760093600000,
"published_at": 1760093600000,
"published_by": "org-token:42",
"tools_snapshot": [],
"dictionaries_snapshot": []
}
}{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "draft_exists",
"message": "A draft exists for this agent — publish or discard it first"
}{
"error": "<string>",
"message": "<string>",
"issues": [
{
"path": "<string>",
"code": "<string>",
"message": "<string>"
}
],
"details": [
"<unknown>"
]
}Authorizations
Your organization API key (it starts with anek_org_). The same key works on the Voice API and the Support API. See Authentication.
Path Parameters
Project id
Agent id
Id of an outdated version, from GET .../agents/{id}/versions.
Response
The version is live again. warnings is present only when the agent's language model could not be confirmed as currently available.
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