Skip to main content
PUT
Error

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

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

Path Parameters

id
string
required

Earning rule ID.

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

Body

application/json

Request body for updating an earning rule. All properties are optional; status is not updatable here.

name
string

Earning rule name.

Required string length: 1 - 200
trigger
object

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.

earnings
object[]

Earning definitions. Items with an id update existing earning items; items without an id are created. Omitted existing items are removed.

Minimum array length: 1
error
object | null

Default error returned when rule validation fails. Nullable.

validity_hours
object | null

Hours during which the rule is active. Nullable.

start_date
string<date-time> | null

Date-time from which the rule is active. Nullable.

end_date
string<date-time> | null

Date-time until which the rule is active. Nullable.

metadata
object | null

Arbitrary key-value metadata. Nullable.

trigger_limits
object | null

Cooldown and frequency limits for the trigger. Nullable.

Response

Updated earning rule

Earning rule as returned by the API.

id
string

Earning rule ID (lern_...).

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

Earning rule name.

Maximum string length: 200
status
enum<string>

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

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

Earning definitions of the rule.

trigger
object

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.

error
object | null

Default error configuration. Absent when not configured.

validity_hours
object

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

start_date
string<date-time> | null

Date-time from which the rule is active. Nullable.

end_date
string<date-time> | null

Date-time until which the rule is active. Nullable.

trigger_limits
object | null

Cooldown and frequency limits. In responses, frequency.limits is always an array (empty for NO_LIMIT).

metadata
object

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

created_at
string<date-time>

Creation timestamp (ISO 8601).

updated_at
string<date-time> | null

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

object
string

Object type marker. Always earning_rule.

Allowed value: "earning_rule"
Last modified on July 13, 2026