Authentication
How to authenticate with the EenFactuurMaken.nl REST API using an API key (Bearer or X-API-Key), the access levels, what a key can't do and how to keep keys safe.
Every API request needs an API key. Create one under Settings → API & AI (see API keys and apps). A key starts with efm_.
Sending the key
Preferably use the Authorization header:
curl https://eenfactuurmaken.nl/api/v1/invoices \
-H "Authorization: Bearer efm_your_key"Can't your tool send Bearer tokens? Use X-API-Key instead:
curl https://eenfactuurmaken.nl/api/v1/invoices \
-H "X-API-Key: efm_your_key"In JavaScript (Node 18 or newer):
const res = await fetch('https://eenfactuurmaken.nl/api/v1/me', {
headers: { Authorization: `Bearer ${process.env.EENFACTUURMAKEN_API_KEY}` },
})
if (!res.ok) throw new Error((await res.json()).data?.code)
console.log(await res.json())In Python:
import os, requests
r = requests.get(
"https://eenfactuurmaken.nl/api/v1/me",
headers={"Authorization": f"Bearer {os.environ['EENFACTUURMAKEN_API_KEY']}"},
timeout=30,
)
r.raise_for_status()
print(r.json())Access levels
When you create a key, you choose its access. It's fixed after that: need something else? Create a new key.
| Access | What the key may do | Useful for |
|---|---|---|
| Full | Everything an API key can do: also quotes, recurring invoices, your business details, layouts, email domains, webhooks, cancelling and deleting. | Your AI assistant, your own scripts. |
| Invoices | Read everything; create and update customers, products and invoices; issue, send, remind, credit, duplicate and mark invoices paid or unpaid; create the online invoice link. No deleting or cancelling, no quotes, no settings. | An integration with your web shop, CRM or other SaaS. See Integrate with your SaaS. |
| Read only | Only GET: invoices, customers, products, PDFs, UBL, exports and statistics. | Reports, dashboards, backups. |
A few rules are about a single field:
- With Invoices you can't archive or restore a customer (
archivedinPATCH /customers/{id}) or create a new online invoice link with"regenerate": true(the link your customer already has would stop working). Creating a missing link is fine. - Downloads with a key, also with Read only, count as a download by you: the PDF with
?download=1, the UBL and the exports. On the Free plan a downloaded invoice may be deleted after 60 days without waiting for a warning.
If a key asks for something its access doesn't allow, you get 403 api_key_permission_denied with what the key has and what's needed in details:
{ "data": { "code": "api_key_permission_denied", "details": { "granted": "read_only", "required": "invoices" } } }GET /me shows in auth how your request comes in (via: api_key, session or oauth) and with which access (access). The level every endpoint needs is in the endpoint reference and in the OpenAPI spec as x-required-permission. Keys created before these levels existed have Full access.
Authentication errors
| Status | Code | Meaning |
|---|---|---|
| 401 | unauthenticated | No key was sent. |
| 401 | invalid_api_key | The key is wrong, revoked or expired. |
| 403 | api_key_permission_denied | The key's access is too low for this request. |
| 403 | session_required | This only works in the web app (see below). |
| 429 | rate_limited | More than 120 requests a minute with this key. Wait the number of seconds in the Retry-After header. |
What only works in the web app?
To protect you if a key leaks, these actions don't work with an API key (403 session_required):
- changing payment details:
iban,bic,bankAccountName,email(reply-to address) anddefaultPaymentLinkthroughPATCH /business; - starting, cancelling or resuming your subscription;
- security (password, 2FA, passkeys, devices, security log, API keys, connected apps) and deleting your account;
- the welcome guide.
Sessions and OAuth
- The web app uses a session cookie. That comes with an extra check on the
Originheader (403 bad_origin) against CSRF. With an API key this doesn't affect you. - OAuth tokens are only for the MCP server. See MCP server. A connected AI app isn't an access level: it only works through MCP and can do everything there that a key with Full access can. The REST API only works with API keys.
Working safely
- Put the key in an environment variable or secrets store, never in your code or in a public repository.
- Only use the API from your server, not from a browser: that would expose your key.
- Create a separate key per integration, with an expiry date and the lowest access that does the job. Then you can revoke one without affecting the rest, and a leaked key does little damage.
- Has a key leaked? Revoke it right away.
Last updated on 29 October 2026
Stuck?
Email us at support@eenfactuurmaken.nl. Tell us what you tried and what happened, and we will help you out.