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

Invite users to the organization

Use this endpoint to invite users to an organization:

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

organizationId

Path

String

Yes

The ID of the organization

Request Body

The following lists all parameters in a request body:

Parameter name In Type Required? Description

organizationId

Path

String

Yes

The org that the invite belongs to

email

Body

Array of strings

Yes

Email addresses to invite

team_id

Body

Array of strings

No

Extra team IDs to join for the invited users

Example request
POST /organizations/{organizationId}/team-invites Content-Type: application/json { "emails": ["user1@example.com", "user2@example.com"], "teamIds": ["team-123", "team-456"] }

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.CreateInvitesV3Response

Default

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

google.rpc.Status

Response example
{ "invites": [ { "id": <string>, "email": <string>, "team_id": <string>, "team_role": <string>, "redirectUrl": <string>, "expirationDate": <timestamp>, "is_autogenerated": <boolean>, "audit": { "who": <string>, "why": <string>, "when": <timestamp>, } } ] }