## GET /v1/reviews

List code reviews newest first. Filter by repository, pull request number, and status, and page with limit and cursor.

Required permissions: read:reviews.
API key: Supported.
CLI user token: Supported.
Session token: Requires the ellipsis:api scope, and the session's permissions.ellipsis rules must allow the operation.
Higher permission levels include lower levels: read < write < delete.

### Response

```text
{
  "has_more": bool,
  "next_cursor": str,
  "reviews": [
    {
      "base_sha": str,
      "blocking": int,
      "created_at": str,
      "error": str,
      "event": str,
      "finalized_at": str,
      "github_review_id": int,
      "head_sha": str,
      "id": str,
      "non_blocking": int,
      "pull_request": {
        "additions": int,
        "author": {
          "avatar_url": str,
          "id": int,
          "login": str,
          "name": str,
          "type": str
        },
        "base": {
          "ref": str,
          "sha": str
        },
        "changed_files": int,
        "commits": int,
        "created_at": str,
        "deletions": int,
        "head": {
          "ref": str,
          "sha": str
        },
        "id": int,
        "merged_at": str,
        "number": int,
        "repository": {
          "id": int,
          "name": str,
          "owner": str
        },
        "status": str,
        "title": str,
        "updated_at": str,
        "url": str
      },
      "repository": {
        "id": int,
        "name": str,
        "owner": str
      },
      "status": str,
      "url": str
    }
  ]
}
```

### Python

```python
import os

from ellipsis import Ellipsis

client = Ellipsis(api_key=os.environ["ELLIPSIS_API_TOKEN"])

for item in client.reviews.list():
    print(item)
```

### TypeScript

```typescript
import { Ellipsis } from '@ellipsis-dev/sdk';

const client = new Ellipsis({
  apiKey: process.env.ELLIPSIS_API_TOKEN!,
});

for await (const item of await client.reviews.list()) {
  console.log(item);
}
```

### cURL

```bash
curl "https://api.ellipsis.dev/v1/reviews" \
  -H "Authorization: Bearer $ELLIPSIS_API_TOKEN"
```

### Response schema

```json
{
  "properties": {
    "has_more": {
      "default": false,
      "type": "boolean"
    },
    "next_cursor": {
      "anyOf": [
        {
          "type": "string"
        },
        {
          "type": "null"
        }
      ]
    },
    "reviews": {
      "items": {
        "properties": {
          "base_sha": {
            "type": "string"
          },
          "blocking": {
            "type": "integer"
          },
          "created_at": {
            "format": "date-time",
            "type": "string"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "event": {
            "anyOf": [
              {
                "enum": [
                  "COMMENT",
                  "APPROVE",
                  "REQUEST_CHANGES"
                ],
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "finalized_at": {
            "anyOf": [
              {
                "format": "date-time",
                "type": "string"
              },
              {
                "type": "null"
              }
            ]
          },
          "github_review_id": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ]
          },
          "head_sha": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "non_blocking": {
            "type": "integer"
          },
          "pull_request": {
            "anyOf": [
              {
                "properties": {
                  "additions": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "author": {
                    "properties": {
                      "avatar_url": {
                        "type": "string"
                      },
                      "id": {
                        "type": "integer"
                      },
                      "login": {
                        "type": "string"
                      },
                      "name": {
                        "type": "object"
                      },
                      "type": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "avatar_url",
                      "id",
                      "login",
                      "name",
                      "type"
                    ],
                    "type": "object"
                  },
                  "base": {
                    "properties": {
                      "ref": {
                        "type": "string"
                      },
                      "sha": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "ref",
                      "sha"
                    ],
                    "type": "object"
                  },
                  "changed_files": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "commits": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "created_at": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "deletions": {
                    "anyOf": [
                      {
                        "type": "integer"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "head": {
                    "properties": {
                      "ref": {
                        "type": "string"
                      },
                      "sha": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "ref",
                      "sha"
                    ],
                    "type": "object"
                  },
                  "id": {
                    "type": "integer"
                  },
                  "merged_at": {
                    "anyOf": [
                      {
                        "type": "string"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "number": {
                    "type": "integer"
                  },
                  "repository": {
                    "properties": {
                      "id": {
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "owner": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "owner"
                    ],
                    "type": "object"
                  },
                  "status": {
                    "enum": [
                      "open",
                      "draft",
                      "merged",
                      "closed"
                    ],
                    "type": "string"
                  },
                  "title": {
                    "type": "string"
                  },
                  "updated_at": {
                    "format": "date-time",
                    "type": "string"
                  },
                  "url": {
                    "type": "string"
                  }
                },
                "required": [
                  "additions",
                  "author",
                  "base",
                  "changed_files",
                  "commits",
                  "created_at",
                  "deletions",
                  "head",
                  "id",
                  "merged_at",
                  "number",
                  "repository",
                  "status",
                  "title",
                  "updated_at",
                  "url"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "repository": {
            "properties": {
              "id": {
                "type": "integer"
              },
              "name": {
                "type": "string"
              },
              "owner": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "name",
              "owner"
            ],
            "type": "object"
          },
          "status": {
            "enum": [
              "running",
              "posting",
              "posted",
              "empty",
              "failed"
            ],
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        },
        "required": [
          "id",
          "url",
          "repository",
          "pull_request",
          "base_sha",
          "head_sha",
          "status",
          "blocking",
          "non_blocking",
          "created_at"
        ],
        "type": "object"
      },
      "type": "array"
    }
  },
  "required": [
    "reviews"
  ],
  "type": "object"
}
```
