---
title: "Link an agent to a phone number"
method: POST
path: "/v2/phone-numbers/link-agent"
tags: ["Phone Numbers"]
---

# Link an agent to a phone number

`POST /v2/phone-numbers/link-agent`

Associates an agent with a phone number for the given `direction`.

| Direction | Effect |
|-----------|--------|
| `inbound` | Agent handles incoming calls on this number |
| `outbound` | Agent is used as the default for outbound calls from this number |
| `both` | Both directions |

## Request body

- LinkAgentRequest
  - `phone_number_id` string, required
  - `agent_uid` string, required
  - `direction` 'inbound' | 'outbound' | 'both', required

## Response `200`

Updated phone number.

- PhoneNumberResponse
  - `id` string, required
  - `phone_number` string, required
  - `name` string
  - `inbound_agent_uid` string
  - `outbound_agent_uid` string
  - `created_at` string, date-time
  - `updated_at` string, date-time

## Other responses

- `400` — Validation error or invalid request body.
- `401` — Missing or invalid API key.
- `404` — The requested resource does not exist.
- `429` — Rate limit exceeded.
- `500` — Unexpected server error.

---

[API](https://skmtc.net/openmicai/apis/openmic-v1-external-api.md) · [All operations](https://skmtc.net/openmicai/apis/openmic-v1-external-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/openmicai/openmic-v1-external-api/revisions/58dc5cff0ca7/schema)
