> ## Documentation Index
> Fetch the complete documentation index at: https://docs.deck.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Events

> React to changes in real time. Deck pushes events to your infrastructure as they happen.

Deck pushes structured events to your infrastructure as things happen. Credentials authenticate, tasks complete, files get captured. Every state change produces an event you can subscribe to and filter.

## Event structure

Events follow an `object.action` naming convention. The `data` field contains a summary of the resource at the time of the event.

```json theme={null}
{
  "id": "evt_a1b2c3d4...",
  "object": "event",
  "type": "task_run.completed",
  "data": {
    "id": "trun_a1b2c3d4...",
    "object": "task_run",
    "status": "completed",
    "result": "success",
    "task_id": "task_a1b2c3d4...",
    "credential_id": "cred_a1b2c3d4...",
    "agent_id": "agt_a1b2c3d4...",
    "source_id": "src_a1b2c3d4...",
    "runtime_ms": 12453,
    "created_at": "2025-01-15T09:30:00Z",
    "updated_at": "2025-01-15T09:31:15Z"
  },
  "created_at": "2025-01-15T09:31:15Z"
}
```

## Destinations

Events are delivered to destinations you configure. Deck supports webhooks and native cloud infrastructure out of the box.

| Type                  | Identifier         |
| --------------------- | ------------------ |
| **Webhook**           | `webhook`          |
| **AWS SQS**           | `aws_sqs`          |
| **AWS Kinesis**       | `aws_kinesis`      |
| **AWS S3**            | `aws_s3`           |
| **GCP Pub/Sub**       | `gcp_pubsub`       |
| **Azure Service Bus** | `azure_servicebus` |
| **RabbitMQ**          | `rabbitmq`         |
| **Hookdeck**          | `hookdeck`         |

Create a destination in the Console or via the API and subscribe to the events you care about:

```json theme={null}
POST /v2/event-destinations

{
  "name": "Production Webhook",
  "type": "webhook",
  "webhook": {
    "url": "https://your-app.com/webhooks/deck"
  },
  "events": ["credential.verified", "task_run.completed", "task_run.failed"]
}
```

Use `"events": ["*"]` to subscribe to everything.

## Deliveries and retries

Each event is delivered independently to every subscribed destination. For webhooks, return a `2xx` within 5 seconds to acknowledge. For cloud destinations, delivery is handled natively.

Failed deliveries retry up to **10 times** with exponential backoff (base 2, starting at 30 seconds). Track delivery status via `GET /v2/event-destinations/{id}/event-deliveries`.

## Retention

Events are stored for **30 days**.

<CardGroup cols={2}>
  <Card title="Events reference" icon="list" href="/events/events-reference">
    Full list of event types by resource.
  </Card>

  <Card title="Destinations & deliveries" icon="satellite-dish" href="/events/destinations-and-deliveries">
    Configure destinations, verify webhook signatures, and track delivery status.
  </Card>

  <Card title="Webhook best practices" icon="shield-check" href="/events/webhook-best-practices">
    Build reliable, idempotent event consumers.
  </Card>

  <Card title="API reference" icon="code" href="/api-reference/events/list-events">
    Events, destinations, and deliveries endpoints.
  </Card>
</CardGroup>
