Update a Label
PATCH/accounts/:account_id/labels/:label_id
Update a label definition.
Updates the fields you send. If you change the title, the new title is
applied to all conversations and contacts that had the old one (in the
background).
| Setting | Value |
|---|---|
| Method | PATCH (or PUT) |
| Path | /api/v1/accounts/{account_id}/labels/{label_id} |
| Authorization | User token. Legacy: administrator. New rules: Labels → update. Not available to agent-bot tokens. |
Body parameters (JSON): the same fields as in
Add Label, all optional, inside a label
object (in a JSON request the wrapper is optional). A new title follows the
same rules: letters, digits, - and _ only, stored in lower case, unique
in the account.
Example request
curl -X PATCH 'https://online.99digital.co.il/api/v1/accounts/12/labels/15' \
-H 'api_access_token: <YOUR_API_ACCESS_TOKEN>' \
-H 'Content-Type: application/json' \
-d '{ "label": { "description": "Top customers", "color": "#ff6b6b", "show_on_sidebar": false } }'
Example response (200 OK)
{
"id": 15,
"title": "vip",
"description": "Top customers",
"color": "#ff6b6b",
"show_on_sidebar": false
}
Request
Responses
- 200
- 401
- 403
- 404
- 422
The updated label.
The access token is missing or wrong, or its user does not belong to this account.
The token's role does not have the permission this endpoint needs, or the endpoint is not open to agent-bot tokens. See Authorization.
The resource does not exist in this account.
The new title has invalid characters, or is already taken.