> ## Documentation Index
> Fetch the complete documentation index at: https://docs.drime.cloud/llms.txt
> Use this file to discover all available pages before exploring further.

# Quick Start

> Start using the Drime Cloud API in under 5 minutes

## Get Your API Token

Before making API requests, you need an access token. You can get one in two ways:

<Tabs>
  <Tab title="From Dashboard">
    1. Log in to [Drime Cloud](https://app.drime.cloud)
    2. Go to [Account Settings → Developers](https://app.drime.cloud/account-settings#developers)
    3. Click **Create a token**
    4. Name your token and click **Create**
    5. Copy and save your token securely
  </Tab>

  <Tab title="Via API">
    Make a POST request to the login endpoint:

    ```bash theme={null}
    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 App"
      }'
    ```

    The response will include your `access_token`:

    ```json theme={null}
    {
      "status": "success",
      "user": {
        "id": 12345,
        "email": "your@email.com",
        "access_token": "123|abcdef1234567890..."
      }
    }
    ```
  </Tab>
</Tabs>

## Make Your First Request

Use your token in the `Authorization` header:

<CodeGroup>
  ```bash cURL theme={null}
  curl https://app.drime.cloud/api/v1/cli/loggedUser \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://app.drime.cloud/api/v1/cli/loggedUser', {
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }
  });

  const data = await response.json();
  console.log(data.user);
  ```

  ```python Python theme={null}
  import requests

  headers = {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
  }

  response = requests.get(
      'https://app.drime.cloud/api/v1/cli/loggedUser',
      headers=headers
  )

  print(response.json())
  ```
</CodeGroup>

## Upload Your First File

<Steps>
  <Step title="Get a presigned URL">
    For files under 5MB, use the simple upload flow:

    ```bash theme={null}
    curl -X POST https://app.drime.cloud/api/v1/s3/simple/presign \
      -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "filename": "document.pdf",
        "mime": "application/pdf",
        "size": 1048576,
        "extension": "pdf",
        "workspaceId": 0
      }'
    ```
  </Step>

  <Step title="Upload to S3">
    Upload the file to the presigned URL:

    ```bash theme={null}
    curl -X PUT "PRESIGNED_URL_FROM_STEP_1" \
      -H "Content-Type: application/pdf" \
      --data-binary @document.pdf
    ```
  </Step>

  <Step title="Create the file entry">
    Register the file in Drime Cloud:

    ```bash theme={null}
    curl -X POST https://app.drime.cloud/api/v1/s3/entries \
      -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
      -H "Content-Type: application/json" \
      -d '{
        "filename": "UUID_FROM_KEY",
        "size": 1048576,
        "clientName": "document.pdf",
        "clientMime": "application/pdf",
        "clientExtension": "pdf",
        "workspaceId": 0
      }'
    ```
  </Step>
</Steps>

## List Your Files

```bash theme={null}
curl https://app.drime.cloud/api/v1/drive/file-entries?workspaceId=0 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
```

Response:

```json theme={null}
{
  "data": [
    {
      "id": 123456,
      "name": "document.pdf",
      "type": "pdf",
      "file_size": 1048576,
      "hash": "MTIzNDU2fA",
      "created_at": "2024-01-15T10:30:00.000000Z"
    }
  ],
  "current_page": 1,
  "total": 1
}
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Authentication" icon="key" href="/authentication">
    Learn more about authentication methods
  </Card>

  <Card title="API Reference" icon="code" href="/api-reference/introduction">
    Explore all available endpoints
  </Card>

  <Card title="Multipart Uploads" icon="upload" href="/api-reference/multipart/create-multipart">
    Upload large files with multipart
  </Card>

  <Card title="Sharing" icon="share" href="/api-reference/sharing/share-entry">
    Share files with others
  </Card>
</CardGroup>
