Workspaces API

Workspaces are the top-level organizational unit in LVNG. They scope channels, agents, workflows, and team members. Each workspace has its own visibility settings, member roles (owner, admin, member), and configurable settings. Users can belong to multiple workspaces. All endpoints require JWT authentication and are rate-limited to 100 requests per minute.

Health Check

Service health endpoint. Placed before /:id routes to avoid parameter capture.

GET/api/v2/workspaces/healthAuthenticated

Returns service health status.

Request

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

Response 200

{
  400">class="text-emerald-400">"status": 400">class="text-emerald-400">"healthy",
  400">class="text-emerald-400">"service": 400">class="text-emerald-400">"workspaces-api-v2"
}

Workspace CRUD

Create, retrieve, update, and delete workspaces. List returns only workspaces where the user is a member (via JOIN on workspace_members). The creator is automatically added as owner.

GET/api/v2/workspacesAuthenticated

List all workspaces the authenticated user belongs to. Returns workspaces joined via workspace_members table, including the user's role and ownership status.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces \
  -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">"workspaces": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
      400">class="text-emerald-400">"name": 400">class="text-emerald-400">"LVNG Engineering",
      400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"lvng-engineering",
      400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Engineering team workspace for product development",
      400">class="text-emerald-400">"owner_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-01-10T08:00:00.000Z",
      400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T10:00:00.000Z",
      400">class="text-emerald-400">"settings": {},
      400">class="text-emerald-400">"my_role": 400">class="text-emerald-400">"owner",
      400">class="text-emerald-400">"is_owner": true
    },
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"c3d4e5f6-a7b8-9012-cdef-345678901234",
      400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Sales Operations",
      400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"sales-ops",
      400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Sales team workspace for CRM and reporting",
      400">class="text-emerald-400">"owner_id": 400">class="text-emerald-400">"2a3b4c5d-6e7f-8901-abcd-ef2345678901",
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-02-01T09:00:00.000Z",
      400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-18T14:00:00.000Z",
      400">class="text-emerald-400">"settings": {},
      400">class="text-emerald-400">"my_role": 400">class="text-emerald-400">"admin",
      400">class="text-emerald-400">"is_owner": false
    }
  ],
  400">class="text-emerald-400">"count": 2
}
POST/api/v2/workspacesAuthenticated

Create a new workspace. The authenticated user is automatically added as the owner. Slug must be lowercase alphanumeric with hyphens only. Returns 409 if slug already exists.

Body Parameters

namestringrequired

Display name for the workspace.

slugstringrequired

URL-safe identifier. Must be lowercase alphanumeric with hyphens (e.g., "my-workspace").

descriptionstring

A brief description of the workspace purpose.

visibilitystring
Default: private

Workspace visibility: public, private, or invite-only.

discoverableboolean
Default: false

Whether the workspace appears in search/discovery.

settingsobject

Initial workspace settings object.

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces \
  -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">"Marketing Hub",
    400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"marketing-hub",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Central workspace for marketing campaigns and analytics",
    400">class="text-emerald-400">"visibility": 400">class="text-emerald-400">"private",
    400">class="text-emerald-400">"discoverable": false
  }'

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">"d4e5f6a7-b8c9-0123-def4-567890123456",
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"Marketing Hub",
    400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"marketing-hub",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Central workspace for marketing campaigns and analytics",
    400">class="text-emerald-400">"owner_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"visibility": 400">class="text-emerald-400">"private",
    400">class="text-emerald-400">"discoverable": false,
    400">class="text-emerald-400">"settings": {},
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-03-19T18:30:00.000Z",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T18:30:00.000Z",
    400">class="text-emerald-400">"my_role": 400">class="text-emerald-400">"owner",
    400">class="text-emerald-400">"is_owner": true
  }
}
GET/api/v2/workspaces/:idAuthenticated

Get detailed workspace information. Verifies the user is a member of the workspace. Includes member count and the user's role.

Path Parameters

iduuidrequired

The workspace ID.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012 \
  -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">"workspace": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"LVNG Engineering",
    400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"lvng-engineering",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Engineering team workspace for product development",
    400">class="text-emerald-400">"owner_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-01-10T08:00:00.000Z",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T10:00:00.000Z",
    400">class="text-emerald-400">"settings": {},
    400">class="text-emerald-400">"member_count": 12,
    400">class="text-emerald-400">"my_role": 400">class="text-emerald-400">"owner",
    400">class="text-emerald-400">"is_owner": true
  }
}
PUT/api/v2/workspaces/:idAuthenticated

