API tokens
Last updated
Was this helpful?
Last updated
Was this helpful?
API token functionality requires defguard version 1.2.4+.
Admin users can generate API tokens to enable request authentication for custom external tools which use defguard REST API.
Tokens retain the same access permissions as their owner, so be careful when sharing them with others.
To generate a new API token go to your profile page and click the Add new API Token
button:
Fill in your chosen token name and submit form:
Copy generated token. This is the only time the token will be available in plain text form. If you lose it you will have to generate a new one.
In the API token list you can later rename or delete a token:
defguard API uses a standard Bearer token authentication scheme.
This means that an API token can be passed in the Authorization
header to authenticate a given request instead of a session cookie used by the web UI:
Example GET request:
You can explore the defguard REST API using Swagger UI by going to <YOUR_DEFGUARD_URL>/api-docs
.
API specification JSON in OpenAPI format can also be fetched from <YOUR_DEFGUARD_URL>/api/v1/api-docs
.