2.5 KiB
title, description, tags, keywords
| title | description | tags | keywords | |||||
|---|---|---|---|---|---|---|---|---|
| API tokens | This article explains how to create and work with API Tokens. |
|
|
Create API Token
Open Account Settings page from the user menu in the bottom left corner of the sidebar.
- Click on
User menuin the bottom left corner of the sidebar, - Select
Account Settingsfrom the dropdown
Follow the steps below to create API Token
- Click on
Tokenstab in theAccount Settingspage - Click on
Add New API Token - Enter the name for the API Token
- Click on
Savebutton to save the changes - Copy the API Token by clicking on
Copybutton displayed underActionsmenu - Use the API Token in the services that require it to authenticate as
xc-tokenin the headers.
{
"headers": {
"xc-token": "Copied API token here under quotes"
}
}
:::warning
- Only one token can be created per user
- API Token does not expire, but it can be deleted anytime. :::
API Token created will get added to the list. Copy API token by clicking on Copy button displayed under Actions menu
Delete API Token
Open Account Settings page from the user menu in the bottom left corner of the sidebar.
- Click on
User menuin the bottom left corner of the sidebar, - Select
Account Settingsfrom the dropdown
- Click on
Tokenstab in theAccount Settingspage - From the
Actionsmenu, click onDeletebutton associated with the API Token to be deleted
:::warning Note that, all the services using the API Token will stop working once the API Token is deleted. :::
Auth Tokens
For quick experiments with the API, you can use the Auth Tokens to generate a temporary token. These tokens are valid for a session until the user logs out or for 10 hours.
Follow the steps below to copy AUTH Token
- Click on
User menuin the bottom left corner of the sidebar, - Select
Copy Auth Tokenfrom the dropdown
{
"headers": {
"xc-auth": "Copied auth token here under quotes"
}
}
:::note
For Self-hosted, you can reconfigure expiry time using environment variable NC_JWT_EXPIRES_IN. This defaults to 10 hours.
:::




