Invitations API
Manage workspace invitations with secure, token-based invitation links. Admins and owners can create and revoke invitations. Invitation links can be shared publicly or sent directly via email. Invitations expire after a configurable number of days (default 7). Rate-limited to 50 requests per minute.
Base paths: /api/v2/workspaces/:workspaceId/invitations and /api/v2/invitations
Invitation Management
Create, list, and revoke invitations for a workspace. These endpoints require admin or owner role in the target workspace.
/api/v2/workspaces/:workspaceId/invitationsAuthenticatedCreate a new workspace invitation. Optionally sends an email to the invitee. If no email is provided, a shareable link invitation is created.
Path Parameters
workspaceIdstringrequiredUUID of the workspace.
Body Parameters
emailstringEmail address to invite. If omitted, creates a shareable link invitation.
rolestringRole for the invitee: "admin" or "member". Defaults to "member".
expirationDaysnumberNumber of days before the invitation expires. Defaults to 7.
Request
curl -X POST "https://api.lvng.ai/api/v2/workspaces/{workspaceId}/invitations" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{}'Response 201
{
"success": true,
"invitation": {
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "colleague@company.com",
"role": "member",
"expires_at": "2026-04-15T12:00:00.000Z",
"created_at": "2026-04-01T12:00:00.000Z",
"invite_link": "https://app.lvng.ai/invite/a1b2c3d4e5f6..."
}
}/api/v2/workspaces/:workspaceId/invitationsAuthenticatedList all pending (non-expired, non-accepted) invitations for a workspace. Includes inviter names and shareable links.
Path Parameters
workspaceIdstringrequiredUUID of the workspace.
Request
curl -X GET "https://api.lvng.ai/api/v2/workspaces/{workspaceId}/invitations" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"success": true,
"invitations": [
{
"id": "550e8400-e29b-41d4-a716-446655440000",
"email": "colleague@company.com",
"role": "member",
"expires_at": "2026-04-15T12:00:00.000Z",
"created_at": "2026-04-01T12:00:00.000Z",
"invited_by": "a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11",
"invite_link": "https://app.lvng.ai/invite/a1b2c3d4e5f6...",
"created_by_name": "Sam C"
}
],
"count": 1
}/api/v2/workspaces/:workspaceId/invitations/:idAuthenticatedRevoke a pending invitation. The invitation link will no longer be valid.
Path Parameters
workspaceIdstringrequiredUUID of the workspace.
idstringrequiredUUID of the invitation to revoke.
Request
curl -X DELETE "https://api.lvng.ai/api/v2/workspaces/{workspaceId}/invitations/{id}" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"success": true,
"message": "Invitation revoked successfully"
}Token-Based Access
Look up and accept invitations using the secure token from the invitation link. The lookup is public (no auth required). Accepting an invitation and checking membership require authentication.
A token that no invitation has answers 404. A link that can no longer be accepted answers 410 on the lookup and on accept, with error set to Expired when its date has passed or AlreadyAccepted when it was used, and says nothing about the workspace.
/api/v2/invitations/:tokenGet invitation details by token. Public endpoint -- no authentication required. Returns workspace name, inviter, role, and expiry date of an invitation that can still be accepted.
Path Parameters
tokenstringrequiredThe secure invitation token from the invite link.
Request
curl -X GET "https://api.lvng.ai/api/v2/invitations/{token}"Response 200
{
"success": true,
"invitation": {
"role": "member",
"email": "colleague@company.com",
"expires_at": "2026-04-15T12:00:00.000Z",
"workspace": {
"name": "Acme Corp",
"slug": "acme-corp"
},
"invited_by": "Sam C"
}
}/api/v2/invitations/:token/acceptAuthenticatedAccept an invitation and join the workspace. Requires authentication. The authenticated user is added as a workspace member with the invited role. Takes no body. Answers 403 EmailMismatch, with expected_email, when the workspace accepts the invitation only from the address it was sent to and the caller is signed in with another one, and 409 AlreadyMember when the caller is already in the workspace.
Path Parameters
tokenstringrequiredThe secure invitation token from the invite link.
Request
curl -X POST "https://api.lvng.ai/api/v2/invitations/{token}/accept" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"success": true,
"message": "Successfully joined the workspace",
"workspace": {
"id": "ws_abc123",
"name": "Acme Corp",
"slug": "acme-corp"
},
"role": "member"
}/api/v2/invitations/:token/membershipAuthenticatedCheck whether the authenticated user is already a member of the invitation's workspace, whatever state the invitation is in (pending, accepted, or expired). Read-only: nothing is accepted or joined. The workspace is returned only to a member; anyone else gets { "success": true, "member": false } and learns nothing about the workspace.
Path Parameters
tokenstringrequiredThe secure invitation token from the invite link.
Request
curl -X GET "https://api.lvng.ai/api/v2/invitations/{token}/membership" \
-H "Authorization: Bearer YOUR_API_KEY"Response 200
{
"success": true,
"member": true,
"workspace": {
"id": "ws_abc123",
"name": "Acme Corp",
"slug": "acme-corp"
}
}