Update a widget
Changes the fields you send and keeps the others, settings and limits field by field. Pause it with status: "paused" (it shows nothing and answers nothing until set live), point it at another assistant with assistant_id, or replace its allowed_domains.
PATCH/v1/widgets/{widget_id}
Requires assistants:write.
Send only what changes. settings and limits are merged field by field, so you can change one colour or one limit without resending the rest.
- Pause.
status: "paused"shows nothing and answers nothing until you set it back tolive. Pausing keeps the code on your site in place. - Allowed domains.
allowed_domainsreplaces the whole list. Send the complete list, and an empty list clears it. - Formats.
settings.bubble,settings.embedandsettings.hosted_pageturn the chat bubble, the in-page chat and the hosted page on or off. A format that is off answers 404, and the loader draws no launcher whenbubbleis off. See Install a widget. - Assistant and mode.
assistant_idpoints the widget at another assistant, andmodechanges what each answer costs. Both apply at the next question. - Monthly ceiling.
limits.monthly_creditsset tonullremoves it. When it is reached, the widget stops answering until the 1st of the next month (UTC).
Changing the widget costs no credits. A PATCH is not retried by the CLI after a server error: read the widget before you try again.
Authorizations
Authorizationbearerin headerrequiredPath parameters
widget_idstringrequiredpattern: ^wdg_[abcdefghjkmnpqrstuvwxyz23456789]{12}$Body
application/jsonrequirednamestringlength: 1–120 charsNew name, 1 to 120 characters.
assistant_idstringpattern: ^ast_[abcdefghjkmnpqrstuvwxyz23456789]{12}$Point the widget at another assistant.
modeenum<string>one of: eco, flash, deepThe query mode every answer of this widget uses, so what it costs per answer (Eco 10, Flash 30 credits (the default), Deep 80). Default flash.
statusenum<string>one of: live, pausedlive answers visitors; paused shows nothing and answers nothing, until set live again.
allowed_domainsstring[]items: ≤ 50 itemsThe websites allowed to show the widget, as hosts (docs.acme.com) or *.acme.com for all subdomains (which also covers acme.com). Scheme, path and port are removed. The browser refuses to show the bubble and the embed on any other site, so a widget with no domain shows nowhere (the hosted page still works). Replaces the previous list.
settingsobjectThe settings you send are changed, the others are kept.
limitsobjectThe limits you send are changed, the others are kept.
Response
Update a widget
dataobjectrequiredrequest_idstringrequiredPossible codes: invalid_request, unknown_field, invalid_parameter, invalid_cursor
errorobjectrequiredrequest_idstringrequiredPossible codes: authentication_required, invalid_api_key, api_key_expired, api_key_revoked, invalid_access_key
errorobjectrequiredrequest_idstringrequiredPossible codes: insufficient_scope, feature_not_available, admin_required, permission_denied
errorobjectrequiredrequest_idstringrequiredPossible codes: resource_not_found
errorobjectrequiredrequest_idstringrequiredPossible codes: request_too_large
errorobjectrequiredrequest_idstringrequiredPossible codes: rate_limited
errorobjectrequiredrequest_idstringrequiredPossible codes: internal_error
errorobjectrequiredrequest_idstringrequired