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

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_…
userIdstringThe member, usr_…

Body

FieldTypeRequiredDescription
rolestringnoowner, admin or member
first_namestringnoUp to 80 characters. Returned as given_name
last_namestringnoUp to 80 characters. Returned as family_name
picturestringnoAn https URL
phonestringnoUp to 40 characters
birthdaystringnoYYYY-MM-DD
pronounsstringnofeminine, masculine or neutral
localesstring[]noUp to 20 language tags (letters, digits and -), each up to 35 characters
timezonestringnoUp to 64 characters
postal_addressobjectnoAny 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

StatuserrorWhen
400invalid_requestAn empty body, an unknown field, or a value that fails validation. The detail names it
403forbiddenYou may not manage this tenant’s members, or you are a tenant admin granting or changing owner
404not_foundNo such member, tenant or org, or an id of the wrong kind
409conflictThe 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"}'