Skip to main content
POST
/
v1
/
events
Ingest an event
curl --request POST \
  --url https://api.scrip.dev/v1/events \
  --header 'Content-Type: application/json' \
  --header 'X-API-Key: <api-key>' \
  --data '
{
  "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"
}
'
{
  "event_timestamp": "2023-11-07T05:31:56Z",
  "external_id": "<string>",
  "id": "<string>",
  "idempotency_key": "<string>",
  "participant_id": "<string>",
  "program_id": "<string>",
  "status": "<string>"
}
Sends an event to a program for a specific participant. The API returns 200 OK immediately with the event in PENDING status. A worker picks up the event, evaluates all matching rules, and executes their actions asynchronously. The idempotency_key is required and scoped per program. Submitting the same key with an identical payload returns the original event without reprocessing. Submitting the same key with a different payload returns 409 Conflict (idempotency_conflict). Use deterministic keys like order-12345-completed, not random UUIDs. If the participant doesn’t exist yet and the program’s on_unknown_participant is CREATE, Scrip creates the participant and processes the event in one step. Existing participants are automatically enrolled in the target program if not already members. Inactive enrollments (FROZEN, LOCKED, or CLOSED) are reactivated. The on_unknown_participant setting controls creation of new participants only — it does not affect enrollment of existing ones.
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

Event with event_data for rule evaluation

event_data
object
required

EventData contains the event data used for rule condition evaluation

event_timestamp
string<date-time>
required

EventTimestamp is when the event occurred (used for rule evaluation)

Example:

"2024-01-15T10:30:00Z"

idempotency_key
string
required

IdempotencyKey ensures this event is only processed once (must be unique per program)

Required string length: 1 - 255
Example:

"order-12345-completed"

program_id
string<uuid>
required

ProgramID links this event to a specific program for rule evaluation

Example:

"550e8400-e29b-41d4-a716-446655440000"

external_id
string

Your system's identifier for the user who triggered this event. Mutually exclusive with participant_id - exactly one must be provided. Auto-creates a participant if this ID doesn't exist (based on the program's on_unknown_participant setting). Existing participants are automatically enrolled in the target program.

Required string length: 1 - 255
Example:

"user_abc123"

participant_id
string<uuid>

Scrip's UUID for the participant. Mutually exclusive with external_id - exactly one must be provided. The participant is automatically enrolled in the target program if not already a member.

Example:

"550e8400-e29b-41d4-a716-446655440000"

recipient_external_id
string

RecipientExternalID optionally specifies a different participant (by external ID) to receive rewards. Mutually exclusive with RecipientID. The recipient is automatically enrolled in the target program if not already a member.

Required string length: 1 - 255
Example:

"user_xyz789"

recipient_id
string<uuid>

RecipientID optionally specifies a different participant (by UUID) to receive rewards (e.g., gifting). Mutually exclusive with RecipientExternalID. The recipient is automatically enrolled in the target program if not already a member.

Example:

"550e8400-e29b-41d4-a716-446655440001"

Response

Event accepted for async processing (new or duplicate)

event_timestamp
string<date-time>

When the event occurred (from the ingestion request)

external_id
string

Your system's identifier for the user, if provided

id
string

Unique identifier for the created event

idempotency_key
string

Client-provided unique key for deduplication

participant_id
string

Participant UUID. May be null if only external_id was provided (resolution may be deferred to async processing).

program_id
string

Program the event was ingested into

status
string

Processing status (PENDING on initial ingestion)