Gamma API

Invite to an organization

POST
/api/organizations/{slug}/invitations

Emails an invitation to join the organization. Answered by the auth plugin, whose refusals are { code, message } rather than { error }.

Who may call it: An owner, security admin or admin of the organization. API keys: no.

Authorization

session
cookiegamma.session_token<token>

The session cookie a sign-in sets. Over HTTPS its name carries the __Secure- prefix. Browsers send it on their own; other clients keep it from the sign-in response.

Path Parameters

slug*string

The organization's slug, as in its URL.

Request Body

application/json
  1. body
email*string
Match^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$
Formatemail
role*string

An admin gives up to admin, a security admin up to securityAdmin, an owner any.

Value in"owner""securityAdmin""admin""projectCreator""member"
resend?boolean

Response Body

OK.

application/json
  1. response

An invitation to join an organization, or one project of it.

id*string
organizationId*string
email*string
role*|

The role it gives on accepting.

status*string

pending, accepted, rejected or canceled. One past expiresAt stays pending.

expiresAt*string
Formatdate-time
createdAt*string
Formatdate-time
inviterId*string

The user who sent it.

projectId?|

The project it invites to, as a guest; null or absent for the organization itself.

Example Request
curl -X POST 'http://localhost:3000/api/organizations/string/invitations' \  -H 'Content-Type: application/json' \  -d '{  "email": "user@example.com",  "role": "owner"}'
Example Response
{  "id": "string",  "organizationId": "string",  "email": "string",  "role": "string",  "status": "string",  "expiresAt": "2019-08-24T14:15:22Z",  "createdAt": "2019-08-24T14:15:22Z",  "inviterId": "string",  "projectId": "string"}