Skip to main content
PATCH
/
v1
/
widget
/
{id}
Update Widget
curl --request PATCH \
  --url https://api.bland.ai/v1/widget/{id} \
  --header 'Content-Type: application/json' \
  --header 'authorization: <authorization>' \
  --data '
{
  "pathway_id": "<string>",
  "agent_prompt": "<string>",
  "allowed_domains": [
    "<string>"
  ],
  "messages_per_minute": 123,
  "config": "<any>",
  "agent_id": "<string>",
  "webhook_url": "<string>"
}
'
{
  "status": 200,
  "data": {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "pathway_id": "a0f0d4ed-f5f5-4f16-b3f9-22166594d7a7",
    "agent_id": "46f37229-7d12-44be-b343-6e68274cfbea",
    "allowed_domains": ["newdomain.com", "anotherdomain.com"],
    "messages_per_minute": 15,
    "config": {
      "theme": "dark",
      "position": "bottom-left",
      "greeting": "Hi there! What can I do for you?",
      "timeoutSeconds": 7200
    },
    "webhook_url": "https://example.com/conversation-webhook",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T14:22:30Z"
  },
  "errors": null
}

Documentation Index

Fetch the complete documentation index at: https://docs.bland.ai/llms.txt

Use this file to discover all available pages before exploring further.

Headers

authorization
string
required
Your API key for authentication.

Path Parameters

id
string
required
UUID of the widget to update.

Body

pathway_id
string
New pathway UUID to associate with the widget. Must be defined if agent_prompt is null.
agent_prompt
string
New pathway UUID to associate with the widget. Must be defined if pathway_id is null.
allowed_domains
string[]
New array of allowed domains where the widget can be embedded.
messages_per_minute
number
New rate limit for messages (minimum: 0).
config
any
New widget configuration object (flexible JSON). Supports timeoutSeconds to configure conversation timeout (default: 86400 seconds / 24 hours).
agent_id
string
New agent UUID to associate with the widget.
webhook_url
string
New URL to receive post-conversation webhook payloads when conversations end. See Post-Conversation Webhooks for payload details.

Response

status
number
HTTP status code (200 for success).
data
object
The updated widget object containing:
  • id (string): 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
  • webhook_url (string | null): Post-conversation webhook URL or null
  • created_at (string): ISO timestamp
  • updated_at (string): Updated 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": "46f37229-7d12-44be-b343-6e68274cfbea",
    "allowed_domains": ["newdomain.com", "anotherdomain.com"],
    "messages_per_minute": 15,
    "config": {
      "theme": "dark",
      "position": "bottom-left",
      "greeting": "Hi there! What can I do for you?",
      "timeoutSeconds": 7200
    },
    "webhook_url": "https://example.com/conversation-webhook",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T14:22:30Z"
  },
  "errors": null
}

Docs for agents: llms.txt