API reference / Products
get
/v1/purposesThe reasons for travel a destination’s form offers
- Operation
listDestinationPurposes- Authentication
- API key
Read from a live capture of the government’s own form. `value` is what the portal posts (Kenya’s is a UUID — matching on the label is what breaks when a portal rewords one); `purpose` is the canonical axis; `product_code` is the catalogue row that purpose selects, resolved here so a client holds no mapping of its own.
`product_code` is null where a destination’s purposes are not product selectors — Ethiopia’s purpose *is* the product, with 27 catalogue rows. An empty list means this destination has no capture yet, which is a fact about our data rather than a missing route.
Request
Responses
200The purposes, or an empty list where none are captured.
destination_iso3stringrequiredpurposesDestinationPurpose[]required400The request body or query failed validation.
errorobjectrequired401No key, an unknown key, a revoked key, or a key whose tenant is not active. All four return an identical body on purpose: distinguishing them would let a caller discover which partners we have.
errorobjectrequired403The key is valid but does not hold the scope this route requires.
errorobjectrequired404Not found, or not yours. A resource belonging to another tenant answers 404 rather than 403, because 403 would confirm the record exists.
errorobjectrequiredExample
curl -X GET https://api.haavisa.com/v1/purposes \
-H "Authorization: Bearer $HAAVISA_API_KEY"More in Products
Something unclear? The eligibility guide explains the model behind the answers; the errors guide covers the envelope.