> ## 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

> **Draft - not available.** The specification is subject to change.

Retrieve a code review created through this API for the authenticated team.
Poll while the status is `processing`. Results are available when the status is `complete`.
A `failed` result includes an error message. The commit SHAs identify the analyzed revision,
even if the pull request has since changed.




## OpenAPI

````yaml https://getunblocked.com/api/v1/public-api.json get /code-reviews/{codeReviewId}
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 the PUT endpoint and poll for the response using the GET
      endpoint.
    name: Answers
  - description: >
      **Draft - not available.** This API specification is provided for feedback
      and is subject to change.


      Create code reviews and risk assessments for pull requests and retrieve
      their results asynchronously, without posting comments or reviews to the
      pull request.
    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.


      You can create multiple collections to manage documents from different
      sources.


      You have the ability to list, create, update, and delete 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 produces a synthesized answer with supporting sources. Search
      endpoints return relevant sources from a single content space. Query
      endpoints return the issues or pull requests matching a natural-language
      query with optional filters. The get endpoint retrieves URL content
      directly.


      **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 create a collection
      before adding documents. Documents used to provide answers will appear as
      references in the Unblocked interface.


      You can create 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 the feed to collect new events.
    name: Security Events
  - description: |
      Retrieve usage data for Unblocked products and features.
    name: Usage
paths:
  /code-reviews/{codeReviewId}:
    get:
      tags:
        - Code Reviews
      summary: Get Code Review
      description: >
        **Draft - not available.** The specification is subject to change.


        Retrieve a code review created through this API for the authenticated
        team.

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

        A `failed` result includes an error message. The commit SHAs identify
        the analyzed revision,

        even if the pull request has since changed.
      operationId: getCodeReview
      parameters:
        - description: The ID returned when the code review was created.
          explode: false
          in: path
          name: codeReviewId
          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
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
          description: Bad Request - Invalid or missing required fields
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
          description: Unauthorized - Invalid or missing API token
        '403':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
          description: Error response
        '404':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
          description: Error response
        '429':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
          description: Error response
        '500':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/PublicApiError'
          description: Internal Server Error
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'
        gitHeadSha:
          description: The head commit SHA analyzed by this code review.
          example: 8a1b2c3d4e5f678901234567890123456789abcd
          type: string
        gitBaseSha:
          description: The base commit SHA analyzed by this code review.
          example: 7a1b2c3d4e5f678901234567890123456789abcd
          type: string
        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:
        - gitBaseSha
        - gitHeadSha
        - id
        - status
      type: object
    PublicApiError:
      properties:
        status:
          description: The HTTP status code
          example: 400
          type: integer
      required:
        - status
      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

````