Phone numbers

Update a phone number

Changed on

Updates a phone number's details.

patch/phone_numbers/{id}

Request

  • Base URL
    https://api.surge.app
  • URL
    https://api.surge.app/phone_numbers/{id}
  • Auth
    HTTP bearer

Path parameters

idstring required

The ID of the phone number to update.

Example:pn_01jsjwe4d9fx3tpymgtg958d9w

Request body

campaign_idstring

Campaign ID to attach this number to (cpn_...).

metadataMetadata

Set of key-value pairs that will be stored with the object.

namestring

A human-readable name for the phone number.

Example request

{
  "campaign_id": "cpn_01jjnn7s0zfx5tdcsxjfy93et2",
  "metadata": {
    "location": "Downtown store"
  },
  "name": "Letty's Main Line"
}

Response

Updated phone number

campaign_idstring nullable required

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

idstring required

Unique identifier for the phone number

metadataMetadata required

Set of key-value pairs that will be stored with the object.

namestring nullable required

A human-readable name for the phone number

numberstring phone-number required

The phone number in E.164 format

type'local' | 'short_code' | 'toll_free' required

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

Example response

{
  "campaign": {
    "attachment_status": "attached",
    "id": "cpn_01jjnn7s0zfx5tdcsxjfy93et2"
  },
  "campaign_id": "cpn_01jjnn7s0zfx5tdcsxjfy93et2",
  "id": "pn_01jsjwe4d9fx3tpymgtg958d9w",
  "metadata": {
    "location": "Downtown store"
  },
  "name": "(801) 555-1234",
  "number": "+18015551234",
  "type": "local"
}

Changes

    • info

      added the new optional request property

    • info

      added the required property to the response with the status

    • info

      response property campaign_id deprecated

    • info

      added the required property to the response with the status