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