Release up to 15 phone numbers
const url = 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/BulkRelease';const options = { method: 'POST', headers: {Authorization: 'Basic <credentials>', 'Content-Type': 'application/json'}, body: '{"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/BulkRelease \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/json' \ --data '{ "phone_numbers": [ "+15555550100", "+15555550101" ] }'Releases each listed number from the account in the path, with the same rules as Release a phone number: numbers that are the default or still in use are skipped. Each number is handled on its own, so the response lists which were released and which failed, with a reason; the call succeeds even when every number fails. A vendor may also release numbers from its own inventory that are assigned to its accounts.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Auth ID of the account to act on: yours or a direct child’s.
Example
AC000000000000000000Request Bodyrequired
Section titled “ Request Bodyrequired ”Numbers to release
object
1 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 released, with reasons.
object
The number as sent.
Why it was not released, e.g. “phone number not found” or a message naming the application or routing that still uses it.
Number of numbers that could not be released.
Summary, e.g. “1 released successfully, 1 could not be released”.
The numbers released.
Number of numbers released.
Example
{ "failed": [ { "phone_number": "+15555550101", "reason": "phone number not found" } ], "failedCount": 1, "message": "1 released successfully, 1 could not be released", "released": [ "+15555550100" ], "releasedCount": 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
exampleThe account in the path could not be looked up
object
Human-readable result or error.
Success or failed.
Example
{ "message": "phone number not found", "status": "failed"}