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

# Get Code Review

> Retrieve a code review for the authenticated team, including automatic, manually requested,
and API-created reviews. Existing repository access restrictions apply to Personal Access Tokens.
Poll while the status is `processing`. Results are available when the status is `complete`.
A `failed` result includes an error message. The head commit SHA identifies the analyzed revision,
even if the pull request has since changed.




## OpenAPI

````yaml https://getunblocked.com/api/v1/public-api.json get /code-reviews/{reviewId}
openapi: 3.0.3
info:
  contact:
    email: help@getunblocked.com
    name: Unblocked
  description: >
    The Unblocked Public API offers seamless collection for managing custom data
    sources through a structured set of endpoints.

    It allows users to create collections and organize and upload documents.


    # Base URL

    The base URL for all requests is:


    ```jsx

    https://getunblocked.com/api/v1

    ```


    # Authentication

    Authentication requires an API key, obtainable from the web dashboard,

    which must be included in the `Authorization` request header for all
    endpoints.


    ```bash

    curl -X GET https://getunblocked.com/api/v1/collections \
         -H "Authorization: Bearer YOUR_API_KEY"
    ```


    # Rate Limits & Quotas


    **Resource Limits:**

    - Collections: Maximum 25 per team

    - Request Size: Maximum 10MB per request

    - Pagination: 1-200 items per page (default: 100)


    **Answers API:**

    - Daily Limit: 1000 questions per day per team

    - Quota Reset: Midnight PST

    - Exceeding the limit returns a 429 Too Many Requests error


    **Field Constraints:**

    - Collection name: 1-32 characters

    - Collection description: 1-4096 characters
  title: Unblocked Public API Reference
  version: v1
  x-logo:
    url: https://avatars.githubusercontent.com/u/91906527?s=300
    altText: Unblocked
servers:
  - url: https://getunblocked.com/api/v1
security:
  - ApiKeyBearerAuth: []
