Skip to main content
POST
Ingest an event
Validation and rule evaluation run asynchronously after Scrip returns 202 Accepted with a Location header for the event.
  • Outcome: Subscribe to event.completed and event.failed webhooks, or poll GET /v1/events/{event_id} (polling can briefly return 404 event_not_found while Scrip records the event). See Wait for the result.
  • Idempotency: idempotency_key is scoped per program. Reusing a key returns the existing event with 202 without reprocessing; reusing a key with a different payload keeps the original event and sends an event.rejected webhook.
  • Participants: Unknown external_id or recipient_external_id values auto-create the participant when the program’s on_unknown_participant is CREATE, and existing participants are enrolled automatically. Balance, counter, and tier actions fail the event with participant_inactive when either the event’s participant or the action’s target is SUSPENDED or CLOSED (tag, attribute, and scheduling actions still run).
  • Large integers: Numeric values in event_data above 2^53 return 400 amount_precision_exceeded. Pass larger integers as strings.
For examples and full lifecycle details, see the Event processing guide.

Authorizations

Authorization
string
header
default:sk_...
required

Send your API key as Authorization: Bearer <key>.

Headers

Idempotency-Key
string

Optional alternative to the body's idempotency_key field (1-255 printable ASCII characters). Used as the event's deduplication key within the program; repeating an event returns 202 Accepted without Idempotent-Replayed. If both header and body are sent, they must match.

Maximum string length: 255

Body

application/json

Event with event_data for rule evaluation

An event to ingest. Rules in the program evaluate it to decide what rewards to issue.

event_data
object
required

JSON object exposed to rule conditions and action expressions as event data. It must not contain a type key; send the name as event_type.

Example:
event_timestamp
string<date-time>
required

When the event occurred (RFC 3339). Rules evaluate against this timestamp rather than ingestion time.

Example:

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

event_type
string
required

The name of the event, such as purchase. It is 1 to 255 characters with no leading or trailing whitespace. Rules read it as event.type. Send it here, not inside event_data.

Required string length: 1 - 255
Example:

"purchase"

idempotency_key
string
required

Your key for this event within the program. Send it here or in the Idempotency-Key header. Sending the same key again returns the same event.

Required string length: 1 - 255
Example:

"order-1001-completed"

program_id
string<uuid>
required

Program that supplies the rules evaluated for this event

Example:

"8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01"

external_id
string

Your system's identifier for the participant who triggered this event. Mutually exclusive with participant_id.

Required string length: 1 - 255
Example:

"user_123"

participant_id
string<uuid>

Scrip's UUID for the participant. Mutually exclusive with external_id.

Example:

"f7a8b9c0-1d2e-4f3a-b4c5-d6e7f8a9b006"

recipient_external_id
string

Optional external identifier for a second participant (e.g. a referral or gift recipient), exposed to rules as recipient.id and recipient.external_id. Mutually exclusive with recipient_id.

Required string length: 1 - 255
Example:

"user_xyz789"

recipient_id
string<uuid>

Optional Scrip UUID for a second participant (e.g. a referral or gift recipient), exposed to rules as recipient.id and recipient.external_id. Mutually exclusive with recipient_external_id.

Example:

"f7a8b9c0-1d2e-4f3a-b4c5-d6e7f8a9b007"

Response

Event accepted for async processing (new or duplicate)

An event that Scrip accepted, with its id and processing status.

event_timestamp
string<date-time>

When the event occurred (from the ingestion request)

Example:

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

external_id
string

Your system's identifier for the user, if provided

Example:

"user_123"

id
string<uuid>

Unique identifier for the created event

Example:

"e5dc1b6a-7f3d-4e2a-8c1b-9a0f4d7e6c05"

idempotency_key
string

Client-provided unique key for deduplication

Example:

"order-1001-completed"

participant_id
string<uuid>

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

Example:

"f7a8b9c0-1d2e-4f3a-b4c5-d6e7f8a9b006"

program_id
string<uuid>

Program the event was ingested into

Example:

"8f14e45f-ceea-4e70-9df8-2a7d1b3c9f01"

status
enum<string>

The event's processing status right after it is accepted.

Available options:
PENDING,
PROCESSING,
COMPLETED,
FAILED
Example:

"PENDING"