---
title: "Link Bot to Phone Number"
method: POST
path: "/v1/phone-numbers/link-agent"
tags: ["Phone Numbers"]
---

# Link Bot to Phone Number

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

Link a bot (agent) to a phone number for inbound/outbound calls.

## Request body

- LinkBotToPhoneNumberRequest
  - `phone_number_id` string, required — Unique identifier of the phone number
  - `agent_id` string, required — Bot ID to link
  - `direction` 'inbound' | 'outbound' | 'both', required — Direction for the bot assignment

## Response `200`

Bot linked to phone number successfully

- LinkBotToPhoneNumberResponse
  - `phone_number_id` string, required — Unique identifier of the phone number
  - `phone_number` string, required — Phone number in E.164 format
  - `inbound_agent_id` string — Bot ID for inbound calls
  - `outbound_agent_id` string — Bot ID for outbound calls
  - `message` string, required — Success message

## Other responses

- `400` — Bad request - validation error
- `401` — Unauthorized - missing or invalid API key
- `404` — Phone number or bot not found
- `500` — Internal 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/71c32e6ffd95/schema)
