Skip to main content
The Scrip API is a REST API. All requests and responses use JSON. The current version is v1. Scrip has no client libraries: every example is plain HTTP, and you can generate a client from the OpenAPI spec or point AI tools at the AI resources.
That is the production address. The sandbox has its own address and sk_test_ keys; see Environments.
If you’re new to Scrip, start with the Quickstart to create a program and process your first event, or read Core Concepts for an overview of the data model.

Most common endpoints

Most applications only call a small set of endpoints as users earn and spend rewards (see Which endpoints you need):

Versioning

Scrip has one live API version at /v1, with no version header to send. The sandbox serves the same version at https://api-sandbox.scrip.dev/v1. Adding a field, endpoint, or error code is non-breaking; ignore fields you do not recognize. The OpenAPI spec always describes the live API. Webhook payloads carry an api_version date for the data object contract, fixed when the event is created so retries keep the original shape; see Payload policy.

Authentication

Every request requires an API key as a bearer token in the Authorization header:
Keys use the sk_ prefix and can read and write every resource in your organization through the routes in this reference. Create and manage keys in the dashboard at Developers, API keys. Send Content-Type: application/json on every request that has a body, or the API returns 415 with code unsupported_media_type. See the Authentication page for details on key management.

Conventions


Idempotency

Use an Idempotency-Key to retry a request safely. Every POST accepts the header, as do PATCH /v1/participants/{participant_id} and PATCH /v1/groups/{group_id}. The key takes 1 to 255 printable ASCII characters. Derive it from the action in your application, such as order-1001-completed, so retries use the same key. For routes that store responses, repeating the same key and request returns the first response with Idempotent-Replayed: true. The status stays the same: a create that returned 201 returns 201 again. Events and other exceptions are described below. Routes that also take an idempotency_key body field accept the key in either place. If you send both and they differ, Scrip returns 400 with code header_body_mismatch. A malformed header returns 400. How long a key lasts depends on the route: Use a key when a participant or group update increments a counter. If the response is lost, retry the same request with the same key to avoid applying the increment twice. See Update state with one request. Rules for stored responses:
  • The same key with a different body, query string, or route returns 409 with code idempotency_conflict. The same JSON in a different key order or spacing counts as the same body.
  • A request that arrives while the first one with that key is still running returns 409 with code idempotency_in_flight. Wait, then send it again with the same key.
  • Scrip stores 2xx and non-retryable 4xx responses, so a rejected request returns the same rejection when you repeat it. It does not store 5xx responses.
  • Retryable errors are not stored: retryable_conflict, idempotency_in_flight, catalog_reconcile_conflict, and rule_order_conflict. Retry the same request with the same key after the conflict clears.
  • A stored, non-retryable 4xx replays for the full 24 hours. A 404 for a parent you create later stays a 404 under that key; use a new key.
  • After 24 hours the key is free to use for a different request.
Events work differently. On POST /v1/events the key is the event’s identity. Send it in the idempotency_key body field or in the Idempotency-Key header, and if you send both, they must match. The same key always returns the same event with 202. Events never carry Idempotent-Replayed. A known key with a different payload keeps the original event and sends an event.rejected webhook event. To correct or replace an event, send a new event with a new key. Four kinds of POST do not store a response: responses that show a secret once (creating an API key or a webhook endpoint, rotating a webhook secret), claim links, which are minted on every call, rule validation and simulation, and configuration previews and analyses. An unkeyed POST /v1/participants with an existing external_id updates the participant: the first call returns 201, the next returns 200. With an Idempotency-Key, the second call is a replay and returns 201 with Idempotent-Replayed: true.

Pagination

List endpoints return a data array and a pagination object:
next_cursor is null on the last page. Pass it as the cursor query parameter to fetch the next page. Use limit to control page size. See Limits and durations for the default and maximum. A cursor works only with the endpoint and filters that issued it. Anything else returns 400 with code invalid_cursor. Single-resource endpoints return the resource directly, with no wrapper.
Most list endpoints support query parameters for filtering and ordering results. Available parameters vary by endpoint and are documented in each endpoint’s parameter table.

Filtering

Filter by resource status or related IDs:
Lists of stored records take created_after and created_before (RFC 3339, both exclusive). Lists of event-driven records also take occurred_after and occurred_before on the event time. Reports and statements that compute over a window take period_start and period_end (inclusive), and point-in-time reports take as_of. Computed reports and balance lists do not accept created_after or created_before. Scrip compares created_after and created_before with the full stored time, but a response shows created_at only to the second. A created_after copied from an item’s created_at can therefore return that item again. To read the next page, use cursor.

Sorting

Control result ordering with sort_by and sort_dir:
Each endpoint defines its own set of sortable fields (for example, created_at or name). The default sort is typically created_at descending. Rules default to order ascending. Search uses case-insensitive partial matching. The searched field varies by resource:
To fetch several assets by id in one call, pass up to 200 comma-separated ids: GET /v1/assets?ids=a3bb189e-8bf9-4c8b-9be0-6b5d2f4e7a02.

Resource states

A resource moves to ARCHIVED with PATCH and {"status": "ARCHIVED"}. Groups, tiers, automations, webhook endpoints, and reward sources have no DELETE. Creating a resource returns 201 Created, and an accepted event returns 202 Accepted with a Location header that points at the event.

Errors

Every error response has the same shape. This one comes from an amount redemption larger than the available balance:
A 409 means the resource’s current state conflicts with the request and you can change that state. A 422 means the request content breaks a business rule, such as insufficient funds.

Status codes

The Errors page lists every code with its status, cause, and fix.

Rate limits

Build to the guidance on Limits and durations. All API keys in the same organization share one rate limit. When exceeded, the API returns 429 with a Retry-After header.

Resources

Your app calls a short list of these as participants earn and redeem: events, balances, the rewards catalog, redemptions, transfers, and webhooks. The rest create or change the program itself, which is the dashboard’s job day to day. Which endpoints you need sorts them. For a complete map of entities and their relationships, see the Data Model.