Minimap

API Docs

Co-Pilot API v1 — let AI assistants build designs in CollabDraw

Your API Keys

Sign in to create and manage API keys. Keys let external AI assistants (Claude, DeepSeek, custom agents) drive CollabDraw on your behalf.

API Usage

Sign in to see your API and MCP usage — request counts filterable by key and channel, plus monthly quotas for AI chats, images, code exports and QR codes.

Prefer not to write API calls?

The CollabDraw MCP server exposes these same actions to Claude, Cursor and any MCP-compatible assistant. Connect it with one URL and your existing API key — no code, no proxy.

https://collabdraw.com/api/mcp

Quick Start

  1. Create an API key under Your API Keys above (shown once — copy it immediately).
  2. Send your key as a Bearer token on every request.
  3. Call POST /chat with a prompt — the AI Agent may ask clarifying questions before building.
curl -X POST \
  https://collabdraw.com/api/v1/chat \
  -H "Authorization: Bearer cd_live_YOUR_KEY" \
  -H "Content-Type: application/json" \
  -d '{"prompt": "Create a landing page for a coffee shop"}'

Base URL

https://collabdraw.com/api/v1

Authentication

Bearer token: Authorization: Bearer cd_live_… — 32 hex characters. Missing or invalid keys return 401 with a signup URL.

OpenAPI Spec

collabdraw.com/openapi.json

Import into Claude, ChatGPT actions, or any OpenAPI-aware client.

Open in Swagger Editor

Endpoints

GET/projects

List projects

Returns your cloud projects, newest first, with share links and thumbnails.

Query parameters

limitintegerdefault 20— Number of projects to return (max 100).
offsetintegerdefault 0— Pagination offset.
200 OK
{
  "projects": [
    {
      "id": "a1b2c3d4-...",
      "title": "Landing Page Concept",
      "page_count": 2,
      "updated_at": "2026-11-24T09:12:00Z",
      "project_url": "https://collabdraw.com/p/xK29fmQaP1",
      "thumbnail_url": "https://...signed...",
      "thumbnail_expires_at": "2026-11-24T09:13:00Z"
    }
  ]
}
POST/projects

Create a project

Creates a new project owned by the key owner. Free plans are limited to 10 projects.

Request body (JSON)

titlestring— Project title. Defaults to "Untitled Project".
template_idstring— Optional template to start from. Some templates are Pro-only.
201 Created
{
  "project": {
    "id": "a1b2c3d4-...",
    "title": "Untitled Project",
    "project_url": "https://collabdraw.com/p/xK29fmQaP1",
    "canvas": { "width": 1200, "height": 800 }
  },
  "chat_next_steps": "Send POST /api/v1/chat with project_id ..."
}
402 Limit reached
{
  "error": "Free plan limit of 10 projects reached. Upgrade to Pro for unlimited projects.",
  "upgrade_url": "https://www.collabdraw.com/pricing"
}
POST/chat

AI Co-Pilot build (core endpoint)

Sends a prompt to the CollabDraw AI Agent to create or update a layered design. The Agent either asks clarifying questions or builds the design and returns the project link.

Request body (JSON)

promptstringrequired— What to create or change (max 8000 chars).
session_iduuid— From a previous response, to continue the conversation.
project_iduuid— Existing project to edit. Omit to let the Agent create one.
image_urlurl— Optional image for the Agent to look at before building (Computer Vision).
200 needs_clarification
{
  "status": "needs_clarification",
  "session_id": "f0e1d2c3-...",
  "project_id": null,
  "questions": [
    "Who is the target audience for this landing page?",
    "What color palette and mood should it have?"
  ],
  "usage": { "tier": "free", "ai_chats_remaining": 49 }
}
200 completed
{
  "status": "completed",
  "session_id": "f0e1d2c3-...",
  "project_id": "a1b2c3d4-...",
  "project_url": "https://collabdraw.com/p/xK29fmQaP1",
  "summary": "Built a coffee shop landing page with hero, menu grid...",
  "thumbnail_url": "https://...signed...",
  "thumbnail_expires_at": "2026-11-24T09:15:00Z",
  "objects_added": 27,
  "usage": { "tier": "free", "ai_chats_remaining": 48 }
}
GET/chat/:sessionId

Poll a chat session

