members
POST /v1/members/invitations
Invite an email to join an organization with a role.
Аутентификация
Отправьте ключ API в качестве токена носителя (bearer token). Ключ должен иметь разрешение members.invite; ключ без него отклоняется с кодом 403, а не 404.
Идентификатор вашей организации
Этот эндпоинт принимает org_id в качестве поля в теле JSON.
Идентификатор вашей организации находится на экране ключей API в вашей панели управления, рядом с самим ключом. Это один и тот же идентификатор для каждого вашего запроса.
Попробовать
Замените всё в угловых скобках на собственные значения, а плейсхолдер ключа — на ключ из вашей панели управления.
curl -X POST https://api.zinndigital.com/v1/members/invitations \
-H "Authorization: Bearer zdk_live_…" \
-H "Content-Type: application/json" \
-d '{ "email": <string>, "role": <string> }'Вошли в систему? Консоль API в вашей панели управления автоматически подставляет реальный идентификатор вашей организации и ваш собственный ключ, а также выполняет запрос к работающему API, чтобы вы могли увидеть актуальный ответ. Откройте эту конечную точку в API-консоли
Подробнее
Invites an **email** (the person need not exist yet — users are Keycloak subjects) to join with a role. The role is validated to be one the inviter is themselves permitted to grant: a role holding any permission the inviter lacks in that organization is refused (422), so `members.invite` is not a ladder to owner. A re-invite of the same email refreshes the pending invite. Emits `member.invited` so the invitation email is sent. Requires `members.invite` in the target org.
Тело запроса
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
email | string | Да | — |
role | string | Да | The role key to grant (e.g. `manager`, `billing`). |
org_id | string | Нет | Organization to invite into; defaults to the caller's own. The caller must hold `members.invite` in **that** organization. |
Ответ
| Имя | Тип | Обязательно | Что это |
|---|---|---|---|
id | string | Да | — |
org_id | string | Да | — |
org_name | string | Да | The inviting organisation's display name, so an invitee can answer "accept?". |
email | string | Да | — |
role | string | Да | — |
site_grants | object[] | Да | The individual sites this invitation lends, when it was created by sharing a site with an address that had no account (`POST /v1/sites/{siteId}/collaborators`). Empty for an ord… |
status | string<pending, accepted, revoked> | Да | — |
expires_at | string | Да | — |
accepted_at | string | Нет | — |
created_at | string | Да | — |
Ошибки, которые может возвращать этот эндпоинт
401 · 403 · 422 · 429