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

# Get Webhook Deliveries

> Get delivery logs for a webhook

## Overview

Retrieve the delivery history for a specific webhook. Use this to monitor webhook delivery status, debug failures, and track retry attempts.

## Authentication

<ParamField header="X-Api-Key" type="string" required>
  Your API key with Write scope

  ```
  X-Api-Key: daya_sk_YOUR_API_KEY
  ```
</ParamField>

## Path Parameters

<ParamField path="id" type="string" required>
  Webhook ID (UUID)

  **Example:** `770e8400-e29b-41d4-a716-446655440000`
</ParamField>

## Query Parameters

<ParamField query="limit" type="integer">
  Number of logs to return

  **Default:** `50`

  **Range:** `1` to `100`
</ParamField>

<ParamField query="offset" type="integer">
  Offset for pagination

  **Default:** `0`
</ParamField>

## Request Examples

<CodeGroup>
  ```bash cURL theme={null}
  curl --request GET \
    --url 'https://api.pro.daya.co/public/v1/webhooks/770e8400-e29b-41d4-a716-446655440000/deliveries?limit=20' \
    --header 'X-Api-Key: daya_sk_YOUR_API_KEY'
  ```

  ```javascript JavaScript theme={null}
  const webhookId = '770e8400-e29b-41d4-a716-446655440000';

  const response = await fetch(
    `https://api.pro.daya.co/public/v1/webhooks/${webhookId}/deliveries?limit=20`,
    {
      headers: { 'X-Api-Key': 'daya_sk_YOUR_API_KEY' }
    }
  );

  const data = await response.json();
  console.log('Delivery logs:', data.data);
  ```

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

  webhook_id = '770e8400-e29b-41d4-a716-446655440000'
  headers = {'X-Api-Key': 'daya_sk_YOUR_API_KEY'}

  response = requests.get(
      f'https://api.pro.daya.co/public/v1/webhooks/{webhook_id}/deliveries',
      headers=headers,
      params={'limit': 20}
  )

  logs = response.json()
  print(f"Delivery logs: {logs['data']}")
  ```

  ```go Go theme={null}
  package main

  import (
      "encoding/json"
      "fmt"
      "net/http"
  )

  func main() {
      req, _ := http.NewRequest("GET", "https://api.pro.daya.co/public/v1/webhooks/770e8400-e29b-41d4-a716-446655440000/deliveries?limit=20", nil)
      req.Header.Set("X-Api-Key", "daya_sk_YOUR_API_KEY")

      client := &http.Client{}
      resp, err := client.Do(req)
      if err != nil {
          panic(err)
      }
      defer resp.Body.Close()

      var result map[string]interface{}
      json.NewDecoder(resp.Body).Decode(&result)
      fmt.Println("Delivery logs:", result["data"])
  }
  ```
</CodeGroup>

## Response

<ResponseField name="success" type="boolean" required>
  Indicates if the request was successful
</ResponseField>

<ResponseField name="message" type="string" required>
  Human-readable response message
</ResponseField>

<ResponseField name="data" type="array" required>
  Array of delivery log objects

  <Expandable title="delivery log properties">
    <ResponseField name="id" type="string">
      Unique delivery log identifier (UUID)
    </ResponseField>

    <ResponseField name="event_id" type="string">
      Event identifier (UUID)
    </ResponseField>

    <ResponseField name="event_type" type="string">
      Type of event

      **Values:** `order.created`, `order.filled`, `order.partially_filled`, `order.cancelled`, `order.rejected`, `trade.executed`, `deposit.completed`, `crypto.deposit.completed`
    </ResponseField>

    <ResponseField name="status" type="string">
      Delivery status

      **Values:** `pending`, `delivered`, `failed`, `retrying`
    </ResponseField>

    <ResponseField name="attempts" type="integer">
      Number of delivery attempts made
    </ResponseField>

    <ResponseField name="max_attempts" type="integer">
      Maximum delivery attempts allowed
    </ResponseField>

    <ResponseField name="response_status_code" type="integer">
      HTTP response status code from your endpoint (if any)
    </ResponseField>

    <ResponseField name="last_error" type="string">
      Last error message (if any)
    </ResponseField>

    <ResponseField name="last_attempt_at" type="string">
      Timestamp of last delivery attempt (ISO 8601)
    </ResponseField>

    <ResponseField name="next_retry_at" type="string">
      Timestamp of next retry attempt (ISO 8601, if retrying)
    </ResponseField>

    <ResponseField name="delivered_at" type="string">
      Timestamp when successfully delivered (ISO 8601)
    </ResponseField>

    <ResponseField name="created_at" type="string">
      ISO 8601 creation timestamp
    </ResponseField>
  </Expandable>
