Skip to main content
Every request to the NZOChain API must include a valid API key. Authentication uses the standard HTTP bearer token scheme — you pass your key in the Authorization header of each request. There are no cookies, sessions, or OAuth flows to set up.

Getting your API key

  1. Log in to the NZOChain dashboard.
  2. Go to Settings → API Keys.
  3. Click Generate new key and copy the value immediately — it is only shown once.
If you lose your key, you can revoke it and generate a new one from the same page.

Passing your API key

Include your key as a bearer token in the Authorization header on every request:

Code examples

Authentication errors

Security best practices

  • Use environment variables. Store your API key in an environment variable (e.g., NZOCHAIN_API_KEY) and read it at runtime. Never hard-code it in your source files.
  • Keep keys server-side. Never include your API key in client-side JavaScript, mobile app bundles, or any code that is shipped to end users.
  • Rotate keys periodically. Regenerate your API key on a regular schedule and immediately after any suspected exposure.
  • Use separate keys per environment. Generate distinct keys for development, staging, and production so you can revoke one without affecting the others.
Never commit your API key to source control. If a key is accidentally committed, revoke it immediately from the NZOChain dashboard and generate a replacement. Treat any exposed key as compromised.