> ## 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 merge readiness for a trail (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}/mergeability
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}/mergeability:
    get:
      tags:
        - trail-approvals
      summary: Get merge readiness for a trail (repo_id addressing)
      operationId: trailsMergeabilityByRepoID
      parameters:
        - description: 'Repo id: placement ULID or public repo_<group ULID>'
          in: path
          name: repo_id
          required: true
          schema:
            description: 'Repo id: placement ULID or public repo_<group ULID>'
            type: string
        - description: Trail number
          in: path
          name: number
          required: true
          schema:
            description: Trail number
            type: string
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TrailMergeabilityResponse'
          description: OK
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Bad Request
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unauthorized
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Forbidden
        '422':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Unprocessable Entity
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Too Many Requests
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Internal Server Error
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ApiError'
          description: Service Unavailable
      security:
        - oauth2: []
        - oidc: []
        - bearerAuth: []
components:
  schemas:
    TrailMergeabilityResponse:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/TrailMergeabilityResponse.json
          format: uri
          readOnly: true
          type: string
        behind_by:
          type: integer
          format: int64
        bypass_policy:
          description: >-
            Effective bypass policy for this response. When readiness is
            unavailable, nobody is a fail-closed fallback, not the saved
            repository setting; merge actions remain unavailable.
          type: string
        checks:
          allOf:
            - description: >-
                Third-party CI runs for headSha from the same read that
                evaluated the checks gate; Entire's own gate rollup is excluded.
                On an open native trail whose checks gate is pending, each
                required name with no report is also listed, with status queued
                and no started_at, whatever checks.availability says. Reported
                runs are meaningful only when checks.availability is available.
            - $ref: '#/components/schemas/TrailChecksJSON'
        comparison_status:
          type: string
        conflict_status:
          description: >-
            Provider conflict verdict for headSha; conflicting blocks mergeable
            independently of gates and CI evidence.
          enum:
            - clean
            - conflicting
            - unknown
          type: string
        delete_branch_on_merge:
          description: >-
            Default for the merge request's deleteBranch option, i.e. the
            repository's delete-branch-on-merge setting; false means the setting
            is off. Null for a GitHub-backed repository, where entire-api never
            deletes the branch, and when readiness is unavailable.
          type:
            - boolean
            - 'null'
        forge_merge_block:
          allOf:
            - description: >-
                Set when the forge's own branch rules (GitHub branch protection
                or rulesets) refuse the merge at headSha, independent of
                Entire's gates. Read under the GitHub App's credential, so it
                does not reflect a viewer's ability to bypass. Null when not
                blocked or unknown, and when GitHub waits only on Entire's own
                gates check run, which the gates already report.
            - $ref: '#/components/schemas/ForgeMergeBlockJSON'
        gates:
          items:
            $ref: '#/components/schemas/GateResult'
          type:
            - array
            - 'null'
        head_sha:
          type:
            - string
            - 'null'
        mergeable:
          type: boolean
      required:
        - delete_branch_on_merge
        - bypass_policy
        - mergeable
        - behind_by
        - comparison_status
        - conflict_status
        - head_sha
        - gates
        - checks
        - forge_merge_block
      type: object
    ApiError:
      additionalProperties: false
      properties:
        $schema:
          description: A URL to the JSON Schema for this object.
          examples:
            - /api/v1/schemas/ApiError.json
          format: uri
          readOnly: true
          type: string
        code:
          type: string
        detail:
          type: string
        error:
          type: string
      required:
        - error
      type: object
    TrailChecksJSON:
      additionalProperties: false
      properties:
        availability:
          description: >-
            available means a complete read, including an empty list;
            unavailable means missing or failed evidence; not_applicable means
            no applicable CI evidence.
          enum:
            - available
            - unavailable
            - not_applicable
          type: string
        runs:
          items:
            $ref: '#/components/schemas/TrailCheckRunJSON'
          type:
            - array
            - 'null'
      required:
        - availability
        - runs
      type: object
    ForgeMergeBlockJSON:
      additionalProperties: false
      properties:
        reason:
          description: >-
            Open set: review_required means GitHub needs an approving review;
            changes_requested means a GitHub reviewer requested changes;
            checks_pending means a required check on headSha has not finished;
            blocked means GitHub reports the merge as blocked without naming a
            readable rule. Unknown future values must be tolerated.
          type: string
          x-open-enum:
            - review_required
            - changes_requested
            - checks_pending
            - blocked
        required_approving_review_count:
          description: Approving reviews GitHub requires; 0 when GitHub did not say.
          format: int64
          type: integer
      required:
        - reason
        - required_approving_review_count
      type: object
    GateResult:
      additionalProperties: false
      properties:
        blocking:
          type: boolean
        completed_at:
          format: date-time
          type:
            - string
            - 'null'
        created_at:
          format: date-time
          type: string
        evaluated_at_sha:
          type:
            - string
            - 'null'
        finding_count:
          format: int64
          type:
            - integer
            - 'null'
        gate_definition_id:
          type: string
        gate_key:
          type: string
        gate_type:
          type: string
        head_sha:
          type:
            - string
            - 'null'
        id:
          type: string
        not_applicable_reason:
          description: >-
            Machine-readable reason for a not_applicable gate. no_changes means
            the branch has no changes from its base; it is not an evaluated
            skipped verdict. Absent for other results, including disabled gates.
          enum:
            - no_changes
          type: string
        outcome:
          type:
            - string
            - 'null'
        rationale:
          type:
            - string
            - 'null'
        reviewers:
          items:
            $ref: '#/components/schemas/ApprovalReviewer'
          type: array
        runner_ids:
          description: >-
            Sorted unique runner IDs contributing to this gate, drawn from the
            Trail detail runners array. Empty when none are associated or
            configuration is unavailable.
          items:
            type: string
          type: array
          uniqueItems: true
        stale_reason:
          type:
            - string
            - 'null'
        state:
          type: string
        status:
          type: string
        value: {}
      required:
        - reviewers
        - runner_ids
        - id
        - gate_definition_id
        - gate_key
        - gate_type
        - blocking
        - status
        - head_sha
        - value
        - rationale
        - created_at
        - completed_at
        - outcome
        - stale_reason
        - evaluated_at_sha
        - finding_count
      type: object
    TrailCheckRunJSON:
      additionalProperties: false
      properties:
        app_name:
          type:
            - string
            - 'null'
        completed_at:
          format: date-time
          type:
            - string
            - 'null'
        conclusion:
          type:
            - string
            - 'null'
        details_url:
          type:
            - string
            - 'null'
        name:
          type: string
        source:
          description: >-
            Slug of the CI plugin that reported this run. Absent for a run read
            from the forge.
          type: string
        started_at:
          format: date-time
          type:
            - string
            - 'null'
        status:
          type: string
        steps:
          items:
            $ref: '#/components/schemas/CheckRunStep'
          type:
            - array
            - 'null'
      required:
        - name
        - status
        - conclusion
        - details_url
        - started_at
        - completed_at
        - app_name
      type: object
    ApprovalReviewer:
      additionalProperties: false
      properties:
        actor_account_id:
          type: string
        login:
          type: string
        reason:
          type:
            - string
            - 'null'
        reviewed_head_sha:
          type:
            - string
            - 'null'
        state:
          enum:
            - pending
            - approved
            - stale
            - changes_requested
            - excluded
          type: string
      required:
        - login
        - state
        - reviewed_head_sha
        - reason
      type: object
    CheckRunStep:
      additionalProperties: false
      properties:
        conclusion:
          type:
            - string
            - 'null'
        exit_status:
          type: integer
          format: int64
        id:
          type: string
        name:
          type: string
        status:
          type: string
      required:
        - id
        - name
        - status
        - conclusion
      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

````