Skip to main content
POST
Move earning rule to draft

Authorizations

X-App-Id
string
header
required
X-App-Token
string
header
required

Path Parameters

earningRuleId
string
required

Earning rule ID.

Pattern: ^lern_[a-f0-9]+$

Response

Drafted earning rule

Earning rule as returned by the API.

id
string
required

Earning rule ID (lern_...).

Pattern: ^lern_[a-f0-9]+$
name
string
required

Earning rule name.

Maximum string length: 200
status
enum<string>
required

Current status. DELETED also exists internally but deleted rules are excluded from API reads.

Available options:
DRAFT,
ACTIVE,
INACTIVE
earnings
object[]
required

Earning definitions of the rule. Contains at least one earning.

Minimum array length: 1
trigger
object
required

Event that triggers the earning rule. Depending on event, either custom_event or segment is required and the other trigger contexts must be null/absent.

validity_hours
object
required

Validity hours. Always present; defaults to { "type": "ANY_TIME" }.

start_date
string<date-time> | null
required

Date-time from which the rule is active. Can be null.

end_date
string<date-time> | null
required

Date-time until which the rule is active. Can be null.

trigger_limits
object
required

Cooldown and frequency limits. Always present. cooldown and frequency are always objects. frequency.limits is always an array and is empty when frequency.type is NO_LIMIT.

earning_limits
object
required

Limits how many points this rule can award. Always present. Defaults to no global limit (global.type NO_LIMIT and global.limits []).

metadata
object
required

Arbitrary key-value metadata. Always present (empty object when unset).

created_at
string<date-time>
required

Creation timestamp (ISO 8601).

updated_at
string<date-time> | null
required

Last update timestamp (ISO 8601). null when never updated.

object
string
required

Object type marker. Always earning_rule.

Allowed value: "earning_rule"
error
Custom error message configuration · object

Default error configuration. Absent when not configured.

Last modified on October 13, 2026