> ## Documentation Index
> Fetch the complete documentation index at: https://aspect.inc/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Comments

> Get all comments for a resource as a nested tree structure



## OpenAPI

````yaml /api-reference/openapi.json get /comments
openapi: 3.1.0
info:
  title: Aspect API
  description: Manage and search media in Aspect.
  version: 1.0.0
servers:
  - url: https://api.aspect.inc
security:
  - ApiKeyAuth: []
tags:
  - name: Users
  - name: API Keys
  - name: Workspaces
  - name: Projects
  - name: Directories
  - name: Assets
  - name: Attachments
  - name: Filesystem Items
  - name: Jobs
  - name: Collections
  - name: Comments
  - name: Search
  - name: Transcription
  - name: Metadata
  - name: Shares
  - name: Share Templates
  - name: Watermarks
paths:
  /comments:
    get:
      tags:
        - Comments
      summary: Get Comments
      description: Get all comments for a resource as a nested tree structure
      operationId: get_comments
      parameters:
        - name: resource_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Resource ID
            description: The ID of the resource (asset or canvas) to get comments for
          description: The ID of the resource (asset or canvas) to get comments for
        - name: asset_id
          in: query
          required: false
          schema:
            anyOf:
              - type: string
                format: uuid
              - type: 'null'
            title: Asset ID
            description: Deprecated alias for resource_id
            deprecated: true
          description: Deprecated alias for resource_id
          deprecated: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/CommentResponse'
                title: Response Get Comments Comments Get
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    CommentResponse:
      properties:
        id:
          type: string
          format: uuid
          title: Id
        resource_id:
          type: string
          format: uuid
          title: Resource Id
        asset_id:
          type: string
          format: uuid
          title: Asset Id
        node_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Node Id
        canvas_position:
          anyOf:
            - $ref: '#/components/schemas/CanvasPosition'
            - type: 'null'
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
        parent_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Parent Id
        text:
          type: string
          title: Text
        timestamp:
          anyOf:
            - type: number
            - type: 'null'
          title: Timestamp
        duration:
          anyOf:
            - type: number
            - type: 'null'
          title: Duration
        anchor_position:
          anyOf:
            - $ref: '#/components/schemas/AnchorPosition'
            - type: 'null'
        annotation:
          anyOf:
            - items:
                anyOf:
                  - $ref: '#/components/schemas/PenPath'
                  - $ref: '#/components/schemas/LinePath'
                  - $ref: '#/components/schemas/ArrowPath'
                  - $ref: '#/components/schemas/BoxPath'
              type: array
            - type: 'null'
          title: Annotation
        page:
          anyOf:
            - type: integer
            - type: 'null'
          title: Page
        text_highlight:
          anyOf:
            - $ref: '#/components/schemas/TextHighlight'
            - type: 'null'
        is_resolved:
          type: boolean
          title: Is Resolved
        private:
          type: boolean
          title: Private
        number:
          anyOf:
            - type: integer
            - type: 'null'
          title: Number
        user:
          anyOf:
            - $ref: '#/components/schemas/UserInfo'
            - type: 'null'
        replies:
          items:
            $ref: '#/components/schemas/CommentResponse'
          type: array
          title: Replies
        reactions:
          items:
            $ref: '#/components/schemas/ReactionGroup'
          type: array
          title: Reactions
        mentions:
          items:
            $ref: '#/components/schemas/MentionInfo'
          type: array
          title: Mentions
        attachments:
          items:
            $ref: '#/components/schemas/SignedAttachment'
          type: array
          title: Attachments
        created:
          type: string
          format: date-time
          title: Created
        updated:
          type: string
          format: date-time
          title: Updated
      type: object
      required:
        - id
        - resource_id
        - asset_id
        - node_id
        - canvas_position
        - user_id
        - parent_id
        - text
        - timestamp
        - duration
        - anchor_position
        - annotation
        - page
        - text_highlight
        - is_resolved
        - private
        - number
        - user
        - replies
        - reactions
        - mentions
        - attachments
        - created
        - updated
      title: CommentResponse
      description: >-
        API response schema for a single comment with nested replies, reactions,
        mentions, and attachments
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    CanvasPosition:
      properties:
        x:
          type: number
          title: X
          description: X position in canvas flow coordinates
        'y':
          type: number
          title: 'Y'
          description: Y position in canvas flow coordinates
      type: object
      required:
        - x
        - 'y'
      title: CanvasPosition
      description: >-
        Canvas pin position in flow coordinates (absolute, or relative to the
        node origin when node_id is set)
    AnchorPosition:
      properties:
        x:
          type: number
          maximum: 100
          minimum: 0
          title: X
          description: X position as percentage (0-100)
        'y':
          type: number
          maximum: 100
          minimum: 0
          title: 'Y'
          description: Y position as percentage (0-100)
      type: object
      required:
        - x
        - 'y'
      title: AnchorPosition
      description: Position for anchored comments on assets (x/y as percentages 0-100)
    PenPath:
      properties:
        tool:
          type: string
          const: pen
          title: Tool
          default: pen
        color:
          type: string
          title: Color
        stroke_width:
          type: number
          title: Stroke Width
        points:
          anyOf:
            - items:
                $ref: '#/components/schemas/AnnotationPoint'
              type: array
            - $ref: '#/components/schemas/CompactPoints'
          title: Points
      type: object
      required:
        - color
        - stroke_width
        - points
      title: PenPath
      description: Pen/freehand drawing path
    LinePath:
      properties:
        tool:
          type: string
          const: line
          title: Tool
          default: line
        color:
          type: string
          title: Color
        stroke_width:
          type: number
          title: Stroke Width
        start:
          $ref: '#/components/schemas/AnnotationPoint'
        end:
          $ref: '#/components/schemas/AnnotationPoint'
      type: object
      required:
        - color
        - stroke_width
        - start
        - end
      title: LinePath
      description: Line path
    ArrowPath:
      properties:
        tool:
          type: string
          const: arrow
          title: Tool
          default: arrow
        color:
          type: string
          title: Color
        stroke_width:
          type: number
          title: Stroke Width
        start:
          $ref: '#/components/schemas/AnnotationPoint'
        end:
          $ref: '#/components/schemas/AnnotationPoint'
      type: object
      required:
        - color
        - stroke_width
        - start
        - end
      title: ArrowPath
      description: Arrow path
    BoxPath:
      properties:
        tool:
          type: string
          const: box
          title: Tool
          default: box
        color:
          type: string
          title: Color
        stroke_width:
          type: number
          title: Stroke Width
        start:
          $ref: '#/components/schemas/AnnotationPoint'
        end:
          $ref: '#/components/schemas/AnnotationPoint'
      type: object
      required:
        - color
        - stroke_width
        - start
        - end
      title: BoxPath
      description: Box/rectangle path
    TextHighlight:
      properties:
        text:
          type: string
          title: Text
          description: The highlighted text content
        rects:
          items:
            $ref: '#/components/schemas/TextHighlightRect'
          type: array
          title: Rects
          description: >-
            Rectangles covering the highlighted text, normalized to page
            dimensions (0-1)
      type: object
      required:
        - text
        - rects
      title: TextHighlight
      description: Data for a text highlight comment
    UserInfo:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: User ID
        first_name:
          type: string
          title: First Name
          description: User's first name
        last_name:
          type: string
          title: Last Name
          description: User's last name
        email:
          type: string
          title: Email
          description: User's email address
        avatar_url:
          anyOf:
            - type: string
            - type: 'null'
          title: Avatar Url
          description: User's avatar URL
      type: object
      required:
        - id
        - first_name
        - last_name
        - email
      title: UserInfo
      description: Lightweight user information for API responses
    ReactionGroup:
      properties:
        reaction:
          type: string
          title: Reaction
          description: Reaction emoji or type
        users:
          items:
            $ref: '#/components/schemas/UserInfo'
          type: array
          title: Users
          description: Users who added this reaction
      type: object
      required:
        - reaction
        - users
      title: ReactionGroup
      description: Grouped reactions by reaction type
    MentionInfo:
      properties:
        start_index:
          type: integer
          title: Start Index
          description: Start position in comment text
        end_index:
          type: integer
          title: End Index
          description: End position in comment text (non-inclusive)
        text:
          type: string
          title: Text
          description: Mention text (e.g., '@John Doe')
        user:
          $ref: '#/components/schemas/UserInfo'
          description: User being mentioned
      type: object
      required:
        - start_index
        - end_index
        - text
        - user
      title: MentionInfo
      description: Mention information with user details
    SignedAttachment:
      properties:
        id:
          type: string
          format: uuid
          title: Id
          description: Resource identifier
        url:
          anyOf:
            - type: string
            - type: 'null'
          title: Url
          description: Temporary download URL
        url_expires_at:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Url Expires At
          description: When the URL expires
        user_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: User Id
          description: User who uploaded. None if deleted.
        filename:
          type: string
          title: Filename
          description: Original filename
        mime_type:
          type: string
          title: Mime Type
          description: MIME type of the file
        size_bytes:
          type: integer
          title: Size Bytes
          description: File size in bytes
        uploaded:
          type: boolean
          title: Uploaded
          description: Whether the file has been uploaded
        created:
          type: string
          format: date-time
          title: Created
          description: Created timestamp
        updated:
          type: string
          format: date-time
          title: Updated
          description: Updated timestamp
      type: object
      required:
        - id
        - user_id
        - filename
        - mime_type
        - size_bytes
        - uploaded
        - created
        - updated
      title: SignedAttachment
      description: >-
        An attachment with a temporary download URL; url and url_expires_at are
        null until the upload is confirmed.
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError
    AnnotationPoint:
      properties:
        x:
          type: number
          title: X
        'y':
          type: number
          title: 'Y'
      type: object
      required:
        - x
        - 'y'
      title: AnnotationPoint
      description: A point in annotation coordinates (0-1 percentage)
    CompactPoints:
      properties:
        x:
          items:
            type: number
          type: array
          title: X
        'y':
          items:
            type: number
          type: array
          title: 'Y'
      type: object
      required:
        - x
        - 'y'
      title: CompactPoints
      description: Compact representation of points for pen paths
    TextHighlightRect:
      properties:
        x:
          type: number
          maximum: 1
          minimum: 0
          title: X
        'y':
          type: number
          maximum: 1
          minimum: 0
          title: 'Y'
        width:
          type: number
          maximum: 1
          minimum: 0
          title: Width
        height:
          type: number
          maximum: 1
          minimum: 0
          title: Height
      type: object
      required:
        - x
        - 'y'
        - width
        - height
      title: TextHighlightRect
      description: >-
        A rectangle defining a highlighted text region on a page (coordinates
        normalized 0-1)
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: Aspect API key (sk_...) in Authorization header. 'Bearer ' optional.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.