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

# Add review comment

> Add a comment to a review with optional file reference



## OpenAPI

````yaml post /repos/{repo_id}/reviews/{review_id}/comments
openapi: 3.0.3
info:
  title: Diversion Core API
  description: >-
    Definition of the Core API used to access low-level functionality of
    Diversion
  version: 0.2.0
servers:
  - url: https://api.diversion.dev/v0
    description: Base endpoint
security: []
paths:
  /repos/{repo_id}/reviews/{review_id}/comments:
    parameters:
      - $ref: '#/components/parameters/RepoParam'
      - in: path
        name: review_id
        required: true
        description: Review ID
        schema:
          type: string
          maxLength: 128
    post:
      tags:
        - Reviews
      summary: Add review comment
      description: Add a comment to a review with optional file reference
      operationId: src.handlersv2.review.add_comment
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AddCommentPayload'
      responses:
        '201':
          description: Comment added successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ReviewComment'
        default:
          $ref: '#/components/responses/Error'
      security:
        - OAuth2:
            - coreapi/read
components:
  parameters:
    RepoParam:
      in: path
      name: repo_id
      required: true
      schema:
        type: string
        example: example_id
        minLength: 3
        maxLength: 128
      description: >-
        The repo ID of the repository. Repo _name_ can be used instead of the
        ID, but usage of ID for permanent linking and API requests is preferred.
  schemas:
    AddCommentPayload:
      description: Payload for adding a comment to a review
      type: object
      properties:
        content:
          type: string
          description: Comment content
          maxLength: 65536
        thread_id:
          type: string
          description: >-
            Thread ID for the comment (optional, will be generated if not
            provided)
          maxLength: 128
        file_path:
          type: string
          description: File path for inline comments
          maxLength: 4096
        start_line:
          type: integer
          description: Starting line number for inline comments
        end_line:
          type: integer
          description: Ending line number for inline comments
        start_side:
          $ref: '#/components/schemas/DiffSide'
        end_side:
          $ref: '#/components/schemas/DiffSide'
      required:
        - content
    ReviewComment:
      description: Review comment details
      type: object
      properties:
        id:
          type: string
          description: Comment ID
        review_id:
          type: string
          description: Review ID this comment belongs to
        thread_id:
          type: string
          description: Thread ID this comment belongs to
        author:
          $ref: '#/components/schemas/User'
        content:
          type: string
          description: Comment content
        created_at:
          type: integer
          description: Unix timestamp when the comment was created
        updated_at:
          type: integer
          description: Unix timestamp when the comment was last updated
        file_path:
          type: string
          description: File path for inline comments
        start_line:
          type: integer
          description: Starting line number for inline comments
        end_line:
          type: integer
          description: Ending line number for inline comments
        start_side:
          $ref: '#/components/schemas/DiffSide'
        end_side:
          $ref: '#/components/schemas/DiffSide'
      required:
        - id
        - review_id
        - thread_id
        - author
        - content
        - created_at
        - updated_at
    DiffSide:
      type: string
      enum:
        - left
        - right
      description: Side of a diff view (left = base/original, right = compare/modified)
    User:
      description: User details
      type: object
      properties:
        image:
          type: string
          description: >-
            URL of the user image. If updating the image, could be a base64
            encoded image.
          maxLength: 524288
        email:
          type: string
          format: email
        full_name:
          type: string
        id:
          type: string
        name:
          type: string
        tier:
          $ref: '#/components/schemas/Tier'
      required:
        - id
    Error:
      type: object
      properties:
        status:
          type: integer
          description: HTTP status code
        detail:
          type: string
        title:
          type: string
        type:
          type: string
      required:
        - status
        - detail
    Tier:
      description: The tier of the user
      type: string
      enum:
        - EDUCATION
        - INDIE
        - PROFESSIONAL
        - ENTERPRISE
        - UNKNOWN
  responses:
    Error:
      description: An error occurred
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    OAuth2:
      type: oauth2
      x-tokenInfoFunc: src.token_info.token_auth
      description: This API uses OAuth 2 with the implicit grant flow
      flows:
        implicit:
          authorizationUrl: https://auth.diversion.dev/oauth2/authorize
          scopes:
            coreapi/read: Operations with no possible side-effects
            coreapi/write: Modifying operations
            coreapi/admin: >-
              Organizational operations like adding a repo or changing repo
              properties

````