access

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

Change a member's role.

すべての access エンドポイント

認証

ベアラー トークンとして API キーを送信します。キーには members.role.assign 権限が付与されている必要があります。権限のないキーは 404 ではなく 403 で拒否されます。

組織 ID を入力する場所

このエンドポイントでは、URL内に組織IDを orgId として直接指定します。パスの中にその値を代入してください。この動作を代替するヘッダーやクエリパラメータはありません。

組織IDは、ダッシュボードのAPIキー画面にキーのすぐ横に表示されています。これは、実行するすべての呼び出しで同じIDになります。

試してみる

アングルブラケット内のすべてをご自身の値に置き換え、キーのプレースホルダーをご利用中のダッシュボードのキーに置き換えてください。

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コンソールでは、実際の組織IDやお客様ご自身のキーが自動入力され、ライブ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