Cancel a call
curl --request DELETE \
--url https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/{contactId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/{contactId}"
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/{contactId}', 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
Cancel an on-demand call before it is dialed, by its contact_id
DELETE
/
api
/
v1
/
campaigns
/
{campaignId}
/
contacts
/
on-demand
/
{contactId}
Cancel a call
curl --request DELETE \
--url https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/{contactId} \
--header 'X-API-Key: <api-key>'import requests
url = "https://api.squawkvoice.ai/api/v1/campaigns/{campaignId}/contacts/on-demand/{contactId}"
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/{contactId}', 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."
}A call can be cancelled while it is waiting to be dialed:
pending, retry (waiting for calling hours to open, or backing off after a busy or no-answer) or callback_requested (scheduled). Once a dial has started there is nothing to stop.
You can also cancel waiting calls by hand from On-Demand activity on the campaign’s On-Demand tab in Studio.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 contact_id returned when you placed the call.
Was this page helpful?