Update workspace properties. Requires admin or owner role. Only the owner can change visibility to 'public' or set discoverable to true.

Path Parameters

iduuidrequired

The workspace ID.

Body Parameters

namestring

Updated workspace name.

descriptionstring

Updated description.

visibilitystring

Updated visibility: public, private, or invite-only.

discoverableboolean

Updated discoverability setting.

settingsobject

Updated settings object (replaces existing).

Request

cURL
400">curl -X 400">PUT https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012 \
  -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">"LVNG Engineering & Platform",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Engineering and platform team workspace"
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"workspace": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
    400">class="text-emerald-400">"name": 400">class="text-emerald-400">"LVNG Engineering & Platform",
    400">class="text-emerald-400">"slug": 400">class="text-emerald-400">"lvng-engineering",
    400">class="text-emerald-400">"description": 400">class="text-emerald-400">"Engineering and platform team workspace",
    400">class="text-emerald-400">"owner_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"visibility": 400">class="text-emerald-400">"private",
    400">class="text-emerald-400">"discoverable": false,
    400">class="text-emerald-400">"settings": {},
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-01-10T08:00:00.000Z",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T18:40:00.000Z"
  }
}
DELETE/api/v2/workspaces/:idAuthenticated

Delete a workspace and all related data (CASCADE deletes members, channels, etc.). Only the workspace owner can delete.

Path Parameters

iduuidrequired

The workspace ID.

Request

cURL
400">curl -X 400">DELETE https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/d4e5f6a7-b8c9-0123-def4-567890123456 \
  -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">"message": 400">class="text-emerald-400">"Workspace deleted successfully"
}

Workspace Members

Manage team members within a workspace. Members have roles: owner (full control), admin (manage members and settings), or member (use resources). Profile data is fetched from the user_profiles table and presence status is enriched from the presence service when available.

GET/api/v2/workspaces/:id/membersAuthenticated

List all members of a workspace with their profile data and online status. Supports search by name/email and role filtering. Requires workspace membership.

Path Parameters

iduuidrequired

The workspace ID.

Query Parameters

searchstring

Filter members by name or email (case-insensitive).

rolestring

Filter by role: owner, admin, or member.

limitinteger
Default: 50

Maximum number of members to return.

offsetinteger
Default: 0

Pagination offset.

Request

cURL
400">curl -X 400">GET 400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/members?role=admin" \
  -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">"members": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"mem_1a2b3c4d-5e6f-7890-abcd-ef1234567890",
      400">class="text-emerald-400">"user_id": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
      400">class="text-emerald-400">"role": 400">class="text-emerald-400">"owner",
      400">class="text-emerald-400">"joined_at": 400">class="text-emerald-400">"2026-01-10T08:00:00.000Z",
      400">class="text-emerald-400">"last_seen_at": 400">class="text-emerald-400">"2026-03-19T17:30:00.000Z",
      400">class="text-emerald-400">"email": 400">class="text-emerald-400">"matty@lvng.ai",
      400">class="text-emerald-400">"display_name": 400">class="text-emerald-400">"Matty Squarzoni",
      400">class="text-emerald-400">"avatar_url": 400">class="text-emerald-400">"https:400">class="text-zinc-500">//cdn.lvng.ai/avatars/matty.jpg",
      400">class="text-emerald-400">"bio": 400">class="text-emerald-400">"Founder & CEO",
      400">class="text-emerald-400">"job_title": 400">class="text-emerald-400">"CEO",
      400">class="text-emerald-400">"online_status": 400">class="text-emerald-400">"online"
    },
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"mem_2b3c4d5e-6f78-9012-bcde-f23456789012",
      400">class="text-emerald-400">"user_id": 400">class="text-emerald-400">"2a3b4c5d-6e7f-8901-abcd-ef2345678901",
      400">class="text-emerald-400">"role": 400">class="text-emerald-400">"admin",
      400">class="text-emerald-400">"joined_at": 400">class="text-emerald-400">"2026-01-12T10:00:00.000Z",
      400">class="text-emerald-400">"last_seen_at": 400">class="text-emerald-400">"2026-03-19T16:45:00.000Z",
      400">class="text-emerald-400">"email": 400">class="text-emerald-400">"sarah@lvng.ai",
      400">class="text-emerald-400">"display_name": 400">class="text-emerald-400">"Sarah Chen",
      400">class="text-emerald-400">"avatar_url": null,
      400">class="text-emerald-400">"bio": null,
      400">class="text-emerald-400">"job_title": 400">class="text-emerald-400">"Engineering Lead",
      400">class="text-emerald-400">"online_status": 400">class="text-emerald-400">"offline"
    }
  ],
  400">class="text-emerald-400">"count": 2,
  400">class="text-emerald-400">"total": 12
}
GET/api/v2/workspaces/:id/members/:userIdAuthenticated

