POST
/
v1
/
widget
Create Widget
curl --request POST \
  --url https://api.bland.ai/v1/widget \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '{
  "pathway_id": "<string>",
  "allowed_domains": [
    "<string>"
  ],
  "messages_per_minute": 123,
  "config": "<any>",
  "agent_id": "<string>"
}'
{
  "status": 200,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "pathway_id": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7",
    "agent_id": null,
    "allowed_domains": ["example.com", "subdomain.example.com"],
    "messages_per_minute": 10,
    "config": {
      "theme": "light",
      "position": "bottom-right"
    },
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  },
  "errors": null
}

Headers

authorization
string
required
Your API key for authentication.

Body

pathway_id
string
required
UUID of the pathway to associate with the widget.
allowed_domains
string[]
required
Array of domains where the widget can be embedded.
messages_per_minute
number
required
Rate limit for messages (minimum: 0).
config
any
required
Widget configuration object (flexible JSON).
agent_id
string
Optional UUID of agent to associate with widget.

Response

status
number
HTTP status code (200 for success).
data
object
The created widget object containing:
  • id (string): Generated widget UUID
  • pathway_id (string): Associated pathway UUID
  • agent_id (string | null): Associated agent UUID or null
  • allowed_domains (string[]): Array of allowed domains
  • messages_per_minute (number): Rate limit for messages
  • config (object): Widget configuration object
  • created_at (string): ISO timestamp
  • updated_at (string): ISO timestamp
errors
null
Always null on successful response.
{
  "status": 200,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "pathway_id": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7",
    "agent_id": null,
    "allowed_domains": ["example.com", "subdomain.example.com"],
    "messages_per_minute": 10,
    "config": {
      "theme": "light",
      "position": "bottom-right"
    },
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z"
  },
  "errors": null
}