Assign an agent
assign an agent to a folder.
POST
https://api.centerfy.ai/webhooks/inbound/agent-folders/:id/agents Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your sub-account API key (cfy_…) | Authenticates the request; or use Authorization: Bearer <key>. |
Content-Type | Yes | application/json | The request body is JSON. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | The folder id to assign the agent into. |
Body parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
agent_id | string | Yes | — | The agent to assign; must be a valid uuid. An agent belongs to at most one folder, so assigning re-homes it from any existing folder. |
Request body
{
"agent_id": "<agent_id>"
}Example
curl -X POST "https://api.centerfy.ai/webhooks/inbound/agent-folders/{id}/agents" \
-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.agentFolders.addAgent("<folderId>", {
"agent_id": "<agent_id>"
});
console.log(result); centerfy agentFolders add-agent <folderId> '{"agent_id":"<agent_id>"}' MCP tool: centerfy_agent_folders_add_agent (see MCP server)
Response
{
"status": "success",
"assigned": true,
"agent_id": "f1e2d3c4-b5a6-4978-8c9d-0e1f2a3b4c5d",
"folder_id": "a1b2c3d4-e5f6-4a7b-8c9d-0e1f2a3b4c5d"
}Notes
An agent belongs to at most one folder, so assigning it re-homes it from any existing folder. Errors: 400 (invalid folder id / invalid agent_id), 401 (unauthenticated), 404 (folder or agent not found), 500 (server error).