Skip to main content

Weather Rules

A weather rule watches the forecast at the shop's locations and acts when a number crosses a line: wind over 40 km/h, a thunderstorm, a marine advisory. When it does, it can close the affected hours by itself, or warn the owner on the dashboard and by email with a one-click close, and tell customers booked in a window that gets closed. These are the same rules as Settings > Weather thresholds in the app.

Endpointsโ€‹

GET    /v1/settings/weather/threshold-rules
GET /v1/settings/weather/threshold-rules/{id}
POST /v1/settings/weather/threshold-rules
PUT /v1/settings/weather/threshold-rules/{id}
DELETE /v1/settings/weather/threshold-rules/{id}

Authenticationโ€‹

GET requires the weather:read scope. POST, PUT and DELETE require weather:write.

The shape of a ruleโ€‹

FieldTypeDescription
idintegerRead-only.
location_idinteger or nullThe location the rule watches. null watches every location.
locationobject or nullRead-only: id, name, has_geo and use_marine_forecast of that location.
labelstring or nullThe rule's name, e.g. "Small-craft advisory".
metricstringWhat to watch. See Metrics.
metric_label, metric_is_boolean, metric_is_marine, metric_unitRead-only details of the metric.
operatorstring>, >=, <, <= or =. Yes/no metrics use =.
threshold_valuenumber or nullThe line, always in metric units (km/h, ยฐC, mm, m, cm) whatever the shop's own units. null for yes/no metrics.
lookahead_hoursintegerHow far ahead to read the forecast, 1 to 72. Default 18.
is_activebooleanDefault true.
effects.fire_agentsbooleanRuns the shop's bots that subscribe to this rule.
effects.propose_auto_closebooleanCloses the affected hours by itself when the forecast crosses the line, and reopens them when it clears. The app calls this Auto-close. Default false.
effects.dashboard_bannerbooleanWith auto-close off, warns the owner on the dashboard and by email, with a one-click close. Off with auto-close off makes a rule that only runs bots. Default true.
effects.notify_customersbooleanEmails and texts customers booked in a window that gets closed. Default true.
applies_tostringWhich bookings the rule covers: all-products, all-experiences or all-products-experiences. A rule set up in the app for specific items reads product, category, experience or experience-category.
display_conditionstringRead-only: the rule as a sentence in the shop's own units, e.g. "Wind speed > 40 km/h", or "Wind speed > 25 mph" for a shop on imperial units.
last_breached_atstring or nullRead-only: when the rule last crossed its line (ISO 8601).
created_at, updated_atstringRead-only.

Metricsโ€‹

metricUnitNotes
wind_speed_kmhkm/h
wind_gust_kmhkm/h
precipitation_mmmm
temperature_cยฐC
snowfall_cmcm
thunderstormyes/noAny thunderstorm in the forecast.
wave_height_mmNeeds a location with the marine forecast on.
swell_height_mmNeeds a location with the marine forecast on.
marine_advisoryyes/noGusts of 40 km/h (25 mph) or more, or waves of 1.2 m (4 ft) or more. Needs a location with the marine forecast on.

List rulesโ€‹

curl "https://app.equipdash.com/api/v1/settings/weather/threshold-rules" \
-H "Authorization: Bearer YOUR_API_KEY"

Newest first, paginated with page and per_page.

Get one ruleโ€‹

curl "https://app.equipdash.com/api/v1/settings/weather/threshold-rules/12" \
-H "Authorization: Bearer YOUR_API_KEY"

Create a ruleโ€‹

curl -X POST "https://app.equipdash.com/api/v1/settings/weather/threshold-rules" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"label": "Small-craft advisory",
"metric": "wind_speed_kmh",
"operator": ">",
"threshold_value": 40,
"applies_to": "all-experiences",
"effect_dashboard_banner": true,
"effect_notify_customers": false
}'

metric and operator are required, and threshold_value is required for every metric that is not yes/no. The effects are sent as effect_fire_agents (default true), effect_dashboard_banner (default true), effect_propose_auto_close (default false) and effect_notify_customers (default true).

Leave applies_to out and the rule covers what the shop sells: all experiences, all products, or both. To cover specific items, attach the rule to them with POST /v1/products/{id}/weather-rules or POST /v1/experiences/{id}/weather-rules.

Success (201 Created)โ€‹

{
"data": {
"id": 12,
"location_id": null,
"label": "Small-craft advisory",
"metric": "wind_speed_kmh",
"metric_label": "Wind speed",
"metric_is_boolean": false,
"metric_is_marine": false,
"metric_unit": "km/h",
"operator": ">",
"threshold_value": 40,
"lookahead_hours": 18,
"is_active": true,
"effects": {
"fire_agents": true,
"dashboard_banner": true,
"propose_auto_close": false,
"notify_customers": false
},
"applies_to": "all-experiences",
"display_condition": "Wind speed > 40 km/h",
"last_breached_at": null,
"created_at": "2026-10-03T09:12:44+00:00",
"updated_at": "2026-10-03T09:12:44+00:00"
},
"meta": {
"request_id": "01JBQ8...",
"timestamp": "2026-10-03T09:12:44+00:00"
}
}

Update a ruleโ€‹

curl -X PUT "https://app.equipdash.com/api/v1/settings/weather/threshold-rules/12" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"metric": "marine_advisory",
"operator": "=",
"location_id": 3,
"applies_to": "all-products-experiences"
}'

PUT takes the same body as create and replaces the rule: metric and operator are required again, and an effect left out goes back to its default. Two fields are kept when you leave them out: applies_to and effect_notify_customers.

Delete a ruleโ€‹

curl -X DELETE "https://app.equipdash.com/api/v1/settings/weather/threshold-rules/12" \
-H "Authorization: Bearer YOUR_API_KEY"

Returns 204 No Content. Closures already confirmed stay in place.

Closure proposalsโ€‹

When a rule that asks first crosses its line, it opens a proposal to close the affected hours. A proposal is only offered while its hours have not ended.

MethodPathScope
GET/api/v1/settings/weather/breach-proposalsweather:read
GET/api/v1/settings/weather/breach-proposals/{id}weather:read
POST/api/v1/settings/weather/breach-proposals/{id}/confirmweather:write
POST/api/v1/settings/weather/breach-proposals/{id}/dismissweather:write
  • The list returns status=pending by default: proposals still waiting for an answer whose hours have not ended. Pass status=all, confirmed, dismissed or cleared for the others.
  • Each proposal carries is_open: true while it can still be confirmed. affected_bookings_count is only sent while it is open.
  • Confirming a proposal whose hours have passed answers 422 with the code window_passed, and nothing closes.

Errorsโ€‹

StatusCodeWhen
422validation_errormetric or operator missing or not one of the listed values
422validation_errorthreshold_value missing for a metric that is not yes/no
422validation_errorapplies_to is not all-products, all-experiences or all-products-experiences
422validation_errorlocation_id is not one of the shop's locations
422validation_errorA marine metric on a location without the marine forecast, or on every location when none has it
422validation_errorlookahead_hours outside 1 to 72
422window_passedConfirming a closure proposal whose hours have already ended
404resource_not_foundNo rule with that id for this shop
403insufficient_scopeThe key lacks weather:read or weather:write