| title | Authenticate with the Noteboxd API |
|---|---|
| sidebarTitle | Authentication |
| description | Noteboxd uses project API keys passed as a Bearer token. Learn how to get your key, pass it correctly, and handle auth errors. |
Noteboxd authenticates every request using an API key passed in the Authorization header as a Bearer token. Keys are scoped to projects, so you can manage access and billing separately for each application you build. There are no OAuth flows or session cookies — just a single header on every request.
Your API key lives in the Noteboxd developer dashboard. To retrieve it:
Go to [developers.noteboxd.com](https://developers.noteboxd.com) and sign in with your Noteboxd account. From the dashboard home, create a new project or click into an existing one. Each project has its own isolated API key and billing balance. Navigate to the **Keys** section of the project. Your API key is displayed there — copy it and store it somewhere secure. All keys are prefixed with `nb_live_`.Pass your API key in the Authorization header of every request using the Bearer scheme:
Authorization: Bearer nb_live_YOUR_KEYHere's a complete curl example that fetches the full record for a fragrance by its canonical ID:
curl https://api.noteboxd.com/v1/fragrances/chanel-no-5 \
-H "Authorization: Bearer nb_live_YOUR_KEY"Replace nb_live_YOUR_KEY with your actual project key. Every endpoint in the Noteboxd API requires this header — requests without it will be rejected with a 401 error.
Store your key in an environment variable and reference it in your code rather than hardcoding it:
export NOTEBOXD_API_KEY=nb_live_YOUR_KEYconst key = process.env.NOTEBOXD_API_KEY;This keeps your key out of version control and makes it easy to rotate without changing your code.
If something goes wrong with authentication, the API returns a JSON error response with a machine-readable code field. Here are the auth-related errors you may encounter:
| Code | HTTP Status | Meaning |
|---|---|---|
MISSING_API_KEY |
401 | No Authorization header was included in the request. |
INVALID_API_KEY |
401 | The key was malformed, has been revoked, or does not exist. |
INSUFFICIENT_BALANCE |
402 | The prepaid balance on the project is depleted. Top up to resume making calls. |
All error responses follow the same shape:
{
"error": {
"code": "INVALID_API_KEY",
"message": "The API key provided does not match any active project key."
}
}