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 eventeventType- The type of event (e.g.,ocpp.message)createdAt- When the event occurredpayload- 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 deliveryeventId- The event this delivery is foreventType- The type of eventpayload- The event datastatus- Current status:success, orfailedattempts- 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:
| Header | Description |
|---|---|
Content-Type | Always application/json |
X-Webhook-Delivery-Id | The delivery ID |
X-Webhook-Timestamp | Unix timestamp when the request was signed |
X-Webhook-Signature | Signature for validating the request (see Validating Signatures) |
