Events and Deliveries

Understanding the difference between events and deliveries is important when working with webhooks.

Events

A Webhook Event represents something that happened in the Lynkwell system. Events are created once and contain:

  • id - Unique identifier for the event
  • eventType - The type of event (e.g., ocpp.message)
  • createdAt - When the event occurred
  • payload - The event data

Events are retained for 30 days and can be viewed via the API.

Deliveries

A Webhook Delivery represents an attempt to send an event to a specific endpoint. One event can have multiple deliveries if you have multiple webhook endpoints subscribed to the same event type.

Deliveries contain:

  • id - Unique identifier for the delivery
  • eventId - The event this delivery is for
  • eventType - The type of event
  • payload - The event data
  • status - Current status: success, or failed
  • attempts - Array of delivery attempts with timestamps and any errors

Deliveries are retained for 30 days. This extended retention window ensures you have ample time to investigate failed deliveries and manually resend them if needed.

Relationship

Event (ocpp.message)
├── Delivery → Endpoint A (success)
├── Delivery → Endpoint B (failed)
└── Delivery → Endpoint C (success)

This separation allows you to:

  • See the original event data regardless of delivery status
  • Track delivery attempts independently for each endpoint
  • Resend failed deliveries without creating duplicate events

Webhook Payload Structure

When Lynkwell sends a webhook to your endpoint, the request body follows this structure:

{
  "id": "whevt_abc123",
  "type": "ocpp.message",
  "createdAt": "2024-01-15T10:30:00.000Z",
  "data": {
    // Event-specific payload
  }
}

The following headers are included with each webhook request:

HeaderDescription
Content-TypeAlways application/json
X-Webhook-Delivery-IdThe delivery ID
X-Webhook-TimestampUnix timestamp when the request was signed
X-Webhook-SignatureSignature for validating the request (see Validating Signatures)

Was this page helpful?