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

# Get Event Delivery Logs

> Retrieve all delivery attempts for a specific event

# Get Event Delivery Logs

GET [https://api.baanx.com/v1/webhooks/events/\{eventId}/logs](https://api.baanx.com/v1/webhooks/events/\{eventId}/logs)
Retrieves delivery logs for a specific event across all webhook endpoints.

## Overview

Returns the event details alongside all webhook delivery attempts for that event. Use this to debug why an event wasn't delivered, check which webhooks received it, and verify delivery timing and responses.

## Authentication

This endpoint requires authentication via Bearer token:

```bash theme={null} theme={null}
Authorization: Bearer YOUR_ACCESS_TOKEN
```

## Request

### Headers

<ParamField header="Authorization" type="string" required>
  Bearer token for authentication
</ParamField>

### Path Parameters

<ParamField path="eventId" type="string (UUID)" required>
  Unique identifier of the event
</ParamField>

### Request Example

<CodeGroup>
  ```bash cURL theme={null} theme={null}
  curl -X GET https://api.baanx.com/v1/webhooks/events/550e8400-e29b-41d4-a716-446655440000/logs \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

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

  const response = await fetch(
    `https://api.baanx.com/v1/webhooks/events/${eventId}/logs`,
    {
      method: 'GET',
      headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
      }
    }
  );

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

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

  event_id = "550e8400-e29b-41d4-a716-446655440000"
  url = f"https://api.baanx.com/v1/webhooks/events/{event_id}/logs"
  headers = {
      "Authorization": "Bearer YOUR_ACCESS_TOKEN"
  }

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

  ```typescript TypeScript theme={null} theme={null}
  const getEventLogs = async (eventId: string) => {
    const response = await fetch(
      `https://api.baanx.com/v1/webhooks/events/${eventId}/logs`,
      {
        method: 'GET',
        headers: {
          'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
        }
      }
    );

    if (!response.ok) {
      throw new Error(`HTTP error! status: ${response.status}`);
    }

    return await response.json();
  };
  ```
</CodeGroup>

## Response

### 200 Success

<ResponseField name="event" type="object">
  The event that triggered deliveries. See [List Events](/api-reference/webhooks/list-events) for field descriptions.
</ResponseField>

<ResponseField name="logs" type="array">
  Array of delivery log entries, one per delivery attempt per webhook endpoint
</ResponseField>

<ResponseField name="logs[].id" type="string (UUID)">
  Unique identifier for this log entry
</ResponseField>

<ResponseField name="logs[].eventId" type="string (UUID)">
  ID of this event
</ResponseField>

<ResponseField name="logs[].webhookId" type="string (UUID)">
  ID of the webhook endpoint this delivery was attempted to
</ResponseField>

<ResponseField name="logs[].attemptNumber" type="integer">
  Delivery attempt number (1–6)
</ResponseField>

<ResponseField name="logs[].requestUrl" type="string">
  The URL the webhook was delivered to
</ResponseField>

<ResponseField name="logs[].requestHeaders" type="object">
  HTTP headers sent with the delivery, including `X-Timestamp` and `X-Signature`
</ResponseField>

<ResponseField name="logs[].requestBody" type="object">
  The webhook payload that was sent
</ResponseField>

<ResponseField name="logs[].responseStatus" type="integer | null">
  HTTP status code returned by your endpoint (`null` if the request failed to connect)
</ResponseField>

<ResponseField name="logs[].responseBody" type="string | null">
  Response body returned by your endpoint
</ResponseField>

<ResponseField name="logs[].errorMessage" type="string | null">
  Error message if delivery failed
</ResponseField>

<ResponseField name="logs[].deliveryStatus" type="string">
  Delivery status: `pending`, `processing`, `success`, or `failed`
</ResponseField>

<ResponseField name="logs[].durationMs" type="integer | null">
  Response time in milliseconds
</ResponseField>

<ResponseField name="logs[].createdAt" type="string (ISO 8601)">
  Timestamp of this delivery attempt
</ResponseField>

<ResponseField name="logs[].nextRetryAt" type="string (ISO 8601) | null">
  Scheduled time for next retry attempt, if applicable
</ResponseField>

<ResponseExample>
  ```json 200 - Success theme={null} theme={null}
  {
    "event": {
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "eventId": "660e8400-e29b-41d4-a716-446655440001",
      "tenant": "partner-name",
      "eventType": "kyc.status.changed",
      "payload": {
        "userId": "user-123",
        "status": "approved"
      },
      "userId": "user-123",
      "sourceService": "kyc-service",
      "status": "completed",
      "createdAt": "2025-12-29T10:00:00.000Z",
      "processedAt": "2025-12-29T10:00:05.000Z",
      "queuedAt": "2025-12-29T10:00:01.000Z"
    },
    "logs": [
      {
        "id": "aaa00000-e29b-41d4-a716-446655440000",
        "eventId": "660e8400-e29b-41d4-a716-446655440001",
        "webhookId": "770e8400-e29b-41d4-a716-446655440002",
        "attemptNumber": 1,
        "requestUrl": "https://api.partner.com/webhooks/kyc",
        "requestHeaders": {
          "Content-Type": "application/json",
          "X-Timestamp": "1704067205",
          "X-Signature": "abc123def456..."
        },
        "requestBody": {
          "eventType": "kyc.status.changed",
          "userId": "user-123",
          "status": "approved"
        },
        "responseStatus": 200,
        "responseBody": "{\"received\": true}",
        "errorMessage": null,
        "deliveryStatus": "success",
        "durationMs": 145,
        "createdAt": "2025-12-29T10:00:05.000Z",
        "nextRetryAt": null
      }
    ]
  }
  ```
</ResponseExample>

## Error Responses

<ResponseExample>
  ```json 401 - Unauthorized theme={null} theme={null}
  {
    "message": "Not authenticated"
  }
  ```

  ```json 403 - Forbidden theme={null} theme={null}
  {
    "message": "Not authorized"
  }
  ```

  ```json 404 - Not Found theme={null} theme={null}
  {
    "message": "Event not found"
  }
  ```

  ```json 503 - Service Unavailable theme={null} theme={null}
  {
    "message": "Notification service is not configured for this environment"
  }
  ```
</ResponseExample>

## Related Endpoints

* `GET /v1/webhooks/events/{eventId}/status` - Lightweight status check for this event
* `POST /v1/webhooks/events/{eventId}/retry` - Retry delivery for this event
* `GET /v1/webhooks/{id}/logs` - View all delivery logs for a specific webhook endpoint
