Skip to main content
GET
List rules
Returns all rules in your organization. Pass program_id to scope results to a single program, and pass rule_set_id to return rules from one set. 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. Each rule includes rule_set_id. With the default sort_by=order, rules are grouped by rule-set position and then by their local position. Use sort_by and sort_dir to select another ordering.
For usage patterns and examples, see the Writing Rules guide.

Authorizations

Authorization
string
header
default:sk_...
required

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

Query Parameters

limit
integer
default:50

Return at most this many records, from 1 to 200, default 50.

Required range: 1 <= x <= 200
cursor
string

The next_cursor from the previous response, valid only with the same endpoint and filters.

program_id
string<uuid>

Filter by program ID

rule_set_id
string<uuid>

Filter by containing rule set 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, ignoring case; % and _ match themselves)

sort_by
enum<string>

Sort field

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

Sort direction

Available options:
asc,
desc
created_after
string<date-time>

Return only records created after this time, RFC 3339.

created_before
string<date-time>

Return only records created before this time, RFC 3339.

Response

List of rules

One page of rules, with the pagination details for the next page.

data
object[]

The rules on this page.

pagination
object

Whether another page follows, and the cursor that fetches it.