---
title: "Add Custom Phone Number"
method: POST
path: "/agents/{nameOrId}/custom-phone-numbers"
tags: ["agents"]
---

# Add Custom Phone Number

`POST /agents/{nameOrId}/custom-phone-numbers`

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

## Path parameters

- `nameOrId` string, required

## Query parameters

- `project` string

## Headers

- `Authorization` string, required
- `X-Sip-Address` string, required
- `X-Sip-Auth-Username` string, required
- `X-Sip-Auth-Password` string, required

## Request body

- object
  - `phone_number` string, required — The E.164 formatted phone number to add (e.g., "+15551234567").
  - `configuration_endpoint` AgentsNameOrIdCustomPhoneNumbersPostRequestBodyContentApplicationJsonSchemaConfigurationEndpoint — When not `null`, the agent will call this endpoint to get configuration options for calls on this phone number.
    - `url` string, required — URL to call. Must be a publicly routable HTTPS URL without embedded credentials.
    - `headers` object — Object of key-value pairs.
    - `timeout_ms` integer — Timeout in milliseconds for the endpoint call.

## Response `200`

Success response

- AgentsAddCustomPhoneNumberResponse200
  - `success` boolean, required

## Other responses

- `400` — Invalid parameters or phone number already assigned
- `401` — Unsupported authentication method
- `403` — Forbidden
- `404` — Agent not found
- `409` — The agent is currently being updated. Please try again.

---

[API](https://skmtc.net/phonic/apis/api-reference.md) · [All operations](https://skmtc.net/phonic/apis/api-reference/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/phonic/api-reference/revisions/dd8166a70626/schema)
