Skip to main content
DELETE
/
phone_numbers
/
{id}
JavaScript
import Surge from '@surgeapi/node';

const client = new Surge({
  apiKey: process.env['SURGE_API_KEY'], // This is the default and can be omitted
});

const phoneNumber = await client.phoneNumbers.release('pn_01j9a43avnfqzbjfch6pygv1td');

console.log(phoneNumber.id);
{
  "campaign_id": "cpn_01jjnn7s0zfx5tdcsxjfy93et2",
  "id": "pn_01jsjwe4d9fx3tpymgtg958d9w",
  "name": "(801) 555-1234",
  "number": "+18015551234",
  "type": "local"
}

Documentation Index

Fetch the complete documentation index at: https://docs.surge.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

The ID of the phone number to release.

Example:

"pn_01j9a43avnfqzbjfch6pygv1td"

Response

Released phone number

A phone number that can be used to send and receive messages and calls

campaign_id
string | null
required

The unique identifier of the campaign this phone number is attached to, if any

id
string
required

Unique identifier for the phone number

name
string | null
required

A human-readable name for the phone number

number
string<phone-number>
required

The phone number in E.164 format

Pattern: ^\+[1-9]\d{6,14}$
Example:

"+18015551234"

type
enum<string>
required

Whether the phone number is local, toll-free, or short code

Available options:
local,
short_code,
toll_free