API Keys
API keys let scripts, tools, or CI/CD pipelines talk to Termix without needing a username and password. Each key acts as a specific user.
Creating a Key
- Go to Admin Settings then the API Keys tab
- Click Create API Key
- Give it a name (e.g.
CI Pipeline) - Pick which user it should act as
- Optionally set an expiry date
- Click Create API Key then copy the token shown. It won't be shown again.
Using a Key
Add it as a Bearer token in the Authorization header of any request.
curl:
curl -H "Authorization: Bearer tmx_your_token_here" http://your-termix-url/host/db/hosts
PowerShell:
Invoke-RestMethod -Uri "http://your-termix-url/host/db/hosts" `
-Headers @{ "Authorization" = "Bearer tmx_your_token_here" }
JavaScript / fetch:
fetch('http://your-termix-url/host/db/hosts', {
headers: { Authorization: 'Bearer tmx_your_token_here' },
});
Revoking a Key
Go to API Keys in Admin Settings, find the key, and click the trash icon.
Notes
- Tokens start with
tmx_ - Keys work on any endpoint that only requires a logged-in user