> ## Documentation Index
> Fetch the complete documentation index at: https://inkbox.ai/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Router

> Get the WhatsApp router number and the commands people text to reach your agents

A WhatsApp router is a number people message to reach an agent. They text `connect @handle`, and the router replies with a clickable WhatsApp link for that agent. The link opens the destination conversation with `start` prefilled. They tap **Send** to begin; opening the link alone sends nothing.

People can also ask the router for help in ordinary language. It can help connect an exact `@handle`, find their current or past connections, resend a connection link, and answer questions about Inkbox. The router knows it is speaking over WhatsApp and gives WhatsApp links, not instructions for another channel. Messages to the router are not forwarded to the destination agent.

Organization routers are available by request. Contact [support@inkbox.ai](mailto:support@inkbox.ai). An organization router reaches only your organization's agents. Organizations without one use the global Inkbox router, which reaches active agents with WhatsApp enabled.

Resolve the router number at runtime. It can change, so do not hardcode it.

## Get router number

```text theme={null}
GET /triage-number
```

Path is relative to `https://inkbox.ai/api/v1/whatsapp`. Any API key or Console session for your organization can read it.

```json JSON theme={null}
{
  "number": "+15555550199",
  "connect_command": "connect @agent",
  "whatsapp_link": "https://wa.me/15555550199?text=connect%20%40agent",
  "connect_qr_png_data_url": "data:image/png;base64,cXI="
}
```

| Field | Type | Description |
| :- | :- | :- |
| `number` | string | The router's E.164 number |
| `connect_command` | string | A connect command for the selected agent |
| `whatsapp_link` | string | A wa.me draft link for that command |
| `connect_qr_png_data_url` | string | A PNG data URL for the same link |

Returns `503` with `error: "whatsapp_router_unavailable"` when no router is available.

```python Python theme={null}
router = inkbox.whatsapp.get_triage_number()
print(f"Text 'connect @my-agent' to {router.number} on WhatsApp")
```

```typescript TypeScript theme={null}
const router = await inkbox.whatsapp.getTriageNumber();
console.log(`Text 'connect @my-agent' to ${router.number} on WhatsApp`);
```

```bash CLI theme={null}
inkbox whatsapp triage-number
```

```bash cURL theme={null}
curl "https://inkbox.ai/api/v1/whatsapp/triage-number" \
  -H "X-API-Key: YOUR_API_KEY"
```

## Router commands

| Command | Result |
| :- | :- |
| `connect @handle` | Replies with a WhatsApp link with `start` prefilled for that agent |
| `list` | Lists the sender's connected agents and a WhatsApp link for each |
| `disconnect @handle` | Ends the sender's connection to that agent |
| `replace @old @new` | Ends the connection to `@old` and connects `@new` |
| `help` | Explains the commands |

The router records the connection and gives the agent's dedicated number when it has one. Dedicated connections appear in the recipient's connection list and can be disconnected or reconnected, but do not use shared-pool capacity. Otherwise, if the agent's organization has its own shared pool, the router connects the sender through a number from that pool. It never falls back to the global pool for that organization. If the person is already using the available connections in that pool, the router can offer a replacement menu. If no number or eligible connection is available, including while the pool is paused or offline, it asks them to try again later. Only organizations without their own pool use the global shared pool, where a person can hold up to three connections at once. [Phone contact rules](https://inkbox.ai/docs/api/phone/contact-rules.md) must allow the sender, or no number is returned.

### Choose a connection to replace

When connecting would exceed the available shared-pool capacity, the router lists your eligible connected agents in that same pool as numbered choices, followed by **Keep current**. Reply with an agent’s displayed number or listed `@handle` to replace that connection with the requested agent. Choose **Keep current** to leave your connections unchanged.

A successful replacement returns the new agent’s WhatsApp link with `start` prefilled. A failed replacement keeps the previous connection. If the menu expires or your connections change, send `connect @handle` again for fresh choices. A new explicit command, such as `list`, `connect @handle`, `disconnect @handle`, or `help`, takes precedence over a pending menu.

Texting the router sends nothing to the agent. The person must then message the returned number, and that message is what lets the agent reply. Connections made this way appear in [`GET /assignments`](https://inkbox.ai/docs/api/whatsapp/connections#list-assignments).

People can also text `connect @handle` directly to a number in your organization's shared pool. That message connects them to the agent and counts as their first message, so the agent can reply right away. The pool number sends no confirmation.

Router selection can return `409` with `error: "whatsapp_connection_busy"` while a connection setting is changing. Honor `Retry-After` and retry the read.

Manage already-owned resources through [number and router management](https://inkbox.ai/docs/api/whatsapp/management.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.