Skip to main content
GET
/
v1
/
rules
List rules
curl --request GET \
  --url https://api.scrip.dev/v1/rules \
  --header 'X-API-Key: <api-key>'
{
  "data": [
    {
      "actions": [
        {
          "amount": "event.amount * 10",
          "asset_id": "550e8400-e29b-41d4-a716-446655440002",
          "type": "CREDIT"
        }
      ],
      "active_from": "2024-01-01T00:00:00Z",
      "active_to": "2024-12-31T23:59:59Z",
      "budgets": [
        {
          "asset_id": "550e8400-e29b-41d4-a716-446655440000",
          "consumed": "4500.00",
          "cron_expression": "0 0 1 * *",
          "interval": "720h",
          "limit": "10000.00",
          "next_reset_at": "2026-03-01T00:00:00Z",
          "schedule_type": "CRON"
        }
      ],
      "condition": "event.type == 'purchase' && event.amount > 0",
      "created_at": "2024-01-15T10:30:00Z",
      "deleted_at": "2023-11-07T05:31:56Z",
      "description": "Awards 10 points per dollar spent",
      "id": "550e8400-e29b-41d4-a716-446655440000",
      "name": "Purchase Reward",
      "order": 100,
      "program_id": "550e8400-e29b-41d4-a716-446655440001",
      "status": "ACTIVE",
      "stop_after_match": false,
      "updated_at": "2024-01-15T10:30:00Z"
    }
  ],
  "pagination": {
    "has_more": true,
    "next_cursor": "YWJjMTIz"
  }
}
Returns all rules for a given program. Archived rules are excluded by default; pass include_archived=true or filter by status to control which rules are returned. Use search to find rules by name. Rules are returned in order sequence by default, which reflects their evaluation priority. Use sort_by and sort_dir to change the ordering.
For usage patterns and examples, see the Writing Rules guide.

Authorizations

X-API-Key
string
header
required

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

Query Parameters

limit
integer
default:50

Maximum number of results (default 50, max 200)

Required range: x >= 1
cursor
string

Pagination cursor from previous response

program_id
string<uuid>

Filter by program ID

include_archived
boolean
default:false

Include archived rules

status
enum<string>

Filter by rule status

Available options:
ACTIVE,
SUSPENDED,
ARCHIVED

Search by rule name (partial match)

sort_by
enum<string>

Sort field

Available options:
order,
created_at,
name
sort_dir
enum<string>

Sort direction

Available options:
asc,
desc

Response

List of rules

data
object[]

Data contains the list of items

pagination
object

Pagination contains cursor information for fetching more results