Skip to main content
POST
Create Rule
Create a Customer Value rule: the goals a customer must reach, the window they must reach them in, and the payout or revenue outcome applied once they do. name is the only always-required field, but the rest of the payload has to be internally consistent — a bonus outcome needs goals, an end_of_cycle trigger needs an outcome_payout_revenue_id, and every data point you reference must be active. See Customer Value for how the parts fit together and the full list of constraints.

Authorizations

X-Eflow-Api-Key
string
header
required

The Everflow API key generated from the Control Center > Security.

Body

application/json
name
string
required

Display name of the rule.

Maximum string length: 255
Example:

"Third purchase bonus"

rule_id
integer

Unique rule ID. Assigned on creation; required when updating.

Example:

87

status
enum<string>
default:active

Whether the rule is enabled. An inactive rule never evaluates, whatever its state.

Available options:
active,
inactive
segmentation
enum<string>
default:shared

How a customer's accumulated history is partitioned. shared tracks one history per customer across everything in scope; the other values track a separate history per partner, per offer, per advertiser, or per combination, so the same customer can progress independently in each.

Available options:
shared,
affiliate,
offer,
advertiser,
affiliate_offer,
affiliate_advertiser
offer_ids
integer[]

Offers the rule applies to. Empty means every offer. Mutually exclusive with advertiser_ids.

advertiser_ids
integer[]

Advertisers the rule applies to, covering all of their offers. Empty means every advertiser. Ignored when offer_ids is set.

affiliate_ids
integer[]

Partners the rule applies to. Empty means every partner.

payout_revenue_id
integer

Restricts the rule to a single event (payout/revenue entry) of the offer in offer_ids. 0 means the rule applies to the offer's base conversion and all of its events.

timezone_id
integer

Timezone used to interpret start_date, end_date, and calendar cycle boundaries. Defaults to the network's timezone.

Example:

67

start_date
string

Inclusive start date, yyyy-MM-dd. Empty means the rule starts as soon as it is created.

Example:

"2026-08-01"

end_date
string

Exclusive end date, yyyy-MM-dd. Must be after start_date. Empty means the rule never expires.

Example:

"2026-12-31"

cycle_type
enum<string>
default:rule_duration

When the customer's accumulated totals reset to zero. Calendar cycles (day, week, month, quarter) reset on the boundary in the rule's timezone. rule_duration never resets — the whole rule is a single cycle. from_first_conversion never resets either; instead the rule stops applying to a customer cycle_duration days after that customer's first conversion.

Available options:
day,
week,
month,
quarter,
rule_duration,
from_first_conversion
cycle_duration
integer

Length of the cycle in days. Required and at least 1 when cycle_type is from_first_conversion; ignored otherwise.

Example:

30

goals
object[]

Conditions the customer's accumulated totals must satisfy for the outcome to apply, evaluated over the whole history rather than against a single conversion. All goals must be satisfied. A rule may only be goalless when cycle_type is from_first_conversion and outcome_type is substitution.

outcome_type
enum<string>
default:substitution

How the outcome is applied. Each incoming conversion is added to the customer's history before the goals are checked, so the outcome lands on the conversion being processed when the history first satisfies them. substitution replaces that conversion's payout and revenue. bonus records a separate bonus conversion on top of it, leaving it untouched.

Available options:
substitution,
bonus
outcome_trigger
enum<string>

When a bonus outcome is granted. instant grants it on the incoming conversion that brought the history to the goals; end_of_cycle grants it once when the cycle closes, aggregating the whole cycle. Required when outcome_type is bonus.

Available options:
instant,
end_of_cycle
outcome_payout_revenue_id
integer

The event the bonus conversion is recorded against. Optional for an instant trigger — omit it to tie the bonus to the incoming event — and required for end_of_cycle.

payout_method
enum<string>

How the payout is computed. disabled leaves the payout untouched, modifier adjusts the original payout, model computes a new payout from a payout type, and data_point derives it from a numeric data point. At least one of payout_method and revenue_method must be enabled.

Available options:
disabled,
modifier,
model,
data_point
payout_modifier
enum<string>

Direction of the adjustment when payout_method is modifier. increase and decrease treat payout_value as a percentage; flat_increase and flat_decrease treat it as an absolute amount.

Available options:
increase,
decrease,
flat_increase,
flat_decrease
payout_type
enum<string>

Payout model used when payout_method is model. Required in that case, and must be cpa when outcome_type is bonus. This is a narrower set than an offer payout type accepts — the _sku variants and cpc are rejected. Responses return blank for any other payout_method, which carries no payout type.

Available options:
cpa,
cps,
cpa_cps,
prv,
cpm
payout_value
number<double>

The payout amount, percentage, or per-unit rate, depending on payout_method. Cannot be negative, must not exceed 100 for a decrease modifier, and must be greater than 0 for data_point.

