access

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

Change a member's role.

Tüm access uç noktaları

Kimlik Doğrulama

Bearer token olarak bir API anahtarı gönderin. Anahtar members.role.assign iznine sahip olmalıdır; bu izne sahip olmayan bir anahtar 404 ile değil, 403 ile reddedilir.

Kurum kimliğinizin yazılacağı yer

Bu uç nokta, kuruluş kimliğinizi doğrudan URL içinde orgId olarak alır. Bunu yola ekleyin; bunun yerine geçecek hiçbir başlık veya sorgu parametresi yoktur.

Kuruluş kimliğiniz (id), kontrol panelinizdeki API anahtarları ekranında, anahtarın hemen yanında yer alır. Yaptığınız her çağrıda aynı kimlik kullanılır.

Dene

Köşeli parantez içindeki her şeyi kendi değerlerinizle ve anahtar yer tutucusunu panonuzdan bir anahtarla değiştirin.

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

Oturum açtınız mı? Panonuzdaki API konsolu, gerçek organizasyon kimliğinizi ve kendi anahtarınızı otomatik olarak doldurur ve isteği canlı API üzerinde çalıştırarak gerçek yanıtı görmenizi sağlar. Bu uç noktayı API konsolunda açın

Ayrıntılar

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.

Parametreler

AdTürZorunluNe olduğu
orgId (path)UuidEvetOrganization ID (UUIDv7).
userId (path)UuidEvetThe user to remove from the organization.

İstek gövdesi

AdTürZorunluNe olduğu
rolestringEvetA role key from `GET /v1/orgs/{orgId}/roles`.

Yanıt

AdTürZorunluNe olduğu
user_idUuidEvetUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringEvet
namestringEvetDisplay name; may be empty for an account that never set one.
rolesstring[]EvetEvery role this person holds in this org, sorted.
joined_atstringEvetWhen their EARLIEST membership of this org was created.
is_selfbooleanEvetWhether this row is the calling user.
removablebooleanEvet
not_removable_reasonOrgMemberRemovalBlock | nullEvetWhy 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_assignablebooleanEvetWhether `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…

Bu uç noktanın dönderebileceği hatalar

401 · 403 · 404 · 409 · 422 · 429