API version: 0.3.0

---

# Anonymous user

For situations where basic access to the Ember Nexus API without special authorization management is required, the
anonymous user can be used. This is just a regular user, which will be used automatically by all API calls which do not
have any `Authorization`-header present.

## Enabling the anonymous user

First create a user account, either through the [`POST /register`](/api/post-register.md) API endpoint or the
[`user:create`](/command/user-create.md) command.

Then set the environment variable `ANONYMOUS_USER_UUID` to the UUID of the created user:

```yml
# docker-compose.yml
services:

  api:
    container_name: api
    volumes:
      - ./well-known-security.txt:/well-known-security.txt
    environment:
      - ANONYMOUS_USER_UUID=02IiNr0G8viOVKjzAMjHS4DASb93nrGVPG8KU
    ports:
      - "80:80"
```

The API container then needs to be restarted:

```bash
docker compose down
docker compose up -d
```

All API requests should now work without the `Authorization`-header.

## Testing the anonymous user

To verify that the anonymous user is actually being used, you can query the [`GET /me`](/api/get-me.md) endpoint:

```bash
curl \
  https://api.example.com/me
```

```json
{
  "type": "User",
  "id": "02IiNr0G8viOVKjzAMjHS4DASb93nrGVPG8KU",
  "data": {
    "createdAt": "2026-07-27T10:39:51+00:00",
    "updatedAt": "2026-07-27T10:39:51+00:00",
    "name": "Anonymous user"
  }
}
```

## Notes

- By default, the anonymous user is **read-only**: requests without a token may only use `GET` and `HEAD` endpoints,
  every other method is answered with `403 Forbidden`. The exceptions are endpoints which have to work without
  authentication, such as [`POST /token`](/api/post-token.md), `POST /register`,
  [`POST /search`](/api/post-search.md) and [`POST /change-password`](/api/post-change-password.md). Set the environment
  variable `ANONYMOUS_USER_READONLY` to `false` to let the anonymous user also create, change and delete data, see
  [configuration](/reference/configuration.md). Only enable this if everybody who can reach the API should be allowed to
  write data.
- Other users can grant the anonymous user access to private data, thereby making it public.
  - In sensitive situations, the anonymous user should not be enabled, or should be heavily restricted and monitored.
- It is not possible for a normal user to be implicitly granted all permissions the anonymous user has. As a workaround
  you can simply directly give the normal user access to the relevant elements or use groups to manage access.
- Similarly, an API request with an invalid or expired token is not downgraded to an anonymous request. If a request
  includes a token, it only ever executes in the context of that token's owner - an invalid token simply returns the
  API's regular error codes.

---

Home: [Ember Nexus API docs](/index.md)

Full site map: [llms.txt](/llms.txt)

Previous: [Transfer of ownership](/reference/access-model/transfer-of-ownership.md)

Next: [Roles and capabilities](/reference/roles-and-capabilities.md)
