# Errors (/docs/api/errors)

Errors are [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) problem details, `Content-Type: application/problem+json`:

```json
{
	"type": "https://numbers.obelism.studio/docs/api/errors#forbidden",
	"title": "The request origin is not allow-listed and no valid token was sent.",
	"status": 403,
	"detail": "The origin https://shop.example.com is not allowed for production in space space_….",
	"code": "forbidden",
	"hint": "See https://numbers.obelism.studio/docs/api/log."
}
```

Branch on `code`; `detail` and `hint` are for people and may change.

Each code below is the anchor of its `type` URL.

### invalid_json [#invalid_json]

**400**: Send a JSON object, as `text/plain` (no preflight) or `application/json`.

### invalid_request [#invalid_request]

**400**: Fix the field `detail` names: a missing `scope`, a `path` without a leading `/`, a string over 256.

### unsupported_api_version [#unsupported_api_version]

**400**: Send `Api-Version: 1`, or leave the header out.

### reserved_event_name [#reserved_event_name]

**400**: Rename the event: names starting with `gtm.` are Google Tag Manager's.

### ingest_failed [#ingest_failed]

**400**: The event was valid but couldn't be queued. Retry later.

### unauthorized [#unauthorized]

**401**: Send a valid bearer token (agent API).

### forbidden [#forbidden]

**403**: `detail` names the origin (or the missing `Origin` header), the environment and the Space it checked. Allow that origin under **Allowed origins** on the Space's page on [www.obelism.studio](https://www.obelism.studio), or send a valid `token` header.

### unknown_organization [#unknown_organization]

**404**: Check `organizationId`. A deleted Organization takes no more events.

### unknown_space [#unknown_space]

**404**: Check `spaceId`: it must be a Space of the Organization you may open.

### not_found [#not_found]

**404**: No endpoint at this path.

### method_not_allowed [#method_not_allowed]

**405**: Use the endpoint's method (`POST` for `/api/log`, `GET` for the agent API).

### payload_too_large [#payload_too_large]

**413**: Keep the body under 8 KB.

### rate_limited [#rate_limited]

**429**: Wait for `Retry-After` before sending more.

### internal_error [#internal_error]

**500**: Something broke on our side. Retry later.
