Apply a label to a member
Give a tenant member a label, or change their level in it.
PUT /organizations/{org}/tenants/{tenantId}/labels/{labelId}/members/{userId}
Applies the label to the member at the given level. Calling it again with another level changes the level. The user has to be a member of the tenant.
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_… |
userId | string | The member, usr_… |
Body
| Field | Type | Required | Description |
|---|---|---|---|
level | string | yes | admin or member |
Response
204 No Content
Errors
| Status | error | When |
|---|---|---|
400 | invalid_request | level is missing or not admin / member |
403 | forbidden | You are a member of the org but not an owner |
404 | not_found | The user is not a member of this tenant, or no such label, tenant or org |
Example
curl -X PUT https://loginwith.loginwith.dev/organizations/acme/tenants/tnt_65f1c2a9e4b0d3f7a1c8e908/labels/lbl_65f1c2a9e4b0d3f7a1c8e90a/members/usr_65f1c2a9e4b0d3f7a1c8e909 \
-H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
-d '{"level": "admin"}'