Returns the status of a chat session. Poll this after POST /chat when builds take longer than your client timeout.

200 OK
{
  "status": "completed",
  "session_id": "f0e1d2c3-...",
  "project_id": "a1b2c3d4-...",
  "project_url": "https://collabdraw.com/p/xK29fmQaP1",
  "thumbnail_url": "https://...signed...",
  "thumbnail_expires_at": "2026-11-24T09:15:30Z",
  "export_url": ".../projects/a1b2c3d4-.../export?format=png",
  "latest_reply": "I built the landing page with a hero section...",
  "updated_at": "2026-11-24T09:14:30Z"
}
GET/projects/:id/export

Export a project

Downloads the project's first page rendered server-side as an image or document.

Query parameters

formatstringdefault png— png, jpeg, webp, pdf, pptx, or svg.
scalenumberdefault 2— Scale factor 1-4. Free plans cap at 2; scale 4 is Pro-only.
pageinteger— 1-based page number. Defaults to the first page.
ProSVG export and 4x scale are Pro-only (402 otherwise).
200 OK
Binary file download (Content-Disposition: attachment).
402 Pro required
{
  "error": "SVG export at scale 4 requires a Pro plan.",
  "upgrade_url": "https://www.collabdraw.com/pricing"
}
POST/projects/:id/export-code

Generate website code

Runs the Frame-to-Code pipeline on the project's first frame and returns a working website.

ProUsage limits: 3 per month on Free, 20 per month on Pro.
200 OK
{
  "status": "completed",
  "export_id": "b7c8d9e0-...",
  "frame_label": "AI Generated Coffee Shop",
  "files": {
    "index.html": "<!DOCTYPE html>...",
    "styles.css": "/* ... */",
    "script.js": "// ..."
  },
  "usage": { "tier": "free", "code_exports_used": 1, "code_exports_remaining": 2 }
}
400 No frame
{ "error": "No frame found on this project's first page. Frames wrap AI-generated and template content; add one first." }
POST/charts

Place a chart on a design

Adds a data-driven chart to an existing project's canvas and returns the project link plus the new chart element id. Supports 22 chart types; single-series and multi-series data.

Request body (JSON)

project_iduuidrequired— The design to place the chart on.
chart_typestringrequired— One of: bar, horizontal_bar, stacked_bar, grouped_bar, waterfall, lollipop, pos_neg_bar, population_pyramid, line, area, stacked_area, percent_area, scatter, bump, step_line, pie, donut, polar_area, radar, funnel, treemap, radial_bar.
dataarrayrequired— Values to plot, max 50 items. Single-series: [{"label": "Jan", "value": 10000}]. Multi-series: [{"label": "Jan", "series": [{"name": "Revenue", "value": 10000}, {"name": "Costs", "value": 4200}]}] (max 8 series). Every item must use the same shape.
titlestring— Optional heading drawn inside the chart (max 120 chars).
pageinteger— Page number in the design. Defaults to 1.
201 Created
{
  "project_id": "a1b2c3d4-...",
  "project_title": "Q3 Revenue Report",
  "element_id": "e4f5a6b7-...",
  "chart_type": "bar",
  "title": "Monthly Revenue",
  "page_number": 1,
  "page_name": "Page 1",
  "position": { "x": 320, "y": 176, "width": 560, "height": 400 },
  "project_url": "https://collabdraw.com/p/xK29fmQaP1"
}
400 Invalid chart type
{
  "error": "Invalid chart_type \"bubble\". Supported types: bar, horizontal_bar, stacked_bar, grouped_bar, waterfall, lollipop, pos_neg_bar, population_pyramid, line, area, stacked_area, percent_area, scatter, bump, step_line, pie, donut, polar_area, radar, funnel, treemap, radial_bar"
}
400 Missing data
{
  "error": "data[0] is missing \"value\" (or \"series\" for multi-series charts)"
}
404 Project not found
{
  "error": "Project not found in this account. Call list_projects to get a valid project id."
}
GET/projects/:id/elements

List elements on a design

Returns every element (text, images, shapes, charts, frames) with its element_id, type, position and content. Call this before editing — add, update and delete all need element ids.

Query parameters