Get detailed member profile including shared channels, DM link, and online status. Requires workspace membership.

Path Parameters

iduuidrequired

The workspace ID.

userIduuidrequired

The user ID of the member.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/members/2a3b4c5d-6e7f-8901-abcd-ef2345678901 \
  -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">"member": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"mem_2b3c4d5e-6f78-9012-bcde-f23456789012",
    400">class="text-emerald-400">"user_id": 400">class="text-emerald-400">"2a3b4c5d-6e7f-8901-abcd-ef2345678901",
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"admin",
    400">class="text-emerald-400">"joined_at": 400">class="text-emerald-400">"2026-01-12T10:00:00.000Z",
    400">class="text-emerald-400">"last_seen_at": 400">class="text-emerald-400">"2026-03-19T16:45:00.000Z",
    400">class="text-emerald-400">"email": 400">class="text-emerald-400">"sarah@lvng.ai",
    400">class="text-emerald-400">"display_name": 400">class="text-emerald-400">"Sarah Chen",
    400">class="text-emerald-400">"avatar_url": null,
    400">class="text-emerald-400">"bio": null,
    400">class="text-emerald-400">"job_title": 400">class="text-emerald-400">"Engineering Lead",
    400">class="text-emerald-400">"online_status": 400">class="text-emerald-400">"offline",
    400">class="text-emerald-400">"shared_channels": [
      { 400">class="text-emerald-400">"id": 400">class="text-emerald-400">"ch_1a2b3c4d", 400">class="text-emerald-400">"name": 400">class="text-emerald-400">"general", 400">class="text-emerald-400">"is_private": false },
      { 400">class="text-emerald-400">"id": 400">class="text-emerald-400">"ch_2b3c4d5e", 400">class="text-emerald-400">"name": 400">class="text-emerald-400">"engineering", 400">class="text-emerald-400">"is_private": true }
    ],
    400">class="text-emerald-400">"dm_id": 400">class="text-emerald-400">"dm_3c4d5e6f-7890-1234-abcd-ef5678901234",
    400">class="text-emerald-400">"is_self": false
  }
}
POST/api/v2/workspaces/:id/membersAuthenticated

Add a user to the workspace. Admins and owners can add others directly. If require_admin_approval is enabled in workspace settings, non-admin self-joins create a pending request instead (returns 202). Returns 409 if user is already a member.

Path Parameters

iduuidrequired

The workspace ID.

Body Parameters

user_iduuidrequired

The user ID to add.

rolestring
Default: member

Role to assign: owner, admin, or member.

messagestring

Message to include with join request (used when admin approval is required).

Request

cURL
400">curl -X 400">POST https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/members \
  -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">"user_id": 400">class="text-emerald-400">"4c5d6e7f-8091-0234-cdef-456789012345",
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"member"
  }'

Response 201

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"member": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"mem_4c5d6e7f-8091-0234-cdef-456789012345",
    400">class="text-emerald-400">"workspace_id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
    400">class="text-emerald-400">"user_id": 400">class="text-emerald-400">"4c5d6e7f-8091-0234-cdef-456789012345",
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"member",
    400">class="text-emerald-400">"invited_by": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"joined_at": 400">class="text-emerald-400">"2026-03-19T18:50:00.000Z"
  }
}
DELETE/api/v2/workspaces/:id/members/:userIdAuthenticated

Remove a member from the workspace. Admins and owners can remove others; users can remove themselves. The workspace owner cannot be removed. Returns 400 if attempting to remove the owner.

Path Parameters

iduuidrequired

The workspace ID.

userIduuidrequired

The user ID to remove.

Request

cURL
400">curl -X 400">DELETE https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/members/4c5d6e7f-8091-0234-cdef-456789012345 \
  -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">"message": 400">class="text-emerald-400">"Member removed successfully"
}
PATCH/api/v2/workspaces/:id/members/:userIdAuthenticated

