Overview
Every API request carries a token in theAuthorization header:
Personal access token
Your own scripts, backups and tools, working on your own account.
OAuth application
An application other Drime users connect to. They approve it on Drime, and you never see their password.
Personal access tokens
Create a token
- Sign in to Drime.
- Open Settings and go to Developers, or use the direct link.
- Under API access tokens, click Create token.
- Give it a name you will recognize later, for example the machine or the script that uses it.
- Choose its Permissions (see below) and click Create.
- Copy the token and store it somewhere safe. It is shown once: after you close the dialog, nobody can display it again, not even Drime.
Permissions
The dialog offers three choices:
The resources are Files, Folders, Sharing, Workspaces, Vault, Sign, Whiteboards, File requests, Send & Track, Contacts, Tags and Analytics (read only). They are the same scopes OAuth applications use,
files.read, files.write and so on, and the scopes page lists the routes each one opens.
A token with Read Only or Restricted permissions never reaches the routes that manage the account itself, whatever you tick: API tokens, sessions, password and two-factor settings, billing and the admin area. Routes that belong to no resource are refused too, so a limited token cannot be used to create a more powerful one.
Any token can read GET /users/me, whatever its permissions.
Vault files stay encrypted. With Vault access, a token lists and downloads encrypted data. Only the vault password, on your side, can decrypt it.
Lifetime and revocation
A personal access token does not expire. It works until you delete it. The API access tokens list shows when each token was last used. Delete a token from the same list as soon as you stop using it, or straight away if it may have leaked: it stops working immediately.Using the token
Send it in theAuthorization header of every request:
Response
Error Responses
401 Unauthorized
The token is missing, wrong, or was deleted:403 Forbidden
The token is valid but its permissions do not cover this route. The message names the missing scope:Keeping tokens safe
Environment variables
Keep tokens out of your code and out of version control
One token per tool
Delete one without breaking the others, and see which one was used last
Narrow permissions
Read Only or Restricted whenever All is not needed
Never in a shipped app
Anything inside a browser page or an app you distribute can be extracted. Use OAuth there
Example: Setting Up Environment Variables
- Linux/macOS
- Windows (PowerShell)
- .env File