Assign to an agent

assign a phone number to an agent.

POST https://api.centerfy.ai/webhooks/inbound/phone-numbers/:id/agent

Headers

HeaderRequiredValueDescription
x-api-keyYesyour sub-account API key (cfy_…)Your API key. Alternatively, pass it as Authorization: Bearer <key>.
Content-TypeYesapplication/jsonRequest body is JSON.

Path parameters

NameTypeRequiredDescription
idstring (uuid)YesThe phone number id to assign.

Body parameters

NameTypeRequiredDefaultDescription
agent_idstringYes—The agent id to assign the number to. Required, and must be a valid UUID for an agent you own, else 400/404.

Request body

{
  "agent_id": "<agent_id>"
}

Example

curl -X POST "https://api.centerfy.ai/webhooks/inbound/phone-numbers/{id}/agent" \
  -H "x-api-key: $CENTERFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "agent_id": "<agent_id>"
}'
import { CenterfyClient } from "@centerfy/sdk";

const centerfy = new CenterfyClient({ apiKey: process.env.CENTERFY_API_KEY! });

const result = await centerfy.phoneNumbers.assignAgent("<phoneNumberId>", {
  "agent_id": "<agent_id>"
});
console.log(result);
centerfy phoneNumbers assign-agent <phoneNumberId> '{"agent_id":"<agent_id>"}'

MCP tool: centerfy_phone_numbers_assign_agent (see MCP server)

Response

{
  "status": "success",
  "assigned": true,
  "phone_number_id": "3f1c2b9a-7d4e-4a21-9c33-0a1b2c3d4e5f",
  "phone_number": "+14155552671",
  "agent_id": "a1b2c3d4-e5f6-7890-abcd-1234567890ab"
}

Errors

  • 400 — for invalid UUIDs; 404 if the number or agent does not exist; 409 if the number is already assigned to a DIFFERENT agent (unassign first); 502 if provisioning fails.

Notes

Assigning a number routes its inbound calls to the agent. Idempotent when re-assigning to the SAME agent (returns 200 with already_assigned: true).

© 2026 Centerfy AI. All rights reserved.