Skip to main content
The Comment interface represents a comment made on a goal. Comments can be made by authenticated users or by guests accessing via share links.

Properties

id
string
required
Unique identifier for the comment
goal_id
string
required
ID of the goal this comment belongs to
user_id
string | null
required
ID of the user who created the comment, or null if created by a guest
guest_label
string | null
required
Display name for guest commenters (when user_id is null), or null for authenticated users
body
string
required
The content of the comment
created_at
string
required
ISO 8601 timestamp when the comment was created
user
object
User details for authenticated commenters (computed/joined field)

Example

Authenticated user comment

{
  "id": "comment_123",
  "goal_id": "goal_456",
  "user_id": "user_789",
  "guest_label": null,
  "body": "Great progress on this milestone!",
  "created_at": "2026-03-03T14:22:00Z",
  "user": {
    "id": "user_789",
    "email": "[email protected]"
  }
}

Guest comment

{
  "id": "comment_124",
  "goal_id": "goal_456",
  "user_id": null,
  "guest_label": "Anonymous Reviewer",
  "body": "This looks promising!",
  "created_at": "2026-03-03T15:10:00Z",
  "user": null
}

Type definitions

export interface Comment {
  id: string
  goal_id: string
  user_id: string | null
  guest_label: string | null
  body: string
  created_at: string
  user?: {
    id: string
    email: string
  }
}

Build docs developers (and LLMs) love