Skip to main content

Overview

The Drime Cloud API uses Bearer Token authentication. Every API request must include your access token in the Authorization header.
Authorization: Bearer YOUR_ACCESS_TOKEN

Obtaining an Access Token

The easiest way to get a token is from the Drime Cloud dashboard:
  1. Log in to Drime Cloud
  2. Go to Account Settings → Developers
  3. Click Create a token
  4. Name your token and click Create
  5. Copy your token and store it securely
Your API token grants full access to your account. Never share it or commit it to version control.

Method 2: Login Endpoint

You can also obtain a token programmatically using the login endpoint:
curl -X POST https://app.drime.cloud/api/v1/auth/login \
  -H "Content-Type: application/json" \
  -d '{
    "email": "your@email.com",
    "password": "your_password",
    "device_name": "My Application"
  }'

Response

{
  "status": "success",
  "user": {
    "id": 15843,
    "email": "your@email.com",
    "display_name": "John Doe",
    "first_name": "John",
    "last_name": "Doe",
    "access_token": "123|abcdef1234567890abcdef1234567890",
    "created_at": "2024-01-01T00:00:00.000000Z",
    "updated_at": "2024-01-15T10:30:00.000000Z"
  }
}

Using the Token

Include the token in every API request:
curl https://app.drime.cloud/api/v1/cli/loggedUser \
  -H "Authorization: Bearer 123|abcdef1234567890abcdef1234567890"

Error Responses

401 Unauthorized

If the token is missing or invalid:
{
  "message": "Unauthenticated."
}

403 Forbidden

If you don’t have permission to access a resource:
{
  "message": "This action is unauthorized."
}

Best Practices

Environment Variables

Store your token in environment variables, not in code

Rotate Tokens

Regularly rotate your API tokens for security

Minimal Scope

Use separate tokens for different applications

HTTPS Only

Always use HTTPS for API requests

Example: Setting Up Environment Variables

export DRIME_API_TOKEN="your_token_here"
Then use it in your code:
const token = process.env.DRIME_API_TOKEN;

fetch('https://app.drime.cloud/api/v1/cli/loggedUser', {
  headers: {
    'Authorization': `Bearer ${token}`
  }
});