/v1/facilities/{facility_id}/revenue-rulesAuthentication
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 POST \
--url 'https://api.staging.facily.ai/v1/facilities/<FACILITY_ID>/revenue-rules' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"name": "string",
"rule_type": "street",
"trigger_kind": "always",
"adjust_amount": 0,
"adjust_direction": "increase",
"adjust_unit": "percent",
"facility_ids": [
"00000000-0000-4000-8000-000000000001"
],
"promotion_id": "00000000-0000-4000-8000-000000000001",
"repeats_yearly": false,
"scope_feature_name": "string",
"scope_group_ids": [
"00000000-0000-4000-8000-000000000001"
],
"scope_kind": "all"
}'Parameters
facility_idpath · stringrequiredFormat: uuid
Request body
application/json · Required
adjust_amountnumber | string | nullSize of the adjustment: a percentage of at most 50, or a dollar amount.
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: a percentage of at most 50, or a dollar amount.
Variant 1: number
numberVariant 2: string
stringVariant 3: null
nulladjust_directionstring | nullRaise or lower the rate (price rules only).
Values: "increase", "decrease"
Show adjust_direction schema
string | nullRaise or lower the rate (price rules only).
Variant 1: string
stringValues: "increase", "decrease"
Variant 2: null
nulladjust_unitstring | nullpercent or dollar; web rules take percent only.
Values: "percent", "dollar"
Show adjust_unit schema
string | nullpercent or dollar; web rules take percent only.
Variant 1: string
stringValues: "percent", "dollar"
Variant 2: null
nullfacility_idsstring[] | nullFacilities the rule covers. Omitted means the facility in the path; an empty list means every facility.
Show facility_ids schema
string[] | nullFacilities the rule covers. Omitted means the facility in the path; an empty list means every facility.
Variant 1: string[]
string[]Variant 2: null
nullnamestringrequiredWhat the rule is called.
Min length: 1 · Max length: 100
promotion_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_yearlybooleanRepeat the date window every year by month and day.
Default: false
rule_typestringrequiredstreet and seasonal rules adjust the street rate, web rules the online discount; a promotion rule switches a promotion on. competitive is reserved and refused.
Values: "street", "seasonal", "web", "promotion", "competitive"
scope_feature_namestring | nullThe characteristic, for the characteristic scope. Case and spacing are ignored.
Max length: 100
Show scope_feature_name schema
string | nullThe characteristic, for the characteristic scope. Case and spacing are ignored.
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_kindstringWhich unit groups the rule considers: all, the listed groups, or a characteristic.
Default: "all" · Values: "all", "groups", "characteristic"
statusstringactive applies the rule; paused keeps it without applying it.
Default: "active" · Values: "active", "paused"
threshold_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_kindstringrequiredWhen the rule applies: always, while occupancy is below or above a threshold, or in a date window.
Values: "always", "occupancy_below", "occupancy_above", "date_window"
window_endstring | nullLast day of the date window, inclusive.
Format: date
Show window_end schema
string | nullLast day of the date window, inclusive.
Variant 1: string
stringVariant 2: null
nullwindow_startstring | nullFirst day of the date window, inclusive.
Format: date
Show window_start schema
string | nullFirst day of the date window, inclusive.
Variant 1: string
stringVariant 2: null
nullResponses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
201Successful 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