Webchats

Create webchat configuration

POST
/api/webchats

Create a new webchat widget configuration. allowedDomains restricts the embed origins; promptId selects which Prompt the agent uses for AI responses on inbound visitor messages.

Authorization

bearerAuth
AuthorizationBearer <token>

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/api/webchats" \  -H "Content-Type: application/json" \  -d '{    "name": "Marketing site widget",    "description": "Bottom-right widget on the marketing site",    "starterMessage": "Hi! Looking for pricing?",    "backgroundColor": "#FFFFFF",    "primaryColor": "#1F2937",    "secondaryColor": "#3B82F6",    "headerTextColor": "#FFFFFF",    "statusText": "We typically reply within minutes",    "statusTextColor": "#6B7280",    "timestampColor": "#9CA3AF",    "csatBackgroundColor": "#F3F4F6",    "csatTextColor": "#111827",    "csatThankYouMessage": "Thanks for your feedback!",    "promptId": "65b2a1c3d4e5f6a7b8c9d0e1",    "allowedDomains": [      "https://example.com"    ],    "pipelineId": "66f0a0b0c0d0e0f0a0b0c0d0",    "pipelineStage": "67f0a0b0c0d0e0f0a0b0c0d0",    "initialStage": "new",    "isAutopilot": true,    "isEnabled": true  }'
{  "message": "Webchat configuration created",  "data": {    "_id": "67d3a0b0c0d0e0f0a0b0c0d0",    "name": "Marketing site widget",    "isEnabled": true  }}