Xác thực
Gửi khóa API dưới dạng mã thông báo bearer. Khóa này phải có quyền members.role.assign; khóa không có quyền này sẽ bị từ chối với mã lỗi 403, không phải 404.
Nơi điền id tổ chức của bạn
Endpoint này nhận mã tổ chức của bạn trực tiếp trong URL dưới dạng orgId. Hãy thay thế nó vào đường dẫn — không có header hoặc query parameter nào có thể thay thế được.
Mã tổ chức của bạn nằm ở màn hình khóa API trong bảng điều khiển, ngay bên cạnh khóa đó. Đây là cùng một mã trong mọi lệnh gọi mà bạn thực hiện.
Dùng thử
Thay thế bất kỳ nội dung nào trong ngoعل (angle brackets) bằng giá trị của riêng bạn và trình giữ chỗ key bằng một key từ trang tổng quan của bạn.
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> }'Đã đăng nhập? Bảng điều khiển API trong trang quản lý của bạn sẽ tự điền ID tổ chức thực tế và khóa của riêng bạn, sau đó chạy yêu cầu đối với API trực tiếp để bạn có thể xem phản hồi thực tế. Mở điểm cuối này trong bảng điều khiển API
Chi tiết
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.
Tham số
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
orgId (path) | Uuid | Có | Organization ID (UUIDv7). |
userId (path) | Uuid | Có | The user to remove from the organization. |
Nội dung yêu cầu
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
role | string | Có | A role key from `GET /v1/orgs/{orgId}/roles`. |
Phản hồi
| Tên | Loại | Bắt buộc | Nội dung này là gì |
|---|---|---|---|
user_id | Uuid | Có | UUIDv7 identifier — sortable by creation time (docs/02 §8). |
email | string | Có | — |
name | string | Có | Display name; may be empty for an account that never set one. |
roles | string[] | Có | Every role this person holds in this org, sorted. |
joined_at | string | Có | When their EARLIEST membership of this org was created. |
is_self | boolean | Có | Whether this row is the calling user. |
removable | boolean | Có | — |
not_removable_reason | OrgMemberRemovalBlock | null | Có | 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_assignable | boolean | Có | 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… |
Các lỗi điểm cuối này có thể trả về
401 · 403 · 404 · 409 · 422 · 429