Skip to content

Events API

Events are webhook payloads received by sources.

Endpoints

MethodPathDescription
GET/api/organizations/{orgId}/eventsList events
GET/api/organizations/{orgId}/events/{id}Get event
POST/api/organizations/{orgId}/events/{id}/replayReplay event
DELETE/api/organizations/{orgId}/events/{id}Delete event

Event Object

json
{
  "id": "evt_abc123",
  "sourceId": "src_xyz789",
  "source": {
    "id": "src_xyz789",
    "name": "GitHub"
  },
  "status": "delivered",
  "headers": {
    "Content-Type": "application/json",
    "X-GitHub-Event": "push",
    "X-GitHub-Delivery": "72d3162e-cc78-11e3-81ab-4c9367dc0958"
  },
  "payloadSize": 2456,
  "payloadHash": "sha256:abc123...",
  "deliveriesCount": 2,
  "deliveriesSucceeded": 2,
  "deliveriesFailed": 0,
  "receivedAt": "2024-01-15T10:30:00Z",
  "createdAt": "2024-01-15T10:30:00Z"
}

Status Values

StatusDescription
pendingAwaiting delivery
deliveredAll deliveries succeeded
partialSome deliveries failed
failedAll deliveries failed

List Events

http
GET /api/organizations/{orgId}/events

Query Parameters

ParameterTypeDescription
pagenumberPage number (default: 1)
pageSizenumberItems per page (default: 20, max: 100)
sourceIdstringFilter by source
statusstringFilter by status
fromstringStart date (ISO 8601)
tostringEnd date (ISO 8601)
searchstringSearch in payload

Example

bash
curl "https://api.webhookrelay.com/api/organizations/org_123/events?sourceId=src_xyz&status=failed" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

json
{
  "data": [
    {
      "id": "evt_abc123",
      "sourceId": "src_xyz789",
      "status": "delivered",
      "headers": {
        "X-GitHub-Event": "push"
      },
      "payloadSize": 2456,
      "deliveriesCount": 2,
      "deliveriesSucceeded": 2,
      "receivedAt": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "total": 1523,
    "page": 1,
    "pageSize": 20
  }
}

Get Event

http
GET /api/organizations/{orgId}/events/{id}

Query Parameters

ParameterTypeDescription
includePayloadbooleanInclude full payload (default: false)
includeDeliveriesbooleanInclude delivery details (default: false)

Example

bash
curl "https://api.webhookrelay.com/api/organizations/org_123/events/evt_abc123?includePayload=true&includeDeliveries=true" \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

json
{
  "id": "evt_abc123",
  "sourceId": "src_xyz789",
  "source": {
    "id": "src_xyz789",
    "name": "GitHub"
  },
  "status": "delivered",
  "headers": {
    "Content-Type": "application/json",
    "X-GitHub-Event": "push",
    "X-GitHub-Delivery": "72d3162e-cc78-11e3-81ab-4c9367dc0958"
  },
  "payload": {
    "ref": "refs/heads/main",
    "repository": {
      "full_name": "user/repo"
    },
    "pusher": {
      "name": "user"
    }
  },
  "payloadSize": 2456,
  "deliveries": [
    {
      "id": "dlv_111",
      "destinationId": "dst_slack1",
      "status": "delivered",
      "attemptCount": 1,
      "latency": 245,
      "deliveredAt": "2024-01-15T10:30:01Z"
    },
    {
      "id": "dlv_222",
      "destinationId": "dst_api",
      "status": "delivered",
      "attemptCount": 1,
      "latency": 180,
      "deliveredAt": "2024-01-15T10:30:01Z"
    }
  ],
  "receivedAt": "2024-01-15T10:30:00Z"
}

Replay Event

Re-deliver an event to all destinations:

http
POST /api/organizations/{orgId}/events/{id}/replay

Request Body (Optional)

FieldTypeDescription
destinationIdsstring[]Specific destinations (default: all)

Example

bash
# Replay to all destinations
curl -X POST https://api.webhookrelay.com/api/organizations/org_123/events/evt_abc123/replay \
  -H "Authorization: Bearer YOUR_TOKEN"

# Replay to specific destinations
curl -X POST https://api.webhookrelay.com/api/organizations/org_123/events/evt_abc123/replay \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"destinationIds": ["dst_slack1"]}'

Response

json
{
  "message": "Event queued for replay",
  "deliveriesCreated": 2
}

Delete Event

http
DELETE /api/organizations/{orgId}/events/{id}

WARNING

Deleting an event also deletes all associated deliveries and the stored payload.

Example

bash
curl -X DELETE https://api.webhookrelay.com/api/organizations/org_123/events/evt_abc123 \
  -H "Authorization: Bearer YOUR_TOKEN"

Response

204 No Content

Event Payload

Get just the event payload:

http
GET /api/organizations/{orgId}/events/{id}/payload

Response

Returns the raw payload as received:

json
{
  "ref": "refs/heads/main",
  "repository": {
    "full_name": "user/repo"
  },
  "commits": [...]
}

Event Timeline

Get detailed timing information:

http
GET /api/organizations/{orgId}/events/{id}/timeline

Response

json
{
  "received": "2024-01-15T10:30:00.000Z",
  "validated": "2024-01-15T10:30:00.005Z",
  "queued": "2024-01-15T10:30:00.010Z",
  "deliveries": [
    {
      "destinationId": "dst_slack1",
      "destinationName": "Slack #dev",
      "attempts": [
        {
          "attemptNumber": 1,
          "startedAt": "2024-01-15T10:30:00.015Z",
          "completedAt": "2024-01-15T10:30:00.260Z",
          "status": "success",
          "statusCode": 200,
          "latency": 245
        }
      ]
    }
  ],
  "totalDuration": 260
}

Bulk Operations

Bulk Replay

http
POST /api/organizations/{orgId}/events/bulk/replay

Request Body

FieldTypeDescription
eventIdsstring[]Event IDs to replay
destinationIdsstring[]Specific destinations (optional)

Example

bash
curl -X POST https://api.webhookrelay.com/api/organizations/org_123/events/bulk/replay \
  -H "Authorization: Bearer YOUR_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "eventIds": ["evt_1", "evt_2", "evt_3"]
  }'

Response

json
{
  "message": "Events queued for replay",
  "eventsQueued": 3,
  "deliveriesCreated": 6
}

Error Responses

404 Not Found

Event not found:

json
{
  "error": "Not Found",
  "message": "Event with ID evt_xyz not found",
  "code": "RESOURCE_NOT_FOUND"
}

410 Gone

Event payload expired (retention policy):

json
{
  "error": "Gone",
  "message": "Event payload has been deleted due to retention policy",
  "code": "PAYLOAD_EXPIRED"
}

Released under the MIT License.