access

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

Change a member's role.

Všechny koncové body access

Všechny dokumenty pro vývojáře

Autentizace

Zašlete API klíč jako nosný token (bearer token). Klíč musí mít oprávnění members.role.assign; klíč bez něj je odmítnut s kódem 403, nikoli 404.

Sem patří ID vaší organizace

Tento koncový bod přebírá ID vaší organizace přímo v URL jako orgId. Dosaďte jej do cesty – neexistuje žádná hlavička ani parametr dotazu, které by to udělaly místo toho.

ID vaší organizace najdete na obrazovce API klíčů ve vašem přehledu, hned vedle samotného klíče. Je to stále stejné ID v každém volání, které provedete.

Vyzvednout

Nahraďte cokoli v závorkách vlastními hodnotami a zástupný symbol klíče klíčem z vašeho řídicího panelu.

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> }'

Přihlášeni? Konzole API ve vašem dashboardu automaticky doplní vaše skutečné ID organizace i váš vlastní klíč a odešle požadavek na živé API, abyste viděli reálnou odpověď. Otevřete tento koncový bod v konzoli API

Podrobnosti

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.

Parametry

NázevTypPožadovánoCo to je
orgId (path)UuidAnoOrganization ID (UUIDv7).
userId (path)UuidAnoThe user to remove from the organization.

Tělo požadavku

NázevTypPožadovánoCo to je
rolestringAnoA role key from GET /v1/orgs/{orgId}/roles.

Odpověď

NázevTypPožadovánoCo to je
user_idUuidAnoUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringAno
namestringAnoDisplay name; may be empty for an account that never set one.
rolesstring[]AnoEvery role this person holds in this org, sorted.
joined_atstringAnoWhen their EARLIEST membership of this org was created.
is_selfbooleanAnoWhether this row is the calling user.
removablebooleanAno
not_removable_reasonOrgMemberRemovalBlock | nullAnoWhy 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_assignablebooleanAnoWhether 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…

Chyby, které může tento koncový bod vrátit

401 · 403 · 404 · 409 · 422 · 429