Invite a user to a team

2 minute read

Use the team invites API to invite users to join a team, and assign default roles.

Retrieve teams

Use this endpoint to get a list of teams within an organization:

Endpoint
GET /v1/organizations/{organization_id}/teams
Parameter name In Type Required? Description

organization_id

Path

String

Yes

The ID of the organization or sub-organization

Responses

The following table outlines the possible responses for this endpoint, including status codes, their meanings, and the schemas that describe the returned data or errors:

Status Code Description Schema

200

Success. List of teams in organization

api.auth.GetTeamsResponse

Default

Error. Occurs when the user ID is missing, invalid, or the requester lacks permission.

google.rpc.Status

Retrieve team invites

Use this endpoint to invite all users belonging to an organization or sub-organization:

Endpoint
POST /v3/organizations/{organizationId}/teams/invites
Parameter name In Type Required? Description

organizationId

Path

String

Yes

The ID of the organization or sub-organization

Request Body

The following lists all parameters in a request body:

Parameter name In Type Required? Description

teamIds

Path

String

Yes

A list of team IDs to invite the users to

emails

Path

String

Yes

A list of users' emails to invite

roleName

Path

String

No

The role to assign all of the invitees

redirectUrl

Path

String

Yes

The URL that the user is sent to once the invite is accepted

invitedBy

Path

String

Yes

The identifier of the person sending the invitation

expirationDate

Path

String

Yes

When the invitations should expire. Defaults to 15 days post creation

Responses

The following table outlines the possible responses for this endpoint, including status codes, their meanings, and the schemas that describe the returned data or errors:

Status Code Description Schema

200

Success. List of sent invitations

api.auth.CreateInvitesResponse

Default

Error. Occurs when the user ID is missing, invalid, or the requester lacks permission.

google.rpc.Status

Response example
{ "sent_invites": [{ "id": "<1>", "email": "<email address>", "team_id":”<1>", "team_role":”<role_name>", "redirect_url":”<redirect_url>", "expiration_date":”<timestamp>" }] }