pageinteger— Limit results to one page number. Omit to list every page.
200 OK
{
  "project_id": "a1b2c3d4-...",
  "project_title": "Q3 Revenue Report",
  "page_count": 1,
  "total_elements": 3,
  "pages": [
    {
      "page_number": 1,
      "page_name": "Page 1",
      "total_elements": 3,
      "elements": [
        { "element_id": "e4f5a6b7-...", "type": "text", "name": "Summer Sale", "x": 120, "y": 80, "width": 400, "height": 48, "visible": true, "text": "Summer Sale", "font_size": 24 },
        { "element_id": "b8c9d0e1-...", "type": "image", "src": "https://...", "x": 100, "y": 200, "width": 480, "height": 320 },
        { "element_id": "c9d0e1f2-...", "type": "chart", "chart_type": "bar", "chart_title": "Monthly Revenue", "frame_label": null }
      ]
    }
  ],
  "project_url": "https://collabdraw.com/p/xK29fmQaP1"
}
POST/projects/:id/elements/text

Add text to a design

Adds a text element to an existing project and returns the new element id plus the project link.

Request body (JSON)

textstringrequired— The text content (max 5000 chars).
xinteger— Left position. Defaults to centred.
yinteger— Top position. Defaults to centred.
widthinteger— Text box width.
pageinteger— Page number. Defaults to 1.
201 Created
{
  "project_id": "a1b2c3d4-...",
  "project_title": "Q3 Revenue Report",
  "element_id": "e4f5a6b7-...",
  "type": "text",
  "page_number": 1,
  "position": { "x": 320, "y": 380, "width": 560, "height": 40 },
  "project_url": "https://collabdraw.com/p/xK29fmQaP1"
}
400 Missing text
{ "error": "text is required" }
POST/projects/:id/elements/image

Add an image to a design

Adds an image from a public https URL — stock photos from /stock-photos, AI images from /images/generate, or any public image link.

Request body (JSON)

srcurlrequired— Public https URL of the image.
xinteger— Left position. Defaults to centred.
yinteger— Top position. Defaults to centred.
widthinteger— Image width in pixels.
heightinteger— Image height in pixels.
pageinteger— Page number. Defaults to 1.
201 Created
{
  "project_id": "a1b2c3d4-...",
  "element_id": "b8c9d0e1-...",
  "type": "image",
  "page_number": 1,
  "position": { "x": 360, "y": 240, "width": 480, "height": 320 },
  "project_url": "https://collabdraw.com/p/xK29fmQaP1"
}
400 Bad src
{ "error": "src must be an https URL pointing at the image" }
POST/projects/:id/elements/shape

Add a shape to a design

Adds a shape (rectangle, ellipse, star, arrow and more) for backgrounds, buttons, badges and callouts.

Request body (JSON)

shapestring— One of: rectangle (default), ellipse, triangle, diamond, star, heart, pentagon, hexagon, arrow, line, polygon, speech_balloon, thought_balloon, burst, cross, note.
fillstring— CSS colour, e.g. "#4A90D9" or "coral". Default #4A90D9.
xinteger— Left position. Defaults to centred.
yinteger— Top position. Defaults to centred.
widthinteger— Shape width.
heightinteger— Shape height.
pageinteger— Page number. Defaults to 1.
201 Created
{
  "project_id": "a1b2c3d4-...",
  "element_id": "d0e1f2a3-...",
  "type": "shape",
  "page_number": 1,
  "position": { "x": 480, "y": 310, "width": 240, "height": 180 },
  "project_url": "https://collabdraw.com/p/xK29fmQaP1"
}
400 Unknown shape
{ "error": "Invalid shape \"cloud\". Supported shapes: rectangle, ellipse, triangle, ..." }
DELETE/projects/:id/elements/:elementId

Delete an element (undoable)

Removes one element from the design. The deletion is pushed to the project's undo history, so the canvas user can restore it with Ctrl+Z — never a hard delete.

200 OK
{
  "project_id": "a1b2c3d4-...",
  "element_id": "e4f5a6b7-...",
  "element_type": "text",
  "page_number": 1,
  "undo": "The element was moved to the project undo history. It can be restored with Ctrl+Z in the editor.",
  "project_url": "https://collabdraw.com/p/xK29fmQaP1"
}
404 Not found
{ "error": "Element e4f5a6b7-... was not found on any page of this project. Call list_elements to see valid element ids." }
GET/templates/:id

Get one template in full detail

