How to create a Matomo auth token (token_auth)

You create tokens in Matomo under Administration → Personal → Security → Auth tokens: confirm your password, add a description, copy the token. Matomo shows it only once. The more important decisions are which user the token belongs to and what it's allowed to do, and that's what this guide covers.

What a token_auth is

A token_auth is a long random string that lets an app or script call the Matomo Reporting API instead of you logging in. iPhone apps, dashboards, spreadsheets and scripts all use one. A token can do whatever its user can do, so treat it like a password.

Since Matomo 4, every user can have several tokens, each with its own description. That's the feature to use: one token per app, revocable on its own.

Creating one

The exact screens differ a bit between Matomo 4, 5 and 6, and Matomo keeps them documented in its official FAQ How to get the token_auth. In short, as of November 2026:

Which access to give it

For reading statistics, view access is enough: visits, pages, sources, countries, devices, goals and (if enabled for the site) the visitor log. A token only sees the sites its user has access to.

Use caseAccess needed
Reading reports in an app or dashboardView
Creating goals, segments or annotations via APIWrite
Managing a site and its usersAdmin
System settings, all sitesSuperuser

Least privilege, and why it matters under GDPR

Matomo data contains personal data: IP-derived locations, visit histories, sometimes user IDs. The GDPR's principles of data minimisation and integrity and confidentiality are a good reason to limit who and what can read it. In practice:

This isn't legal advice, but it's the setup that's easiest to justify to a data protection officer. Matomo's GDPR guide covers the wider picture.

Should you tick "Only allow secure requests"?

With this option the token only works in the body of a POST request, never as a URL parameter. That keeps it out of server logs, proxy logs and browser histories, where URLs tend to end up.

Keeping tokens safe

Using the token in Statomo

Statomo, a native iPhone app for Matomo, offers two ways in:

Either way the token sits in the iOS Keychain, and the app talks directly to your Matomo over HTTPS, with no Statomo account or server in between. Connection problems? See Connect your Matomo to your iPhone.

FAQ

Can I see an existing token again?

No. Matomo shows a token only once, right after creating it. Create a new one and delete the old one.

Does a token expire?

Only if you set an expiry date (Matomo 5 and 6). Otherwise it's valid until you delete it or the user is removed.

Is a view-only token enough for a Matomo app?

Yes, for reading statistics. Write or admin access is only needed to change things in Matomo.

Updated November 2026.