Create a label

Create a label in a tenant.

POST /organizations/{org}/tenants/{tenantId}/labels

Creates a label with no one in it. Apply it to members with 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_…

Body

FieldTypeRequiredDescription
namestringyes1–64 characters, trimmed
colorstringnoindigo, blue, emerald, amber, rose, violet, teal or orange. Default indigo
iconstringnoA Heroicons name: a-z, 0-9 and -, up to 64 characters. Default user-group
descriptionstringnoUp to 280 characters. Default ""

No other field is accepted.

Response

201 Created with the label.

{
  "id": "lbl_65f1c2a9e4b0d3f7a1c8e90a",
  "tenant_id": "tnt_65f1c2a9e4b0d3f7a1c8e908",
  "name": "Finance",
  "color": "emerald",
  "icon": "banknotes",
  "description": "",
  "members": []
}

Errors

StatuserrorWhen
400invalid_requestAn 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 tenant in this org, or the org is not yours

Example

curl -X POST https://loginwith.loginwith.dev/organizations/acme/tenants/tnt_65f1c2a9e4b0d3f7a1c8e908/labels \
  -H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
  -d '{"name": "Finance", "color": "emerald", "icon": "banknotes"}'