Release a phone number
const url = 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/%2B15555550100?customerid=AC000000000000000001';const options = {method: 'DELETE', headers: {Authorization: 'Basic <credentials>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request DELETE \ --url 'https://api.siprtc.io/v1/Accounts/AC000000000000000000/PhoneNumbers/%2B15555550100?customerid=AC000000000000000001' \ --header 'Authorization: Basic <credentials>'Releases a number from the account: its application is unlinked and its subscription moves to cancellation_request, so inbound calls and messages to it stop. Within the subscription period you can undo this with Undo a phone number release; a vendor can return it to its inventory with Return a released number to inventory. This operation acts on the account in the path, or on customerid (a direct child) when given; a vendor may also release a number from its own inventory that is assigned to one of its accounts. A number that is the account’s default outbound number, or that is still used by an application, IVR, AI agent, CX router or workflow action, is not released; the 400 message names what still uses it. On success the service answers 204 with no body.
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
AC000000000000000000The number, with or without +.
Example
+15555550100Query Parameters
Section titled “ Query Parameters ”Auth ID of a direct child account to release the number from.
Example
AC000000000000000001Responses
Section titled “ Responses ”Released
Still in use or the default number, does not belong to this account, or the gateway could not resolve your company (company id is empty)
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"}Phone number not found, subscription not found, or the 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"}