tags:
  - description: >
      Ask Unblocked questions and retrieve answers asynchronously. Submit a
      question using [Ask a
      Question](https://docs.getunblocked.com/api-reference/answers/ask-a-question)
      and poll for the response using [Retrieve an
      Answer](https://docs.getunblocked.com/api-reference/answers/retrieve-an-answer).
    name: Answers
  - description: >
      Use [Create Code
      Review](https://docs.getunblocked.com/api-reference/code-reviews/create-code-review)
      or [Create Risk
      Assessment](https://docs.getunblocked.com/api-reference/code-reviews/create-risk-assessment)
      to analyze pull requests without posting comments or reviews to the pull
      request.

      Retrieve results asynchronously using [Get Code
      Review](https://docs.getunblocked.com/api-reference/code-reviews/get-code-review)
      or [Get Risk
      Assessment](https://docs.getunblocked.com/api-reference/code-reviews/get-risk-assessment).
    name: Code Reviews
  - description: >
      A collection in Unblocked allows you to organize related documents from
      various data sources, such as customer support tools, knowledge bases, and
      internal wikis, which are not natively supported by Unblocked.


      Use [Create
      Collection](https://docs.getunblocked.com/api-reference/collections/create-collection)
      to manage documents from different sources.


      Use [List
      Collections](https://docs.getunblocked.com/api-reference/collections/list-collections),
      [Get
      Collection](https://docs.getunblocked.com/api-reference/collections/get-collection),
      [Update
      Collection](https://docs.getunblocked.com/api-reference/collections/update-collection),
      and [Delete
      Collection](https://docs.getunblocked.com/api-reference/collections/delete-collection)
      to manage them as needed.


      Deleting a collection will also remove all the associated documents.
    name: Collections
  - description: >
      Retrieve context from the data sources connected to Unblocked, including
      code, pull requests, issues, messages, and documentation.


      [Research
      Context](https://docs.getunblocked.com/api-reference/context/research-context)
      produces a synthesized answer with supporting sources.

      [Search
      Code](https://docs.getunblocked.com/api-reference/context/search-code),
      [Search
      Documentation](https://docs.getunblocked.com/api-reference/context/search-documentation),
      [Search
      Issues](https://docs.getunblocked.com/api-reference/context/search-issues),
      [Search
      Messages](https://docs.getunblocked.com/api-reference/context/search-messages),
      and [Search Pull
      Requests](https://docs.getunblocked.com/api-reference/context/search-pull-requests)
      return relevant sources from a single content space.

      [Query
      Issues](https://docs.getunblocked.com/api-reference/context/query-issues)
      and [Query Pull
      Requests](https://docs.getunblocked.com/api-reference/context/query-pull-requests)
      return matches for a natural-language query with optional filters.

      [Get URL
      Content](https://docs.getunblocked.com/api-reference/context/get-url-content)
      retrieves URL content directly.


      Your team's plan must include the Context API. Personal Access Token users
      must have an Unblocked license.


      **Authentication behavior:**

      - **Personal Access Token (PAT) keys**: Requests are attributed to the
      key's user

      - **Team-wide API keys**: Requests are attributed to the team
    name: Context
  - description: >
      A document contains content that Unblocked uses to answer questions. Each
      document is associated with a collection, so you must use [Create
      Collection](https://docs.getunblocked.com/api-reference/collections/create-collection)
      before adding documents. Documents used to provide answers will appear as
      references in the Unblocked interface.


      Use [Put
      Document](https://docs.getunblocked.com/api-reference/documents/put-document)
      and [Delete
      Document](https://docs.getunblocked.com/api-reference/documents/delete-document)
      to create, update, and delete documents as needed.
    name: Documents
  - description: >
      SCIM (System for Cross-domain Identity Management) is a standard for
      automating the exchange of user identity information between identity
      domains or IT systems.


      You can use the SCIM API to manage users and groups in Unblocked.


      **Authentication behavior:**

      - **Public API and SCIM API keys**: Accepted for SCIM requests

      - **Personal Access Token (PAT) keys**: Only team admins may use the SCIM
      API; non-admin members receive `403 Forbidden`

      - **SAML prerequisite**: The team must have SAML identity provider
      metadata configured; otherwise requests receive `403 Forbidden`
    name: SCIM
  - description: >
      Retrieve a feed of team events for downstream ingestion into a security

      information and event management (SIEM) system. The feed currently
      includes

      audit logs. Poll [List Audit
      Logs](https://docs.getunblocked.com/api-reference/security-events/list-audit-logs)
      to collect new events.
    name: Security Events
  - description: |
      Retrieve usage data for Unblocked products and features.
    name: Usage
paths:
  /code-reviews/{reviewId}:
    get:
      tags:
        - Code Reviews
      summary: Get Code Review
      description: >
        Retrieve a code review for the authenticated team, including automatic,
        manually requested,

        and API-created reviews. Existing repository access restrictions apply
        to Personal Access Tokens.

        Poll while the status is `processing`. Results are available when the
        status is `complete`.

        A `failed` result includes an error message. The head commit SHA
        identifies the analyzed revision,

        even if the pull request has since changed.
      operationId: getCodeReview
      parameters:
        - description: >-
            The `reviewId` from [List Code Review
            Usage](https://docs.getunblocked.com/api-reference/usage/list-code-review-usage)
            or the ID returned by [Create Code
            Review](https://docs.getunblocked.com/api-reference/code-reviews/create-code-review).
          explode: false
          in: path
          name: reviewId
          required: true
          schema:
            $ref: '#/components/schemas/ApiResourceId'
          style: simple
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CodeReview'
          description: OK - The current status and available result
        default:
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
          description: >
            Error response. See
            [Errors](https://docs.getunblocked.com/api-reference/errors) for
            status codes and retry guidance.
components:
  schemas:
    ApiResourceId:
      description: The ID of a resource that can be retrieved from the service.
      format: uuid
      type: string
    CodeReview:
      properties:
        id:
          $ref: '#/components/schemas/ApiResourceId'
        status:
          $ref: '#/components/schemas/PullRequestAnalysisStatus'
        headSha:
          description: The head commit SHA analyzed by this code review.
          example: 8a1b2c3d4e5f678901234567890123456789abcd
          type: string
        prUrl:
          description: URL of the pull request in its source control provider.
          example: https://github.com/acme/backend/pull/123
          format: uri
          type: string
        headBranch:
          description: The pull request's source branch.
          example: feature/add-validation
          type: string
        baseBranch:
          description: The pull request's target branch when this code review was created.
          example: main
          type: string
        trigger:
          description: The event that triggered this code review.
          enum:
            - Pull request code changed
            - Pull request opened
            - Pull request ready for review
            - Pull request reopened
            - Pull request label added
            - Manually triggered
            - Public API
          example: Public API
          type: string
          x-enum-varnames:
            - pullRequestCodeChanged
            - pullRequestOpened
            - pullRequestReadyForReview
            - pullRequestReopened
            - pullRequestLabelAdded
            - manuallyTriggered
            - publicApi
        deepReview:
          description: >-
            Whether this review uses [deep
            review](https://docs.getunblocked.com/code-review/setup-and-configuration#deep-review).
          example: true
          type: boolean
        error:
          description: An error message present when status is failed; omitted otherwise.
          example: Unable to retrieve the pull request diff.
          type: string
        comments:
          description: >-
            Present when status is complete; omitted otherwise. An empty array
            means no findings.
          items:
            $ref: '#/components/schemas/CodeReviewComment'
          type: array
      required:
        - baseBranch
        - deepReview
        - headBranch
        - headSha
        - id
        - prUrl
        - status
        - trigger
      type: object
    PublicApiError:
      additionalProperties: false
      properties:
        message:
          description: A human-readable explanation of the error.
          type: string
        documentationUrl:
          description: The URL of the documentation for the API operation that was called.
          type: string
      required:
        - documentationUrl
        - message
      type: object
    PullRequestAnalysisStatus:
      description: |
        The status of an asynchronous run. Poll while processing.
        Complete and failed are terminal states.
      enum:
        - processing
        - complete
        - failed
      example: processing
      type: string
    CodeReviewComment:
      properties:
        id:
          $ref: '#/components/schemas/ApiResourceId'
        filePath:
          description: The repository-relative path of the file containing the finding.
          example: src/auth/session.kt
          type: string
        lineSide:
          description: >-
            The side of the diff containing the finding. Left is the base
            revision; right is the head revision.
          enum:
            - left
            - right
          example: right
          type: string
        startLine:
          description: The inclusive, one-based start line in the specified revision.
          example: 42
          format: int32
          minimum: 1
          type: integer
        endLine:
          description: >-
            The inclusive, one-based end line in the specified revision. Must be
            greater than or equal to startLine.
          example: 45
          format: int32
          minimum: 1
          type: integer
        category:
          description: The category of the finding.
          enum:
            - BestPractice
            - CodeStyle
            - CrashOrHang
            - ErrorHandling
            - LogicError
            - Maintainability
            - Performance
            - Readability
            - Security
            - Testability
          example: LogicError
          type: string
        title:
          description: A short summary of the finding.
          example: Expired sessions remain valid
          type: string
        description:
          description: The finding and suggested remediation in Markdown.
          example: Check the session expiration before allowing the request.
          type: string
      required:
        - category
        - description
        - endLine
        - filePath
        - id
        - lineSide
        - startLine
        - title
      type: object
  securitySchemes:
    ApiKeyBearerAuth:
      bearerFormat: Unblocked API Key
      description: The API key to authenticate requests. Obtainable from the web dashboard.
      scheme: bearer
      type: http

````