# Retrieving Webhook Events

## Overview

Webhook events contain details and bodies of webhooks sent in the past 30 days.

See our [API Reference](https://app.gitbook.com/s/8lXIp71Ct5qCUhXjko2q/events/webhook-events/get-all-webhook-events) for a full description of each of the below calls.

## Retrieving List of Event Types

You can fetch a list of all event types available at Violet by performing the following request.

```bash
curl GET https://sandbox-api.violet.io/v1/events/webhooks/event/types \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"
```

## Retrieving Events for All Webhooks

You can fetch all events for all webhook that belong to your app.

```bash
curl GET https://sandbox-api.violet.io/v1/events/webhooks/all/events?page=1&size=25 \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"
```

## Retrieving Events for a Webhook

You can fetch all events for a specific webhook.

```bash
curl GET https://sandbox-api.violet.io/v1/events/webhooks/{webhook_id}/events?page=1&size=25 \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"
```

## Retrieving a Single Event for a Webhook

You can fetch an event from a specific webhook given its id.

```bash
curl GET https://sandbox-api.violet.io/v1/events/webhooks/{webhook_id}/events/{event_id} \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"
```

## Retrieving a Single Event Body for a Webhook

You can fetch an event body from a specific webhook given its id.

```bash
curl GET https://sandbox-api.violet.io/v1/events/webhooks/{webhook_id}/events/{event_id}/body \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"
```

## Retrieving a Single Event Headers for a Webhook

You can fetch the headers that were sent for a specific webhook event by using the combination of webhook and event IDs.

```bash
curl GET https://sandbox-api.violet.io/v1/events/webhooks/{webhook_id}/events/{event_id}/headers \
-H "X-Violet-App-Id: your-app-id-here" \
-H "X-Violet-App-Secret: your-app-secret-here" \
-H "X-Violet-Token: your-token-here" \
-H "Content-type: application/json"
```
