A team invitation adds a person to a team a platform created. The team’s first admin is invited automatically when the team is created, so this endpoint is for everyone after that.
Example team invitation
cURL
workos_team_invitation
Each role_slug maps to one of the five dashboard roles:
role_slug |
Dashboard role | Description |
|---|---|---|
admin |
Admin | Can invite, configure environments, and manage resources |
member |
Developer | Can configure environments and manage resources |
member-sandbox |
Sandbox Developer | Can manage staging environments, read-only in production |
support |
Support | Can only manage users and organizations |
support-viewer |
Support Viewer | Read-only access to users and organizations |
Sends an email invitation to the recipient. Inviting an address that already has a pending invitation to this team resends it.
cURL
| curl --request POST \ | |
| --url "https://api.workos.com/platform/teams/team_01K4BN3VKH8AFZC5J334QZY3PM/invitations" \ | |
| --header "Authorization: Bearer $PLATFORM_ACCESS_TOKEN" \ | |
| --header "Content-Type: application/json" \ | |
| -d @- <<'BODY' | |
| { | |
| "email": "bob@example.com", | |
| "role_slug": "member" | |
| } | |
| BODY |
| { | |
| "object": "workos_team_invitation", | |
| "email": "bob@example.com", | |
| "role_slug": "member" | |
| } |
POST/platform /teams /:team_id /invitations
Parameters
Returns
- 400 (
user_already_team_member): the person is already an accepted member of this team. - 400 (
user_belongs_to_another_team): the person belongs to a different WorkOS team. A user can only belong to one team, which makes this the most common invitation error in practice. - 403 (
platform_not_authorized): the platform isn’t authorized on this team. - 404 (
team_not_found): no such team.
Radar Continue to the next section
Up next