Skip to main content
POST
/
v1
/
events
/
batch
Ingest events in batch
curl --request POST \
  --url https://api.scrip.dev/v1/events/batch \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "events": [
    {
      "event_data": {},
      "event_timestamp": "2024-01-15T10:30:00Z",
      "idempotency_key": "order-12345-completed",
      "program_id": "550e8400-e29b-41d4-a716-446655440000",
      "external_id": "user_abc123",
      "participant_id": "550e8400-e29b-41d4-a716-446655440000",
      "recipient_external_id": "user_xyz789",
      "recipient_id": "550e8400-e29b-41d4-a716-446655440001"
    }
  ]
}
'
{
  "error_count": 1,
  "results": [
    {
      "error": "invalid program_id",
      "event": {
        "event_timestamp": "2023-11-07T05:31:56Z",
        "external_id": "<string>",
        "id": "<string>",
        "idempotency_key": "<string>",
        "participant_id": "<string>",
        "program_id": "<string>",
        "status": "<string>"
      },
      "index": 0,
      "status": "accepted"
    }
  ],
  "success_count": 9,
  "total": 10
}
Sends up to 100 events in a single request. Each event in the batch is processed independently: individual events can succeed or fail without affecting the others. The response includes a per-event result array with the same ordering as the input. Batch ingestion follows the same semantics as single-event ingestion. Each event requires an idempotency_key scoped to its program_id. Duplicate keys with identical payloads return the original event; duplicate keys with different payloads return 409 Conflict (idempotency_conflict). This endpoint returns 200 OK once all events are enqueued. Processing happens asynchronously. Check individual event statuses via the get event endpoint or by polling the list endpoint with the relevant filters.
For usage patterns and examples, see the Event Processing guide.

Authorizations

X-API-Key
string
header
required

API key passed in the X-API-Key header.

Body

application/json

Batch of events

events
object[]
required

Events is a list of events to ingest (max 100 per request)

Required array length: 1 - 100 elements

Response

Batch accepted for async processing

error_count
integer

ErrorCount is the number of events that failed

Example:

1

results
object[]

Results contains the outcome for each event

success_count
integer

SuccessCount is the number of events successfully ingested

Example:

9

total
integer

Total is the number of events in the request

Example:

10