Release a number
const url = 'https://api.clearance.rest/numbers/release';const options = { method: 'POST', headers: {'X-API-Key': '<X-API-Key>', 'Content-Type': 'application/json'}, body: '{"sid":"c1aaeac1-ec52-44e2-b00a-d1350fb6bee6"}'};
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.clearance.rest/numbers/release \ --header 'Content-Type: application/json' \ --header 'X-API-Key: <X-API-Key>' \ --data '{ "sid": "c1aaeac1-ec52-44e2-b00a-d1350fb6bee6" }'Releases a number. What that means depends on the number’s provider, which is read from the number itself:
-
Twilio: the number is deleted from the Twilio account.
-
Hero SMS: the activation is cancelled (refunded if no SMS arrived) or completed (if one did). Hero SMS refuses cancellation during the first ~2 minutes after renting; retry after that, or let the rental expire and refund on its own.
-
Mobile: only your project’s attachment is removed.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”object
The sid of a number from GET /list. Twilio’s own providerSid (PN…) is also accepted.
Example
{ "sid": "c1aaeac1-ec52-44e2-b00a-d1350fb6bee6"}Responses
Section titled “Responses”Released.
object
Example
{ "success": true}sid is missing.
Error envelope returned with a non-2xx status.
object
Human-readable error message.
Example
{ "success": false, "error": "sid zorunludur"}The X-API-Key header is missing or invalid.
Error envelope returned with a non-2xx status.
object
Human-readable error message.
Example
{ "success": false, "error": "geçersiz API anahtarı"}The number does not belong to your project.
Error envelope returned with a non-2xx status.
object
Human-readable error message.
Example
{ "success": false, "error": "numara bu projeye ait değil"}The upstream provider call failed (network error, auth error, or the provider’s own error).
Error envelope returned with a non-2xx status.
object
Human-readable error message.
Example
{ "success": false, "error": "invalid json body"}