Create a comment on a task.
Authorship is taken from the authenticated user — agent comments are written by the agent runtime through a separate code path and are not creatable via this endpoint.
Returns: Persisted comment with the server-populated id.
Raises: NotFoundError: If task not found or belongs to another organization.
Request body for creating a task comment.
Authorship is set by the service from the request context — callers only need to provide the body.
Attributes: body: Markdown body of the comment.
Successful Response
A markdown comment on a task.
Comments are first-class graph nodes connected to tasks via
has_comment edges. Authorship is recorded as graph edges as well:
user comments use authored_by_user and agent comments persist a
dual authored_by_instance plus authored_by_type pair so that
type-level attribution survives instance garbage collection.
Attributes:
id: SurrealDB record ID (populated by database).
organization_id: Owning organization (mirrored from the task).
task_id: Task this comment belongs to.
body: Markdown body of the comment.
author_type: Whether the author is a user or an agent.
author_user_id: User ID when author_type is user.
author_instance_id: Agent instance ID when author_type is agent.
author_agent_type_id: Agent type ID when author_type is agent.
edited: True after at least one update.
Source of a task comment.
user, agent