Phone numbers
Update Phone Number
Points a number at an agent, lends it to one for calling out, names it, or forwards its calls — any of the four. agent makes the number that agent's line (it stops being any other agent's; the agent must have voice switched on); callingAgent lets an agent call out on it without answering it (a brought number needs its carrier account's keys saved first); forwardTo sends every call to another phone, and works whether or not an agent answers the number (in the console: Numbers page, the number's menu, Forward calls). They are applied in the order label, agent, callingAgent, forwardTo, and a refusal stops there with the earlier changes kept. Needs a full key.
PATCH/phone-numbers/{number}
Path parameters
- numberstringrequired
- The number, in any spelling — compared on its digits (8 to 15 of them). Encode a leading
+as%2B, or leave it out.
Headers
- Katexs-Workspacestring
- Developers only: the customer workspace this request acts in — its
org_…id fromPOST /customers. Leave it out to act in your own workspace. Refused with404(Workspace not found.) when the id is unknown, is not one of your customers, or is not anorg_…id;410when that customer was deleted (restore it withPOST /customers/{id}/restoreuntil it is erased);403when the key belongs to one customer workspace (it cannot act as another);400when your workspace is not a developer workspace./customers/*andGET /customers/usageare your own workspace's and refuse the header with400: call them without it.
Request body
- labelstring | null
- A name for the number.
nullor""removes it. - agentstring | null
- The agent that answers the number (
ag_…): it becomes that agent's line and stops being any other's. The agent must have voice switched on.nullmakes nothing answer it. - callingAgentstring | null
- The agent that calls out on the number without answering it (
ag_…) — campaigns spread their calls over an agent's numbers.nulltakes it back. Where the number answers is unchanged. - forwardTostring | null
- Forward every call to this number to this phone (E.164, like
+14155550134) without the agent answering — a fallback for when the agent is not working. It rings for 30 seconds. If nobody picks up, a caller on a number from us, Plivo or Twilio hears that nobody could take the call; a caller on a number brought from Telnyx gets no spoken message — the line rings out or returns busy, then ends. A call that is picked up is cut off at its limit: on a number rented here, when the balance can no longer pay for it and never later than 20 minutes (the platform's maximum call length); on a number you brought, after 30 minutes. Premium-rate, shared-cost, toll-free, satellite and some high-cost international destinations are refused (forward_destination_not_allowed, 422). It works whether or not an agent answers the number: with an agent, the forward replaces it; with none (never attached, deleted, or its voice switched off) the forward answers the call itself, so the number never goes quiet. A workspace that cannot pay for a call, or has no free call line, does not forward - the caller hears that the number is not answering. Billed like a call put through to a person: every connected minute on a number rented here (at the voice plan of the agent attached to the number, or the Premium plan when no agent is; under your own keys, the flat own-key price of that set), nothing on a number you brought. A forwarded call is not recorded. Cannot be this number or another number on the platform.nullstops forwarding.
Example request
bash
curl -X PATCH "https://app.katexs.com/api/v1/phone-numbers/{number}" \
-H "Authorization: Bearer $KATEXS_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "Front desk",
"agent": "ag_3f6a9c21-7d4e-4b58-9a1f-0c2e8b7d5a34",
"callingAgent": "ag_9b0e4d17-5a2c-4e6f-b381-7c4d2a0f9e15"
}'Responses
| Status | Description |
|---|---|
200 | The number as it now is. |
400 | A field has the wrong type or is too long, or the body names none of the four (label, agent, callingAgent, forwardTo). |
401 | The key is missing, wrong or revoked. The answer is always the same, whichever it is. |
403 | The key's access level (read-only or build) does not allow this request, the plan does not include it, or a customer's key named another workspace in Katexs-Workspace. code says which: key_scope_read, key_scope_build, workspace_header_forbidden, or forbidden. |
404 | This workspace holds no such number, or no such agent. |
409 | The agent has no voice switched on, it already answers this number, the number is already its own line, or the number is brought and its carrier account's keys are not saved, so it cannot call out. For forwardTo, the code says which: forward_loop (the target is this number or another number on the platform) or number_cannot_forward (the number's phone provider cannot forward calls). |
410 | The customer named in Katexs-Workspace was deleted. POST /customers/{id}/restore brings it back until its erase date. |
422 | forwardTo is a number a forward cannot go to: premium-rate, shared-cost, toll-free, satellite or a high-cost international destination. The code is forward_destination_not_allowed. |
429 | Over a per-minute limit. Wait for Retry-After seconds. code and limit say which limit: rate_limit_resources (240 requests a minute for the workspace), rate_limit_family (2,400 across a developer's customers), rate_limit_calls, rate_limit_messages, rate_limit_codes, rate_limit_code_recipient, concurrent_calls or number_daily_limit. |
500 | A change could not be saved. Changes made before it in the order label, agent, callingAgent, forwardTo are kept; repeat the request. |
503 | forwardTo could not be checked against our own numbers just now, so nothing was set. Try again in a moment. |
Response fields
- numberstringrequired
- The number. A rented number reads as digits with its country code (
918041234567); a brought one as you brought it, usually E.164. - labelstring | nullrequired
- Its name, or null. Always null for a brought number in List Phone Numbers.
- sourcestringrequired
rentedhere and charged monthly, orbroughtfrom your own carrier account and never billed by us. One of:rented,brought.- agentstring | nullrequired
- The agent that answers it (
ag_…), or null for nobody. - sincestring (date-time) | nullrequired
- When a rented number was rented; null for a brought one.
- providerstring | nullrequired
- Your own carrier account a brought number is on (
plivo,vobiz,twilioortelnyx); null for a number rented here. - callingAgentstring | nullrequired
- The agent lent this number to call out on (
ag_…), or null. May differ fromagent. - forwardTostring | nullrequired
- Where every call to this number is forwarded (E.164) instead of the agent answering - and when no agent answers it - or null when the agent answers as usual.
200 response
{
"number": "918041234567",
"label": "Front desk",
"source": "rented",
"agent": "ag_3f6a9c21-7d4e-4b58-9a1f-0c2e8b7d5a34",
"since": "2026-09-02T07:15:40.118Z",
"provider": null,
"callingAgent": "ag_9b0e4d17-5a2c-4e6f-b381-7c4d2a0f9e15",
"forwardTo": null
}Last updated November 2026 · Found a problem? Email support@katexs.com
