Rent Phone Number

Phone numbers

Rent Phone Number

Rents a number from Search Available Phone Numbers. This costs money: the first month's rent (the monthlyPrice the search showed) is charged from your balance at once, and again every month on the same day until you release the number. Every refusal happens before anything is bought or charged. The number arrives answered by nobody — Update Phone Number points it at an agent. Send an Idempotency-Key so a retry cannot rent twice: a repeat returns the first answer with Idempotent-Replayed: true, and a request that failed lets the same key try again. Needs a full key.

POST/phone-numbers

Headers

Idempotency-Keystring
Any unique string. A retry with the same key within 24 hours returns the first request's answer instead of acting twice.
Katexs-Workspacestring
Developers only: the customer workspace this request acts in — its org_… id from POST /customers. Leave it out to act in your own workspace. Refused with 404 (Workspace not found.) when the id is unknown, is not one of your customers, or is not an org_… id; 410 when that customer was deleted (restore it with POST /customers/{id}/restore until it is erased); 403 when the key belongs to one customer workspace (it cannot act as another); 400 when your workspace is not a developer workspace. /customers/* and GET /customers/usage are your own workspace's and refuse the header with 400: call them without it.

Request body

numberstringrequired
A number from Search Available Phone Numbers, in any spelling.

Example request

bash
curl -X POST "https://app.katexs.com/api/v1/phone-numbers" \
  -H "Authorization: Bearer $KATEXS_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "number": "918041234567"
}'

Responses

StatusDescription
201The number is yours, as Get Phone Number shows it.
400number is missing or is not a phone number.
401The key is missing, wrong or revoked. The answer is always the same, whichever it is.
402Your balance does not hold a month's rent. Top up first.
403The key may not do this, the Free plan cannot rent numbers, or new numbers are paused on this account.
404The Katexs-Workspace header names a workspace that is unknown, is not one of your customers, or is not an org_… id. Always this one sentence, so a key cannot learn which ids exist in other accounts.
409Somebody already holds that number.
410The customer named in Katexs-Workspace was deleted. POST /customers/{id}/restore brings it back until its erase date.
429Over 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.
503The number could not be bought or set up just now; if it was bought, it has been handed back and nothing was charged. Try again, or pick another.

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
rented here and charged monthly, or brought from 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, twilio or telnyx); null for a number rented here.
callingAgentstring | nullrequired
The agent lent this number to call out on (ag_…), or null. May differ from agent.
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.
201 response
{
  "number": "918041234567",
  "label": null,
  "source": "rented",
  "agent": null,
  "since": "2026-10-06T10:30:05.442Z",
  "provider": null,
  "callingAgent": null
}

Last updated November 2026 · Found a problem? Email support@katexs.com