API reference / Partner
/v2/keysIssue an API key
- Operation
issueKey- Authentication
- API key
Creates a key for the calling tenant. A key may only grant scopes its own holder holds — otherwise `keys:write` becomes a privilege-escalation primitive.
Request
Body
namestringrequiredenvironmentstringone of: livetest
kindstringone of: secretpublishable
allowed_originsstring[]Browser origins this key may be used from. A publishable key with none permits nothing — it fails closed, because forgetting to configure this must not produce a key usable anywhere.
scopesstring[]Omit to inherit every scope the calling key holds. You may only grant scopes you hold yourself — requesting anything else is a 403, because a key that could widen its own scopes would be a privilege-escalation primitive.
Responses
keystringrequiredThe full key. Returned exactly once — we store only a SHA-256 digest, so it cannot be recovered or re-displayed, including by us.
prefixstringrequiredenvironmentstringone of: livetest
kindstringrequiredWhich kind of key this is, and the field to branch on. `publishable` keys are capped to a scope ceiling and rejected outside their origin allowlist; `secret` keys are not.
one of: secretpublishable
scopesstring[]dropped_scopesstring[]Requested and not granted. Present only when something was dropped, and named rather than silently omitted so nobody builds against a capability they were refused.
dropped_reasonstringWhy anything in `dropped_scopes` was dropped. Present only alongside it.
warningstringrequirederrorobjectrequirederrorobjectrequirederrorobjectrequirederrorobjectrequiredExample
curl -X POST https://api.haavisa.com/v2/keys \
-H "Authorization: Bearer $HAAVISA_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "<name>"
}'More in Partner
Something unclear? The eligibility guide explains the model behind the answers; the errors guide covers the envelope.