Get publish status
curl --request GET \
--url https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/publish-jobs/{jobId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/publish-jobs/{jobId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/publish-jobs/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"job_id": "0c4f8e2a-6b1d-4a39-9e57-2f8d1c3b6a90",
"stage": "replicating_kb",
"status": "publishing",
"version": {
"version_id": "a71d3e95-2c8b-4f04-8d6a-9b1e5c7f2d38",
"version_number": 4,
"name": "November pricing update"
}
}
}Agents
Get publish status
Follow a publish until its new version is live or the publish fails
GET
/
api
/
v1
/
assistants
/
{assistantId}
/
publish-jobs
/
{jobId}
Get publish status
curl --request GET \
--url https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/publish-jobs/{jobId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/publish-jobs/{jobId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.squawkvoice.ai/api/v1/assistants/{assistantId}/publish-jobs/{jobId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"job_id": "0c4f8e2a-6b1d-4a39-9e57-2f8d1c3b6a90",
"stage": "replicating_kb",
"status": "publishing",
"version": {
"version_id": "a71d3e95-2c8b-4f04-8d6a-9b1e5c7f2d38",
"version_number": 4,
"name": "November pricing update"
}
}
}Use the
When a publish fails,
poll_url that Publish an agent returned, as it is. Call it every few seconds and decide on status:
status | What it means |
|---|---|
publishing | Still running. Wait for published before you rely on the new version. |
published | The new version is live for new phone calls, website chats and emails. |
failed | The publish stopped. What was live stays live, and the new version was never created. |
error gives a short reason. Decide on status, not on its wording, but read it before you try again:
- A knowledge base linked to the agent is being deleted or no longer exists. The message doesn’t say which one, so check the agent’s knowledge base in Studio and remove it from the agent before you publish again.
- The live version changed while the publish was running. Someone made another version live in Studio. Check Get live version and the draft before you publish again, because a publish puts the whole draft live over their choice.
- Anything else. Publish again.
failed, so you can stop polling then.Authorizations
An API key from Manage → API Keys in Studio. See Authentication.
Path Parameters
The agent's ID. Open the agent in Studio and select Copy ID in its header.
The job_id returned when you started the publish.
Was this page helpful?