Discard the draft
curl --request POST \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/discard-draft \
--header 'Authorization: Bearer <token>'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/discard-draft"
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}/discard-draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "no_draft_to_discard",
"message": "No draft to discard"
}{
"error": "<string>",
"code": "<string>"
}Agents
Discard the draft
Deletes the agent’s unpublished draft. The agent returns to its published version, including the tools and dictionaries attached to it. No request body.
POST
/
v1
/
projects
/
{projectId}
/
agents
/
{id}
/
discard-draft
Discard the draft
curl --request POST \
--url https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/discard-draft \
--header 'Authorization: Bearer <token>'import requests
url = "https://voice-api.onclarity.com/v1/projects/{projectId}/agents/{id}/discard-draft"
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}/discard-draft', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"error": "Invalid or revoked token"
}{
"error": "<string>",
"code": "<string>"
}{
"error": "no_draft_to_discard",
"message": "No draft to discard"
}{
"error": "<string>",
"code": "<string>"
}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 was discarded.