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โ
| Field | Type | Description |
|---|---|---|
id | integer | Read-only. |
location_id | integer or null | The location the rule watches. null watches every location. |
location | object or null | Read-only: id, name, has_geo and use_marine_forecast of that location. |
label | string or null | The rule's name, e.g. "Small-craft advisory". |
metric | string | What to watch. See Metrics. |
metric_label, metric_is_boolean, metric_is_marine, metric_unit | Read-only details of the metric. | |
operator | string | >, >=, <, <= or =. Yes/no metrics use =. |
threshold_value | number or null | The line, always in metric units (km/h, ยฐC, mm, m, cm) whatever the shop's own units. null for yes/no metrics. |
lookahead_hours | integer | How far ahead to read the forecast, 1 to 72. Default 18. |
is_active | boolean | Default true. |
effects.fire_agents | boolean | Runs the shop's bots that subscribe to this rule. |
effects.propose_auto_close | boolean | Closes 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_banner | boolean | With 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_customers | boolean | Emails and texts customers booked in a window that gets closed. Default true. |
applies_to | string | Which 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_condition | string | Read-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_at | string or null | Read-only: when the rule last crossed its line (ISO 8601). |
created_at, updated_at | string | Read-only. |
Metricsโ
metric | Unit | Notes |
|---|---|---|
wind_speed_kmh | km/h | |
wind_gust_kmh | km/h | |
precipitation_mm | mm | |
temperature_c | ยฐC | |
snowfall_cm | cm | |
thunderstorm | yes/no | Any thunderstorm in the forecast. |
wave_height_m | m | Needs a location with the marine forecast on. |
swell_height_m | m | Needs a location with the marine forecast on. |
marine_advisory | yes/no | Gusts 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.
| Method | Path | Scope |
|---|---|---|
GET | /api/v1/settings/weather/breach-proposals | weather:read |
GET | /api/v1/settings/weather/breach-proposals/{id} | weather:read |
POST | /api/v1/settings/weather/breach-proposals/{id}/confirm | weather:write |
POST | /api/v1/settings/weather/breach-proposals/{id}/dismiss | weather:write |
- The list returns
status=pendingby default: proposals still waiting for an answer whose hours have not ended. Passstatus=all,confirmed,dismissedorclearedfor the others. - Each proposal carries
is_open:truewhile it can still be confirmed.affected_bookings_countis only sent while it is open. - Confirming a proposal whose hours have passed answers
422with the codewindow_passed, and nothing closes.
Errorsโ
| Status | Code | When |
|---|---|---|
422 | validation_error | metric or operator missing or not one of the listed values |
422 | validation_error | threshold_value missing for a metric that is not yes/no |
422 | validation_error | applies_to is not all-products, all-experiences or all-products-experiences |
422 | validation_error | location_id is not one of the shop's locations |
422 | validation_error | A marine metric on a location without the marine forecast, or on every location when none has it |
422 | validation_error | lookahead_hours outside 1 to 72 |
422 | window_passed | Confirming a closure proposal whose hours have already ended |
404 | resource_not_found | No rule with that id for this shop |
403 | insufficient_scope | The key lacks weather:read or weather:write |