Assign a calendar to an agent

Give an agent a calendar it can check and book on, the same as adding it in the agent editor. Posting an already-assigned calendar updates its tool name/description.

POST https://api.centerfy.ai/webhooks/inbound/agents/:id/calendars

Headers

HeaderRequiredValueDescription
x-api-keyYesyour sub-account API key (cfy_…)Authenticates the request; or use Authorization: Bearer <key>.

Path parameters

NameTypeRequiredDescription
idstring (uuid)YesThe agent id.

Body parameters

NameTypeRequiredDefaultDescription
calendar_idstring (uuid)Yes—Calendar to assign; must be in this sub-account.
tool_namestringNo—Name the agent sees for this calendar’s booking tool: letters, digits, _ and - only, max 64 characters, unique per agent. Defaults to calendar_N for a new assignment.
tool_descriptionstringNo—Tells the agent when to use this calendar (max 1000 characters). Defaults to “Book an appointment in <calendar name>” for a new assignment.

Request body

{
  "calendar_id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b"
}

Example

curl -X POST "https://api.centerfy.ai/webhooks/inbound/agents/{id}/calendars" \
  -H "x-api-key: $CENTERFY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "calendar_id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b"
}'
import { CenterfyClient } from "@centerfy/sdk";

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

const result = await centerfy.calendars.assignToAgent("<agentId>", {
  "calendar_id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b"
});
console.log(result);
centerfy calendars assign-agent <agentId> '{"calendar_id":"4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b"}'

MCP tool: centerfy_calendars_assign_agent (see MCP server)

Response

{
  "status": "success",
  "assigned": true,
  "created": true,
  "assignment": {
    "id": "7a8b9c0d-1e2f-4a3b-8c4d-5e6f7a8b9c0d",
    "agent_id": "2b3c4d5e-6f7a-4b8c-9d0e-1f2a3b4c5d6e",
    "calendar_id": "4e5f6a7b-8c9d-4e0f-9a1b-2c3d4e5f6a7b",
    "calendar_name": "Consultations",
    "tool_name": "calendar_1",
    "tool_description": "Book an appointment in Consultations",
    "is_active": true
  }
}

Errors

  • 400 — if calendar_id isn’t a UUID or tool_name has invalid characters; 404 if the agent or calendar is not in this sub-account; 409 if tool_name is already used by another calendar on this agent.

Notes

Returns 201 with created: true for a new assignment, 200 with created: false when updating an existing one.

© 2026 Centerfy AI. All rights reserved.