/v1/revenue-rules/{rule_id}Authentication
Bearer API key or Facily session, subject to permissions and facility scope.
Authentication and scopeRequest example
Replace bracketed path values with real IDs from your environment. The body, where shown, is generated from the schema and uses illustrative values.
curl --request PATCH \
--url 'https://api.staging.facily.ai/v1/revenue-rules/<RULE_ID>' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"adjust_amount": 0,
"adjust_direction": "increase",
"adjust_unit": "percent",
"facility_ids": [
"00000000-0000-4000-8000-000000000001"
],
"name": "string",
"promotion_id": "00000000-0000-4000-8000-000000000001",
"repeats_yearly": false,
"rule_type": "street",
"scope_feature_name": "string",
"scope_group_ids": [
"00000000-0000-4000-8000-000000000001"
],
"scope_kind": "all",
"status": "active"
}'Parameters
rule_idpath · stringrequiredFormat: uuid
Request body
application/json · Required
adjust_amountnumber | string | nullSize of the adjustment.
Pattern: ^(?!^[-+.]*$)[+-]?0*(?:\d{0,8}|(?=[\d.]{1,11}0*$)\d{0,8}\.\d{0,2}0*$)
Show adjust_amount schema
number | string | nullSize of the adjustment.
Variant 1: number
numberVariant 2: string
stringVariant 3: null
nulladjust_directionstring | nullRaise or lower the rate.
Values: "increase", "decrease"
Show adjust_direction schema
string | nullRaise or lower the rate.
Variant 1: string
stringValues: "increase", "decrease"
Variant 2: null
nulladjust_unitstring | nullpercent or dollar.
Values: "percent", "dollar"
Show adjust_unit schema
string | nullpercent or dollar.
Variant 1: string
stringValues: "percent", "dollar"
Variant 2: null
nullfacility_idsstring[] | nullNew facilities; an empty list means every facility.
Show facility_ids schema
string[] | nullNew facilities; an empty list means every facility.
Variant 1: string[]
string[]Variant 2: null
nullnamestring | nullNew name.
Min length: 1 · Max length: 100
Show name schema
string | nullNew name.
Variant 1: string
stringVariant 2: null
nullpromotion_idstring | nullThe promotion a promotion rule switches on.
Format: uuid
Show promotion_id schema
string | nullThe promotion a promotion rule switches on.
Variant 1: string
stringVariant 2: null
nullrepeats_yearlyboolean | nullRepeat the date window every year.
Show repeats_yearly schema
boolean | nullRepeat the date window every year.
Variant 1: boolean
booleanVariant 2: null
nullrule_typestring | nullCannot change: the rule's own type is accepted, any other is refused with a 400.
Values: "street", "seasonal", "web", "promotion", "competitive"
Show rule_type schema
string | nullCannot change: the rule's own type is accepted, any other is refused with a 400.
Variant 1: string
stringValues: "street", "seasonal", "web", "promotion", "competitive"
Variant 2: null
nullscope_feature_namestring | nullThe characteristic, for that scope.
Max length: 100
Show scope_feature_name schema
string | nullThe characteristic, for that scope.
Variant 1: string
stringVariant 2: null
nullscope_group_idsstring[] | nullThe unit groups, for the groups scope.
Show scope_group_ids schema
string[] | nullThe unit groups, for the groups scope.
Variant 1: string[]
string[]Variant 2: null
nullscope_kindstring | nullall, groups or characteristic.
Values: "all", "groups", "characteristic"
Show scope_kind schema
string | nullall, groups or characteristic.
Variant 1: string
stringValues: "all", "groups", "characteristic"
Variant 2: null
nullstatusstring | nullactive or paused.
Values: "active", "paused"
Show status schema
string | nullactive or paused.
Variant 1: string
stringValues: "active", "paused"
Variant 2: null
nullthreshold_pctnumber | string | nullOccupancy percentage, for the occupancy triggers.
Pattern: ^(?!^[-+.]*$)[+-]?0*(?:\d{0,3}|(?=[\d.]{1,6}0*$)\d{0,3}\.\d{0,2}0*$)
Show threshold_pct schema
number | string | nullOccupancy percentage, for the occupancy triggers.
Variant 1: number
numberVariant 2: string
stringVariant 3: null
nulltrigger_kindstring | nullWhen the rule applies.
Values: "always", "occupancy_below", "occupancy_above", "date_window"
Show trigger_kind schema
string | nullWhen the rule applies.
Variant 1: string
stringValues: "always", "occupancy_below", "occupancy_above", "date_window"
Variant 2: null
nullwindow_endstring | nullLast day of the date window.
Format: date
Show window_end schema
string | nullLast day of the date window.
Variant 1: string
stringVariant 2: null
nullwindow_startstring | nullFirst day of the date window.
Format: date
Show window_start schema
string | nullFirst day of the date window.
Variant 1: string
stringVariant 2: null
nullResponses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"active_group_count": 0,
"active_groups": [
{
"code": "string",
"facility_id": "00000000-0000-4000-8000-000000000001",
"id": "00000000-0000-4000-8000-000000000001",
"name": "string"
}
],
"adjust_amount": "<VALUE_MATCHING_PATTERN>",
"adjust_direction": "string",
"adjust_unit": "string",
"created_at": "2026-10-29T12:00:00Z",
"created_by": "00000000-0000-4000-8000-000000000001",
"display_status": "Active",
"facility_ids": [
"00000000-0000-4000-8000-000000000001"
],
"id": "00000000-0000-4000-8000-000000000001",
"last_activated_at": "2026-10-29T12:00:00Z",
"name": "string",
"promotion_id": "00000000-0000-4000-8000-000000000001",
"promotion_name": "string",
"repeats_yearly": false,
"rule_type": "string",
"scope_feature_name": "string",
"scope_group_ids": [
"00000000-0000-4000-8000-000000000001"
],
"scope_kind": "string",
"status": "string",
"threshold_pct": "<VALUE_MATCHING_PATTERN>",
"trigger_kind": "string",
"updated_at": "2026-10-29T12:00:00Z",
"window_end": "2026-10-29",
"window_start": "2026-10-29"
},
"meta": {
"request_id": "string"
}
}application/json
dataRevenueRuleResponserequiredOne pricing or promotion rule, with the unit groups it applies to now.
Show data schema
active_group_countintegerrequiredHow many unit groups the rule applies to now.
active_groupsRevenueRuleActiveGroup[]requiredThe unit groups the rule applies to now.
Show active_groups schema
codestring | nullrequiredThe group's code, where it has one.
Show code schema
string | nullThe group's code, where it has one.
Variant 1: string
stringVariant 2: null
nullfacility_idstringrequiredThe facility the group belongs to.
Format: uuid
idstringrequiredThe unit group's id.
Format: uuid
namestringrequiredThe group's name.
adjust_amountstring | nullrequiredSize of the adjustment, for price rules.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show adjust_amount schema
string | nullSize of the adjustment, for price rules.
Variant 1: string
stringVariant 2: null
nulladjust_directionstring | nullrequiredincrease or decrease, for price rules.
Show adjust_direction schema
string | nullincrease or decrease, for price rules.
Variant 1: string
stringVariant 2: null
nulladjust_unitstring | nullrequiredpercent or dollar, for price rules.
Show adjust_unit schema
string | nullpercent or dollar, for price rules.
Variant 1: string
stringVariant 2: null
nullcreated_atstringrequiredWhen the rule was created.
Format: date-time
created_bystringrequiredWho created the rule.
Format: uuid
display_statusstringrequiredActive, Paused, or Expired once a one-off date window has ended.
Values: "Active", "Paused", "Expired"
facility_idsstring[]requiredFacilities the rule covers; empty means every facility.
Show facility_ids schema
stringidstringrequiredThe rule's id.
Format: uuid
last_activated_atstring | nullrequiredWhen the rule last started applying to a unit group.
Format: date-time
Show last_activated_at schema
string | nullWhen the rule last started applying to a unit group.
Variant 1: string
stringVariant 2: null
nullnamestringrequiredWhat the rule is called.
promotion_idstring | nullrequiredThe promotion a promotion rule switches on.
Format: uuid
Show promotion_id schema
string | nullThe promotion a promotion rule switches on.
Variant 1: string
stringVariant 2: null
nullpromotion_namestring | nullrequiredThat promotion's name.
Show promotion_name schema
string | nullThat promotion's name.
Variant 1: string
stringVariant 2: null
nullrepeats_yearlybooleanrequiredWhether the date window repeats every year.
rule_typestringrequiredstreet, seasonal, web or promotion.
scope_feature_namestring | nullrequiredThe characteristic, for the characteristic scope.
Show scope_feature_name schema
string | nullThe characteristic, for the characteristic scope.
Variant 1: string
stringVariant 2: null
nullscope_group_idsstring[] | nullrequiredThe unit groups, for the groups scope.
Show scope_group_ids schema
string[] | nullThe unit groups, for the groups scope.
Variant 1: string[]
string[]Variant 2: null
nullscope_kindstringrequiredall, groups or characteristic.
statusstringrequiredactive or paused.
threshold_pctstring | nullrequiredOccupancy percentage, for the occupancy triggers.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show threshold_pct schema
string | nullOccupancy percentage, for the occupancy triggers.
Variant 1: string
stringVariant 2: null
nulltrigger_kindstringrequiredalways, occupancy_below, occupancy_above or date_window.
updated_atstringrequiredWhen the rule last changed.
Format: date-time
window_endstring | nullrequiredLast day of the date window.
Format: date
Show window_end schema
string | nullLast day of the date window.
Variant 1: string
stringVariant 2: null
nullwindow_startstring | nullrequiredFirst day of the date window.
Format: date
Show window_start schema
string | nullFirst day of the date window.
Variant 1: string
stringVariant 2: null
nullmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired400Validation error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired401Unauthenticated
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired403Permission denied
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired404Not found
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired409Business logic error
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired503Temporary failure
{
"error": {
"code": "string",
"message": "string",
"details": {}
},
"meta": {
"request_id": "string"
}
}application/json
errorErrorBodyrequiredThe shape of error.* in an error response.
Show error schema
codestringrequireddetailsobject | nullShow details schema
object | nullVariant 1: object
objectVariant 2: null
nullmessagestringrequiredmetaMetarequiredEnvelope metadata. Every response carries one.
Show meta schema
request_idstringrequired