Undo the release of up to 15 numbers
const url = 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/BulkRevoke';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"customerid":"AC000000000000000001","modified_by":"jane@example.com","phone_numbers":["+15555550100","+15555550101"]}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/BulkRevoke \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "customerid": "AC000000000000000001", "modified_by": "jane@example.com", "phone_numbers": [ "+15555550100", "+15555550101" ] }'Restores each listed released number with the same rules as Undo a phone number release, on your account or with customerid on a direct child account. Each number is handled on its own, so the response lists which were restored and which failed, with a reason; the call succeeds even when every number fails.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Your Auth ID.
Example
AC000000000000000000Request Bodyrequired
Section titled “ Request Bodyrequired ”Numbers to restore
object
Auth ID of a direct child account to restore the numbers for. Omit to restore them for yourself.
Example
AC000000000000000001Optional name of the person making the change, recorded in the audit log.
Example
jane@example.com1 to 15 numbers. Duplicates (ignoring + and spaces) and blank entries are dropped.
Example
[ "+15555550100", "+15555550101"]Responses
Section titled “ Responses ”Per-number results
object
The numbers not restored, with reasons.
object
The number as sent.
Why it was not restored.
Number of numbers that could not be restored.
Summary, e.g. “1 revoked successfully, 1 could not be revoked”.
The numbers restored.
Number of numbers restored.
Example
{ "failed": [ { "phone_number": "+15555550101", "reason": "record not found" } ], "failedCount": 1, "message": "1 revoked successfully, 1 could not be revoked", "revoked": [ "+15555550100" ], "revokedCount": 1}Body not valid JSON, no numbers, or more than 15
object
Human-readable result or error.
Success or failed.
Example
{ "message": "phone number not found", "status": "failed"}Missing or invalid credentials (returned by the API gateway)
Example generated
exampleCustomerid is not your account or a direct child
object
Human-readable result or error.
Success or failed.
Example
{ "message": "phone number not found", "status": "failed"}Your account could not be looked up
object
Human-readable result or error.
Success or failed.
Example
{ "message": "phone number not found", "status": "failed"}The account named in customerid could not be looked up
object
Human-readable result or error.
Success or failed.
Example
{ "message": "phone number not found", "status": "failed"}