Change a member's role
const url = 'https://api.emite.cr/v1/tenants/me/members/example';const options = { method: 'PATCH', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"role":"admin"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request PATCH \ --url https://api.emite.cr/v1/tenants/me/members/example \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "role": "admin" }'The new role is a system role other than owner (admin, billing_manager, accountant, issuer, viewer) or the slug of one of the company's custom roles (400 MEMBER_ROLE_INVALID otherwise). Refuses to change the owner's role (use the ownership transfer) or the caller's own role.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”UUID of the user whose role is changing.
Request Bodyrequired
Section titled “Request Bodyrequired”object
New role slug. May be a system role or a custom role slug. owner is NOT assignable — use POST /transfer-ownership instead.
Example
adminResponses
Section titled “Responses”The member, with the new role.
object
Identifier of the member's account — the :userId of PATCH / DELETE /v1/tenants/me/members/:userId and of …/:userId/revoke-sessions.
Email of the account.
Name of the account.
The member's role in this company. A system role (owner, admin, billing_manager, accountant, issuer, viewer) or the slug of one of the company's custom roles (GET /v1/tenants/me/roles).
When the person became a member.
true for the company's owner — there is exactly one. The owner's role cannot be changed, nor the owner removed: ownership moves with POST /v1/tenants/me/members/transfer-ownership/request and …/confirm.
Example
{ "email": "ana@example.com", "name": "Ana Rojas", "role": "issuer"}Missing or invalid JWT.
Insufficient scope. Team management is JWT-only — API keys cannot reach these endpoints.
Member not found (MEMBER_NOT_FOUND).
Touching the owner (OWNER_TRANSFER_REQUIRED) or self (MEMBER_CANNOT_CHANGE_OWN_ROLE).