access

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

Change a member's role.

Semua titik akhir access

Autentikasi

Kirim kunci API sebagai token bearer. Kunci tersebut harus memiliki izin members.role.assign; kunci tanpa izin tersebut akan ditolak dengan status 403, bukan 404.

Tempat ID organisasi Anda dimasukkan

Endpoint ini menggunakan id organisasi Anda di dalam URL itu sendiri, sebagai orgId. Gantikan ke dalam path — tidak ada header atau parameter kueri yang dapat menggantikannya.

ID organisasi Anda berada di layar kunci API di dasbor Anda, di sebelah kunci itu sendiri. Itu adalah ID yang sama dalam setiap panggilan yang Anda buat.

Coba

Ganti apa pun di dalam tanda kurung sudut dengan nilai Anda sendiri, dan placeholder kunci dengan kunci dari dasbor Anda.

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

Sudah masuk? Konsol API di dasbor Anda akan mengisi ID organisasi asli dan kunci Anda sendiri, serta menjalankan permintaan terhadap API langsung sehingga Anda dapat melihat respons aktualnya. Buka titik akhir ini di konsol API

Detail

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.

Parameter

NamaJenisWajibTentang apa ini
orgId (path)UuidYaOrganization ID (UUIDv7).
userId (path)UuidYaThe user to remove from the organization.

Isi permintaan

NamaJenisWajibTentang apa ini
rolestringYaA role key from `GET /v1/orgs/{orgId}/roles`.

Tanggapan

NamaJenisWajibTentang apa ini
user_idUuidYaUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringYa
namestringYaDisplay name; may be empty for an account that never set one.
rolesstring[]YaEvery role this person holds in this org, sorted.
joined_atstringYaWhen their EARLIEST membership of this org was created.
is_selfbooleanYaWhether this row is the calling user.
removablebooleanYa
not_removable_reasonOrgMemberRemovalBlock | nullYaWhy 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_assignablebooleanYaWhether `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…

Kesalahan yang dapat dikembalikan oleh titik akhir ini

401 · 403 · 404 · 409 · 422 · 429