---
title: "Update a chat button"
method: PATCH
path: "/chat_buttons/{id}"
tags: ["Agent"]
---

# Update a chat button

`PATCH /chat_buttons/{id}`

## Request

- Base URL: `https://api.meetdarwin.ai/v1`
- URL: `https://api.meetdarwin.ai/v1/chat_buttons/{id}`
- Auth: HTTP bearer

Requires the `agent:write` scope.

## Path parameters

- `id` string, required

## Headers

- `Idempotency-Key` string

## Request body

- ChatButtonInput
  - `label` string: What the visitor reads on the button.
  - `message` string: send: the visitor's first message. fill: typed into the chat box for them to edit. agent: what the agent is told, so it speaks first. outcome: the form's id (out_…).
  - `behavior` 'send' | 'fill' | 'agent' | 'outcome': What a click does once the chat opens. Default send. outcome opens one of the agent's forms; message is its out_… id.
  - `style` 'brand' | 'soft' | 'outline' | 'link': Default brand: the chat's own colors.
  - `size` 'sm' | 'md' | 'lg' | 'custom'
  - `corners` 'match' | 'square' | 'pill' | 'custom': match: the same corners as the chat.
  - `width` 'auto' | 'full': auto fits the label; full fills the width of what it is pasted into.
  - `colors` object: Hex colors; empty takes the style's color from the chat. border can be "none".
    - `background` string
    - `text` string
    - `border` string
    - `hover` string
  - `custom` object: Pixels, used when size or corners is custom.
    - `paddingX` number
    - `paddingY` number
    - `fontSize` number
    - `radius` number
  - `nofollow` boolean: Adds rel="nofollow" to the button's link.

## Response `200`

OK

- ChatButton
  - `id` string, required
  - `object` 'chat_button', required
  - `label` string, required
  - `message` string, required
  - `behavior` 'send' | 'fill' | 'agent' | 'outcome', required
  - `style` 'brand' | 'soft' | 'outline' | 'link', required
  - `size` 'sm' | 'md' | 'lg' | 'custom', required
  - `corners` 'match' | 'square' | 'pill' | 'custom', required
  - `width` 'auto' | 'full', required
  - `colors` object, required
    - `background` string, required
    - `text` string, required
    - `border` string, required
    - `hover` string, required
  - `custom` object, required
    - `paddingX` number, required
    - `paddingY` number, required
    - `fontSize` number, required
    - `radius` number, required
  - `nofollow` boolean, required
  - `link` string, required
  - `html` string, required: The paste-in HTML: a plain link that opens the chat already on the page.

## Other responses

- `400`: Invalid request (`invalid_request`, `unsupported_version`).
- `401`: Missing or invalid key (`authentication_required`, `invalid_api_key`).
- `402`: The workspace must add a card before the API can be used (`payment_required`).
- `403`: The key lacks the scope (`insufficient_scope`), the feature is off (`feature_disabled`), or the workspace's plan doesn't include it (`plan_required`, with `required_plan`).
- `404`: No such object in this workspace (`not_found`).
- `409`: Conflicts with the current state (`conflict`, `idempotency_key_in_use`), or the change would leave a live agent with no calendar or live form (`goal_required`).
- `422`: Refused by a rule (`unprocessable`, `idempotency_key_reused`).
- `429`: Rate limited (`rate_limited`) or a monthly allowance used (`quota_exceeded`); see Retry-After.

## Changes

- **2026-10-20** `f93b0bcb454a`: 24 info
  - added the optional property `feature` to the response with the `400` status
  - added the optional property `feature` to the response with the `401` status
  - added the optional property `feature` to the response with the `402` status
  - added the optional property `feature` to the response with the `403` status
  - …20 more

[Operation history](https://skmtc.dev/meetdarwin/apis/darwin-api/changes/chat_buttons/:id/patch.md)

---

[API](https://skmtc.dev/meetdarwin/apis/darwin-api.md) · [All operations](https://skmtc.dev/meetdarwin/apis/darwin-api/llms.txt) · [OpenAPI document](https://skmtc.dev/meetdarwin/apis/darwin-api/revisions/f93b0bcb454a?raw)
