Open App

Authentication

API keys, monoid login, and environment variables

The CLI needs an API token to call the MONOid API. You can get a key from the app and then provide it via login, environment variable, or a flag.

Where to get an API key

Create and manage API keys under Settings > API Keys in the MONOid app. For details (scopes, expiry, security), see API & Webhooks.

Auth methods (precedence)

The CLI uses the first available source in this order:

  1. --token — Pass the token on the command line (highest precedence). Example: monoid --token mo_... organisations list
  2. MONOID_API_TOKEN — Set in your environment. Example: export MONOID_API_TOKEN="mo_..."
  3. Stored credentials — After monoid login, the token is saved under ~/.config/monoid/credentials.json and used when neither --token nor MONOID_API_TOKEN is set.

Log in

To store your token so you don't have to pass it every time:

monoid login

You'll be prompted to enter your API token. Alternatively, pass it as an argument:

monoid login mo_your_token_here

The CLI checks the token against the API before saving it.

Verify auth

To confirm the token works and see the current user and scopes:

monoid whoami

Log out

To remove the stored token:

monoid logout

This deletes the credentials file; it does not revoke the key in the app. Revoke keys under Settings > API Keys if needed.

Security

  • Do not commit tokens — Keep them out of version control and shared configs.
  • Use minimum scopes — Prefer read-only keys when you only need to read data.
  • Use expiry dates — Set an expiry on keys when possible and rotate them periodically.

For more on key management and webhooks, see API & Webhooks. For HTTP details and request/response shapes, see the API Reference.

Next step

Now that you are authenticated, continue with Quick Start.