Onboarding API

Manages the user onboarding flow: profile setup, workspace invitation handling, first workspace creation, and onboarding completion. Determines which onboarding steps are needed based on profile completeness, workspace membership, and pending invitations. Rate-limited to 30 requests per minute.

Base path: /api/v2/onboarding

GET/api/v2/onboarding/statusAuthenticated

Get the user's onboarding status. Checks profile completion, workspace membership, and pending invitations to determine remaining steps.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/onboarding/status \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"status": {
    400">class="text-emerald-400">"needsOnboarding": true,
    400">class="text-emerald-400">"onboardingCompleted": false,
    400">class="text-emerald-400">"currentStep": 400">class="text-emerald-400">"profile",
    400">class="text-emerald-400">"steps": {
      400">class="text-emerald-400">"welcome": { 400">class="text-emerald-400">"completed": true, 400">class="text-emerald-400">"required": true },
      400">class="text-emerald-400">"profile": { 400">class="text-emerald-400">"completed": false, 400">class="text-emerald-400">"required": true },
      400">class="text-emerald-400">"invitations": { 400">class="text-emerald-400">"completed": false, 400">class="text-emerald-400">"required": true },
      400">class="text-emerald-400">"workspace": { 400">class="text-emerald-400">"completed": false, 400">class="text-emerald-400">"required": true }
    },
    400">class="text-emerald-400">"profile": {
      400">class="text-emerald-400">"hasDisplayName": false,
      400">class="text-emerald-400">"hasAvatar": false,
      400">class="text-emerald-400">"displayName": null,
      400">class="text-emerald-400">"avatarUrl": null
    },
    400">class="text-emerald-400">"workspaces": {
      400">class="text-emerald-400">"count": 0,
      400">class="text-emerald-400">"isInWorkspace": false
    },
    400">class="text-emerald-400">"invitations": {
      400">class="text-emerald-400">"pendingCount": 2,
      400">class="text-emerald-400">"hasPendingInvitations": true
    }
  }
}
POST/api/v2/onboarding/profileAuthenticated

Complete the profile setup step. Updates the user's display name, avatar, and bio in Supabase Auth metadata.

Body Parameters

display_namestringrequired

Display name (minimum 2 characters).

avatar_urlstring

URL to an avatar image.

biostring

Short bio or description.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/onboarding/profile \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"display_name": 400">class="text-emerald-400">"Matty S",
    400">class="text-emerald-400">"avatar_url": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//example.com/avatar.jpg",
    400">class="text-emerald-400">"bio": 400">class="text-emerald-400">"Building the future of AI collaboration"
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"profile": {
    400">class="text-emerald-400">"displayName": 400">class="text-emerald-400">"Matty S",
    400">class="text-emerald-400">"avatarUrl": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//example.com/avatar.jpg",
    400">class="text-emerald-400">"bio": 400">class="text-emerald-400">"Building the future of AI collaboration"
  }
}
GET/api/v2/onboarding/pending-invitationsAuthenticated

Get all pending workspace invitations for the authenticated user's email. Includes workspace details and inviter information.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/onboarding/pending-invitations \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"invitations": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"inv_abc123",
      400">class="text-emerald-400">"workspaceId": 400">class="text-emerald-400">"ws_abc123",
      400">class="text-emerald-400">"workspace": {
        400">class="text-emerald-400">"id": 400">class="text-emerald-400">"ws_abc123",
        400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Acme Corp",
        400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"acme-corp",
        400">class="text-emerald-400">"description": 400">class="text-emerald-400">"The Acme team workspace",
        400">class="text-emerald-400">"avatarUrl": null
      },
      400">class="text-emerald-400">"role": 400">class="text-emerald-400">"member",
      400">class="text-emerald-400">"invitedBy": {
        400">class="text-emerald-400">"id": 400">class="text-emerald-400">"user_xyz",
        400">class="text-emerald-400">"displayName": 400">class="text-emerald-400">"Matty S",
        400">class="text-emerald-400">"avatarUrl": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//example.com/avatar.jpg"
      },
      400">class="text-emerald-400">"createdAt": 400">class="text-emerald-400">"2026-03-28T10:00:00.000Z",
      400">class="text-emerald-400">"expiresAt": 400">class="text-emerald-400">"2026-04-04T10:00:00.000Z"
    }
  ],
  400">class="text-emerald-400">"count": 1
}
POST/api/v2/onboarding/accept-invitationsAuthenticated