Update a member's role. Requires admin or owner role. Only the owner can assign the 'owner' role (which also transfers workspace ownership). Cannot change the current owner's role.

Path Parameters

iduuidrequired

The workspace ID.

userIduuidrequired

The user ID to update.

Body Parameters

rolestringrequired

New role: owner, admin, or member.

Request

cURL
400">curl -X 400">PATCH https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/members/3b4c5d6e-7f80-9012-bcde-f34567890123 \
  -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">"role": 400">class="text-emerald-400">"admin"
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"member": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"mem_3b4c5d6e-7f80-9012-bcde-f34567890123",
    400">class="text-emerald-400">"workspace_id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
    400">class="text-emerald-400">"user_id": 400">class="text-emerald-400">"3b4c5d6e-7f80-9012-bcde-f34567890123",
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"admin",
    400">class="text-emerald-400">"joined_at": 400">class="text-emerald-400">"2026-01-15T14:00:00.000Z"
  }
}

Settings & Permissions

Configure workspace-level settings and view effective permissions. Settings are stored in the workspace_settings table. If no settings exist on first access, defaults are auto-created. Organization admins can also manage workspace settings.

GET/api/v2/workspaces/:id/settingsAuthenticated

Get workspace settings. Creates default settings if none exist. Requires workspace membership or org admin role.

Path Parameters

iduuidrequired

The workspace ID.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/settings \
  -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">"settings": {
    400">class="text-emerald-400">"workspace_id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
    400">class="text-emerald-400">"allow_member_invite": true,
    400">class="text-emerald-400">"allow_conversation_creation": true,
    400">class="text-emerald-400">"allow_result_sharing": true,
    400">class="text-emerald-400">"require_admin_approval": false,
    400">class="text-emerald-400">"default_twin_mode": 400">class="text-emerald-400">"active",
    400">class="text-emerald-400">"join_mode": null,
    400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-01-10T08:00:00.000Z",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-15T10:00:00.000Z"
  }
}
PATCH/api/v2/workspaces/:id/settingsAuthenticated

Update workspace settings. Requires workspace admin/owner role or organization admin. Returns 400 if no valid settings fields are provided.

Path Parameters

iduuidrequired

The workspace ID.

Body Parameters

allow_member_inviteboolean

Whether members can invite others.

allow_conversation_creationboolean

Whether members can create conversations.

allow_result_sharingboolean

Whether members can share results externally.

require_admin_approvalboolean

Whether new member additions require admin approval.

default_twin_modestring

Default twin mode: active, observer, or on-demand.

join_modestring

How users can join: open, request, or invite-only.

Request

cURL
400">curl -X 400">PATCH https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/settings \
  -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">"require_admin_approval": true,
    400">class="text-emerald-400">"default_twin_mode": 400">class="text-emerald-400">"observer",
    400">class="text-emerald-400">"join_mode": 400">class="text-emerald-400">"request"
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"settings": {
    400">class="text-emerald-400">"workspace_id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
    400">class="text-emerald-400">"allow_member_invite": true,
    400">class="text-emerald-400">"allow_conversation_creation": true,
    400">class="text-emerald-400">"allow_result_sharing": true,
    400">class="text-emerald-400">"require_admin_approval": true,
    400">class="text-emerald-400">"default_twin_mode": 400">class="text-emerald-400">"observer",
    400">class="text-emerald-400">"join_mode": 400">class="text-emerald-400">"request",
    400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T19:10:00.000Z"
  }
}
GET/api/v2/workspaces/:id/permissionsAuthenticated

Get the effective permissions for the authenticated user. Calculated from workspace member role and organization membership. Org admins receive elevated permissions even without workspace membership.

Path Parameters

iduuidrequired

The workspace ID.

Request

cURL
400">curl -X 400">GET https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/permissions \
  -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">"permissions": {
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"owner",
    400">class="text-emerald-400">"canViewSettings": true,
    400">class="text-emerald-400">"canEditSettings": true,
    400">class="text-emerald-400">"canManageMembers": true,
    400">class="text-emerald-400">"canInviteMembers": true,
    400">class="text-emerald-400">"canCreateConversations": true,
    400">class="text-emerald-400">"canDeleteWorkspace": true,
    400">class="text-emerald-400">"isOwner": true,
    400">class="text-emerald-400">"isOrgAdmin": false
  }
}

Join Requests

