Authentication
Authenticate with a project API key in the X-Api-Key header.
Every request is authenticated with an API key sent in the X-Api-Key header:
curl -X GET 'https://api.gbnotification.dokploy.geobilgi.net/api/v1/companies/COMPANY_ID/projects/PROJECT_ID/messages' \ -H 'X-Api-Key: YOUR_API_KEY'Key format
A key has three parts separated by underscores: nb_<prefix>_<secret>.
| Part | Example | Notes |
|---|---|---|
nb | nb | Fixed platform prefix. |
prefix | k3j9x0a1b2c4 | 12 lowercase letters and digits. It identifies the key and is shown in the dashboard. |
secret | Q2Vh… | 32 letters and digits. Only a hash is stored; nobody can show it again. |
Scope of a key
A key belongs to one project. It can only call routes of that project
(/companies/{companyId}/projects/{projectId}/… with the key's own ids) and only these permissions:
| Permission | Allows |
|---|---|
messages.send | Send messages, cancel messages |
messages.read | List and read messages and dispatches, read project statistics |
templates.read | List and read message templates |
attachments.write | Upload and delete attachments |
attachments.read | Read attachment metadata, download attachments |
A key cannot delete messages, change templates, providers or storage, manage keys or members, or call any route outside its project. Those actions are done by users in the dashboard.
Provider restriction
The dashboard lets you pick a provider when you create a key (Restrict to provider). This value is stored with the key, but messages are always delivered through the project's provider chain for the channel.
Authentication errors
| Status | When |
|---|---|
401 Unauthorized | The header is missing, the key is malformed or unknown, or it was revoked, expired, or its project was deleted. |
403 Forbidden | The key is valid but the route belongs to another company or project, or needs a permission the key does not have. |
404 Not Found | The route is in scope but the resource (message, template, attachment) does not exist in the project. |
429 Too Many Requests | The rate limit was exceeded. See Rate limits. |
401 and 403 responses carry a problem details body without a code; do not retry them
without fixing the key or the URL.
Lifecycle
- Expiry is optional and set when the key is created. An expired key answers
401. - Revocation in the dashboard takes effect on the next request; there is no cache.
- Last used is shown in the dashboard (updated at most once a minute).
- To rotate a key: create a new key, deploy it to your services, then revoke the old one.
Good practices
- Keep keys on your servers: in a secret manager or environment variables, never in source control, mobile apps or web pages. The API does not send CORS headers, so browsers cannot call it anyway.
- Use one key per service or environment, so you can revoke one without affecting the others.
- Prefer keys with an expiry date and rotate them before they expire.