# List webhook events

> Source: https://truto.one/docs/api-reference/admin/webhook-events/list/

`GET /webhook-event`

Resource: **Webhook Events**

## Query parameters

- **`environment_id`** _(string)_
  The environment whose events to list. Required when you call with a dashboard session; an API token uses its own environment.
- **`webhook_id`** _(string)_
  Only events for this webhook.
- **`integrated_account_id`** _(string)_
  Only events about this integrated account.
- **`event`** _(string)_
  Only events of this type.
- **`status`** _(string)_
  Only events in this state.
  Allowed: `pending`, `failed`, `delivered`
- **`created_at`** _(object)_
  A window on when the events were created, `created_at[gt]` and `created_at[lt]`.
- **`limit`** _(integer)_
  The most events to return.
- **`next_cursor`** _(string)_
  The `next_cursor` from the previous page.

## Response body

- **`result`** _(array<object>)_
  - **`id`** _(string)_
    The event's ID, the same `id` your endpoint receives in the payload. A resend keeps it, so you can deduplicate on it.
  - **`webhook_id`** _(string)_
    The webhook the event is for.
  - **`event`** _(string)_
    The event type.
  - **`status`** _(string)_
    `pending`: waiting for its first attempt, a retry, or a resend. `failed`: it was not delivered: every attempt failed, its five-minute retry window ran out, or your endpoint answered 400, 404 or 413, which are not retried. You can resend it. `delivered`: your endpoint answered with a 2xx.
    Allowed: `pending`, `failed`, `delivered`
  - **`integrated_account_id`** _(string)_
    The integrated account the event is about, when it is about one. Null for events stored before this field existed.
  - **`attempts`** _(integer)_
    Delivery attempts since the event was created or last resent.
  - **`last_error`** _(string)_
    Why the last attempt failed. Null once the event is delivered.
  - **`endpoint_status`** _(integer)_
    The HTTP status your endpoint answered on the last attempt. Null when it did not answer (a timeout or a connection error) or no attempt has been made.
  - **`created_at`** _(string)_
    When Truto stored the event, to the second.
  - **`delivered_at`** _(string)_
    When your endpoint accepted the event.
  - **`failed_at`** _(string)_
    When the event was marked failed.
  - **`payload`** _(object)_
    The event as it was or will be sent: the JSON body your endpoint receives. `X-Truto-Signature` signs it with the webhook's secret at the time it is sent.
- **`next_cursor`** _(string)_
  Pass this as `next_cursor` for the next page; `null` on the last page.
- **`limit`** _(number)_

## Code examples

### curl

```bash
curl -X GET 'https://api.truto.one/webhook-event' \
  -H 'Authorization: Bearer <your_api_token>' \
  -H 'Content-Type: application/json'
```

### JavaScript

```javascript
const response = await fetch('https://api.truto.one/webhook-event', {
  method: 'GET',
  headers: {
    'Authorization': 'Bearer <your_api_token>',
    'Content-Type': 'application/json',
  },
});

const data = await response.json();
console.log(data);
```

### Python

```python
import requests

url = "https://api.truto.one/webhook-event"
headers = {
    "Authorization": "Bearer <your_api_token>",
    "Content-Type": "application/json",
}
params = {
}

response = requests.get(url, headers=headers, params=params)
print(response.json())
```
