access

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

Change a member's role.

ចំណុចបញ្ចប់ access ទាំងអស់

ការផ្ទៀងផ្ទាត់ភាពត្រឹមត្រូវ

បញ្ជូនសោ API ជា bearer token។ សោនេះត្រូវតែមានសិទ្ធិ members.role.assign។ សោដែលគ្មានសិទ្ធិនេះនឹងត្រូវបដិសេធដោយកូដ 403 មិនមែន 404 ទេ។

កន្លែងដែលលេខសម្គាល់អង្គការរបស់អ្នកត្រូវដាក់

ចំនុចបញ្ចប់នេះទទួលលេខសម្គាល់អង្គការរបស់អ្នកនៅក្នុង URL ផ្ទាល់ ដូចជា orgId។ សូមជំនួសវាចូលទៅក្នុងផ្លូវ (path) ដែលគ្មានក្បាលទំព័រ ឬប៉ារ៉ាម៉ែត្រសំណួរណាមួយអាចធ្វើជំនួសបានឡើយ។

លេខសម្គាល់អង្គការរបស់អ្នកស្ថិតនៅលើអេក្រង់គ្រាប់ចុច API ក្នុងផ្ទាំងគ្រប់គ្រងរបស់អ្នក នៅជាប់នឹងគ្រាប់ចុចផ្ទាល់តែម្ដង។ វាគឺជាលេខសម្គាល់ដូចគ្នានៅក្នុងការហៅទូរសព្ទនីមួយៗដែលអ្នកធ្វើ។

សាកល្បង

ជំនួសអ្វីមួយនៅក្នុងសញ្ញាពងក្រពើ < > ដោយប្រើតម្លៃផ្ទាល់ខ្លួនរបស់អ្នក ហើយជំនួសកន្លែងរក្សាទុកសោដោយប្រើសោចេញពីផ្ទាំងគ្រប់គ្រងរបស់អ្នក។

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

បានចូលគណនីរួចហើយមែនទេ? កុងសូល API ក្នុងផ្ទាំងគ្រប់គ្រងរបស់អ្នក បំពេញលេខសម្គាល់ស្ថាប័នពិតប្រាកដរបស់អ្នក និងសោផ្ទាល់ខ្លួនរបស់អ្នក ហើយដំណើរការសំណើទល់នឹង API ផ្ទាល់ ដូច្នេះអ្នកអាចមើលឃើញការឆ្លើយតបពិតប្រាកដ។ បើកចំណុចបញ្ចប់នេះក្នុងកុងសូល API

ព័ត៌មានលម្អិត

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.

ប៉ារ៉ាម៉ែត្រ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
orgId (path)Uuidបាទ/ចាសOrganization ID (UUIDv7).
userId (path)Uuidបាទ/ចាសThe user to remove from the organization.

សំណើរបស់រាងកាយ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
rolestringបាទ/ចាសA role key from `GET /v1/orgs/{orgId}/roles`.

ផ្អាកដំណើរការ

ឈ្មោះប្រភេទតម្រូវការតើវាជាអ្វី
user_idUuidបាទ/ចាសUUIDv7 identifier — sortable by creation time (docs/02 §8).
emailstringបាទ/ចាស
namestringបាទ/ចាសDisplay name; may be empty for an account that never set one.
rolesstring[]បាទ/ចាសEvery role this person holds in this org, sorted.
joined_atstringបាទ/ចាសWhen their EARLIEST membership of this org was created.
is_selfbooleanបាទ/ចាសWhether this row is the calling user.
removablebooleanបាទ/ចាស
not_removable_reasonOrgMemberRemovalBlock | nullបាទ/ចាសWhy 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_assignablebooleanបាទ/ចាសWhether `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…

កំហុសដែលចំណុចបញ្ចប់នេះអាចបង្វិលត្រឡប់មកវិញ

401 · 403 · 404 · 409 · 422 · 429