craaft-api
Use when interacting with the Craaft Kanban JSON API - creating projects (optionally from a board template such as sprint / bug-tracker / sales-pipeline), columns, cards and comments, reading or updating a single card or its full detail view, archiving and restoring cards or listing a board's archived cards, bulk-importing or batch-updating/moving cards, managing checklists and milestones, tags, board members, board access and workspace invitations, uploading card attachments or board backgrounds, following cards, reading the focus/hygiene views, searching across boards, drag-dropping cards via PATCH, configuring outbound webhooks (craaft signed JSON, Slack or Discord delivery, verifying `X-Craaft-Signature`) or email-to-card intake addresses, or running any automation that authenticates with a `cra_*` bearer token. Triggers when the user mentions "Craaft API", "Craaft personal access token", a `cra_…` token, "Craaft webhook", "Craaft email to card", the Craaft Python / JavaScript / PHP SDK, the Craaft MCP server, or a Craaft host (`craaft.io` or self-hosted). Does NOT apply to browser/SPA flows - those use cookie-based session auth and CSRF.
Skill body
Craaft API skill
When to use
This skill applies when:
- The user asks to call the Craaft API directly (curl, fetch, requests, Python SDK).
- A
cra_*bearer token appears in the conversation, env, or instructions. - The user wants to automate Craaft - cron jobs, scripts, integrations.
- The user asks “how do I create / move / list cards via the API”.
Do NOT use when:
- The user is logged into the SPA in a browser - that path uses cookies + CSRF, not bearer auth.
- The user wants to manage API keys themselves (the
/api-keysendpoint requires session auth, not key auth, to avoid recursion).
Base URL + auth
BASE = <PUBLIC_BASE_URL>/api/v1 # NEVER /api/ - unversioned routes 404 since 2026-05-06
TOKEN = cra_<24 base64url chars> # 36 chars total, 192 bits entropy
Header on every request:
Authorization: Bearer cra_xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Scheme is case-insensitive (Bearer / bearer both work). The literal cra_ prefix is required - tokens without it 401 fast (Resolver short-circuits before hitting the DB).
Tokens are minted once, never recoverable. The user creates one in Settings → API keys. Only sha256(token) is stored. Never echo a full token back to the user; never log it; never embed it in shell history (use env vars or stdin).
cro_ OAuth access tokens (issued to MCP clients like Claude) behave exactly like cra_ keys; they expire after an hour and are refreshed by the client.
Error shapes
All errors are {"error": "<human readable>"}. Status codes:
| Status | Meaning | Recovery |
|---|---|---|
| 400 | Malformed body / missing field / invalid ?type |
Fix payload, retry |
| 401 | Missing / bad / revoked token; sets WWW-Authenticate: Bearer realm="craaft API" |
Ask user for a fresh token |
| 402 | Plan limit - Free tier project cap (3), attachment uploads, member invites, or integrations (webhooks / email-to-card, limit: "integrations") on a Free workspace; body has {error, limit, currentPlan, ...} |
Surface upgrade path |
| 403 | Authenticated but not authorized - e.g. requires board admin on webhook / email-to-card routes when the caller can see the board but isn’t a board admin |
Stop, surface to user |
| 404 | Resource missing OR caller lacks board access - intentionally indistinguishable | Don’t probe; report |
| 409 | Conflict (email/username taken, column still holds live cards, email-to-card already enabled, etc.) | Adjust input |
| 413 | Upload exceeds 25 MiB attachment cap | Shrink file or split workflow |
| 429 | Rate limit; carries Retry-After: <seconds> |
Sleep, retry |
| 5xx | Server bug | Retry once with backoff; report after 2 |
Rate limits
Per-token bucket: 60 burst + 1 req/sec sustained. In-memory per Cloud Run replica - the effective ceiling scales with horizontal replicas.
When automating: don’t fan out > 30 parallel requests per token. For bulk imports, prefer the bulk endpoints (since 2026-07-18) - one request spends one rate-limit token for up to 100 cards, vs 100 tokens for 100 single creates. Honor Retry-After strictly; it’s the next-token-available delay.
Surface (versioned: /api/v1/...)
Authoritative spec is served at <HOST>/openapi.yaml (no auth required). Fetch the live URL when you need the current shape - the running binary serves it directly:
curl -s "$HOST/openapi.yaml" > /tmp/craaft-openapi.yaml
Highlights:
| Method | Path | Purpose |
|---|---|---|
| GET | /me |
Current user |
| PATCH | /me |
Partial update of name / email / username |
| GET | /me/notifications |
Inbox, newest first. Query: before (RFC3339Nano cursor), limit (default 30, max 50), unread=1, kind (mention, assigned, comment, moved, updated, due). Returns {items, nextBefore}, NOT a bare array - see pitfalls 32 and 34 |
| GET | /me/notifications/count |
Unseen count → {unseen} |
| POST | /me/notifications/seen |
Mark seen up to a point in time {upTo} → {unseen} |
| POST | /me/notifications/read |
Mark specific ids and/or a whole card’s read {ids?, cardId?} → {unseen} |
| POST | /me/notifications/read-all |
Mark everything read, no body → {unseen} |
| GET | /projects |
List your projects |
| POST | /projects |
Create (name, description?, template? - a key from /board-templates; omitted = kanban) |
| POST | /imports/preview |
Dry run of a board import. multipart/form-data: file (Trello JSON, CSV or craaft JSON export, max 5 MB), source? (trello, csv, jira, asana, craaft; detected when omitted), mapping? (CSV only, JSON of craaft field to header; replaces the suggested mapping), name?. Returns what would be created: columns with card counts, totals, assignee matches, access (matched assignees, other than you and workspace owners/admins, who become contributors on the new private board), warnings, and for CSV the headers, suggested mapping and sample rows. A CSV with no guessable title header and no mapping still gets 200 with the headers and an empty summary: map title and preview again. Writes nothing |
| POST | /imports |
Import the same file into a NEW private board (never an existing one). Same fields as the preview. 201 with the project, shaped like POST /projects. All or nothing, no notifications; adds the preview’s access people as contributors; a craaft export keeps its description. 400 CSV with no title mapping or over 200 headers, 402 board cap, 413 over 5 MB, 422 over a limit (2,000 cards, 200 columns, 500 checklist items on a card, 20,000 checklist items or comments in all; the message gives the numbers), 503 + Retry-After: 5 when 2 imports are already running |
| GET | /board-templates |
Template catalogue: [{key, name, description, columns: [{title, color, isDone}]}] |
| GET | /projects/{id} |
Single project + columns + counts + brief (the board brief, Markdown; read it before working on the board’s cards) |
| PATCH | /projects/{id} |
Partial update (incl. brief (up to 20,000 characters, board admins only), visibility, backgroundColor, showMilestones, showArchived, showFiles) |
| DELETE | /projects/{id} |
Cascading delete |
| GET | /projects/{id}/export?format=json\|csv |
Export the board (project, columns, cards, comments, attachment metadata). Defaults to JSON. JSON is version 2: columns carry isDone and cardLimit, cards carry checklist ([{text, done}]) |
| POST | /projects/{id}/share |
Enable public read-only sharing → {publicToken} |
| DELETE | /projects/{id}/share |
Revoke sharing |
| POST | /projects/{id}/columns |
Add column (title) |
| GET | /projects/{id}/cards |
All live cards in a project (omits description - use GET /cards/{id} or /detail) |
| GET | /projects/{id}/cards/archived |
Archived cards (same lean shape + archivedAt), newest first, max 200 |
| GET | /projects/{id}/files |
Files on the board’s cards (archived included), newest first. q (every word must match name / card title / card description / uploader / type), limit (default 100, max 200), before cursor → {items, total, nextBefore}; items carry card {id, title, column, archived} |
| POST | /projects/{id}/cards |
Create card (title, column, position, optional description only) |
| POST | /projects/{id}/cards/bulk |
Create up to 100 cards in one transaction - items DO take full metadata |
| POST | /projects/{id}/cards/rebalance |
Renumber a column’s cards to 1, 2, 3, … in request order (up to 10 000 ids) |
| GET | /projects/{id}/tags |
Distinct tags on the board’s cards (includes archived cards) |
| POST | /projects/{id}/background-image |
Upload a board background (multipart/form-data, field file, max 10 MiB). Board-admin only |
| GET | /projects/{id}/background-image |
Download the board background bytes |
| DELETE | /projects/{id}/background-image |
Remove the background. Board-admin only |
| GET | /projects/{id}/events |
SSE stream (realtime), NOT an activity log - see pitfall 19 |
| GET | /projects/{id}/activity |
Board activity feed, newest first: cards added / moved / archived / restored / deleted, priority, assignee, comments (excerpt), columns added / renamed / deleted. Query: before (the previous page’s nextBefore, opaque), limit (default 50, max 100), actor (user id), type (comma-separated) → {items, nextBefore}. cardId only while the card is still on this board; deleted cards keep cardTitle. Kept 12 months |
| GET | /cards/{id}/attachments |
List attachments on a card |
| POST | /cards/{id}/attachments |
Upload file (multipart/form-data, field file, max 25 MiB; Pro workspace) |
| PATCH | /columns/{id} |
Update (title/color/position/isDone/cardLimit) |
| POST | /columns/{id}/archive |
Archive every live card in a done column → {archived, ids} |
| DELETE | /columns/{id} |
409 if it holds live cards; its archived cards move to the first remaining column |
| GET | /cards/{id} |
Fetch one card (same shape PATCH returns, including following and description) |
| GET | /cards/{id}/detail |
Card (with description) + comments + events (newest 100, oldest-first) + checklist + attachments |
| GET | /cards/{id}/prompt |
{cardId, prompt}: the card as a Markdown brief for an AI tool (title, board, column, metadata, link and ID, description, checklist, 10 newest comments, attachment names, then the board brief). Same text as Copy as prompt in the web app; MCP tool get_card_prompt |
| POST | /cards/{id}/archive |
Archive one card → {archived: true, id} |
| POST | /cards/{id}/restore |
Un-archive → full card, back in its original column + position |
| PATCH | /cards/{id} |
Update card metadata + same-board drag-drop |
| PATCH | /cards/bulk |
Up to 100 partial updates in one transaction (items are {id, ...patch}) |
| DELETE | /cards/{id} |
Delete |
| POST | /cards/{id}/move |
Move card to another board (targetProjectId, column) |
| POST | /cards/bulk/move |
Sweep/move up to 100 cards (ids, column, optional targetProjectId) |
| GET | /cards/{id}/events |
Activity log, oldest-first: moved (column change), moved_board (to another board: values are <project id>:<column key>, fromName/toName are board names and fromDetail/toDetail column titles, omitted for boards you can’t see), priority, assignee. Ignore types you don’t recognise |
| GET | /cards/{id}/comments |
List, oldest-first |
| POST | /cards/{id}/comments |
Add comment (body, max 5000 chars) |
| POST | /cards/{id}/follow |
Follow a card. Idempotent, 204, no body |
| DELETE | /cards/{id}/follow |
Unfollow. Idempotent, 204, no body |
| GET | /cards/{id}/checklist |
List checklist items, ordered by position |
| POST | /cards/{id}/checklist |
Add item (text, max 1000 chars); appends to the end |
| PATCH | /checklist/{id} |
Update item (text and/or done) |
| DELETE | /checklist/{id} |
Delete item |
| GET | /projects/{id}/milestones |
List milestones (date asc) |
| POST | /projects/{id}/milestones |
Add (name, dueOn as YYYY-MM-DD); board-admin only |
| PATCH | /milestones/{id} |
Update (name, dueOn, achieved bool); board-admin only |
| DELETE | /milestones/{id} |
Delete; board-admin only |
| GET | /attachments/{id} |
Download attachment bytes |
| DELETE | /attachments/{id} |
Delete attachment |
| GET | /cards/focus |
Focus envelope: due / attention / hygiene counts |
| GET | /cards/hygiene?type=ghosts\|stuck\|mine_no_date |
Hygiene drill-down |
| PATCH | /comments/{id} |
Edit (author only) |
| DELETE | /comments/{id} |
Delete (author or workspace owner/admin) |
| GET | /search?q=…&limit=… |
Cross-project ILIKE search (description is a ≤180-char snippet; hits carry archived). limit defaults to 20, values over 50 clamp to 50 |
| GET | /members |
Workspace members (joinedAt, optional boardAccess) |
| PATCH | /members/{userId} |
Change a member’s workspace role. Owner/admin only |
| DELETE | /members/{userId} |
Remove from the workspace (also closes their SSE streams). Owner/admin only |
| GET | /invitations |
Pending invitations |
| POST | /invitations |
Invite by email + role (+ optional boardGrants on member invites) → {invitation, consumed} wrapper. Pro only |
| DELETE | /invitations/{id} |
Revoke a pending invite so its accept link stops working. Owner/admin only |
| GET | /projects/{id}/members |
Board members (explicit + implicit; each row has source) |
| POST | /projects/{id}/members |
Grant board access {userId, role} (admin | contributor). Board-admin only |
| PATCH | /projects/{id}/members/{userId} |
Change explicit grant role |
| DELETE | /projects/{id}/members/{userId} |
Remove grant (board-admin, or self-remove) |
| GET | /projects/{id}/webhooks |
{webhooks: [...], eventCatalogue: [...]}. Board admin, Pro |
| POST | /projects/{id}/webhooks |
Create {url, description?, format?, events?} → 201 subscription. Board admin, Pro |
| PATCH | /webhooks/{id} |
Partial update {url?, description?, format?, events?, active?}. {id} is the subscription id. Board admin, Pro |
| DELETE | /webhooks/{id} |
204. Board admin, not plan-gated |
| GET | /projects/{id}/inbound-email |
{enabled, address, aiAvailable, aiUsage}, plus senders and turnedAway when enabled; address is null when not set up. Board admin, Pro |
| POST | /projects/{id}/inbound-email |
Enable email-to-card {targetColumn?, aiEnrich?} → 201 address; 409 if already enabled. Board admin, Pro |
| PATCH | /projects/{id}/inbound-email |
{active?, targetColumn?, rotate?, aiEnrich?, aiAlways?, aiInstructions?} → address. Board admin, Pro |
| DELETE | /projects/{id}/inbound-email |
204. Board admin, not plan-gated |
| POST | /projects/{id}/inbound-email/senders |
Allow a sender {pattern} (a@x.com or @x.com) → 201 sender; 400 invalid / free-mail domain / 50 already; 409 already allowed. Board admin, Pro |
| DELETE | /projects/{id}/inbound-email/senders/{senderId} |
204. Board admin, not plan-gated |
| GET | /projects/{id}/github |
{enabled, canConnect, installations, binding}: whether the server has GitHub, the workspace’s installs and the board’s repository (binding null when not connected) |
| PUT | /projects/{id}/github |
Connect the board {installationId, repoId, openColumn?, mergedColumn?} (column keys; null = don’t move). Workspace owner/admin |
| DELETE | /projects/{id}/github |
Disconnect the board. Workspace owner/admin |
| GET | /projects/{id}/github/repos |
Repos the workspace’s installs can reach. Workspace owner/admin |
| GET | /projects/{id}/github/pulls |
Pull requests on the board’s live cards (each has cardId) |
| GET | /cards/{id}/github |
{repo, pullRequests, branches}; also in /cards/{id}/detail as github |
| POST | /cards/{id}/github/pulls |
Link a pull request {url} from the board’s connected repository |
| DELETE | /cards/{id}/github/pulls/{linkId} |
Unlink a pull request |
| POST | /cards/{id}/github/branch |
Create branch <short id>-<title slug> from the default branch; existed: true if it was already there |
GitHub: a pull request links to a card when its branch starts with the card’s 4-character short id (a82d-fix-search), its title or body says craaft #a82d, or it contains the card id or link. Only pull requests from a branch in the repository, or by its owner, an organisation member or a collaborator, link cards (at most 10 each). Opening it (not as a draft) moves the card to the board’s open column; merging moves it to the merged column. Installing the GitHub App happens in the web app (board settings > GitHub), not through the API.
These four need no Authorization header at all:
| Method | Path | Purpose |
|---|---|---|
| GET | /public/projects/{token} |
Read-only board snapshot for a share token |
| GET | /public/projects/{token}/background-image |
That board’s background bytes |
| GET | /users/{id}/avatar |
A user’s uploaded avatar bytes (404 when they have none) |
| GET | /version |
Build/version info, useful as a liveness probe |
GET /me returns id, email, name, username, avatarUrl, hasPassword, emailVerified plus newsletterSubscribed / newsletterAvailable.
Card responses carry id, projectId, column, title, description, position, dueDate, assignedUserId, assignedUserName, size, priority, tags, createdBy, createdByName, updatedBy, updatedByName, attachmentCount, checklistDone, checklistTotal, following, createdAt, updatedAt. checklistDone / checklistTotal are denormalized counts, so you get checklist progress without a second call; following is scoped to the authenticated caller. GET /projects/{id}/cards omits description (the board list is lean); fetch GET /cards/{id} or /detail when you need the body. Search hits return a ≤180-character description snippet.
Project responses include myRole, myBoardRole, visibility, canUploadAttachments (reflects the board’s workspace plan, not the caller’s), plus isFavorite, publicToken (non-empty only while sharing is on), backgroundImage / backgroundColor (mutually exclusive), colorScheme, textColor, showMilestones / showArchived / showFiles (whether the board’s top bar shows those buttons; board admins toggle them, the data is unaffected), totalCards, columnCounts, workspaceName, members and columns.
Endpoints intentionally not exposed via token auth (session + CSRF only): /auth/*, /api-keys, /billing/*, /admin/*, /me/avatar upload+delete, /me/newsletter, /workspace, /support.
Two-factor sign-in doesn’t affect API keys: a cra_* bearer token works as before. The /me/2fa* routes are session-only, so a token gets 403.
Archive and restore (documented 2026-09-28)
POST /cards/{id}/archivehides a card from the board without deleting it →{"archived": true, "id": "..."}.404if it is already archived.POST /cards/{id}/restoreun-archives it → the full card (same shape asGET /cards/{id}), back in the column and position it was archived from.404if the card is not archived.GET /projects/{id}/cards/archivedlists archived cards, most recently archived first, capped at 200 (older ones stay reachable via search).POST /columns/{id}/archivearchives every live card in a column markedisDoneand returns{"archived": <count>, "ids": [...]}; theidslet you undo by restoring each one.- Realtime / webhook events:
card.archived(payload{id, column}, same ascard.deleted) andcard.restored(payload = full card).
Integrations: webhooks and email-to-card (Pro, board admin)
Both are gated the same way, checked in this order: board not visible →
404; visible but caller isn’t a board admin → 403 requires board admin;
Free workspace → 402 with limit: "integrations". DELETE skips the plan
check so a downgraded workspace can still clean up.
Outbound webhooks. Subscription shape:
{id, endpointId, url, secret, description, format, events, active, createdAt, recentDeliveries: [{event, status, statusCode, attempts, error, createdAt}]}.
format:craaft(default, signed JSON envelope{event, occurredAt, projectId, data}),slackordiscord(a chat message POSTed to their incoming-webhook URL, unsigned - those services authenticate by the secret URL itself).events: filter of names fromeventCatalogue; omitted or[]= all. Unknown names, unknown formats and bad URLs are400.- Event catalogue (2026-09-28):
card.created,card.updated,card.deleted,card.archived,card.restored,card.comment.{created,updated,deleted},card.checklist.item.{created,updated,deleted},column.{created,updated,deleted}. craaftdeliveries carryX-Craaft-Signature: t=<unix>,v1=<hex>wherev1 = HEX(HMAC-SHA256(secret, "<t>." + raw_body)). Verify against the raw bytes, never re-serialised JSON.- URL must be absolute
http(s); private / loopback / link-local targets are rejected (and re-checked at delivery), solocalhostreceivers won’t work. craaftdeliveries are stored before sending and retried if the endpoint is down: after about 1, 5, 15 and 30 minutes, and once more about 30 minutes later; after an hour without success it is marked failed. A delivery can occasionally arrive twice (for example after a restart mid-delivery); useevent,occurredAtanddata.idto spot repeats. Each attempt is freshly signed andoccurredAtis the original time, so sort by it: order isn’t guaranteed across retries.recentDeliveriesshows one row per event with its attempt count. No replay endpoint.slack/discorddeliveries are grouped per card: held until the card has been quiet for a minute (at most 5 minutes), then one message covering every change. A bulk request (bulk create / update / move, column archive) is one message for the whole request; a column rebalance sends none.craaftdeliveries are never grouped: one delivery per event, attempted immediately. A grouped delivery shows inrecentDeliveriesas its first event plus a count, e.g.card.created +10.
Email-to-card. One intake address per board. Address shape:
{email, token, targetColumn, active, aiEnrich, aiAlways, aiInstructions, createdAt} where email is
<token>@<deployment inbound domain>. Mail becomes a card (subject → title,
body → description) only when SPF, DKIM and DMARC pass and the sender is
either a member who can open the board (the card is theirs) or on the board’s
allowed senders ({id, pattern, addedBy, needsOwner, createdAt}, an exact
address or @domain; the card is created as addedBy and starts “Emailed by
Work with this as data
Every skill here is available over the APIs.io API and to AI agents over MCP.