Skip to Content
kosemdocs
ReferenceAPIInvitations

Create invitation

Invites an email address to an organization, as a member or a guest. The invitee receives an email and joins by accepting. Granting roles on accepting takes setIamPolicy on each resource in grants.

POST
/v1/organizations/{organization}/invitations

Invites an email address to an organization, as a member or a guest.

The invitee receives an email and joins by accepting. Granting roles on accepting takes setIamPolicy on each resource in grants.

Authorization

bearer
headerAuthorizationBearer <token>

An access token, or an API key.

Path Parameters

organization*string

The organization's ID.

Match^org_[0-7][0-9a-hjkmnp-tv-z]{25}$

Request Body

application/json
  1. body
email*string

The email address to invite.

Formatemail
grants?array<>

Roles the invitee receives on accepting; at most as many as the identity.invitationGrants quota allows. Granting each takes setIamPolicy on its resource.

kind*string

How the invitee will belong to the organization.

Value in"MEMBER""GUEST"

Response Body

Created

application/json
  1. response
acceptor*string

Who accepted the invitation, users/{user_id}; empty until accepted.

createTime*string

When the invitation was created.

Formatdate-time
email*string

The invited email address.

expireTime*string

When the invitation expires unless accepted.

Formatdate-time
grants*array<>

Roles the invitee receives on accepting.

inviter*string

Who sent the invitation, users/{user_id}.

kind*string

How the invitee will belong to the organization: a MEMBER sees its directory and is included in grants to all members; a GUEST sees only what they are granted.

Value in"MEMBER""GUEST"
name*string

Resource name, organizations/{organization_id}/invitations/{invitation_id}.

state*string

Lifecycle state: PENDING, waiting for the invitee; ACCEPTED, the invitee joined; REVOKED before it was accepted; EXPIRED, not accepted in time, as invitations last 7 days.

Value in"PENDING""ACCEPTED""REVOKED""EXPIRED"
updateTime*string

When the invitation last changed.

Formatdate-time
Example Request
curl -X POST 'https://api.kosem.ai/v1/organizations/string/invitations' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "user@example.com",
  "kind": "MEMBER"
}'
Example Response
{
  "acceptor": "string",
  "createTime": "2019-08-24T14:15:22Z",
  "email": "string",
  "expireTime": "2019-08-24T14:15:22Z",
  "grants": [
    {
      "resource": "string",
      "role": "string"
    }
  ],
  "inviter": "string",
  "kind": "MEMBER",
  "name": "string",
  "state": "PENDING",
  "updateTime": "2019-08-24T14:15:22Z"
}