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.

POST/api/v2/workspaces/:workspaceId/invitationsAuthenticated

Create a new workspace invitation. Optionally sends an email to the invitee. If no email is provided, a shareable link invitation is created.

Path Parameters

workspaceIdstringrequired

UUID of the workspace.

Body Parameters

emailstring

Email address to invite. If omitted, creates a shareable link invitation.

rolestring

Role for the invitee: "admin" or "member". Defaults to "member".

expirationDaysnumber

Number of days before the invitation expires. Defaults to 7.

Request

cURL
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..."
  }
}
GET/api/v2/workspaces/:workspaceId/invitationsAuthenticated

List all pending (non-expired, non-accepted) invitations for a workspace. Includes inviter names and shareable links.

Path Parameters

workspaceIdstringrequired

UUID of the workspace.

Request

cURL
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
}
DELETE/api/v2/workspaces/:workspaceId/invitations/:idAuthenticated

Revoke a pending invitation. The invitation link will no longer be valid.

Path Parameters

workspaceIdstringrequired

UUID of the workspace.

idstringrequired

UUID of the invitation to revoke.

Request

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

GET/api/v2/invitations/:token

Get 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

tokenstringrequired

The secure invitation token from the invite link.

Request

cURL
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"
  }
}
POST/api/v2/invitations/:token/acceptAuthenticated

Accept 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

tokenstringrequired

The secure invitation token from the invite link.

Request

cURL
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"
}
GET/api/v2/invitations/:token/membershipAuthenticated

Check 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

tokenstringrequired

The secure invitation token from the invite link.

Request

cURL
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"
  }
}