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

NameTypeDescription
orgstringThe organization: its id (org_…) or its slug. It has to be an org your token can manage (see Who can call it)
tenantIdstringThe tenant, tnt_…
labelIdstringThe label, lbl_…

Body

FieldTypeRequiredDescription
namestringno1–64 characters, trimmed
colorstringnoindigo, blue, emerald, amber, rose, violet, teal or orange
iconstringnoA Heroicons name: a-z, 0-9 and -, up to 64 characters
descriptionstringnoUp 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

StatuserrorWhen
400invalid_requestAn empty body, an unknown field, or a value that fails validation. The detail names it
403forbiddenYou are a member of the org but not an owner
404not_foundNo 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"}'