Inkbox

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

---

# Router
description: Discover the Inkbox iMessage router number and the connect command humans text to reach your agent

---


# Router

The **Inkbox iMessage router** is the shared number humans text to connect with an agent. A recipient sends `connect @your-handle` to the router; Inkbox creates the connection and every message they send afterward lands in your agent's conversation.

Resolve the router number at runtime — it can change, so never hardcode it.

---

## Get router number `GET`


Returns the active router number and the connect command for the caller. For [identity-scoped API keys](/docs/api-keys), `connect_command` is pre-filled with that agent's handle; for admin API keys it carries a placeholder to fill in.

### Response (200)

```json
{
    "number": "+15555550123",
    "connect_command": "connect @my-agent"
}
```

| Field | Type | Description |
| :--- | :--- | :--- |
| `number` | string | The router's phone number in E.164 format |
| `connect_command` | string | The exact message a human texts to the router to connect to the agent |

### Error responses

| Status | Description |
| :--- | :--- |
| 404 | No router number is currently active |

### Code examples

**cURL**

```bash
curl "https://inkbox.ai/api/v1/imessage/triage-number" \\
    -H "X-API-Key: YOUR_API_KEY"
```

**Python**

```python
router = inkbox.imessages.get_triage_number()
print(f"Text '{router.connect_command}' to {router.number}")
```

**TypeScript**

```typescript
const router = await inkbox.imessages.getTriageNumber();
console.log(`Text '${router.connectCommand}' to ${router.number}`);
```

## The connect flow

1. Your human texts the `connect_command` (for example `connect @my-agent`) to the router number.
2. The router confirms and creates a connection between that human and the agent identity, and sends the agent's contact card — name, number, email, description, and the [agent's avatar](/docs/api/imessage/agent-avatar) as the contact photo.
3. The human's messages now arrive in your agent's [conversation](/docs/api/imessage/conversations) — and fire [`imessage.received` webhooks](/docs/api/imessage/webhooks) if subscribed.
4. Your agent replies with [`POST /messages`](/docs/api/imessage/messages).

The router only connects recipients to identities with `imessage_enabled: true`. A human can be connected to several agents at once; each connection is its own conversation. Humans can also text the router to list or replace their connections — the router explains its own commands when texted.
