Invite new users to join your organization. Admins and owners can send invitations, and recipients can accept or decline via a unique token link.
Endpoints
| Method | Endpoint | Description |
|---|
GET | /v1/orgs/:org_id/invites | List pending invites (admin+) |
POST | /v1/orgs/:org_id/invites | Send invite (admin+) |
DELETE | /v1/orgs/:org_id/invites/:invite_id | Revoke invite (admin+) |
GET | /v1/invites/:token | Get invite details (no auth required) |
POST | /v1/invites/:token/accept | Accept invite |
POST | /v1/invites/:token/decline | Decline invite |
Invite Object
{
"id": 42,
"email": "newuser@example.com",
"role": "member",
"status": "pending",
"invited_by_email": "admin@example.com",
"created_at": "2025-01-01T00:00:00Z",
"expires_at": "2025-01-08T00:00:00Z"
}
| Field | Type | Description |
|---|
id | integer | Unique identifier |
email | string | Invitee’s email address |
role | string | Assigned role: admin or member |
status | string | pending, accepted, or declined |
invited_by_email | string | Email of the user who sent the invite |
created_at | string | ISO 8601 timestamp |
expires_at | string | ISO 8601 expiration timestamp (7 days from creation) |
When retrieving an invite by token (the public endpoint), the response also includes an org_name field with the organization’s display name.
List Pending Invites
Retrieve all pending invites for your organization. Requires admin or owner role.
curl https://api.thunderphone.com/v1/orgs/{org_id}/invites \
-H "Authorization: Token YOUR_API_TOKEN"
Send an Invite
Invite a user to join your organization by email. Requires admin or owner role.
curl -X POST https://api.thunderphone.com/v1/orgs/{org_id}/invites \
-H "Authorization: Token YOUR_API_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"email": "newuser@example.com",
"role": "member"
}'
| Field | Type | Required | Description |
|---|
email | string | Yes | Email address to invite |
role | string | No | Role to assign: admin or member (default: member) |
Revoke an Invite
Cancel a pending invite. Requires admin or owner role.
curl -X DELETE https://api.thunderphone.com/v1/orgs/{org_id}/invites/42 \
-H "Authorization: Token YOUR_API_TOKEN"
Response: 204 No Content
Get Invite Details
Retrieve details about an invite using its token. This endpoint does not require authentication and is used to display invite information before the recipient accepts or declines.
curl https://api.thunderphone.com/v1/invites/abc123def456
Response
{
"id": 42,
"email": "newuser@example.com",
"role": "member",
"status": "pending",
"invited_by_email": "admin@example.com",
"org_name": "Acme Corp",
"created_at": "2025-01-01T00:00:00Z",
"expires_at": "2025-01-08T00:00:00Z"
}
Expired or already-used invites return 410 Gone.
Accept an Invite
Accept an invite using its token. The authenticated user will be added to the organization with the assigned role.
curl -X POST https://api.thunderphone.com/v1/invites/abc123def456/accept \
-H "Authorization: Token YOUR_API_TOKEN"
Response
{
"detail": "Invite accepted.",
"org_id": 1
}
Decline an Invite
Decline an invite using its token.
curl -X POST https://api.thunderphone.com/v1/invites/abc123def456/decline \
-H "Authorization: Token YOUR_API_TOKEN"
Response
{
"detail": "Invite declined."
}