Create a canvas comment thread
import { FloraClient } from '@flora-ai/flora';
const client = new FloraClient({ apiKey: process.env['FLORA_API_KEY'] });
const comment = await client.projects.comments.create({ projectId: '<projectId>', body: '<body>', x: 1, y: 1,});console.log(comment);curl -X POST 'https://app.flora.ai/api/v1/projects/<projectId>/comment-threads' \ -H 'Authorization: Bearer $FLORA_API_KEY' \ -H 'Content-Type: application/json' \ -d '{ "body": "<body>", "x": 1, "y": 1}'Pins a new comment thread on the project canvas at x/y and posts the first message. Optionally attach the pin to a canvas node with node_id (UUID or short id such as n7; unknown short ids are rejected) and offset_x/offset_y. author chooses whether the comment is attributed to the credential’s user (user, the default) or to FLORA (flora). author=flora is reserved for Flora’s own FAUNA, Chat, and Create agents; customer API keys and MCP credentials receive forbidden. Generation review threads cannot be created here. Guests who can comment on the project can create threads; they do not need edit or generate permission. Mutating public API requests support an optional Idempotency-Key header for client retries; duplicate keys within two hours return idempotency_duplicate.
Error responses use the standard error body.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”Project identifier
Project identifier
Request Body required
Section titled “ Request Body required ”object
Plain-text comment body
Canvas X coordinate of the pin
Canvas Y coordinate of the pin
Attach the pin to this canvas node
Horizontal offset from the node’s origin when node_id is set. Defaults to 0.
Vertical offset from the node’s origin when node_id is set. Defaults to 0.
Who the comment is attributed to. user posts as the credential’s user. flora posts as FLORA, the product voice, and is accepted only from Flora’s own FAUNA, Chat, and Create credentials. Customer API keys and MCP credentials cannot use flora. Defaults to user.
Responses
Section titled “ Responses ”Comment thread created.
object
Comment thread identifier
Project identifier
Workspace identifier
Whether the thread is still open
When the thread was created, as a Unix timestamp in milliseconds
Number of live comments in the thread
Where the thread is pinned. canvas is a pin on the project canvas. generation is a review thread on a generation.
Public run id of the generation this review thread is pinned to. Absent on canvas threads.
object
Canvas X coordinate of the pin
Canvas Y coordinate of the pin
Canvas node the pin is attached to, when pinned to a node
object
Comment identifier
Plain-text comment body
object
Author kind
Display name
Author profile image URL
When the comment was created, as a Unix timestamp in milliseconds
Live comments in the thread, oldest first
object
Comment identifier
Plain-text comment body
object
Author kind
Display name
Author profile image URL
When the comment was created, as a Unix timestamp in milliseconds
Example
{ "comment_thread_id": "cth_abc123", "project_id": "prj_abc123", "workspace_id": "ws_abc123", "status": "open", "anchor": "canvas", "generation_id": "run_abc123", "preview": { "comment_id": "cmt_abc123", "body": "Looks good — ship it.", "author": { "type": "user", "name": "Ada Lovelace" } }, "messages": [ { "comment_id": "cmt_abc123", "body": "Looks good — ship it.", "author": { "type": "user", "name": "Ada Lovelace" } } ]}