Fetches the complete record for one template: description, frame size, plan tier, author, fork, usage and comment counts.

200 OK
{
  "id": "pitch-deck-dark",
  "name": "Pitch Deck — Dark",
  "category": "presentations",
  "category_name": "Presentations",
  "description": "A 10-slide investor deck with bold section headers...",
  "tier": "pro",
  "available_on_plan": "pro",
  "is_pro_only": true,
  "frame": { "width": 1280, "height": 720 },
  "tags": ["pitch", "startup"],
  "thumbnail_url": "https://...",
  "source": "official",
  "fork_count": 0,
  "usage_count": 0,
  "comment_count": 0,
  "created_at": null
}
404 Not found
{ "error": "Template \"pitch-deck-dark\" was not found. Call list_templates to browse available templates." }
GET/projects/:id/export-frame

Export one frame

Downloads just one frame's region rendered server-side — perfect for slide-by-slide or card-by-card exports. Match frames by frame_label from the elements list.

Query parameters

frame_labelstring— A frame_label from GET /projects/:id/elements.
formatstringdefault png— png, jpeg, pdf, or svg.
scalenumberdefault 1— Scale factor 1-4. Free plans cap at 2; scale 4 is Pro-only.
ProSVG frame export and 4x scale are Pro-only (402 otherwise).
200 OK
Binary file download (Content-Disposition: attachment).
404 No such frame
{
  "error": "No frame labelled \"Slide 2\" exists on this page. Use list_elements to see valid frame_label values.",
  "available_frame_labels": ["Slide 1", "Slide 3"]
}
PATCH/projects/:id/elements/:elementId/chart

Update a chart on a design

Changes the type, data, title or colour scheme of an existing chart element. Only the fields you send change.

Request body (JSON)

chart_typestring— New chart type, e.g. change "bar" to "donut".
dataarray— Replacement data, same format as POST /charts.
titlestring— New heading (max 120 chars). Empty string removes the title.
color_schemestring— Palette id. Empty string resets to default.
200 OK
{
  "project_id": "a1b2c3d4-...",
  "element_id": "c9d0e1f2-...",
  "chart_type": "donut",
  "title": "Q3 Revenue",
  "color_scheme": "ocean",
  "page_number": 1,
  "project_url": "https://collabdraw.com/p/xK29fmQaP1"
}
400 Not a chart
{ "error": "Element c9d0e1f2-... is a text, not a chart. update_chart only works on chart elements." }
GET/charts/types

List chart types and colour schemes

Every supported chart type with a one-line description, every palette id, and the exact data format the chart endpoints expect.

200 OK
{
  "chart_types": [
    { "id": "bar", "name": "bar", "description": "Vertical bars, one per category" },
    { "id": "donut", "name": "donut", "description": "Pie with a hole, handy for a centre total" }
  ],
  "color_schemes": ["default", "ocean", "warm", "forest", "sunset", "slate", "vivid", "midnight", "earth", "coral", "arctic", "neon", "mono"],
  "data_format": { "limits": { "max_items": 50, "max_series": 8 } }
}
POST/images/generate

Generate an AI image (async)

Generates an image from a text prompt. Returns a job id immediately; poll until the image is ready. Finished images land in the media library (Images > Recent) and are served from collabdraw.com storage.

Request body (JSON)

promptstringrequired— What to draw (max 2000 chars).
aspect_ratiostring— 1:1 (default), 16:9, 9:16, 4:3, 3:4, 3:2, 2:3.
project_iduuid— Optional design to place the finished image on.
ProUsage limits: 3 per month on Free, 100 per month on Pro.
202 Accepted
{
  "job_id": "f1a2b3c4-...",
  "status": "generating",
  "prompt": "a watercolour fox in a misty forest",
  "aspect_ratio": "1:1",
  "poll_url": "https://collabdraw.com/api/v1/images/generate/f1a2b3c4-...",
  "usage": { "used": 1, "limit": 3, "remaining": 2 }
}
200 Poll result
{
  "job_id": "f1a2b3c4-...",
  "status": "completed",
  "prompt": "a watercolour fox in a misty forest",
  "width": 1024,
  "height": 1024,
  "image_url": "https://www.collabdraw.com/storage/v1/object/public/<user>/<id>.png",
  "completed_at": "2026-11-27T10:02:11Z"
}
402 Limit reached
{
  "error": "Free plan limit of 3 AI image generations per month reached. Upgrade to Pro for 100/month.",
  "used": 3,
  "limit": 3,
  "upgrade_url": "https://www.collabdraw.com/pricing"
}
POST/images/remove-background

