Ingest an event
Submit an event for asynchronous rule evaluation. Resubmitting the same idempotency_key for a program returns the existing event instead of creating a new one.
202 Accepted immediately. A worker picks up the event, evaluates all matching rules, and executes their actions.
Identify the participant with exactly one of external_id or participant_id. Pass event_timestamp for when the event occurred and event_data containing the payload your rules will evaluate against. Optionally set recipient_id or recipient_external_id to route rewards to a different participant (e.g. gifting).
The idempotency_key is required and scoped per program. Submitting the same key again returns the same event identity without reprocessing, even if the payload differs. To correct or replace an event, submit a new event with a new idempotency key. 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. The on_unknown_participant setting controls creation of new participants only.
Existing participants are automatically enrolled in the target program if not already members. Inactive enrollments (FROZEN, LOCKED, or CLOSED) are reactivated. Enrollment behavior applies regardless of the on_unknown_participant setting.
Business validation (program existence and status, participant resolution) happens asynchronously. A 202 Accepted response confirms receipt, not that the event is valid or will complete. Subscribe to event.failed webhooks for error notification. Failed events expose a machine-readable error_code (when the failure has a classified code, such as participant_suspended or program_inactive) on both the event resource and the event.failed webhook payload.
Read-after-write is not immediate: in queue-based ingestion mode the returned id may briefly 404 on GET /v1/events/{id} and GET /v1/events/by-key (typically well under a second) until the async consumer materializes the event. The ID is durable; poll until it resolves. Every accepted submission eventually becomes readable, either as a processed event or as status FAILED with an error_code if it was rejected asynchronously.
Events whose resolved actor or recipient is SUSPENDED or CLOSED are rejected before any rule runs: as a 422 with code participant_suspended or participant_closed when identities resolve synchronously, or as a terminal FAILED event with the same error_code in queue-based mode.
Numeric values in event_data whose magnitude exceeds 2^53 are rejected with 400 amount_precision_exceeded; send very large values as strings to preserve them exactly.
Authorizations
API key passed in the X-API-Key header.
Body
Event with event_data for rule evaluation
EventData contains the event data used for rule condition evaluation
EventTimestamp is when the event occurred (used for rule evaluation)
"2024-01-15T10:30:00Z"
IdempotencyKey ensures this event is only processed once (must be unique per program)
1 - 255"order-12345-completed"
ProgramID links this event to a specific program for rule evaluation
"550e8400-e29b-41d4-a716-446655440000"
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.
1 - 255"user_abc123"
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.
"550e8400-e29b-41d4-a716-446655440000"
RecipientExternalID optionally specifies a different participant (by external ID) to receive rewards (e.g., referral / gifting). Mutually exclusive with RecipientID. Auto-creates the recipient if this ID doesn't exist (based on the program's on_unknown_participant setting), mirroring external_id. An existing recipient is automatically enrolled in the target program if not already a member.
1 - 255"user_xyz789"
RecipientID optionally specifies a different participant (by UUID) to receive rewards (e.g., gifting). Mutually exclusive with RecipientExternalID. Must reference an existing participant; they are automatically enrolled in the target program if not already a member.
"550e8400-e29b-41d4-a716-446655440001"
Response
Event accepted for async processing (new or duplicate)
When the event occurred (from the ingestion request)
"2024-01-15T10:30:00Z"
Your system's identifier for the user, if provided
"user_abc123"
Unique identifier for the created event
"550e8400-e29b-41d4-a716-446655440000"
Client-provided unique key for deduplication
"order-12345-completed"
Participant UUID. May be null if only external_id was provided (resolution may be deferred to async processing).
"550e8400-e29b-41d4-a716-446655440002"
Program the event was ingested into
"550e8400-e29b-41d4-a716-446655440001"
Processing status (PENDING on initial ingestion)
"PENDING"