API reference / Admin

post/v2/projects

Create a tenant

Operation
createProject
Authentication
API key

Internal. Requires `projects:write`. Returns the tenant’s first key, once.

Request

Body

idstringrequired
namestringrequired
planstring

one of: developerstartergrowthenterprise

data_residencystringnull

Set when a tenant’s data may not leave a jurisdiction. Ethiopia requires local storage of locally-collected personal data (Proclamation 1321/2024, Art. 22(1)). Null means no requirement is recorded. **Recorded only** — nothing enforces it yet.

Responses

201Created, with the first key.
keystringrequired

The full key. Returned exactly once — we store only a SHA-256 digest, so it cannot be recovered or re-displayed, including by us.

prefixstringrequired
environmentstring

one of: livetest

kindstringrequired

Which 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_reasonstring

Why anything in `dropped_scopes` was dropped. Present only alongside it.

warningstringrequired
400The request body or query failed validation.
errorobjectrequired
401No 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.
errorobjectrequired
403`projects:write` is required. No partner key is ever issued this scope.
errorobjectrequired
404Not found, or not yours. A resource belonging to another tenant answers 404 rather than 403, because 403 would confirm the record exists.
errorobjectrequired
409A tenant with that id already exists.
errorobjectrequired

Example

curl
curl -X POST https://api.haavisa.com/v2/projects \
  -H "Authorization: Bearer $HAAVISA_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "id": "<id>",
    "name": "<name>"
  }'

More in Admin

Something unclear? The eligibility guide explains the model behind the answers; the errors guide covers the envelope.