Obtain a Token from the Dashboard
API7 Enterprise uses Dashboard-created tokens for authenticated access. Across the docs, the same token can be used as the X-API-KEY value in API7 Enterprise Admin API requests or as ADC_TOKEN when using ADC.
For routine API access, sign in with a non-root user and create a token for that user instead of using the initial Super Admin account.
Before You Begin
- A running API7 Gateway instance with Dashboard access.
- A non-root user account with the permissions required for the resources you want to manage.
If you only have the initial administrator account, sign in as Super Admin, create or invite a user, assign the required role, and then sign in with that user before creating a token. For details, see User Management and Role-Based Access Control.
Create a Token in the Dashboard
- Sign in to the Dashboard with your non-root user account.
- In the sidebar, navigate to Organization -> Tokens.
- Click Create Token.
- Enter a name and any other required settings.
- Copy the generated token and store it securely.
Use the Token
Set the token as an environment variable for Admin API examples:
export API_KEY="a7ee-xxxxxxxxxxxxx"
Use it in API7 Enterprise Admin API requests:
If you are not running locally, replace localhost with your Dashboard or Admin API host.
curl -k "https://localhost:7443/api/users" -X GET \
-H "X-API-KEY: ${API_KEY}"
You can use the same token for:
- API7 Enterprise Admin API requests under
/api/*and/apisix/admin/* - ADC authentication as
ADC_TOKEN
Security Notes
- Treat the token like a password and do not commit it to source control.
- Create separate tokens for different users or automation workflows when possible.
- Revoke tokens you no longer need.