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
You can have one active token at a time. Generating a new token automatically revokes the previous one.
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: