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

# Get a discussion and its messages (repo_id addressing)



## OpenAPI

````yaml https://aws-us-east-2.api.entire.io/api/v1/openapi.json?section=trails get /repos/{repo_id}/trails/{number}/discussions/{discussion_id}
openapi: 3.1.0
info:
  title: Entire API
  version: 0.1.0
  description: >-
    Unified Entire API gateway. Aggregates the control plane and regional
    repository-operation services behind a single endpoint.
servers:
  - url: https://aws-us-east-2.api.entire.io/api/v1
security:
  - bearerAuth: []
tags:
  - name: search
    description: Operations under the /search surface.
  - name: semantic-search
    description: Operations under the /semantic-search surface.
  - name: brainstore
    description: Operations served by the brainstore service.
  - description: >-
      The authenticated caller's own cross-repo activity, commits, checkpoints,
      sessions, and recap.
    name: me
    x-group: Your activity
  - description: >-
      Residency-aware previews of the caller's surface, served under
      /experimental. Shapes may change without notice.
    name: experimental
  - description: >-
      Per-user settings: pinned and recent repos, diff view, and saved filter
      tabs.
    name: preferences
  - description: >-
      Repository discovery list, metadata, and headline rollups (summary,
      activity, contributors, agents).
    name: repos
  - description: >-
      Git browsing for a repo: commits, commit detail, branch compare, tree
      listings, raw file bytes, and branches.
    name: code
  - description: >-
      Checkpoint listing, resolution, LLM analysis, transcripts, and per-repo
      checkpoint status.
    name: checkpoints
    x-group: Checkpoints
  - description: >-
      Materialised sessions: listing, detail, transcripts, rename, and the
      public-share toggle.
    name: sessions
    x-group: Sessions
  - description: >-
      Repo dashboard aggregates under /overview: commit and checkpoint stats,
      contributor breakdowns, and session patterns.
    name: overview
  - description: Live ref-change stream for a repo (SSE).
    name: refs
    x-group: Ref events
  - description: >-
      Trails themselves: list, create, read, update, delete, plus per-repo
      counts, claimed branches, and the body-document ensure.
    name: trails
    x-group: Trails
  - description: >-
      What has happened on a trail: the merged timeline, the event stream, and
      who is watching (per trail, plus a repo-wide roll-up).
    name: trail-activity
    x-group: Activity
  - description: >-
      Conversation on a trail: discussions, their messages, and the live
      discussion-event stream.
    name: trail-discussions
    x-group: Discussions
  - description: >-
      Code review on a trail: review state, comments, diffs, reviewed files, and
      review re-runs.
    name: trail-reviews
    x-group: Reviews
  - description: >-
      Runner output on a trail: the latest result per configured runner, monitor
      results, and manual launches.
    name: trail-runs
  - description: >-
      Quality gates: repo gate definitions, gate settings, repo-authored monitor
      definitions, and a trail's gate evaluation.
    name: trail-gates
    x-group: Gates
  - description: >-
      Getting a trail landed: approval decisions, merge readiness, and the merge
      itself.
    name: trail-approvals
    x-group: Approvals
  - description: >-
      Trail attachment blobs: upload intent, completion, retrieval, and
      deletion.
    name: trail-attachments
  - description: Project-scoped Trails, and their owned repository Changes and discussions.
    name: projects
  - description: Agent-provenance ranking for a repo's code scopes.
    name: experts
    x-group: Experts
  - description: >-
      git-meta-compatible repo metadata read and write (git is the source of
      truth).
    name: git-meta
  - description: >-
      A project's versioned agents — what each runs (its own runner or an Entire
      preset), what it is called, the environment it runs in, the repositories
      it reviews and its trigger — and Entire's presets. Saving one runs
      nothing.
    name: agents
  - description: >-
      A project's saved, versioned Environments — where an agent runs: provider
      and sandbox lifetime — reusable across the project's repositories and
      agents. Configuration only: saving one provisions nothing.
    name: environments
  - description: >-
      Runs of a project's agents, each on one Change: starting one, the
      immutable snapshot each captured, status, output and results, retry and
      cancel.
    name: runs
  - description: >-
      Mutating repo configuration: runner, trail, public-sharing, and
      gate-enforcement settings (requires repo manage_settings for every forge).
    name: repo-settings
  - description: The caller's open pull requests across their repositories.
    name: pull-requests
  - description: 'Service-authed only: editor-document sync behind the trail body editor.'
    name: trails-internal
  - description: The runner OIDC issuer's discovery document and JWKS. Machine-consumed.
    name: runner-issuer
  - name: repositories
    x-group: Git