Accept multiple workspace invitations at once. Adds the user to each workspace and marks invitations as accepted.

Body Parameters

invitation_idsstring[]required

Array of invitation UUIDs to accept.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/onboarding/accept-invitations \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"invitation_ids": [400">class="text-emerald-400">"inv_abc123", 400">class="text-emerald-400">"inv_def456"]
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"accepted": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"ws_abc123",
      400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Acme Corp",
      400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"acme-corp",
      400">class="text-emerald-400">"role": 400">class="text-emerald-400">"member"
    }
  ],
  400">class="text-emerald-400">"acceptedCount": 1,
  400">class="text-emerald-400">"errors": [
    { 400">class="text-emerald-400">"invitationId": 400">class="text-emerald-400">"inv_def456", 400">class="text-emerald-400">"error": 400">class="text-emerald-400">"Invitation has expired" }
  ]
}
POST/api/v2/onboarding/create-workspaceAuthenticated

Create a first workspace during onboarding. Creates the workspace, adds the user as owner, and sets up a default general channel.

Body Parameters

namestringrequired

Workspace name (minimum 2 characters).

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/onboarding/create-workspace \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"My Team"
  }'

Response 201

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"workspace": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"ws_new123",
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"My Team",
    400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"my-team-a1b2",
    400">class="text-emerald-400">"isOwner": true,
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"owner"
  }
}
POST/api/v2/onboarding/completeAuthenticated

Mark onboarding as complete. Sets the onboarding_completed flag in user metadata and returns a redirect destination.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/onboarding/complete \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"completed": true,
  400">class="text-emerald-400">"redirectTo": 400">class="text-emerald-400">"/chat?workspace=acme-corp"
}
GET/api/v2/onboarding/invitation/:tokenAuthenticated

Get invitation details by token. Shows workspace info, role, and whether the invitation is expired or already accepted.

Path Parameters

tokenstringrequired

Invitation token (UUID).

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/onboarding/invitation/550e8400-e29b-41d4-a716-446655440000 \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY"

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"invitation": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"inv_abc123",
    400">class="text-emerald-400">"email": 400">class="text-emerald-400">"user@company.com",
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"member",
    400">class="text-emerald-400">"workspace": {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"ws_abc123",
      400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Acme Corp",
      400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"acme-corp",
      400">class="text-emerald-400">"description": 400">class="text-emerald-400">"The Acme team workspace",
      400">class="text-emerald-400">"avatarUrl": null
    },
    400">class="text-emerald-400">"isExpired": false,
    400">class="text-emerald-400">"isAccepted": false,
    400">class="text-emerald-400">"expiresAt": 400">class="text-emerald-400">"2026-04-08T10:00:00.000Z"
  }
}
POST/api/v2/onboarding/validate-inviteAuthenticated

Validate an invite token for the authenticated user. Checks if the invitation matches the user's email, is not expired, and has not been accepted.

Body Parameters

tokenstringrequired

Invitation token to validate.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/onboarding/validate-invite \
  -H 400">class="text-emerald-400">"Authorization: Bearer YOUR_API_KEY" \
  -H 400">class="text-emerald-400">"Content-Type: application/json" \
  -d '{
    400">class="text-emerald-400">"token": 400">class="text-emerald-400">"550e8400-e29b-41d4-a716-446655440000"
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"valid": true,
  400">class="text-emerald-400">"invitation": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"inv_abc123",
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"member",
    400">class="text-emerald-400">"workspace": {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"ws_abc123",
      400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Acme Corp",
      400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"acme-corp"
    }
  }
}