Get embed code
Get the HTML snippet to paste on a website to show the agent's widget — the same iframe code the agent page copies.
GET
https://api.centerfy.ai/webhooks/inbound/agents/:id/widget/embed Headers
| Header | Required | Value | Description |
|---|---|---|---|
x-api-key | Yes | your sub-account API key (cfy_…) | Authenticates the request; or use Authorization: Bearer <key>. |
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
id | string (uuid) | Yes | The agent id. |
Query parameters
| Name | Type | Required | Default | Description |
|---|---|---|---|---|
type | string | No | — | One of orb, button, demo, live-avatar. Defaults to the widget’s configured type (orb if unset). |
Example
curl -X GET "https://api.centerfy.ai/webhooks/inbound/agents/{id}/widget/embed" \
-H "x-api-key: $CENTERFY_API_KEY" import { CenterfyClient } from "@centerfy/sdk";
const centerfy = new CenterfyClient({ apiKey: process.env.CENTERFY_API_KEY! });
const result = await centerfy.agentWidget.embed("<agentId>");
console.log(result); centerfy agentWidget embed <agentId> MCP tool: centerfy_agent_widget_embed (see MCP server)
Response
{
"status": "success",
"agent_id": "0f1e2d3c-4b5a-4968-8776-655443322110",
"type": "orb",
"widget_url": "https://app.example.com/widget?agent=0f1e2d3c-4b5a-4968-8776-655443322110&type=orb",
"embed_code": "<!-- Centerfy AI Voice Widget (Orb) -->\n <iframe\n src=\"https://app.example.com/widget?agent=0f1e2d3c-4b5a-4968-8776-655443322110&type=orb\"\n allow=\"microphone\"\n style=\"background: transparent; width: 100%; height: 120px; border: none;\"\n id=\"centerfyOrbWidget\"\n ></iframe>"
}Errors
400— if type is not one of the listed values.404— if the agent is not in this sub-account.
Notes
The snippet only contains the agent id — no token or secret; the widget authenticates itself when it loads. The orb height follows the orb size. The widget asks visitors for microphone access.