> ## 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.

# Key Concepts

> Understanding the core concepts of Drime Cloud

## File Entries

A **File Entry** represents either a file or a folder in Drime Cloud. Each entry has:

* A unique **ID**
* A **hash** for public URLs
* A **parent\_id** (null = root)
* A **workspace\_id** (0 = personal space)

```json theme={null}
{
  "id": 123456,
  "name": "document.pdf",
  "type": "pdf",
  "hash": "MTIzNDU2fA",
  "file_hash": "9f86d081884c7d659a2feaa0c55ad015a3bf4f1b2b0b822cd15d6c15b0f00a08",
  "parent_id": null,
  "workspace_id": 0,
  "created_at": "2024-01-14T08:20:00.000000Z",
  "updated_at": "2024-01-20T15:30:00.000000Z",
  "client_last_modified": 1712345678000
}
```

## Identifiers: `id` vs `hash`

Every entry carries two identifiers. They are **not** interchangeable everywhere:

| Field  | What it is                                                 | Where to use it                                                              |
| ------ | ---------------------------------------------------------- | ---------------------------------------------------------------------------- |
| `id`   | Numeric primary key (e.g. `485529678`)                     | All `/file-entries/{entryId}` endpoints, metadata, integrity checks          |
| `hash` | URL-safe encoded version of the ID (e.g. `NDg1NTI5Njc4fA`) | Public/share URLs, downloads (`/file-entries/download/{hash}`), folder paths |

<Warning>
  The `hash` field is an **encoded identifier**, not a hash of the file content. For content
  hashing (integrity, deduplication), see `file_hash` below.
</Warning>

## Content Hash (`file_hash`)

`file_hash` stores the **SHA-256 hex digest of the file content**. It is set when:

* The client provides `fileHash` at upload time ([Upload File](/api-reference/uploads/upload-file), [Create S3 Entry](/api-reference/uploads/create-s3-entry))
* A successful [Verify File Integrity](/api-reference/files/verify-file-integrity) call stores the server-computed hash

Use it for:

* **Deduplication / instant uploads** via [Check File Hash](/api-reference/files/check-file-hash)
* **End-to-end integrity checks** via [Verify File Integrity](/api-reference/files/verify-file-integrity)

## Timestamps & Modification Time

File entries expose several time fields with distinct meanings:

| Field                  | Format                      | Meaning                                                         |
| ---------------------- | --------------------------- | --------------------------------------------------------------- |
| `created_at`           | ISO 8601 (UTC)              | When the entry was created in Drime                             |
| `updated_at`           | ISO 8601 (UTC)              | Last server-side change (rename, move, content replace)         |
| `client_last_modified` | Unix epoch **milliseconds** | Original modification time of the file on the client machine    |
| `captured_at`          | ISO 8601 (UTC)              | EXIF capture date for photos/videos (drives the photo timeline) |

To **preserve the original mtime** of files (like rclone's `SetModTime` or a sync client would):

1. Pass `lastModified` (ms epoch) in the upload request body, **or**
2. Call [Set File Metadata](/api-reference/files/set-file-metadata) on an existing entry

```bash theme={null}
# Preserve mtime on an already-uploaded file
curl -X POST https://app.drime.cloud/api/v1/file-entries/485529678/metadata \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{"lastModified": 1712345678000}'
```

## Workspaces

**Workspaces** allow you to organize your files and collaborate:

<CardGroup cols={2}>
  <Card title="Personal Space" icon="user">
    `workspaceId = 0` represents your default personal space
  </Card>

  <Card title="Shared Workspaces" icon="users">
    Create workspaces to collaborate with your team
  </Card>
</CardGroup>

## File Types

Drime Cloud automatically recognizes file types:

| Type     | Description                  |
| -------- | ---------------------------- |
| `folder` | Folder                       |
| `image`  | Images (jpg, png, gif, etc.) |
| `video`  | Videos (mp4, mov, etc.)      |
| `audio`  | Audio files (mp3, wav, etc.) |
| `pdf`    | PDF documents                |
| `text`   | Text files                   |
| `file`   | Other files                  |

## Permissions

When sharing, you can grant different permissions:

<AccordionGroup>
  <Accordion title="view" icon="eye">
    Allows viewing the file/folder
  </Accordion>

  <Accordion title="edit" icon="pen">
    Allows modifying the file/folder
  </Accordion>

  <Accordion title="download" icon="download">
    Allows downloading the file
  </Accordion>
</AccordionGroup>

## Vault (Encrypted Storage)

The **Vault** is a client-side encrypted storage area:

<Warning>
  Vault files are encrypted with your password. If you lose this password, files are **unrecoverable**.
</Warning>

* Client-side AES encryption
* Keys never leave your device
* Ideal for sensitive documents
