Update a tenant member
Change a member's role or profile.
PATCH /organizations/{org}/tenants/{tenantId}/members/{userId}
The body is the mask. email cannot be changed. An invited member has no confirmed email yet, so they cannot be given a role until they first sign in.
Authorization
Org owner, or owner / admin of this tenant. Anyone else gets 403 forbidden. A tenant admin cannot grant or change owner.
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_… |
userId | string | The member, usr_… |
Body
| Field | Type | Required | Description |
|---|---|---|---|
role | string | no | owner, admin or member |
first_name | string | no | Up to 80 characters. Returned as given_name |
last_name | string | no | Up to 80 characters. Returned as family_name |
picture | string | no | An https URL |
phone | string | no | Up to 40 characters |
birthday | string | no | YYYY-MM-DD |
pronouns | string | no | feminine, masculine or neutral |
locales | string[] | no | Up to 20 language tags (letters, digits and -), each up to 35 characters |
timezone | string | no | Up to 64 characters |
postal_address | object | no | Any of street_number, street, city, postcode, region, country; each up to 80 characters |
At least one field is required. An empty string for a profile field means “not set”: it does not clear the field.
Response
200 OK with the updated member.
{
"user_id": "usr_65f1c2a9e4b0d3f7a1c8e909",
"email": "ada@acme.fr",
"name": "Ada Lovelace",
"given_name": "Ada",
"family_name": "Lovelace",
"picture": "https://…",
"role": "member",
"provisionner": "google",
"providers": ["google"],
"labels": [
{ "id": "lbl_65f1c2a9e4b0d3f7a1c8e90a", "name": "Finance", "color": "emerald", "icon": "banknotes", "level": "member" }
]
}
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 may not manage this tenant’s members, or you are a tenant admin granting or changing owner |
404 | not_found | No such member, tenant or org, or an id of the wrong kind |
409 | conflict | The member is still invited and cannot be given a role yet |
Example
curl -X PATCH https://loginwith.loginwith.dev/organizations/acme/tenants/tnt_65f1c2a9e4b0d3f7a1c8e908/members/usr_65f1c2a9e4b0d3f7a1c8e909 \
-H "Authorization: Bearer $TOKEN" -H "content-type: application/json" \
-d '{"role": "admin"}'