paths:
  /repos/{repo_id}/trails/{number}/discussions/{discussion_id}:
    get:
      tags:
        - trail-discussions
      summary: Get a discussion and its messages (repo_id addressing)
      operationId: trailDiscussionDetailByRepoID
      parameters:
        - name: repo_id
          in: path
          required: true
          schema:
            type: string
        - in: path
          name: number
          required: true
          schema:
            type: string
        - in: path
          name: discussion_id
          required: true
          schema:
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrailDiscussionDetailResponseBody'
          description: OK
        '400':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Bad Request
        '401':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Unauthorized
        '403':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Forbidden
        '404':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Not Found
        '422':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Unprocessable Entity
        '429':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Too Many Requests
        '500':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Internal Server Error
        '503':
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/ProblemDocument'
          description: Service Unavailable
      security:
        - oauth2: []
        - oidc: []
        - bearerAuth: []
components:
  schemas:
    TrailDiscussionDetailResponseBody:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/TrailDiscussionDetailResponseBody.json
          format: uri
          readOnly: true
          type: string
        discussion:
          $ref: '#/components/schemas/TrailDiscussionSummaryJSON'
        event_cursor:
          type: string
        messages:
          items:
            $ref: '#/components/schemas/TrailDiscussionMessageJSON'
          type:
            - array
            - 'null'
      required:
        - discussion
        - messages
        - event_cursor
      type: object
    ProblemDocument:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/ProblemDocument.json
          format: uri
          readOnly: true
          type: string
        code:
          description: Stable error code; see https://entire.com/errors/.
          type: string
        detail:
          description: Human-readable explanation; server errors omit internal details.
          type: string
        request_id:
          description: Request identifier correlated with server logs.
          minLength: 1
          type: string
        status:
          description: HTTP response status.
          format: int64
          maximum: 599
          minimum: 400
          type: integer
        title:
          description: Short description of the HTTP error.
          type: string
        type:
          description: Documentation URL for this error code.
          format: uri
          type: string
      required:
        - type
        - title
        - status
        - detail
        - code
        - request_id
      type: object
    TrailDiscussionSummaryJSON:
      additionalProperties: false
      properties:
        created_at:
          format: date-time
          type: string
        created_by:
          type:
            - string
            - 'null'
        created_by_identity:
          $ref: '#/components/schemas/ContributorIdentity'
        etag:
          type: string
        id:
          type: string
        kind:
          type: string
        last_message_at:
          format: date-time
          type:
            - string
            - 'null'
        last_message_author:
          type:
            - string
            - 'null'
        message_count:
          type: integer
          format: int64
        messages:
          description: Only on the list route with include_messages=true
          items:
            $ref: '#/components/schemas/TrailDiscussionMessageJSON'
          type: array
        participants:
          items:
            $ref: '#/components/schemas/TrailDiscussionParticipantJSON'
          type:
            - array
            - 'null'
        resolved:
          type: boolean
        resolved_at:
          format: date-time
          type:
            - string
            - 'null'
        resolved_by:
          type:
            - string
            - 'null'
        resolved_by_identity:
          $ref: '#/components/schemas/ContributorIdentity'
        review_comment:
          $ref: '#/components/schemas/ReviewCommentJSON'
        review_comment_id:
          type:
            - string
            - 'null'
        title:
          type: string
        trail_id:
          type: string
        updated_at:
          format: date-time
          type: string
      required:
        - id
        - trail_id
        - title
        - kind
        - resolved
        - resolved_by
        - resolved_by_identity
        - resolved_at
        - created_by
        - created_by_identity
        - created_at
        - updated_at
        - last_message_at
        - last_message_author
        - message_count
        - participants
        - review_comment_id
        - review_comment
      type: object
    TrailDiscussionMessageJSON:
      additionalProperties: false
      properties:
        author:
          type: string
        body:
          type: string
        created_at:
          format: date-time
          type: string
        etag:
          type: string
        id:
          type: string
        identity:
          $ref: '#/components/schemas/ContributorIdentity'
        replies:
          items:
            $ref: '#/components/schemas/TrailDiscussionMessageReplyJSON'
          type:
            - array
            - 'null'
      required:
        - id
        - author
        - identity
        - created_at
        - body
        - replies
      type: object
    ContributorIdentity:
      additionalProperties: false
      properties:
        account_id:
          type:
            - string
            - 'null'
        automation:
          $ref: '#/components/schemas/AutomationIdentity'
        avatar_url:
          type:
            - string
            - 'null'
        display_name:
          type:
            - string
            - 'null'
        handles:
          items:
            $ref: '#/components/schemas/IdentityHandle'
          type:
            - array
            - 'null'
        kind:
          type: string
        username:
          type: string
      required:
        - kind
        - account_id
        - display_name
        - avatar_url
        - handles
      type: object
    TrailDiscussionParticipantJSON:
      additionalProperties: false
      properties:
        actor_account_id:
          type: string
        identity:
          $ref: '#/components/schemas/ContributorIdentity'
        login:
          type: string
      required:
        - login
        - identity
      type: object
    ReviewCommentJSON:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/ReviewCommentJSON.json
          format: uri
          readOnly: true
          type: string
        actor_display_name:
          type:
            - string
            - 'null'
        actor_id:
          type:
            - string
            - 'null'
        actor_identity:
          $ref: '#/components/schemas/ContributorIdentity'
        agent_verdict:
          allOf:
            - description: >-
                The latest verdict the agent that raised this finding gave on it
                in a later run; absent until one has.
            - $ref: '#/components/schemas/FindingVerdictJSON'
        body:
          type:
            - string
            - 'null'
        client_id:
          type:
            - string
            - 'null'
        client_id_hash:
          type:
            - string
            - 'null'
        code_version_id:
          type: string
        confidence:
          format: double
          type:
            - number
            - 'null'
        created_at:
          format: date-time
          type: string
        discussion_id:
          type:
            - string
            - 'null'
        discussion_message_count:
          type: integer
          format: int64
        id:
          type: string
        location:
          $ref: '#/components/schemas/CommentLocationJSON'
        repo_id:
          type: string
        review_id:
          type: string
        severity:
          type:
            - string
            - 'null'
        source:
          allOf:
            - description: >-
                The agent run whose review published this finding; absent for
                every other comment. actor_id stays the publishing principal.
            - $ref: '#/components/schemas/AgentOutputSourceJSON'
        stale_checked_at:
          format: date-time
          type:
            - string
            - 'null'
        stale_checked_code_version_id:
          type:
            - string
            - 'null'
        stale_outcome:
          type: string
        status:
          type: string
        status_actor_display_name:
          type:
            - string
            - 'null'
        status_actor_id:
          type:
            - string
            - 'null'
        status_actor_identity:
          $ref: '#/components/schemas/ContributorIdentity'
        status_actor_kind:
          type:
            - string
            - 'null'
        status_changed_at:
          format: date-time
          type:
            - string
            - 'null'
        status_reason:
          type:
            - string
            - 'null'
        status_source:
          type:
            - string
            - 'null'
        trail_id:
          type: string
        updated_at:
          format: date-time
          type: string
      required:
        - discussion_id
        - discussion_message_count
        - id
        - trail_id
        - repo_id
        - review_id
        - code_version_id
        - actor_id
        - actor_display_name
        - actor_identity
        - body
        - severity
        - confidence
        - status
        - status_reason
        - status_actor_id
        - status_actor_display_name
        - status_actor_identity
        - status_changed_at
        - status_source
        - status_actor_kind
        - stale_outcome
        - stale_checked_at
        - stale_checked_code_version_id
        - client_id
        - client_id_hash
        - created_at
        - updated_at
        - location
      type: object
    TrailDiscussionMessageReplyJSON:
      additionalProperties: false
      properties:
        author:
          type: string
        body:
          type: string
        created_at:
          format: date-time
          type: string
        id:
          type: string
        identity:
          $ref: '#/components/schemas/ContributorIdentity'
      required:
        - id
        - author
        - identity
        - created_at
        - body
      type: object
    AutomationIdentity:
      additionalProperties: false
      properties:
        automation_id:
          description: >-
            The automation's aut_<ULID> subject, for an automation that is not a
            plugin installation.
          type: string
        installation_id:
          description: The plugin installation's ins_<ULID> id.
          type: string
        plugin:
          description: The plugin's slug.
          type: string
      type: object
    IdentityHandle:
      additionalProperties: false
      properties:
        handle:
          type: string
        is_primary:
          type: boolean
        provider:
          type: string
      required:
        - provider
        - handle
      type: object
    FindingVerdictJSON:
      additionalProperties: false
      properties:
        created_at:
          format: date-time
          type: string
        evidence:
          description: Where the agent looked at the head it reviewed, and what it found.
          type: string
        outcome:
          description: >-
            resolved or dismissed: the agent closed the finding;
            awaiting_confirmation: a high severity finding stays open until a
            person closes it; reopened_by_person, already_closed: a person's
            decision stood; kept: still present.
          enum:
            - resolved
            - dismissed
            - kept
            - awaiting_confirmation
            - reopened_by_person
            - already_closed
          type: string
        run_id:
          description: The run that gave it (GET .../runs/{id}).
          type: string
        verdict:
          enum:
            - fixed
            - still_present
            - no_longer_applies
          type: string
      required:
        - run_id
        - verdict
        - evidence
        - outcome
        - created_at
      type: object
    CommentLocationJSON:
      additionalProperties: false
      properties:
        code_version_id:
          type: string
        end_column:
          format: int64
          type:
            - integer
            - 'null'
        end_line:
          format: int64
          type:
            - integer
            - 'null'
        file_path:
          type:
            - string
            - 'null'
        granularity:
          type: string
        id:
          type: string
        language:
          type:
            - string
            - 'null'
        nearby_text:
          type:
            - string
            - 'null'
        review_comment_id:
          type: string
        selected_text:
          type:
            - string
            - 'null'
        start_column:
          format: int64
          type:
            - integer
            - 'null'
        start_line:
          format: int64
          type:
            - integer
            - 'null'
      required:
        - id
        - review_comment_id
        - code_version_id
        - granularity
        - file_path
        - start_line
        - start_column
        - end_line
        - end_column
        - selected_text
        - nearby_text
        - language
      type: object
    AgentOutputSourceJSON:
      additionalProperties: false
      properties:
        agent:
          allOf:
            - description: The agent (GET .../agents/{id}), by its current name.
            - $ref: '#/components/schemas/AgentNameJSON'
        run_id:
          description: The run that published it (GET .../runs/{id}).
          type: string
      required:
        - agent
        - run_id
      type: object
    AgentNameJSON:
      additionalProperties: false
      properties:
        id:
          description: Agent id (GET .../agents/{id}).
          type: string
        name:
          description: The agent's current name.
          type: string
      required:
        - id
        - name
      type: object
  securitySchemes:
    bearerAuth:
      bearerFormat: JWT
      description: >-
        Bearer token authorizing this operation's repository action. Each
        operation's security requirement names the resource action the token
        must be authorized for (pull or push).
      scheme: bearer
      type: http
    oauth2:
      description: OAuth 2.0 authorization code flow.
      flows:
        authorizationCode:
          authorizationUrl: https://us.auth.entire.io/authorize
          scopes:
            offline_access: Stay signed in and receive a refresh token.
            openid: Verify your identity.
          tokenUrl: https://us.auth.entire.io/oauth/token
      type: oauth2
    oidc:
      description: >-
        OpenID Connect discovery document:
        https://us.auth.entire.io/.well-known/openid-configuration
      openIdConnectUrl: https://us.auth.entire.io/.well-known/openid-configuration
      type: openIdConnect

````