Corridor PR Reviews API

Access pull request review results and AI analysis.

OpenAPI Specification

corridor-pr-reviews-api-openapi.yml Raw ↑
openapi: 3.1.0
info:
  title: Corridor Dashboard PR Reviews API
  version: '1.0'
  summary: Programmatic access to Corridor findings, guardrails, PR reviews, team settings, and dashboard data.
  description: 'Corridor exposes a REST API for integrating its AI-coding security platform with CI/CD pipelines, custom dashboards, and other tools. All endpoints are authenticated with API tokens (the `cor_` prefix) passed as an `Authorization: Bearer` header. API tokens carry the same access as the user who created them and cannot perform admin operations (those require a user session). This specification was faithfully generated by the API Evangelist enrichment pipeline from Corridor''s published API reference; it is not a verbatim provider-published machine-readable spec.'
  contact:
    name: Corridor Support
    email: support@corridor.dev
    url: https://docs.corridor.dev/api/reference
  x-apievangelist-generated: '2026-07-18'
  x-apievangelist-method: generated
  x-apievangelist-source: https://docs.corridor.dev/api/reference
servers:
- url: https://app.corridor.dev/api
  description: Corridor production API
security:
- bearerAuth: []
tags:
- name: PR Reviews
  description: Access pull request review results and AI analysis.
paths:
  /teams/{id}/pr-reviews:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Team ID.
    get:
      operationId: listPrReviews
      tags:
      - PR Reviews
      summary: List PR reviews
      parameters:
      - name: limit
        in: query
        required: false
        schema:
          type: integer
      - name: offset
        in: query
        required: false
        schema:
          type: integer
      - name: type
        in: query
        required: false
        schema:
          type: string
        description: Filter by review type.
      - name: sortBy
        in: query
        required: false
        schema:
          type: string
      - name: sortOrder
        in: query
        required: false
        schema:
          type: string
          enum:
          - ASC
          - DESC
      responses:
        '200':
          description: PR reviews with pagination.
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/PrReview'
                  pagination:
                    $ref: '#/components/schemas/Pagination'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /teams/{id}/pr-reviews/{prReviewId}:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Team ID.
    - name: prReviewId
      in: path
      required: true
      schema:
        type: string
    get:
      operationId: getPrReview
      tags:
      - PR Reviews
      summary: Get PR review
      description: Returns the full PR review including comments, findings, and metadata.
      responses:
        '200':
          description: The PR review.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PrReview'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
  /teams/{id}/pr-reviews/by-pr:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Team ID.
    get:
      operationId: getPrReviewByNumber
      tags:
      - PR Reviews
      summary: Get PR review by PR number
      description: Look up PR reviews by pull request number and repository name. The response body includes a `status` field on non-success outcomes (`in_progress`, `repo_not_found`, `pr_review_not_found`) so callers can branch without parsing error strings.
      parameters:
      - name: prNumber
        in: query
        required: true
        schema:
          type: integer
        description: The pull request / merge request number.
      - name: repoName
        in: query
        required: true
        schema:
          type: string
        description: Repository name.
      - name: fullHistory
        in: query
        required: false
        schema:
          type: boolean
        description: When true
        returns all complete reviews for the PR.: null
      responses:
        '200':
          description: 'The most recent review, a `{ reviews, total }` set, or a `{ status: in_progress }` body.'
        '404':
          description: repo_not_found or pr_review_not_found.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Error'
        '401':
          $ref: '#/components/responses/Unauthorized'
  /teams/{id}/pr-review-findings:
    parameters:
    - name: id
      in: path
      required: true
      schema:
        type: string
      description: Team ID.
    get:
      operationId: listPrReviewFindings
      tags:
      - PR Reviews
      summary: List PR review findings
      parameters:
      - name: prReviewId
        in: query
        required: false
        schema:
          type: string
        description: Filter by specific PR review.
      - name: limit
        in: query
        required: false
        schema:
          type: integer
      - name: offset
        in: query
        required: false
        schema:
          type: integer
      responses:
        '200':
          description: PR review findings.
        '401':
          $ref: '#/components/responses/Unauthorized'
components:
  schemas:
    PrReview:
      type: object
      properties:
        id:
          type: string
        title:
          type: string
        severity:
          type: string
          enum:
          - critical
          - high
          - medium
          - low
        state:
          type: string
          enum:
          - open
          - closed
          - potential
        affectedFile:
          type: string
        createdAt:
          type: string
          format: date-time
        cwe:
          type: string
        github_pr_id:
          type: integer
        publish_status:
          type: string
          enum:
          - SUCCEEDED
          - SKIPPED
    Pagination:
      type: object
      properties:
        page:
          type: integer
        limit:
          type: integer
        total:
          type: integer
        totalPages:
          type: integer
        hasNext:
          type: boolean
        hasPrev:
          type: boolean
    Error:
      type: object
      properties:
        error:
          type: string
          description: Description of what went wrong.
      required:
      - error
  responses:
    Unauthorized:
      description: Unauthorized — invalid or missing token.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
    NotFound:
      description: Not found.
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/Error'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      description: 'API token with the `cor_` prefix, generated from Profile > API Tokens in the Corridor dashboard. Passed as `Authorization: Bearer cor_...`.'