POST

Assign Phone Number to Agent

Routes an owned phone number to this Agent.

POSThttps://api.vantaxai.com/v1/agents/{agent_id}/phone-numbers

Once assigned, inbound calls and messages to the number are handled by the Agent. A number can be assigned to only one Agent at a time.

Headers

  • Authorizationstringrequired

    Bearer authentication with your secret API key.

    example: Bearer vx_live_3fa9c2…

  • Content-Typestringrequired

    Must be application/json for requests with a body.

    example: application/json

Path Parameters

  • agent_idstringrequired

    The Agent to assign the number to.

    example: agt_3d9b21

Body Parameters

  • phone_number_idstringrequired

    The owned phone number to assign.

    example: pn_55ad12

Request

curl -X POST https://api.vantaxai.com/v1/agents/agt_3d9b21/phone-numbers \
  -H "Authorization: Bearer vx_live_3fa9c2..." \
  -H "Content-Type: application/json" \
  -d '{
  "phone_number_id": "pn_55ad12"
}'

Response

{
  "success": true,
  "message": "Phone number assigned",
  "data": {
    "id": "pn_55ad12",
    "number": "+14155550142",
    "agent_id": "agt_3d9b21",
    "source": "platform"
  }
}