Skip to main content
POST
/
v1
/
phone-numbers
/
link-agent
Link Bot to Phone Number
curl --request POST \
  --url https://api.openmic.ai/v1/phone-numbers/link-agent \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "phone_number_id": "ybhb8wzi487w02m2bc7dh0ev",
  "agent_id": "bvrg8wzi487w02m2bc7dh0ev",
  "direction": "both"
}'
{
  "phone_number_id": "ybhb8wzi487w02m2bc7dh0ev",
  "phone_number": "+15551112222",
  "inbound_agent_id": "bvrg8wzi487w02m2bc7dh0ev",
  "outbound_agent_id": "bvrg8wzi487w02m2bc7dh0ev",
  "message": "Bot linked successfully for inbound and outbound calls."
}

Authorizations

Authorization
string
header
required

Bearer token authentication using API key. Find it at: https://chat.openmic.ai/api-key

Body

application/json

Bot linking details

phone_number_id
string
required

Unique identifier of the phone number

agent_id
string
required

Bot UID to link

direction
enum<string>
required

Direction for the bot assignment

Available options:
inbound,
outbound,
both

Response

Bot linked to phone number successfully

phone_number_id
string
required

Unique identifier of the phone number

phone_number
string
required

Phone number in E.164 format

message
string
required

Success message

inbound_agent_id
string

Bot UID for inbound calls

outbound_agent_id
string

Bot UID for outbound calls