> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bludia.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Common errors

> Fixes for frequent Bludia API errors: Missing API key, Invalid API key, CORS blocked, Missing access token, invalid_or_expired_token, permission_denied, Collection not found, empty results for end users, 409 conflicts, 422 validation, and 429 rate limits.

> [accordion] 401 Missing API key.
>
> The `X-BLUDIA-API-KEY` header wasn't sent. Check the header name and that your env variable is loaded (frontend env vars often need a prefix such as `VITE_` or `NEXT_PUBLIC_`).

> [accordion] 401 Invalid API key.
>
> The key is wrong or incomplete. Keys are shown once; if you didn't copy all of it, create a new one. Make sure there are no spaces or quotes around it.

> [accordion] 403 API key revoked. / API key expired.
>
> Create a new key in **API** → **API Keys**, or extend the expiry of the existing one.

> [accordion] 403 CORS blocked (browser only)
>
> Add your exact origin (scheme, host, port), for example `http://localhost:5173`, to the key's allowed origins. See [CORS](https://docs.bludia.com/api/cors.md).

> [accordion] 401 Missing access token. on /collections/...
>
> You're using an `end_users` key without a signed-in user. Log in first and send `Authorization: Bearer <access_token>`. For server scripts, use a `platform` key.

> [accordion] 401 invalid\_or\_expired\_token
>
> * **Access token expired** (15 min default): call `/auth/{guard}/refresh` and retry.
> * **Refresh token reused:** refresh tokens rotate; store the new one every time.
> * **Wrong project or guard:** tokens only work with keys from the same project.

> [accordion] 403 permission\_denied
>
> The user's roles lack the permission for this action on the collection. Grant it in **Authentication** → **Roles**, and check the user actually has the role.

> [accordion] Empty list or 404 for records that exist
>
> Row-level security is hiding them. With no allow policy, end users only see records **they created**, so records created in the dashboard or with a platform key aren't visible to them. Add an allow policy. See [Row-level security](https://docs.bludia.com/authorization/row-level-security.md).

> [accordion] 404 Collection not found / guard\_not\_found
>
> Use the **slug**, not the display name or ID: `/collections/order_items/records`, `/auth/users/login`. Slugs are case-sensitive.

> [accordion] Fields are missing or null in responses
>
> Use exact field **names** (not labels) as JSON keys when writing. Unknown keys are ignored silently. Password fields are never returned.

> [accordion] 409 Conflict on update
>
> Someone changed the record after you loaded it. Reload, re-apply the change, and send the new `version`.

> [accordion] 409 duplicate\_account on register
>
> An account with that login value exists. Offer "log in" or "forgot password".

> [accordion] 422 validation errors
>
> The message names the field and rule. Check required fields, formats, select options, and number ranges. See [Validation](https://docs.bludia.com/database/validation.md).

> [accordion] 429 Rate limit exceeded.
>
> Slow down and retry with backoff. Use larger pages and `with` to reduce requests, or raise the key's limit. See [Rate limits](https://docs.bludia.com/api/rate-limits.md).

> [accordion] A write fails with a message I didn't expect
>
> A `before*` hook may be rejecting it. Check **Hooks** → **Executions** for the error and logs. See [Logs & debugging](https://docs.bludia.com/hooks/logs-and-debugging.md).

> [accordion] Emails aren't arriving
>
> Check the SMTP channel settings (host, port, encryption, credentials), that the sender domain is verified with your provider, the template name used in the hook, and the spam folder.

## Still stuck?

Email [support@bludia.com](mailto:support@bludia.com) with the endpoint, status code, response body, and `request_id` if present. Never include API keys or passwords.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.