> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/Nectr-AI/nectr-ai-pr-review-agent/llms.txt
> Use this file to discover all available pages before exploring further.

# List Reviews

> List all PR reviews with optional filtering and search

## Overview

Retrieve a paginated list of PR reviews processed by Nectr AI. This endpoint deduplicates reviews by PR number and repository, returning the most recent event with the highest priority status for each unique PR.

## Authentication

Requires a valid JWT token in the `Authorization` header:

```
Authorization: Bearer YOUR_JWT_TOKEN
```

## Query Parameters

<ParamField query="limit" type="integer" default="20">
  Maximum number of reviews to return (1-100)
</ParamField>

<ParamField query="status" type="string" optional>
  Filter by event status or PR status. Valid values:

  * Event status: `pending`, `processing`, `completed`, `failed`
  * PR status: `open`, `merged`, `closed`
</ParamField>

<ParamField query="search" type="string" optional>
  Search reviews by PR title, repository name, or PR number
</ParamField>

## Response

Returns an array of review objects, deduplicated by unique PR.

<ResponseField name="[]" type="array">
  Array of review objects
</ResponseField>

<ResponseField name="[].id" type="integer">
  Event ID
</ResponseField>

<ResponseField name="[].event_type" type="string">
  Type of event (e.g., "pull\_request")
</ResponseField>

<ResponseField name="[].source" type="string">
  Event source (e.g., "github")
</ResponseField>

<ResponseField name="[].status" type="string">
  Processing status: `pending`, `processing`, `completed`, or `failed`
</ResponseField>

<ResponseField name="[].pr_status" type="string">
  Live PR status from GitHub: `open`, `merged`, or `closed`
</ResponseField>

<ResponseField name="[].created_at" type="datetime">
  Timestamp when the event was created
</ResponseField>

<ResponseField name="[].processed_at" type="datetime">
  Timestamp when the event was processed (null if pending)
</ResponseField>

<ResponseField name="[].pr_title" type="string">
  Pull request title
</ResponseField>

<ResponseField name="[].pr_number" type="integer">
  Pull request number
</ResponseField>

<ResponseField name="[].repo_name" type="string">
  Repository full name (owner/repo)
</ResponseField>

<ResponseField name="[].branch" type="string">
  Source branch name
</ResponseField>

<ResponseField name="[].author" type="string">
  GitHub username of the PR author
</ResponseField>

<ResponseField name="[].pr_url" type="string">
  Direct URL to the pull request on GitHub
</ResponseField>

<ResponseField name="[].ai_summary" type="string">
  AI-generated review summary (available when status is completed)
</ResponseField>

<ResponseField name="[].files_analyzed" type="integer">
  Number of files analyzed by the AI reviewer
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl -X GET "https://api.nectr.ai/api/v1/reviews?limit=10&status=completed" \
    -H "Authorization: Bearer YOUR_JWT_TOKEN"
  ```

  ```python Python theme={null}
  import requests

  response = requests.get(
      "https://api.nectr.ai/api/v1/reviews",
      headers={"Authorization": f"Bearer {token}"},
      params={
          "limit": 10,
          "status": "completed"
      }
  )

  reviews = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://api.nectr.ai/api/v1/reviews?limit=10&status=completed',
    {
      headers: {
        'Authorization': `Bearer ${token}`
      }
    }
  );

  const reviews = await response.json();
  ```
</CodeGroup>

## Example Response

```json theme={null}
[
  {
    "id": 1234,
    "event_type": "pull_request",
    "source": "github",
    "status": "completed",
    "pr_status": "open",
    "created_at": "2026-03-10T14:30:00Z",
    "processed_at": "2026-03-10T14:32:15Z",
    "pr_title": "Add user authentication endpoints",
    "pr_number": 42,
    "repo_name": "acme/api-server",
    "branch": "feature/auth",
    "author": "johndoe",
    "pr_url": "https://github.com/acme/api-server/pull/42",
    "ai_summary": "APPROVE\n\nConfidence: 4/5\n\nThis PR implements secure authentication...",
    "files_analyzed": 8
  },
  {
    "id": 1230,
    "event_type": "pull_request",
    "source": "github",
    "status": "completed",
    "pr_status": "merged",
    "created_at": "2026-03-09T10:15:00Z",
    "processed_at": "2026-03-09T10:17:45Z",
    "pr_title": "Fix database connection pooling",
    "pr_number": 41,
    "repo_name": "acme/api-server",
    "branch": "bugfix/db-pool",
    "author": "janedoe",
    "pr_url": "https://github.com/acme/api-server/pull/41",
    "ai_summary": "APPROVE\n\nConfidence: 5/5\n\n🟢 **Minor Suggestion**: Consider adding...",
    "files_analyzed": 3
  }
]
```

## Filtering Examples

### Filter by Event Status

Get all reviews that are currently being processed:

```bash theme={null}
GET /api/v1/reviews?status=processing
```

### Filter by PR Status

Get all reviews for merged PRs:

```bash theme={null}
GET /api/v1/reviews?status=merged
```

### Search Reviews

Search for reviews containing "authentication" in title or repo name:

```bash theme={null}
GET /api/v1/reviews?search=authentication
```

Search for a specific PR number:

```bash theme={null}
GET /api/v1/reviews?search=42
```

## Notes

* Reviews are **deduplicated** by unique PR (repo + PR number). If multiple events exist for the same PR, the endpoint returns the event with the highest priority status
* Status priority (highest to lowest): `completed` > `failed` > `processing` > `pending`
* The `pr_status` field is fetched live from GitHub API for accuracy
* If GitHub API fetch fails, `pr_status` falls back to the last known state from the webhook payload
* The `search` parameter matches against PR title, repo name, and PR number (case-insensitive)
