Register an action
register_actionTell Ogen which fact an action kind depends on, and how costly that action is to undo. Actions that are costly to undo wait for a person, so any cost other than "read" must name the approver who decides them — register that person with register_approver first. Record only. Each kind with a named approver is one scope; Record covers 5, and more can be added.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| key | Yes | The bound key this kind depends on. | |
| cost | Yes | How costly this kind of action is to undo. The costlier it is to undo, the more a person is involved before it happens. | |
| kind | Yes | The action kind commit_gated_action will be called with. | |
| approver | No | The name of the person who confirms a hold on this kind (see register_approver), or the reserved word "principal" — the kind then waits for whoever commit_gated_action's own ask names (principal: { email }), never a registered approver. Required for any cost other than "read", and for decide_with "passkey_only" (which a principal-gated kind can never use — a principal has no passkey). Omit to leave an already-registered approver unchanged; pass null to clear the approver, which only a "read" kind with decide_with "token_or_passkey" may do. | |
| decide_with | No | Which door may decide this kind's holds: the mailed one-time token or a passkey ("token_or_passkey", the default), or a passkey only ("passkey_only") — requires approver. Omit to leave an already-registered kind's setting unchanged. | |
| release_when | No | Release this kind without a person when its OWN bound fact — read live, the business's own record — resolves and satisfies exactly one rule: fact_equals (a string match) or fact_at_least (a number comparison against a named argument of the ask). Never both, never anything else. A fact that disagrees between systems, or can't be read, always waits for a person. Shares the same daily count as auto_release_under (one counter, not two). Applies to a caller's ask too — your own record deciding, not a limit you set. Only on a cost "expensive" kind; never with decide_with "passkey_only". Owner key only. Omit to leave unchanged; pass null to clear. | |
| hold_ttl_hours | No | How long a hold on this kind waits for a person, in whole hours (1-168, default 24). Omit to leave unchanged. A longer window is a longer time for the fact to move; a decision still goes by the fact as it stands when it runs. | |
| fallback_approver | No | A second registered approver (see register_approver) who is handed a hold on this kind once half its life has passed with no decision. The approver can still decide. Omit to leave unchanged; pass null to clear. | |
| auto_release_under | No | Release this kind without a person when its fact is settled and the arguments' amount is under a limit. A disagreement between systems still waits for a person, whatever the amount. Never with decide_with "passkey_only". Only on a cost "expensive" kind. At most auto_release_per_day releases of this kind in any 24 hours (default 20); past that, a person decides. The value is compared in your own unit (cents or dollars is yours) on that one field; the release ticket binds every argument. Owner key only. Omit to leave unchanged; pass null to clear. | |
| auto_release_per_day | No | How many times a day this kind may be released without a person: a count, 1-200, over any 24 hours (default 20). Past it, a person decides. Ogen keeps no amount; the most released in a day is your limit times this count. Only on a cost "expensive" kind. Owner key only. Omit to leave unchanged; pass null to go back to the default. | |
| hold_ttl_skip_weekends | No | Count only working days toward hold_ttl_hours — your weekend (Saturday-Sunday unless you set another with settings action "contact"), in your timezone. Refused until your timezone is set with settings action "contact". Default false. Omit to leave unchanged. |