Canvas

The Canvas API provides persistence for drag-and-drop cards and folders. Cards have a type, content, x/y position, optional folder assignment, and arbitrary metadata. Folders are ordered by creation date and can hold any number of cards.

List Cards

GET/api/v2/canvas/cardsAuthenticated

Returns all canvas cards for the authenticated user, ordered by created_at descending. Optionally filter by folder.

Query Parameters

folder_idstring (UUID)

Filter cards belonging to a specific folder. Omit to return all cards.

Request

cURL
curl -X GET "https://api.lvng.ai/api/v2/canvas/cards" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "cards": [
    {
      "id": "7b8c9d0e-1f2a-3b4c-5d6e-7f8a9b0c1d2e",
      "type": "note",
      "content": "## Onboarding Flow\n1. Welcome email\n2. Profile setup",
      "position": { "x": 120, "y": 80 },
      "folder_id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
      "metadata": { "color": "#3b82f6" },
      "created_at": "2026-03-12T09:00:00.000Z",
      "updated_at": "2026-03-18T15:30:00.000Z"
    },
    {
      "id": "2c3d4e5f-6a7b-8c9d-0e1f-2a3b4c5d6e7f",
      "type": "task",
      "content": "Audit rate-limiting config",
      "position": { "x": 450, "y": 80 },
      "folder_id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
      "metadata": {},
      "created_at": "2026-03-14T11:20:00.000Z",
      "updated_at": "2026-03-14T11:20:00.000Z"
    }
  ]
}

Create Card

POST/api/v2/canvas/cardsAuthenticated

Creates a new canvas card. The type field is required. Position defaults to (0, 0) if omitted.

Body Parameters

typestringrequired

Card type identifier (e.g. "note", "task", "image", "link").

contentstring
Default: ""

Card body content. Defaults to empty string.

positionobject
Default: { x: 0, y: 0 }

Coordinates as { x: number, y: number }. Defaults to { x: 0, y: 0 }.

folder_idstring (UUID)
Default: null

Folder to place the card in. Null if not in a folder.

metadataobject
Default: {}

Arbitrary JSON metadata (color, tags, etc.).

Request

cURL
curl -X POST "https://api.lvng.ai/api/v2/canvas/cards" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 201

{
  "card": {
    "id": "9e0f1a2b-3c4d-5e6f-7a8b-9c0d1e2f3a4b",
    "type": "note",
    "content": "- Ship voice notes MVP\n- Fix calendar sync bug",
    "position": { "x": 200, "y": 300 },
    "folder_id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
    "metadata": { "color": "#10b981" },
    "created_at": "2026-03-19T10:00:00.000Z",
    "updated_at": "2026-03-19T10:00:00.000Z"
  }
}

Update Card

PUT/api/v2/canvas/cards/:idAuthenticated

Updates an existing canvas card. Only provided fields are modified; the type field cannot be changed.

Path Parameters

idstring (UUID)required

The card ID.

Body Parameters

contentstring

Updated card content.

positionobject

Updated position as { x: number, y: number }.

folder_idstring (UUID) | null

Move to a different folder, or null to unlink.

metadataobject

Replacement metadata object.

Request

cURL
curl -X PUT "https://api.lvng.ai/api/v2/canvas/cards/{id}" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 200

{
  "card": {
    "id": "9e0f1a2b-3c4d-5e6f-7a8b-9c0d1e2f3a4b",
    "type": "note",
    "content": "- Ship voice notes MVP\n- Fix calendar sync bug\n- Deploy knowledge base v2",
    "position": { "x": 200, "y": 350 },
    "folder_id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
    "metadata": { "color": "#10b981" },
    "created_at": "2026-03-19T10:00:00.000Z",
    "updated_at": "2026-03-19T10:25:00.000Z"
  }
}

Delete Card

DELETE/api/v2/canvas/cards/:idAuthenticated

Permanently deletes a canvas card. Returns 404 if the card does not exist or does not belong to the authenticated user.

Path Parameters

idstring (UUID)required

The card ID to delete.

Request

cURL
curl -X DELETE "https://api.lvng.ai/api/v2/canvas/cards/{id}" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "success": true
}

List Folders

GET/api/v2/canvas/foldersAuthenticated

Returns all canvas folders for the authenticated user, ordered by created_at ascending.

Request

cURL
curl -X GET "https://api.lvng.ai/api/v2/canvas/folders" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "folders": [
    {
      "id": "d4e5f6a7-b8c9-0d1e-2f3a-4b5c6d7e8f90",
      "customer_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "user_id": "f6a7b8c9-0d1e-2f3a-4b5c-6d7e8f901234",
      "name": "Product Roadmap",
      "color": "#6366f1",
      "created_at": "2026-02-01T08:00:00.000Z"
    },
    {
      "id": "b2c3d4e5-f6a7-8901-bcde-f12345678901",
      "customer_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
      "user_id": "f6a7b8c9-0d1e-2f3a-4b5c-6d7e8f901234",
      "name": "Design System",
      "color": null,
      "created_at": "2026-02-15T10:00:00.000Z"
    }
  ]
}

Create Folder

POST/api/v2/canvas/foldersAuthenticated

Creates a new folder to organize canvas cards. The name field is required.

Body Parameters

namestringrequired

Folder display name.

colorstring
Default: null

Hex color code for the folder accent.

Request

cURL
curl -X POST "https://api.lvng.ai/api/v2/canvas/folders" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{}'

Response 201

{
  "folder": {
    "id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
    "customer_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "user_id": "f6a7b8c9-0d1e-2f3a-4b5c-6d7e8f901234",
    "name": "Architecture Decisions",
    "color": "#f59e0b",
    "created_at": "2026-03-19T10:30:00.000Z"
  }
}

Delete Folder

DELETE/api/v2/canvas/folders/:idAuthenticated

Deletes a folder. Cards in the folder are unlinked (their folder_id is set to null) rather than deleted.

Path Parameters

idstring (UUID)required

The folder ID to delete.

Request

cURL
curl -X DELETE "https://api.lvng.ai/api/v2/canvas/folders/{id}" \
  -H "Authorization: Bearer YOUR_API_KEY"

Response 200

{
  "success": true
}