Skip to main content
PATCH
Update a rule

Authorizations

Authorization
string
header
required

A project key (Developers → API keys). Keep it on your server, not in an app.

Headers

traceparent
string

W3C Trace Context; joins your trace to ours

Idempotency-Key
string
required

A retry with the same key and body returns the first response

Required string length: 1 - 255

Path Parameters

id
string
required

A rule_… ID or the rule's key

Example:

"order-points"

Body

application/json
name
string

What people call the rule, 1 to 80 characters

Required string length: 1 - 80
when
object

What starts the rule: an event, a schedule, or a unit's balance reaching a number or crossing multiples of it. Give one

if
object[]

Conditions that must all hold, up to 20. Leave out for none. Replaces the list

Maximum array length: 20

One IF clause. It has exactly one key, and every clause in a list must hold

limit
object[]

How often the rule may apply to one person, up to 5. Leave out for no limit. Replaces the list

Maximum array length: 5
Example:
do
object[]

What the rule changes: units. Needs at least one action unless the rule has effects, which are not available yet

Maximum array length: 10

One change to a unit. It has exactly one of add, remove, reset or streak

budget
object[]

Caps on what the rule gives everyone, up to 5. Leave out for none. An empty list removes them

Maximum array length: 5
modify
object[]

Changes to what the rule gives, for some people, up to 5. Leave out for none. An empty list removes them

Maximum array length: 5
effects
object[]

Not available yet. What the rule would do in a chat platform besides changing units: post in a channel or message the person. A key or agent that saves a rule with effects gets approval_required. Leave out for none

Maximum array length: 3

Response

Update a rule

id
string
required

A rule ID, starting with rule_.

key
string
required

The rule's key, which other rules and Activity call it by: lowercase letters, digits and dashes, starting with a letter, up to 64 characters

Pattern: ^[a-z][a-z0-9-]{0,63}$
name
string
required

What people call the rule, 1 to 80 characters

status
enum<string>
required

draft: saved, never taken live. live: running. paused: stopped, and runs again when resumed

Available options:
draft,
live,
paused
version
integer
required

The newest version

live_version
integer | null
required

The version running now; null if the rule has never been live

definition
object
required

What the newest version does: when it starts, the conditions, limits and changes