---
title: "Route a number to an agent or SIP extension"
method: PUT
path: "/api/v1/numbers/{id}"
tags: ["numbers"]
---

# Route a number to an agent or SIP extension

`PUT /api/v1/numbers/{id}`

## Request

- Base URL: `https://www.callagent.pro`
- URL: `https://www.callagent.pro/api/v1/numbers/{id}`
- Auth: HTTP bearer

route_mode is REQUIRED. agent -> also send agent_id (assistant_id also accepted, as an alias — the underlying column is named assistant_id, but every other endpoint calls this resource 'agent', so send agent_id if in doubt); extension -> also send route_extension_id; none -> unroute.

## Path parameters

- `id` integer, required

## Request body

- object
  - `route_mode` 'agent' | 'extension' | 'none', required
  - `agent_id` integer, nullable: Preferred name for this field
  - `assistant_id` integer, nullable: Alias for agent_id. Send either one; sending both with different values is a 422
  - `route_extension_id` integer, nullable

## Response `200`

Routing saved. Returns an acknowledgement only; re-read GET /numbers to see the new target.

- object
  - `ok` boolean

## Other responses

- `401`: Missing or invalid Bearer key
- `422`: Sent both agent_id and assistant_id with DIFFERENT values. Either alone is fine; identical values are fine too. This is refused rather than resolved silently, because the old behaviour kept assistant_id and dropped agent_id, which could point a number at an agent the caller never named.
- `429`: Too many requests — see the endpoint's rate limit tier (agent-api 120/min, agent-api-heavy 6/min, agent-api-secrets 10/min)

---

[API](https://skmtc.dev/callagent/apis/callagent-pro-agent-api.md) · [All operations](https://skmtc.dev/callagent/apis/callagent-pro-agent-api/llms.txt) · [OpenAPI document](https://skmtc.dev/callagent/apis/callagent-pro-agent-api/revisions/38072cf8a24b?raw)
