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
curl -X GET "https://api.lvng.ai/api/v2/onboarding/status" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "success": true,
  "status": {
    "needsOnboarding": true,
    "onboardingCompleted": false,
    "currentStep": "profile",
    "steps": {
      "welcome": { "completed": true, "required": true },
      "profile": { "completed": false, "required": true },
      "invitations": { "completed": false, "required": true },
      "workspace": { "completed": false, "required": true }
    },
    "profile": {
      "hasDisplayName": false,
      "hasAvatar": false,
      "displayName": null,
      "avatarUrl": null
    },
    "workspaces": {
      "count": 0,
      "isInWorkspace": false
    },
    "invitations": {
      "pendingCount": 2,
      "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
curl -X POST "https://api.lvng.ai/api/v2/onboarding/profile" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 200

{
  "success": true,
  "profile": {
    "displayName": "Sam C",
    "avatarUrl": "https://example.com/avatar.jpg",
    "bio": "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
curl -X GET "https://api.lvng.ai/api/v2/onboarding/pending-invitations" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "success": true,
  "invitations": [
    {
      "id": "inv_abc123",
      "workspaceId": "ws_abc123",
      "workspace": {
        "id": "ws_abc123",
        "name": "Acme Corp",
        "slug": "acme-corp",
        "description": "The Acme team workspace",
        "avatarUrl": null
      },
      "role": "member",
      "invitedBy": {
        "id": "user_xyz",
        "displayName": "Sam C",
        "avatarUrl": "https://example.com/avatar.jpg"
      },
      "createdAt": "2026-03-28T10:00:00.000Z",
      "expiresAt": "2026-04-04T10:00:00.000Z"
    }
  ],
  "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
curl -X POST "https://api.lvng.ai/api/v2/onboarding/accept-invitations" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 200

{
  "success": true,
  "accepted": [
    {
      "id": "ws_abc123",
      "name": "Acme Corp",
      "slug": "acme-corp",
      "role": "member"
    }
  ],
  "acceptedCount": 1,
  "errors": [
    { "invitationId": "inv_def456", "error": "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
curl -X POST "https://api.lvng.ai/api/v2/onboarding/create-workspace" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 201

{
  "success": true,
  "workspace": {
    "id": "ws_new123",
    "name": "My Team",
    "slug": "my-team-a1b2",
    "isOwner": true,
    "role": "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
curl -X POST "https://api.lvng.ai/api/v2/onboarding/complete" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 200

{
  "success": true,
  "completed": true,
  "redirectTo": "/chat?workspace=acme-corp"
}