1
Build in Staging
A Staging project has its own users, units, rules and keys, and cannot reach Production’s people. Send test events, write rules, preview them. Use a clock you can move to test streaks and expiry (testing).
2
Rules start as drafts
A rule you or an agent create is a draft. It listens to nothing.
POST /v1/rules/{id}/preview shows what it would have done to recent events: who would have received what, how many people, what a limit would have stopped.3
A person takes it live
An owner or admin takes a rule live in the dashboard. If an agent or a key tries (
POST /v1/rules/{id}/live), it gets approval_required and a link. You can also ask on purpose: POST /v1/proposals makes a proposal, which a person approves or declines with a card that shows exactly what would change. A proposal waits 7 days. After that it reads as expired and nobody can decide it: ask again.4
Copy to Production
A person in the dashboard proposes copying rules and units from Staging into Production: how it works. An owner or admin in Production approves. Rules arrive as drafts there, and a person takes them live.
5
Switch your app to the Production key
Your code does not change. The address is the same, and only the key differs. Keep the Staging key for your tests.
What waits for a person, and why
A key or an agent that tries any of these gets
approval_required (or forbidden) with a next_step, and never a partial change. Units are different: a project key can make and change them (a unit with nobody holding it changes nothing), and an agent key cannot.
An agent can also ask to take back an added template with lurk.apply. The approval card shows which draft rules will go.
Held changes
A rule can ask for a person to look at a big give:hold_over holds any change above a number until someone decides (Activity → the held item). The person can give it or refuse it, with a note. Nothing has changed for the user until a person gives it.
If something goes wrong
- Pause the rule.
POST /v1/rules/{id}/pausestops it at once. An agent can do this. Balances stay as they are. - Undo a receipt. A person undoes it from Activity: it writes a new receipt that reverses the first, and both stay.
- A budget, on a rule, caps what it can give in a day, week or month, however many events arrive.