API tokens
Create a token that lets a script use the Control Panel API as you, and choose what it can do and when it expires.
Before you start
- Every user can create tokens. A token never does more than your own account may do.
- You know your password and, with two-factor authentication on, have your authenticator app or phone.
Create a token
Open your profile
Open the menu under your name and choose Profile.
Go to API tokens
Choose API tokens, under Access.
Name it and choose what it can do
Enter a Name that says what uses the token, such as
Deploy script. Under What it can do, Read is ticked: tick the others only if the script needs them.Choose when it expires
Under Expires, keep 90 days or choose another length, On a date… or Never. A date can be up to 5 years ahead.
Confirm it is you
Enter your password in Confirm your password. With two-factor authentication on, also enter a new code in Code from your authenticator app, or choose Text me a code and enter it in Code we text you.
Create the token and copy it
Choose Create token. Copy the token from Copy your token now and store it in a secret manager, then choose I've stored it.
The token is shown once. If you lose it, delete it and create another.
The token is listed under Existing tokens and works straight away: Authentication shows how to send it.
No choice includes another: Scopes says what each allows. Deploy, offered when your account can run deployments, lets a token start, retry, cancel and roll back deployments, and needs Write too.
Check your tokens
Existing tokens shows what each token can do, when it was last used and when it expires.
| You see | It means |
|---|---|
| Read, Write | The token holds those choices and no others. |
| All abilities | The token was created before choices were offered. It can do everything your account can. |
| Never used | No request has been made with the token. |
| Never expires | The token works until you delete it. |
| Expired and a date, in red | The token no longer works. It stays listed until you delete it. |
Replace a token that shows All abilities or Never expires with one that holds only what its script needs.
Delete a token
Delete it from the list
Under Existing tokens, choose Delete… beside the token, then Delete token in the Delete this token? dialog.
Apps and scripts that use the token stop working straight away. This cannot be undone.
A token cannot be edited: to change what one can do or when it expires, create a new token and delete the old one.