Cancel a call by request ID
curl --request DELETE \
--url https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/by-request-id/{requestId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/by-request-id/{requestId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/by-request-id/{requestId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"contact_id": "6f1c2a9e-4b7d-4e2a-9c51-0d3e8f7a1b24",
"dialing_status": "blocked",
"already_cancelled": false
}
}{
"success": false,
"error": "Unauthorized: Invalid credentials"
}{
"success": false,
"error": "Forbidden: This API key does not have access to this campaign."
}{
"success": false,
"error": "On-demand contact not found"
}{
"status": "error",
"message": "Too many requests, please try again later."
}On-Demand Calls
Cancel a call by request ID
Cancel an on-demand call before it is dialed, by the request_id returned when you placed it
DELETE
/
api
/
v1
/
campaigns
/
{campaignId}
/
contacts
/
on-demand
/
by-request-id
/
{requestId}
Cancel a call by request ID
curl --request DELETE \
--url https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/by-request-id/{requestId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/by-request-id/{requestId}"
headers = {"X-API-Key": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {'X-API-Key': '<api-key>'}};
fetch('https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/by-request-id/{requestId}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));{
"success": true,
"data": {
"contact_id": "6f1c2a9e-4b7d-4e2a-9c51-0d3e8f7a1b24",
"dialing_status": "blocked",
"already_cancelled": false
}
}{
"success": false,
"error": "Unauthorized: Invalid credentials"
}{
"success": false,
"error": "Forbidden: This API key does not have access to this campaign."
}{
"success": false,
"error": "On-demand contact not found"
}{
"status": "error",
"message": "Too many requests, please try again later."
}Use this when your system keeps the
request_id rather than the contact_id. The rules are the same as Cancel a call.Authorizations
An API key from Manage → API Keys in Studio. See Authentication.
Path Parameters
The campaign's ID, copied from its On-Demand tab in Studio.
The request_id returned when you placed the call.
Was this page helpful?