PATCH
/
update-phone-number
/
{phone_number}
import Retell from 'retell-sdk';

const client = new Retell({
  apiKey: 'YOUR_RETELL_API_KEY',
});

async function main() {
  const phoneNumberResponse = await client.phoneNumber.update('+14157774444', {
    inbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
    nickname: 'Frontdesk Number',
    outbound_agent_id: 'oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD',
  });

  console.log(phoneNumberResponse.inbound_agent_id);
}

main();
{
  "phone_number": "+14157774444",
  "phone_number_type": "retell-twilio",
  "phone_number_pretty": "+1 (415) 777-4444",
  "inbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
  "outbound_agent_id": "oBeDLoLOeuAbiuaMFXRtDOLriTJ5tSxD",
  "inbound_agent_version": 1,
  "outbound_agent_version": 1,
  "area_code": 415,
  "nickname": "Frontdesk Number",
  "inbound_webhook_url": "https://example.com/inbound-webhook",
  "last_modification_timestamp": 1703413636133
}

Authorizations

Authorization
string
header
required

Authentication header containing API key (find it in dashboard). The format is "Bearer YOUR_API_KEY"

Path Parameters

phone_number
string
required

E.164 format of the number (+country code, then number with no space, no special characters), used as the unique identifier for phone number APIs.

Example:

"+14157774444"

Body

application/json

Response

200
application/json
Successfully updated an phone number object.

The response is of type object.