Remove the background from an image

Cuts the subject out of an image — the same model as the in-app Background Remover, with the same plan limits. Returns a transparent PNG on collabdraw.com storage.

Request body (JSON)

image_urlurlrequired— Public https URL of the image to process.
project_iduuid— Optional design to place the processed image on.
ProUsage limits: 30 per month on Free, unlimited on Pro (shared with the in-app remover).
200 OK
{
  "status": "completed",
  "image_url": "https://www.collabdraw.com/storage/v1/object/public/<user>/<id>.png",
  "source_url": "https://images.pexels.com/...",
  "format": "image/png",
  "usage": { "used": 4, "limit": 30, "remaining": 26 }
}
400 Fetch failed
{ "error": "The image could not be downloaded. Check the URL is publicly reachable (https, no login wall) and points directly at an image file." }
POST/images/analyze

Analyse an image

Returns an AI description, a prompt that would recreate the image, its dominant colours, and any visible text — powered by the same vision model as the app.

Request body (JSON)

image_urlurlrequired— Public https URL of the image to analyse.
tasksarray— Which analyses to run: describe, recreate_prompt, extract_colors, extract_text. Default: describe, extract_colors, extract_text.
200 OK
{
  "status": "completed",
  "image_url": "https://...",
  "description": "A minimal poster with a large coral circle...",
  "recreate_prompt": null,
  "colors": ["#f28b6b", "#1a2b3c", "#f5efe6"],
  "text_found": "SUMMER SALE",
  "tasks": ["describe", "extract_colors", "extract_text"]
}
400 Unknown task
{ "error": "Unknown task(s): translate. Supported tasks: describe, recreate_prompt, extract_colors, extract_text" }
GET/usage

Read usage statistics

Returns request counts for your account — REST and MCP counted separately — plus a breakdown per API key and per endpoint, and how much of each monthly quota is left.

Query parameters

daysintegerdefault 30— Rolling window for the request counts, 1-365 days.
channelstringdefault all— all, rest, or mcp.
key_idstring— Optional API key id to scope the report to a single key.
200 OK
{
  "range": { "days": 30, "since": "2026-11-01T00:00:00Z" },
  "channel": "all",
  "requests": { "total": 128, "rest": 101, "mcp": 27 },
  "by_key": [
    { "key_id": "b7c8d9e0-...", "name": "Cursor", "key_prefix": "cd_live_a1b2", "is_active": true, "requests": 128, "mcp_requests": 27 }
  ],
  "by_endpoint": [
    { "endpoint": "POST /api/v1/chat", "count": 74 },
    { "endpoint": "POST /api/mcp", "count": 27 }
  ],
  "monthly": [
    { "usage_type": "ai_chat", "used": 74, "limit": 50, "remaining": 0 },
    { "usage_type": "qr_save", "used": 2, "limit": 5, "remaining": 3 }
  ],
  "limits": { "tier": "free", "rate_per_minute": 20, "max_projects": 10, "max_keys": 2 }
}
401 Unauthorized
{
  "error": "Invalid or missing API key",
  "signup_url": "https://www.collabdraw.com"
}

Rate Limits & Quotas

PlanRate limitAI chatsAI imagesCode exportsBackground removalsKeys
Free20 requests / min50 / month3 / month3 / month30 / month2 active keys
Pro120 requests / min150 / month100 / month20 / monthUnlimited10 active keys

Exceeding the rate limit returns 429. Exceeding a monthly quota returns 402 with an upgrade URL. QR codes generated through the Agent follow website rules: unlimited generation, 5 saved per month on Free. Background removals via the API share the in-app Background Remover allowance.

Errors

401

Invalid or missing API key — response includes a signup_url.

402

Plan or monthly usage limit reached — response includes an upgrade_url and remaining usage.

404

Project, page, or session not found (or not owned by this key).

429

Rate limit exceeded — retry after the window resets (60s rolling).

502

The AI model or renderer failed — safe to retry once.

Ready to connect your assistant?

Create your first API key — it takes less than a minute.