API tokens (also called Personal Access Tokens or PATs) allow external tools to access your Authn8 2FA codes programmatically. This is useful for:
From the main navigation, go to Settings, then click on API Tokens in the settings menu.
Click the "Create Token" button in the top right corner of the API Tokens page.
In the modal that appears, fill in the following fields:
After clicking "Create Token", your new token will be displayed. Copy it immediately as it will not be shown again.
Include your token in API requests using the Authorization header:
Authorization: Bearer pat_xxxxxxxxxxxxxxxxxxxxx
For MCP server configuration, you have two options:
Best for Claude Desktop, Cursor, AntiGravity, and other local AI clients. Add to your config file:
{
"mcpServers": {
"authn8": {
"command": "npx",
"args": ["-y", "@authn8/mcp-server"],
"env": {
"AUTHN8_API_KEY": "pat_your_token_here"
}
}
}
}
Best for ChatGPT and other cloud-based AI agents. Configure with:
https://api.authn8.com/mcp/sseBearer pat_your_token_hereTo revoke a token, go to the API Tokens page and click the "Revoke" button next to the token you want to disable. The token will stop working immediately.