access

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

Change a member's role.

כל נקודות הקצה מסוג access

כל תיעוד המפתחים

אימות

שלחו מפתח API כאסימון נושא (bearer token). על המפתח לכלול את הרשאה members.role.assign; מפתח שאינו כולל אותה יידחה בסטטוס 403, ולא 404.

המקום שבו מזהה הארגון שלך נכנס

נקודת קצה זו מקבלת את מזהה הארגון שלך בכתובת ה-URL עצמה, בתור orgId. השתמש בו בנתיב — אין כותרת או פרמטר שאילתת חיפוש שיעשו זאת במקומו.

מזהה הארגון שלך נמצא במסוף מפתחות ה-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…

שגיאות שנקודה קצה זו עשויה להחזיר

401 · 403 · 404 · 409 · 422 · 429