Add Custom Phone Number

Adds a custom phone number to an agent. The user must configure their SIP trunk to point to Phonic's SIP server.

Authentication

AuthorizationBearer
Bearer authentication header of the form `Bearer <PHONIC_API_KEY>`. Manage your API keys [here](https://phonic.co/api-keys).

Path parameters

nameOrIdstringRequired
The name or the ID of the agent.

Headers

X-Sip-AddressstringOptional

SIP address of the user’s SIP trunk. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details.

X-Sip-Auth-UsernamestringOptional

SIP auth username. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details.

X-Sip-Auth-PasswordstringOptional

SIP auth password. Optional, but if provided, all three SIP headers (X-Sip-Address, X-Sip-Auth-Username, X-Sip-Auth-Password) must be provided. When these headers are provided, call transfers from the agent will use the provided SIP details.

Query parameters

projectstringOptionalDefaults to main

The name of the project containing the agent. Only used when nameOrId is a name.

Request

This endpoint expects an object.
phone_numberstringRequired

The E.164 formatted phone number to add (e.g., “+15551234567”).

configuration_endpointobject or nullOptional

When not null, the agent will call this endpoint to get configuration options for calls on this phone number.

Response

Success response
successboolean

Errors