Skip to navigation

Cancel contacts

View as Markdown

Stops calls to some contacts of a batch while the rest of the batch keeps running. Use it when a contact has already answered you another way (for example on WhatsApp) and no longer needs the call.

Name the contacts either by phones (the numbers you added them with) or by contact_ids (from Get batch contacts), up to 500 per request. Phones follow the same rules as adding contacts: a 10-digit number for India, or any number with country_code (one country code per request).

A contact still waiting for its call (status Pending, or Unanswered and waiting for a retry) is cancelled, and so is any callback booked for it. Its status becomes Cancelled and the batch never calls it again. It stays in the batch and in its contact list.

Each phone or ID gets one result:

  • cancelled: it will not be called.
  • in_call: it is being called right now. That call is not cut. If you still want no further calls, send the request again after the call ends.
  • already_done: there is no call left to stop (the contact is Completed, Failed, Invalid or already Cancelled).
  • not_found: the batch has no contact with this phone or ID.

If a phone is in the batch more than once, every contact with that phone is cancelled, and the result is in_call if any of them is on a call. counts adds up the results.

A cancel can’t be undone through the API. To call a cancelled contact again, add it to the batch again.

Authentication

X-API-Keystring

API key for authentication. Example: raya_ABCD1234567890abcdef

Path parameters

idintegerRequired
The batch ID

Request

This endpoint expects an object.
phoneslist of stringsOptional

Phone numbers as you added them: 10 digits for India, or any digits with country_code.

country_codestringOptional

Country code for every phone in phones (1 to 4 digits, no ”+”). Leave it out for Indian 10-digit numbers.

contact_idslist of integersOptional
Contact IDs from Get batch contacts.

Response

One result per phone or contact ID, plus counts
batch_idintegerOptional
resultslist of objectsOptional

One entry per phone or contact ID sent, in the order sent (repeated values are listed once).

countsobjectOptional

Errors

400
Bad Request Error
404
Not Found Error