Example:

5

payout_percentage
number<double>

Percentage of sale amount (cps, cpa_cps) or of revenue (prv) used when payout_method is model.

payout_data_point_identifier
string

Identifier of the numeric data point the payout is derived from. Required when payout_method is data_point; the data point must exist, be active, and have type number.

payout_data_point_calculation
enum<string>
default:accumulated

Which value of the data point to use — current for the value on the incoming conversion, accumulated for the total across the cycle. Defaults to accumulated. current is not allowed with an end_of_cycle outcome trigger.

Available options:
current,
accumulated
revenue_method
enum<string>

How the revenue is computed. Mirrors payout_method. At least one of payout_method and revenue_method must be enabled.

Available options:
disabled,
modifier,
model,
data_point
revenue_modifier
enum<string>

Direction of the adjustment when revenue_method is modifier. Mirrors payout_modifier.

Available options:
increase,
decrease,
flat_increase,
flat_decrease
revenue_type
enum<string>

Revenue model used when revenue_method is model. Required in that case, and must be rpa when outcome_type is bonus. This is a narrower set than an offer revenue type accepts — the _sku variants and rpc are rejected. Responses return blank for any other revenue_method, which carries no revenue type.

Available options:
rpa,
rps,
rpa_rps,
rpm
revenue_value
number<double>

The revenue amount, percentage, or per-unit rate, depending on revenue_method. Same constraints as payout_value.

Example:

8

revenue_percentage
number<double>

Percentage of sale amount used when revenue_method is model with rps or rpa_rps.

revenue_data_point_identifier
string

Identifier of the numeric data point the revenue is derived from. Required when revenue_method is data_point; the data point must exist, be active, and have type number.

revenue_data_point_calculation
enum<string>
default:accumulated

Which value of the data point to use. Mirrors payout_data_point_calculation.

Available options:
current,
accumulated
progress_settings
object[]

Exceptions to the cycle reset. Every metric and data point accumulates toward the rule's goals and, by default, resets at the end of each cycle; each entry here names one that carries its total over into the next cycle instead. Each metric may appear at most once. Only meaningful on calendar cycles — a rule_duration or from_first_conversion cycle never resets.

Response

200 - application/json
network_id
integer
read-only

Network ID.

Example:

1

rule_id
integer

Unique rule ID. Assigned on creation; required when updating.

Example:

87

name
string

Display name of the rule.

Maximum string length: 255
Example:

"Third purchase bonus"

status
enum<string>
default:active

Whether the rule is enabled. An inactive rule never evaluates, whatever its state.

Available options:
active,
inactive
state
enum<string>
read-only

Where the rule sits in its lifecycle, derived from its timeframe and configuration. scheduled before its start date, expired on or after its end date, stopped_running when its configuration is no longer valid to apply, and running otherwise. The state controls which fields an update can change.

Available options:
scheduled,
running,
stopped_running,
expired
stopped_running_reason
enum<string>
read-only

Why the rule is stopped_running. private_event means the rule defines a payout setting on a scoped event that is private; only revenue may be adjusted in that case.

Available options:
default,
private_event
segmentation
enum<string>
default:shared

How a customer's accumulated history is partitioned. shared tracks one history per customer across everything in scope; the other values track a separate history per partner, per offer, per advertiser, or per combination, so the same customer can progress independently in each.

Available options:
shared,
affiliate,
offer,
advertiser,
affiliate_offer,
affiliate_advertiser
offer_ids
integer[]

Offers the rule applies to. Empty means every offer. Mutually exclusive with advertiser_ids.

advertiser_ids
integer[]

Advertisers the rule applies to, covering all of their offers. Empty means every advertiser. Ignored when offer_ids is set.

affiliate_ids
integer[]

Partners the rule applies to. Empty means every partner.

payout_revenue_id
integer

Restricts the rule to a single event (payout/revenue entry) of the offer in offer_ids. 0 means the rule applies to the offer's base conversion and all of its events.

timezone_id
integer

Timezone used to interpret start_date, end_date, and calendar cycle boundaries. Defaults to the network's timezone.

Example:

67

start_date
string

Inclusive start date, yyyy-MM-dd. Empty means the rule starts as soon as it is created.

Example:

"2026-08-01"

end_date
string

Exclusive end date, yyyy-MM-dd. Must be after start_date. Empty means the rule never expires.

Example:

"2026-12-31"

cycle_type
enum<string>
default:rule_duration

When the customer's accumulated totals reset to zero. Calendar cycles (day, week, month, quarter) reset on the boundary in the rule's timezone. rule_duration never resets — the whole rule is a single cycle. from_first_conversion never resets either; instead the rule stops applying to a customer cycle_duration days after that customer's first conversion.

