Skip to main content
PATCH
/
v1
/
phone-numbers
/
{phone_id}
Update Phone Number
curl --request PATCH \
  --url https://api.oneinbox.ai/v1/phone-numbers/{phone_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "friendly_name": "<string>",
  "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
  "inbound_routing": {
    "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
    "fallback": {
      "agent_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
    },
    "voicemail_message": "<string>"
  }
}
'
{
  "id": "<string>",
  "phone_number": "<string>",
  "friendly_name": "<string>",
  "provider": "<string>",
  "agent_id": "<string>",
  "status": "<string>",
  "inbound_trunk_id": "<string>",
  "outbound_trunk_id": "<string>",
  "dispatch_rule_id": "<string>",
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z",
  "inbound_routing": {
    "agent_id": "<string>",
    "fallback": {
      "agent_id": "<string>"
    },
    "voicemail_message": "<string>"
  }
}

Authorizations

Authorization
string
header
required

Your API key sent as a Bearer credential — Authorization: Bearer <api_key>, where <api_key> starts with oi_sk_ (create one via POST /v1/api-keys). Although the field is labelled 'token', paste your API key here. A dashboard JWT is also accepted on this header for the same endpoints.

Path Parameters

phone_id
string<uuid>
required

Body

application/json
friendly_name
string | null
agent_id
string<uuid> | null
inbound_routing
InboundRoutingUpdate · object

Partial routing patch for PATCH /phone-numbers/{id}. Every field is optional so callers can change just one knob (e.g. voicemail_message) without re-sending agent_id. The service MERGES the provided fields into the number's existing inbound_routing — fields left unset are preserved; an explicit null on fallback clears it. agent_id, when omitted, keeps the current routing agent (falling back to the number's column-level agent_id).

Response

Successful Response

id
string
required
phone_number
string
required
friendly_name
string | null
required
provider
string
required
agent_id
string
required
status
string
required
inbound_trunk_id
string | null
required
outbound_trunk_id
string | null
required
dispatch_rule_id
string | null
required
created_at
string<date-time>
required
updated_at
string<date-time>
required
inbound_routing
InboundRouting · object

Per-number routing override. Stored as JSONB so we can extend with business-hours and caller-id rules later without a schema change.