Manage pending join requests for workspaces with admin approval enabled. When a non-admin user requests to join, a pending request is created. Admins and owners can approve or reject requests. Approved users are added with the member role. Rejected requests can be resubmitted.

GET/api/v2/workspaces/:id/requestsAuthenticated

List join requests for the workspace. Enriched with user profile data. Requires admin or owner role.

Path Parameters

iduuidrequired

The workspace ID.

Query Parameters

statusstring
Default: pending

Filter by status: pending, approved, or rejected.

Request

cURL
400">curl -X 400">GET 400">class="text-emerald-400">"https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/requests?status=pending" \
  -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">"requests": [
    {
      400">class="text-emerald-400">"id": 400">class="text-emerald-400">"a7b8c9d0-e1f2-3456-7890-abcdef123456",
      400">class="text-emerald-400">"user_id": 400">class="text-emerald-400">"5d6e7f80-9102-3456-def0-567890123456",
      400">class="text-emerald-400">"status": 400">class="text-emerald-400">"pending",
      400">class="text-emerald-400">"message": 400">class="text-emerald-400">"I'd like to join the engineering workspace to collaborate on the API project.",
      400">class="text-emerald-400">"rejection_reason": null,
      400">class="text-emerald-400">"reviewed_by": null,
      400">class="text-emerald-400">"reviewed_at": null,
      400">class="text-emerald-400">"created_at": 400">class="text-emerald-400">"2026-03-19T15:00:00.000Z",
      400">class="text-emerald-400">"updated_at": 400">class="text-emerald-400">"2026-03-19T15:00:00.000Z",
      400">class="text-emerald-400">"user": {
        400">class="text-emerald-400">"id": 400">class="text-emerald-400">"5d6e7f80-9102-3456-def0-567890123456",
        400">class="text-emerald-400">"email": 400">class="text-emerald-400">"jordan@example.com",
        400">class="text-emerald-400">"full_name": 400">class="text-emerald-400">"Jordan Taylor",
        400">class="text-emerald-400">"avatar_url": null
      }
    }
  ],
  400">class="text-emerald-400">"count": 1
}
PATCH/api/v2/workspaces/:id/requests/:requestIdAuthenticated

Approve or reject a pending join request. Approved users are added as members. Returns 400 if the request has already been handled. Requires admin or owner role.

Path Parameters

iduuidrequired

The workspace ID.

requestIduuidrequired

The join request ID.

Body Parameters

actionstringrequired

Action to take: approve or reject.

rejection_reasonstring

Reason for rejection (optional, used when action is reject).

Request

cURL
400">curl -X 400">PATCH https:400">class="text-zinc-500">//api.lvng.ai/api/v2/workspaces/b2c3d4e5-f6a7-8901-bcde-f23456789012/requests/a7b8c9d0-e1f2-3456-7890-abcdef123456 \
  -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">"action": 400">class="text-emerald-400">"approve"
  }'

Response 200

{
  400">class="text-emerald-400">"success": true,
  400">class="text-emerald-400">"action": 400">class="text-emerald-400">"approved",
  400">class="text-emerald-400">"request": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"a7b8c9d0-e1f2-3456-7890-abcdef123456",
    400">class="text-emerald-400">"user_id": 400">class="text-emerald-400">"5d6e7f80-9102-3456-def0-567890123456",
    400">class="text-emerald-400">"workspace_id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
    400">class="text-emerald-400">"status": 400">class="text-emerald-400">"approved",
    400">class="text-emerald-400">"reviewed_by": 400">class="text-emerald-400">"8f3a2b1c-4d5e-6f7a-8b9c-0d1e2f3a4b5c",
    400">class="text-emerald-400">"reviewed_at": 400">class="text-emerald-400">"2026-03-19T19:20:00.000Z"
  },
  400">class="text-emerald-400">"member": {
    400">class="text-emerald-400">"id": 400">class="text-emerald-400">"mem_5d6e7f80-9102-3456-def0-567890123456",
    400">class="text-emerald-400">"workspace_id": 400">class="text-emerald-400">"b2c3d4e5-f6a7-8901-bcde-f23456789012",
    400">class="text-emerald-400">"user_id": 400">class="text-emerald-400">"5d6e7f80-9102-3456-def0-567890123456",
    400">class="text-emerald-400">"role": 400">class="text-emerald-400">"member",
    400">class="text-emerald-400">"joined_at": 400">class="text-emerald-400">"2026-03-19T19:20:00.000Z"
  }
}