Create a chat widget
Creates a widget and mints its publicKey — the non-secret key that goes in the embed snippet. A publicKey in the request body is ignored.
A widget with an empty allowedOrigins list is valid and will not load anywhere: the public endpoints fail closed on origin. That is deliberate, so a snippet lifted from one site cannot be run on another.
Authorization
bearerAuth A Tandem bearer token. Requests are scoped to the organization the token belongs to; no organization header is required.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/v1/agent-media/chat-widgets" \ -H "Content-Type: application/json" \ -d '{ "name": "string" }'{ "widget": { "id": "string", "publicKey": "string", "createdAt": "2019-08-24T14:15:22Z", "updatedAt": "2019-08-24T14:15:22Z", "name": "string", "displayName": "string", "agentId": "string", "workflowId": "string", "description": "", "avatarUrl": "string", "showAvatar": true, "position": "bottom-right", "launcherIcon": "bubble", "launcherIconUrl": "string", "brandColor": "string", "greeting": "string", "allowedOrigins": [] }}{ "error": "string", "errors": [ { "field": "string", "message": "string" } ]}{ "error": "string", "message": "string", "limit": 0, "length": 0, "reason": "string"}