| Header | Value | Purpose |
|---|---|---|
X-API-KEY | Your secret API key | Authenticates the request |
X-CLIENT-ID | Your Client ID | Identifies which account the request belongs to |
Finding your credentials
Your credentials live in the Authmatech dashboard:- Client ID — always visible in your account.
- API key — generated on demand. The raw key is displayed once at generation; afterward only its fingerprint is stored. If you lose it, rotate to issue a new one.
Including credentials in requests
Send both headers on every request:Credential types
Authmatech issues different credentials for different surfaces. Use the right one for the right place.| Credential | Header | Where it’s used | Scope |
|---|---|---|---|
| API key | X-API-KEY | Your backend → all server APIs (/v1/api/**) | Full account access. Keep secret. |
| Client ID | X-CLIENT-ID | Every request | Identifies your account. Not a secret, but required. |
| SDK token | X-SDK-TOKEN | Browser/mobile SDK → /v1/api/sdk/session only | Narrow scope. Cannot call Verify or any server API. Safe for the client. |
| Client secret | — | Unlocks sensitive operations such as API-key rotation | Long-lived. Keep secret. |
The SDK token exists precisely so you never put your API key in client code. The Web SDK registers a session with the SDK token; your backend then performs the verification with the API key.
Rotating your API key
Rotate from the dashboard or via the API whenever a key may be exposed, or on a regular schedule:POST /v1/api/me/api-key/rotate— rotate your own key (requires your client secret).POST /v1/api/clients/rotate-key— rotate by client.
Security best practices
- Never commit keys to source control. Use environment variables or a secrets manager. Add
.envto.gitignore. - Never expose the API key client-side. Browser bundles and mobile apps are publicly readable. Use the SDK token for client code.
- Reference keys from the environment in production —
process.env.AUTHMATECH_API_KEY(Node.js),os.environ["AUTHMATECH_API_KEY"](Python). - Rotate on exposure and on a schedule.
Authentication errors
If either header is missing or the key is invalid, the API returns401 Unauthorized.
| Status | Meaning | How to fix |
|---|---|---|
401 Unauthorized | X-API-KEY or X-CLIENT-ID missing, malformed, or invalid | Confirm both headers are present and copied exactly from the dashboard |
400 Bad Request | The product or feature isn’t enabled for your account | Check your plan, or contact support@authmatech.com |
Next steps
Quickstart
See authentication in a complete working call.
API authentication reference
The headers, scopes, and error shapes in detail.