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

# Create S3 Entry

> Register a file in Drime after S3 upload

## Overview

Creates a file entry in the Drime database after successfully uploading a file to S3/R2. This is the final step in both simple and multipart upload flows.

## Request Body

<ParamField body="filename" type="string" required>
  The UUID filename from the S3 key (last segment)
</ParamField>

<ParamField body="size" type="integer" required>
  File size in bytes
</ParamField>

<ParamField body="clientName" type="string" required>
  Original filename to display to users
</ParamField>

<ParamField body="clientMime" type="string">
  MIME type of the file
</ParamField>

<ParamField body="clientExtension" type="string">
  File extension without dot
</ParamField>

<ParamField body="workspaceId" type="integer">
  Workspace ID. Use `0` for personal workspace.
</ParamField>

<ParamField body="parentId" type="integer">
  Parent folder ID. Use `null` for root.
</ParamField>

<ParamField body="relativePath" type="string">
  Folder path for auto-creation (overrides parentId)
</ParamField>

## Response

<ResponseField name="fileEntry" type="object">
  The created file entry object
</ResponseField>

<ResponseField name="status" type="string">
  Request status (`success`)
</ResponseField>

<RequestExample>
  ```bash cURL 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": "71ea55f2-1ba7-46ad-98b7-db487ecac2f6",
      "size": 87965,
      "clientName": "document.pdf",
      "clientMime": "application/pdf",
      "clientExtension": "pdf",
      "workspaceId": 0,
      "parentId": null
    }'
  ```

  ```javascript JavaScript theme={null}
  // After uploading to S3...
  const key = 'uploads/71ea55f2-1ba7-46ad-98b7-db487ecac2f6/71ea55f2-1ba7-46ad-98b7-db487ecac2f6';
  const uuid = key.split('/').pop(); // Extract UUID

  const response = await fetch('https://app.drime.cloud/api/v1/s3/entries', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      filename: uuid,
      size: file.size,
      clientName: file.name,
      clientMime: file.type,
      clientExtension: file.name.split('.').pop(),
      workspaceId: 0,
      parentId: null
    })
  });

  const { fileEntry } = await response.json();
  console.log(`File registered: ${fileEntry.name} (ID: ${fileEntry.id})`);
  ```

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

  # After uploading to S3...
  key = 'uploads/71ea55f2-1ba7-46ad-98b7-db487ecac2f6/71ea55f2-1ba7-46ad-98b7-db487ecac2f6'
  uuid = key.split('/')[-1]

  response = requests.post(
      'https://app.drime.cloud/api/v1/s3/entries',
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={
          'filename': uuid,
          'size': 87965,
          'clientName': 'document.pdf',
          'clientMime': 'application/pdf',
          'clientExtension': 'pdf',
          'workspaceId': 0,
          'parentId': None
      }
  )

  file_entry = response.json()['fileEntry']
  print(f"File registered: {file_entry['name']} (ID: {file_entry['id']})")
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "fileEntry": {
      "name": "document.pdf",
      "file_name": "71ea55f2-1ba7-46ad-98b7-db487ecac2f6",
      "mime": "application/pdf",
      "file_size": 87965,
      "type": "pdf",
      "extension": "pdf",
      "workspace_id": 0,
      "owner_id": 15843,
      "id": 488163222,
      "hash": "NDg4MTYzMjIyfA",
      "path": "488163222",
      "url": "api/v1/file-entries/488163222",
      "created_at": "2025-12-22T13:45:07.000000Z",
      "updated_at": "2025-12-22T13:45:07.000000Z"
    },
    "status": "success"
  }
  ```
</ResponseExample>

<Tip>
  If you provide `relativePath`, folders will be automatically created and the file placed in the correct location.
</Tip>
