API reference / Rules
/v1/rules/exportThe whole rule set, for a partner to hold locally
- Operation
exportRules- Authentication
- API key
A partner with volume does not want a round trip per passenger. This is the state; the `rule.changed`, `rule.added` and `rule.retired` webhooks are the delta.
**`sha256` is what joins them.** It is computed over `JSON.stringify(rules)` exactly as returned, and it is the same value `rule_snapshots.hash` holds, so it appears in every `rule.*` payload. One string answers both *"is my cached copy current?"* (compare against the webhook) and *"is my stored file intact?"* (recompute over the file).
The keys are camel-case here rather than snake-case as elsewhere in this API, because these are the exact bytes the hash covers and the exact object the webhook delivers.
Every rule carries its citation and the date we last read the source. A cached copy is only as good as that date, which is why it travels with the rule rather than beside it.
Request
Responses
exported_atstringrequiredsha256stringrequiredSHA-256 of `JSON.stringify(rules)` exactly as returned here, and the same value `rule_snapshots.hash` holds — so comparing it against a `rule.changed` payload tells a partner whether their copy is current, and recomputing it over a stored file tells them whether that file is intact.
rule_countintegerrequiredrulesRule[]requiredproductsProduct[]requirednotestringrequirederrorobjectrequirederrorobjectrequirederrorobjectrequirederrorobjectrequiredExample
curl -X GET https://api.haavisa.com/v1/rules/export \
-H "Authorization: Bearer $HAAVISA_API_KEY"Something unclear? The eligibility guide explains the model behind the answers; the errors guide covers the envelope.