access

PATCH /v1/orgs/{orgId}/members/{userId}

Change a member's role.

Todos os endpoints de access

Autenticação

Envie uma chave de API como um token de portador. A chave deve ter a permissão members.role.assign; uma chave sem ela é recusada com 403, e não 404.

Onde vai o ID da sua organização

Este endpoint aceita o ID da sua organização diretamente na URL, como orgId. Substitua-o no caminho — não há cabeçalho ou parâmetro de consulta que sirva como alternativa.

O ID da sua organização está na tela de chaves de API no seu painel, ao lado da própria chave. É o mesmo ID em todas as chamadas que você fizer.

Experimente

Substitua qualquer item entre colchetes por seus próprios valores e o espaço reservado para a chave por uma chave do seu painel.

curl -X PATCH https://api.zinndigital.com/v1/orgs/{orgId}/members/{userId} \
  -H "Authorization: Bearer zdk_live_…" \
  -H "Content-Type: application/json" \
  -d '{ "role": <string> }'

Conectado? O console da API no seu painel preenche o ID da sua organização real e a sua própria chave, e executa a requisição contra a API de produção para que você possa ver a resposta real. Abra este endpoint no console da API

Detalhes

Sets this member's role in the organization. Requires `members.role.assign` **on that org**. ⛔ **Replaces** the member's roles with the one given rather than adding to them — a person may hold several `Membership` rows, and collapsing them can only ever reduce what they hold, so no path through this endpoint escalates by accident. Three refusals, and they are the same rules an invitation is held to: **403** if the member holds a permission the caller does not (`more_privileged`), **403** if the *role being granted* holds one (`role_not_grantable` — this is what stops any holder of the key promoting themselves to `owner`), and **409** for the org's last owner (`last_owner`). An unknown role is a **422**, never a 403, so a typo is distinguishable from a permission you lack.

Parâmetros

NomeTipoObrigatórioO que é
orgId (path)UuidSimOrganization ID (UUIDv7).
userId (path)UuidSimThe user to remove from the organization.

Corpo da requisição

NomeTipoObrigatórioO que é
rolestringSimA role key from `GET /v1/orgs/{orgId}/roles`.

Resposta

NomeTipoObrigatórioO que é
user_idUuidSimUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringSim
namestringSimDisplay name; may be empty for an account that never set one.
rolesstring[]SimEvery role this person holds in this org, sorted.
joined_atstringSimWhen their EARLIEST membership of this org was created.
is_selfbooleanSimWhether this row is the calling user.
removablebooleanSim
not_removable_reasonOrgMemberRemovalBlock | nullSimWhy not, when `removable` is false. Null when removable — and also null for a caller lacking `members.remove`, because "you cannot remove anyone here" is a fact about the caller…
role_assignablebooleanSimWhether `PATCH` on this member would be accepted — the caller holds `members.role.assign` here, does not outrank themselves, and this is not the last owner. ⛔ *Which* role may t…

Erros que este endpoint pode retornar

401 · 403 · 404 · 409 · 422 · 429