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

> Retrieve recent webhook events with optional filtering

## Endpoint

```
GET /api/v1/events
```

Lists recent webhook events received from GitHub, optionally filtered by status.

## Authentication

Requires a valid JWT token in cookies (obtained via GitHub OAuth).

## Query Parameters

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

<ParamField query="status" type="string">
  Filter by event status: `pending`, `completed`, or `failed`
</ParamField>

## Response

Returns an array of event objects, ordered by creation time (most recent first).

<ResponseField name="id" type="integer">
  Unique event identifier
</ResponseField>

<ResponseField name="event_type" type="string">
  GitHub event type (e.g., `pull_request`, `push`)
</ResponseField>

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

<ResponseField name="payload" type="object">
  Raw GitHub webhook payload (JSON string)
</ResponseField>

<ResponseField name="created_at" type="string">
  ISO 8601 timestamp when event was received
</ResponseField>

<ResponseField name="processed_at" type="string">
  ISO 8601 timestamp when event processing completed (null if pending)
</ResponseField>

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://your-backend.railway.app/api/v1/events?limit=10&status=completed \
    -H "Cookie: access_token=your_jwt_token"
  ```

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

  async with httpx.AsyncClient() as client:
      response = await client.get(
          "https://your-backend.railway.app/api/v1/events",
          params={"limit": 10, "status": "completed"},
          cookies={"access_token": "your_jwt_token"}
      )
      events = response.json()
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://your-backend.railway.app/api/v1/events?limit=10&status=completed',
    {
      credentials: 'include',
    }
  );
  const events = await response.json();
  ```
</CodeGroup>

## Example Response

```json theme={null}
[
  {
    "id": 42,
    "event_type": "pull_request",
    "status": "completed",
    "payload": "{\"action\":\"opened\",\"number\":123,...}",
    "created_at": "2026-03-10T14:30:00Z",
    "processed_at": "2026-03-10T14:30:15Z"
  },
  {
    "id": 41,
    "event_type": "pull_request",
    "status": "completed",
    "payload": "{\"action\":\"synchronize\",\"number\":122,...}",
    "created_at": "2026-03-10T12:15:00Z",
    "processed_at": "2026-03-10T12:15:12Z"
  }
]
```

## Use Cases

* **Monitoring**: Track webhook delivery and processing success rates
* **Debugging**: Identify failed events that need investigation
* **Analytics**: Analyze event volume and types over time
* **Auditing**: Review webhook activity for compliance

## Related Endpoints

<CardGroup cols={2}>
  <Card title="Event Details" icon="magnifying-glass" href="/api/events/details">
    Get detailed information about a specific event
  </Card>

  <Card title="Reviews List" icon="list" href="/api/reviews/list">
    View PR reviews generated from events
  </Card>
</CardGroup>
