Update a label
Change a label's name, color, icon or description.
PATCH /organizations/{org}/tenants/{tenantId}/labels/{labelId}
The body is the mask. Who carries the label is not changed here: see Apply a label to a member.
Authorization
Org owner. A member who is not an owner gets 403 forbidden; a non-member gets 404.
Path parameters
| Name | Type | Description |
|---|---|---|
org | string | The organization: its id (org_…) or its slug. It has to be an org your token can manage (see Who can call it) |
tenantId | string | The tenant, tnt_… |
labelId | string | The label, lbl_… |
Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | no | 1–64 characters, trimmed |
color | string | no | indigo, blue, emerald, amber, rose, violet, teal or orange |
icon | string | no | A Heroicons name: a-z, 0-9 and -, up to 64 characters |
description | string | no | Up to 280 characters |
At least one field is required.
Response
200 OK with the updated label.
{
"id": "lbl_65f1c2a9e4b0d3f7a1c8e90a",
"tenant_id": "tnt_65f1c2a9e4b0d3f7a1c8e908",
"name": "Finance",
"color": "emerald",
"icon": "banknotes",
"description": "",
"members": [
{ "user_id": "usr_65f1c2a9e4b0d3f7a1c8e909", "level": "admin" }
]
}
Errors
| Status | error | When |
|---|---|---|
400 | invalid_request | An empty body, an unknown field, or a value that fails validation. The detail names it |
403 | forbidden | You are a member of the org but not an owner |
404 | not_found | No such label in this tenant, no such tenant, or the org is not yours |
Example
curl -X PATCH https://loginwith.loginwith.dev/organizations/acme/tenants/tnt_65f1c2a9e4b0d3f7a1c8e908/labels/lbl_65f1c2a9e4b0d3f7a1c8e90a \
-H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
-d '{"color": "teal"}'