/v1/facilities/{facility_id}/revenue-rules/previewAuthentication
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/preview' \
--header "Authorization: Bearer $FACILY_API_KEY" \
--header 'Content-Type: application/json' \
--data '{
"replaces_rule_id": "00000000-0000-4000-8000-000000000001",
"rule": {
"rule_type": "street",
"trigger_kind": "always",
"adjust_amount": 0,
"adjust_direction": "increase",
"adjust_unit": "percent",
"facility_ids": [
"00000000-0000-4000-8000-000000000001"
],
"name": "Preview",
"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
replaces_rule_idstring | nullA saved rule the draft replaces, so an edit is not counted twice.
Format: uuid
Show replaces_rule_id schema
string | nullA saved rule the draft replaces, so an edit is not counted twice.
Variant 1: string
stringVariant 2: null
nullruleRevenueRuleDraftRequest | nullThe draft rule; omit to preview the saved rules.
Show rule schema
RevenueRuleDraftRequest | nullThe draft rule; omit to preview the saved rules.
Variant 1: RevenueRuleDraftRequest
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 draft would cover, as on create: omitted means the facility in the path, an empty list every facility. Its unit groups and promotion are checked against all of them; only the facility in the path is previewed.
Show facility_ids schema
string[] | nullFacilities the draft would cover, as on create: omitted means the facility in the path, an empty list every facility. Its unit groups and promotion are checked against all of them; only the facility in the path is previewed.
Variant 1: string[]
string[]Variant 2: null
nullnamestringOptional while drafting.
Default: "Preview" · 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
nullVariant 2: null
nullResponses
Expand a status to inspect its schema. Generated examples show structure and synthetic values.
200Successful Response
{
"data": {
"as_of": "2026-10-29",
"band_pct": "<VALUE_MATCHING_PATTERN>",
"draft_group_count": 0,
"facility_id": "00000000-0000-4000-8000-000000000001",
"groups": [
{
"code": "string",
"draft_applies": false,
"feature_names": [
"string"
],
"id": "00000000-0000-4000-8000-000000000001",
"managed_after": false,
"managed_now": false,
"name": "string",
"occupancy_pct": "<VALUE_MATCHING_PATTERN>",
"promotion_ids_after": [
"00000000-0000-4000-8000-000000000001"
],
"promotion_ids_now": [
"00000000-0000-4000-8000-000000000001"
],
"street_after": "<VALUE_MATCHING_PATTERN>",
"street_now": "<VALUE_MATCHING_PATTERN>",
"web_after": "<VALUE_MATCHING_PATTERN>",
"web_now": "<VALUE_MATCHING_PATTERN>"
}
],
"groups_moving": 0
},
"meta": {
"request_id": "string"
}
}application/json
dataRevenueRulePreviewResponserequiredWhat a draft rule would change at one facility, against the saved rules as they evaluate today. Nothing was written and nothing was locked.
Show data schema
as_ofstringrequiredThe facility-local date the conditions were read on.
Format: date
band_pctstringrequiredHow far rules may move a rate from its base, in percent, without a floor or ceiling.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
draft_group_countintegerrequiredGroups the draft rule would apply to.
facility_idstringrequiredThe facility previewed.
Format: uuid
groupsRevenueRulePreviewGroup[]requiredEvery live unit group of the facility.
Show 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
nulldraft_appliesbooleanrequiredWhether the draft rule applies to this group.
feature_namesstring[]requiredThe group's characteristics.
Show feature_names schema
stringidstringrequiredThe unit group's id.
Format: uuid
managed_afterbooleanrequiredWhether a rule would move them with the draft saved as well.
managed_nowbooleanrequiredWhether a saved rule moves this group's rates today.
namestringrequiredThe group's name.
occupancy_pctstring | nullrequiredThe occupancy rules compare against; null with no countable units.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show occupancy_pct schema
string | nullThe occupancy rules compare against; null with no countable units.
Variant 1: string
stringVariant 2: null
nullpromotion_ids_afterstring[]requiredPromotions rules would switch on with the draft saved as well.
Show promotion_ids_after schema
stringpromotion_ids_nowstring[]requiredPromotions the saved rules switch on for this group today.
Show promotion_ids_now schema
stringstreet_afterstring | nullrequiredEffective street rate with the draft saved as well.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show street_after schema
string | nullEffective street rate with the draft saved as well.
Variant 1: string
stringVariant 2: null
nullstreet_nowstring | nullrequiredEffective street rate under the saved rules with today's occupancy and date (tonight's value).
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show street_now schema
string | nullEffective street rate under the saved rules with today's occupancy and date (tonight's value).
Variant 1: string
stringVariant 2: null
nullweb_afterstring | nullrequiredEffective online rate with the draft saved as well.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show web_after schema
string | nullEffective online rate with the draft saved as well.
Variant 1: string
stringVariant 2: null
nullweb_nowstring | nullrequiredEffective online rate under the saved rules today.
Pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
Show web_now schema
string | nullEffective online rate under the saved rules today.
Variant 1: string
stringVariant 2: null
nullgroups_movingintegerrequiredGroups whose street or online rate the draft changes.
metaMetarequiredEnvelope 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