Spunto CMS
The API

Comments

The conversation about a card — discussions and replies, comments on a passage, resolving, reactions, images, who may do what, and the events it emits.

A card's body is what the card says. Comments are what people say about it: a question to the author, a review note, a trace left by an integration. They live next to the card, not inside it — they are not part of the body, never enter the published version, and do not make a card "changed since publishing".

In the app, discussions sit below the body and the subtasks. ⌘ Enter sends. Select text in the body and choose Comment to start a discussion on that passage.

Discussions

A discussion is a root comment and its replies — one level, as in Notion. Replying to a reply attaches the new comment to the root, so there is never a tree to walk.

  • A root may be anchored on a passage of the body: a block and the quoted text.
  • A root may be resolved, and reopened.
  • Any comment — root or reply — carries emoji reactions.

Reading

GET /workspaces/{workspaceId}/items/{itemId}/comments?threads=true&resolved=false&order=desc&limit=30

Returns a CommentPage: rows and a nextCursor, keyset-paginated like everything else — pass nextCursor back as cursor to continue in the same direction.

  • threads=true pages discussions: rows are root comments, each with all its replies (oldest first), and the page carries discussions — { open, resolved } counts for the card, whatever the filter. A page never cuts a discussion in two. Without it, the thread is read flat, replies included, each comment with its parentId — the shape it had before discussions existed.
  • resolved=true|false (with threads=true) keeps only resolved or open discussions. The app reads open ones first and loads resolved ones on demand.
  • order=asc (the default) reads from the start; order=desc starts with the latest.

Each comment carries its author (kind: user, api_key, app or system, an id and a frozen label), createdAt, editedAt (null until the first edit), parentId, anchor, resolvedAt and resolvedBy (roots only), reactions, and three booleans computed for the caller: viewerCanEdit, viewerCanDelete and viewerCanResolve. Use them rather than re-implementing the rules below — they live in one place.

Writing

POST   /workspaces/{workspaceId}/items/{itemId}/comments            { "body": "…", "parentId"?: "…", "anchor"?: { "blockId": "…", "quote": "…" } }
PATCH  /workspaces/{workspaceId}/items/{itemId}/comments/{commentId} { "body": "…" }
DELETE /workspaces/{workspaceId}/items/{itemId}/comments/{commentId}
  • The body is Markdown, up to 10,000 characters, trimmed, and the API returns it exactly as written. The app renders it formatted: headings, lists, checkboxes (not tickable), quotes, code fences, bold, italic, links, clickable bare URLs, and images on a line of their own. Raw HTML is never interpreted.
  • An image is an attachment or an address. Upload it with POST /workspaces/{id}/files, then cite it by id on its own line: ![screenshot](file:<fileId>). The API checks that the id is an image of this workspace (400 otherwise), and the app serves it through the same scoped route as a body image — it has no public URL. ![text](https://…) still works for an image hosted elsewhere. In the app, the image button and pasting a screenshot do this for you.
  • Mention someone with [@Name](user:<userId>) — a member of the workspace (400 otherwise; see GET /workspaces/{id}/members). The app renders it as @Name, and the person is notified. In the app, typing @ in a comment proposes the members.
  • parentId replies to a discussion; anchor starts one on a passage. Not both: a reply has no anchor of its own.
  • The author is the caller, never a field of the request. An API key comments as key “sync”, an app as app “GitHub” — not as the person who created or installed it.
  • Commenting takes the member role. A viewer reads discussions but cannot reply or react. For an installed app, reading is items:read and writing items:write.
  • Only the author edits. Editing someone else's words would make them say something else (403). Sending the same text again writes nothing and emits nothing.
  • The author or an admin deletes. Deleting a root deletes its discussion, replies included. Deletion is permanent.
  • Deleting a card deletes its discussions, subtasks' included.

Commenting on a passage

{ "body": "Source?", "anchor": { "blockId": "01a1…", "quote": "sales doubled" } }

blockId is the id of a block of the card's body; quote is the selected text, verbatim. Both must exist when the comment is written — an unknown block or a quote that is not in it is a 400. After that, the body may change: the anchor is not stored in the document and does not move with it. The app highlights the first occurrence of the quote in the block for as long as it is there; once it is gone, the discussion shows "passage changed" with its quote, which is what was commented on.

Resolving

PUT /workspaces/{workspaceId}/items/{itemId}/comments/{commentId}/resolution { "resolved": true }

On a root only (a reply is a 400). Its author, or any member and above, may resolve or reopen it. resolvedAt and resolvedBy are frozen like an author. Asking for the state it is already in writes nothing. In the app, resolved discussions fold under "N resolved discussions" and their passage is no longer highlighted.

Reactions

POST /workspaces/{workspaceId}/items/{itemId}/comments/{commentId}/reactions { "emoji": "👍", "active"?: true }

One reaction per comment, person and emoji. Without active the call toggles; with it, it sets the state — safe to replay. emoji is a single emoji (ZWJ sequences, skin tones and flags included); anything else is a 400. The response is the comment; reactions lists each emoji with its count, people (frozen labels, in the order they reacted) and viewerReacted.

Counts in views

Rows returned by a view query (POST …/query, POST …/grouped-query) carry commentCount: the card's open discussions. The app shows it on table rows, board cards and list rows. It is absent on published reads and on routes that return a single card — the card's discussions are there.

Events

comment.created, comment.updated, comment.deleted, comment.resolved and comment.reopened, written in the same transaction as the change. The resource is the comment; changes.itemId always names the card it belongs to — even when it did not change — so a webhook consumer can attach it without another read. changes.body carries the text before and after; comment.created also carries parentId and anchor when set; comment.resolved / comment.reopened carry resolvedAt. Deleting a discussion emits one comment.deleted per comment.

Reactions emit no event. A 👍 does not change what the discussion says, and an event would wake every comment.* webhook for it.

On this page