</ResponseField>

### Success Response

<ResponseExample>
  ```json 200 OK theme={null}
  {
    "success": true,
    "message": "Delivery logs retrieved successfully",
    "data": [
      {
        "id": "880e8400-e29b-41d4-a716-446655440000",
        "event_id": "550e8400-e29b-41d4-a716-446655440000",
        "event_type": "order.filled",
        "status": "delivered",
        "attempts": 1,
        "max_attempts": 10,
        "response_status_code": 200,
        "last_error": null,
        "last_attempt_at": "2024-01-15T10:30:01Z",
        "next_retry_at": null,
        "delivered_at": "2024-01-15T10:30:01Z",
        "created_at": "2024-01-15T10:30:00Z"
      },
      {
        "id": "880e8400-e29b-41d4-a716-446655440001",
        "event_id": "550e8400-e29b-41d4-a716-446655440001",
        "event_type": "order.cancelled",
        "status": "retrying",
        "attempts": 3,
        "max_attempts": 10,
        "response_status_code": 500,
        "last_error": "Internal Server Error",
        "last_attempt_at": "2024-01-15T10:35:00Z",
        "next_retry_at": "2024-01-15T10:40:00Z",
        "delivered_at": null,
        "created_at": "2024-01-15T10:00:00Z"
      },
      {
        "id": "880e8400-e29b-41d4-a716-446655440002",
        "event_id": "550e8400-e29b-41d4-a716-446655440002",
        "event_type": "trade.executed",
        "status": "failed",
        "attempts": 10,
        "max_attempts": 10,
        "response_status_code": 0,
        "last_error": "Connection timeout",
        "last_attempt_at": "2024-01-14T22:00:00Z",
        "next_retry_at": null,
        "delivered_at": null,
        "created_at": "2024-01-14T08:00:00Z"
      }
    ],
    "timestamp": "2024-01-15T10:35:00Z"
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 400 Bad Request - Invalid ID theme={null}
  {
    "success": false,
    "message": "Validation error",
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Invalid webhook ID format"
    }
  }
  ```

  ```json 404 Not Found theme={null}
  {
    "success": false,
    "message": "Webhook not found",
    "error": {
      "code": "WEBHOOK_NOT_FOUND",
      "message": "No webhook found with the specified ID"
    }
  }
  ```

  ```json 401 Unauthorized theme={null}
  {
    "success": false,
    "message": "Unauthorized",
    "error": {
      "code": "API_KEY_INVALID",
      "message": "The provided API key is invalid"
    }
  }
  ```
</ResponseExample>

## Delivery Status

| Status      | Description                           |
| ----------- | ------------------------------------- |
| `pending`   | Event queued, not yet attempted       |
| `delivered` | Successfully delivered (2xx response) |
| `retrying`  | Delivery failed, will retry           |
| `failed`    | All retry attempts exhausted          |

## Retry Behavior

Failed deliveries are retried with exponential backoff:

| Attempt | Delay After Previous |
| ------- | -------------------- |
| 1       | 10 seconds           |
| 2       | 30 seconds           |
| 3       | 1 minute             |
| 4       | 5 minutes            |
| 5       | 15 minutes           |
| 6       | 30 minutes           |
| 7       | 1 hour               |
| 8       | 2 hours              |
| 9       | 4 hours              |
| 10      | 8 hours              |

After 10 failed attempts, the delivery is marked as `failed` and the webhook may be automatically disabled.

## Rate Limits

* **100 requests per minute** per API key

## Next Steps

<CardGroup cols={2}>
  <Card title="Get Webhook" icon="eye" href="/pro/api-reference/get-webhook">
    View webhook details
  </Card>

  <Card title="Update Webhook" icon="pen" href="/pro/api-reference/update-webhook">
    Update webhook configuration
  </Card>

  <Card title="Webhook Overview" icon="bell" href="/pro/webhooks/overview">
    Learn about webhook events
  </Card>

  <Card title="Webhook Verification" icon="shield-check" href="/pro/webhooks/verification">
    Verify webhook signatures
  </Card>
</CardGroup>
