API keys and sign-in

Create an API key, choose its access, sign in the CLI and revoke keys you no longer need.

Create an API key

  1. Open Settings → API and CLI.
  2. Click Create key and fill in a name (for example "Spreadsheet export"), the access and the expiry.
  3. Copy the key right away. Moniary stores only a fingerprint of it, so it can't show it again.

Keys start with mny_ and go in the request header:

Authorization: Bearer mny_…

Access

AccessWhat the key can do
ReadOnly actions that read data. It changes nothing.
Read and writeAlso upload, edit, issue and send documents and match payments.

An action the key isn't allowed to run returns 403 INSUFFICIENT_SCOPE. For reports, exports and AI agents that only answer questions, use a read key.

Who a key belongs to

  • A key acts as you, and only in the company (workspace) where you created it. Create another key for another company.
  • It always has your current permissions. If your role changes, so does what the key can do.
  • If you leave the company, the key stops working.
  • Everyone sees and manages only their own keys. You can have up to 20 active keys per company.

Sign in the CLI

moniary login opens your browser. Sign in, pick the company and the access and click Allow access. The CLI then gets its own key called "CLI (your computer's name)". It appears in your list of keys and you revoke it like any other. More on the CLI page.

The sign-in uses OAuth with PKCE: the browser passes a one-time code only to the CLI on your computer (127.0.0.1). The code is valid for 10 minutes and works once.

Revoke a key

In the list of keys, click Revoke next to the key. It stops working immediately. If a key leaks (for example into a repository), revoke it and create a new one.

Security

  • Don't put keys in code or in a browser. Keep them in an environment variable or a secrets manager.
  • Give each script or service its own key with a clear name. The Last used column then shows which keys are still in use.
  • For one-off jobs, set the key to expire after 30 or 90 days.