Getting your token
- Open Matter settings
- Click Generate API Token
- Copy the token
mat_ prefix identifies it as a Matter API token. If you ever see one in logs or code, you know what it is.
Using your token
Pass the token in theAuthorization header on every request:
Token lifecycle
| Action | What happens |
|---|---|
| Generate | Creates a new token. Any previous token is immediately revoked. |
| Regenerate | Invalidates the old token and issues a new one. |
| Revoke | Destroys the token. API access stops immediately. |
Security best practices
Store tokens in environment variables
Store tokens in environment variables
Use .env files for local development
Use .env files for local development
Rotate tokens periodically
Rotate tokens periodically
If you suspect a token has been exposed, regenerate it immediately in your settings.
Error responses
If authentication fails, the API returns401 Unauthorized: