Skip to main content
POST
Error

Authorizations

Authorization
string
header
required

A staff session token, uk_st_…. Minted by sign-up, sign-in or the two-factor exchange. Only a 401 means it is spent; not_a_member (403) is about the organization named in X-Organization-Id and leaves the token good for the others.

Headers

X-Organization-Id
string

The organization the caller is acting on — the org_… code that appears in the panel URL. It identifies; the membership JOIN is what authorizes, so a forged code reads nothing: the answer is not_a_member (403), which does not mean the session is over. Absent, the session's default organization answers, or — if that membership was revoked while the session was open — any other one the caller still holds.

Query Parameters

environment
enum<string>
default:live

Which environment to act in. A view parameter, valid only on the staff surface — a machine credential never chooses its environment, it is resolved from the key.

Available options:
live,
test

Body

application/json
key
string
required

Lowercase letters, digits, dots, dashes and underscores. Frozen after creation.

Maximum string length: 80
name
string
required
Maximum string length: 120
kind
enum<string>
required
Available options:
event,
product_event
event_type
string
required

One of event_types for an event rule; any name your product sends for a product_event one.

points
integer
required

Not zero.

Required range: -10000 <= x <= 10000
award_limit
enum<string>
required

Required. There is no default on purpose.

Available options:
once,
per_day,
cooldown,
unlimited
limit_value
integer

Required for per_day and cooldown, refused for the other two.

Required range: 1 <= x <= 525600
segment_id
string<uuid> | null

Who earns from it, or null for everybody.

active
boolean
default:false

Response

The rule.

rule
object

A fact, some points, and a ceiling. A rule pays when the fact it names lands — nothing you or your users can call moves a balance, the same way nothing ticks an onboarding step.