How to create an API token
Create an API token when another system needs to read or write data in your Drum account. The token acts as the Drum user who creates it, with that user’s permissions.
Before you begin
You need:
- To be an account admin, or to have a role with at least one API permission (
api_read,api_create,api_updateorapi_delete) - To be signed in as the user the integration should act as
We recommend a separate Drum user for each integration, with a role that holds only the permissions it needs. See Recommended setup for an integration.
Create the token
- Open your user menu and select Profile.
- Select API in the settings menu.
- Select Create an API Token.
- In Token Name, enter a name that says what the token is for, such as “Xero cost sync”.
- In Account, select the account the integration will work in. You cannot change this later.
- Under Toolsets, leave the default unless an AI client will use this token. The REST API ignores this setting.
- Select Generate New API Token.
Drum opens the token’s page.
- Select the copy button next to the token, and store the token in your integration’s secrets store.
Check it works:
curl -H "Authorization: Bearer YOUR_API_TOKEN" \
https://app.getdrum.com/api/v1/projects
A 200 response with a JSON array means the token works. See Make your first API request for a full walkthrough.
Rename a token
- Open Profile, then API, and select the token.
- Select Edit Token.
- Change Token Name and select Update API Token.
Revoke a token
Revoke a token when an integration is retired, or straight away if the token may have been exposed.
- Open Profile, then API, and select the token.
- Select Revoke Token and confirm.
The token stops working at once. Requests with it return 401. Create a new token for the integration if it still needs access.
Troubleshooting
| Response | Fix |
|---|---|
401 with an empty body |
The token is wrong or revoked. Copy it again from its page |
401 “requires an account-scoped API token” |
The token is from before tokens had an account. Create a new one |
403 “Insufficient API permissions” |
Add the API permission for that method to the user’s role |
403 “Forbidden” on /projects |
The token works, but the user’s role cannot read projects. Add a project read permission, or check the token with GET /api/v1/me instead |
403 “Account access revoked” |
The token’s user was removed from the account. Create a token as an active user |
| You cannot see API in the settings menu | Your role has no API permission. Ask an account admin |