Available options:
day,
week,
month,
quarter,
rule_duration,
from_first_conversion
cycle_duration
integer

Length of the cycle in days. Required and at least 1 when cycle_type is from_first_conversion; ignored otherwise.

Example:

30

goals
object[]

Conditions the customer's accumulated totals must satisfy for the outcome to apply, evaluated over the whole history rather than against a single conversion. All goals must be satisfied. A rule may only be goalless when cycle_type is from_first_conversion and outcome_type is substitution.

outcome_type
enum<string>
default:substitution

How the outcome is applied. Each incoming conversion is added to the customer's history before the goals are checked, so the outcome lands on the conversion being processed when the history first satisfies them. substitution replaces that conversion's payout and revenue. bonus records a separate bonus conversion on top of it, leaving it untouched.

Available options:
substitution,
bonus
outcome_trigger
enum<string>

When a bonus outcome is granted. instant grants it on the incoming conversion that brought the history to the goals; end_of_cycle grants it once when the cycle closes, aggregating the whole cycle. Required when outcome_type is bonus.

Available options:
instant,
end_of_cycle
outcome_payout_revenue_id
integer

The event the bonus conversion is recorded against. Optional for an instant trigger — omit it to tie the bonus to the incoming event — and required for end_of_cycle.

payout_method
enum<string>

How the payout is computed. disabled leaves the payout untouched, modifier adjusts the original payout, model computes a new payout from a payout type, and data_point derives it from a numeric data point. At least one of payout_method and revenue_method must be enabled.

Available options:
disabled,
modifier,
model,
data_point
payout_modifier
enum<string>

Direction of the adjustment when payout_method is modifier. increase and decrease treat payout_value as a percentage; flat_increase and flat_decrease treat it as an absolute amount.

Available options:
increase,
decrease,
flat_increase,
flat_decrease
payout_type
enum<string>

Payout model used when payout_method is model. Required in that case, and must be cpa when outcome_type is bonus. This is a narrower set than an offer payout type accepts — the _sku variants and cpc are rejected. Responses return blank for any other payout_method, which carries no payout type.

Available options:
cpa,
cps,
cpa_cps,
prv,
cpm
payout_value
number<double>

The payout amount, percentage, or per-unit rate, depending on payout_method. Cannot be negative, must not exceed 100 for a decrease modifier, and must be greater than 0 for data_point.

Example:

5

payout_percentage
number<double>

Percentage of sale amount (cps, cpa_cps) or of revenue (prv) used when payout_method is model.

payout_data_point_identifier
string

Identifier of the numeric data point the payout is derived from. Required when payout_method is data_point; the data point must exist, be active, and have type number.

payout_data_point_calculation
enum<string>
default:accumulated

Which value of the data point to use — current for the value on the incoming conversion, accumulated for the total across the cycle. Defaults to accumulated. current is not allowed with an end_of_cycle outcome trigger.

Available options:
current,
accumulated
revenue_method
enum<string>

How the revenue is computed. Mirrors payout_method. At least one of payout_method and revenue_method must be enabled.

Available options:
disabled,
modifier,
model,
data_point
revenue_modifier
enum<string>

Direction of the adjustment when revenue_method is modifier. Mirrors payout_modifier.

Available options:
increase,
decrease,
flat_increase,
flat_decrease
revenue_type
enum<string>

Revenue model used when revenue_method is model. Required in that case, and must be rpa when outcome_type is bonus. This is a narrower set than an offer revenue type accepts — the _sku variants and rpc are rejected. Responses return blank for any other revenue_method, which carries no revenue type.

Available options:
rpa,
rps,
rpa_rps,
rpm
revenue_value
number<double>

The revenue amount, percentage, or per-unit rate, depending on revenue_method. Same constraints as payout_value.

Example:

8

revenue_percentage
number<double>

Percentage of sale amount used when revenue_method is model with rps or rpa_rps.

revenue_data_point_identifier
string

Identifier of the numeric data point the revenue is derived from. Required when revenue_method is data_point; the data point must exist, be active, and have type number.

revenue_data_point_calculation
enum<string>
default:accumulated

Which value of the data point to use. Mirrors payout_data_point_calculation.

Available options:
current,
accumulated
progress_settings
object[]

Exceptions to the cycle reset. Every metric and data point accumulates toward the rule's goals and, by default, resets at the end of each cycle; each entry here names one that carries its total over into the next cycle instead. Each metric may appear at most once. Only meaningful on calendar cycles — a rule_duration or from_first_conversion cycle never resets.

relationship
object
read-only

Related data, returned only when requested with the relationship query parameter.

time_created
integer
read-only

Unix timestamp of creation.

Example:

1734455015

time_saved
integer
read-only

Unix timestamp of last update.

Example:

1734455015