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

# Duplicate Entries

> Create copies of files and folders

## Overview

Creates duplicates of one or more file entries. The copies are created in the same location with "(copy)" appended to the name.

## Query Parameters

<ParamField query="workspaceId" type="integer">
  Workspace context
</ParamField>

## Request Body

<ParamField body="entryIds" type="array" required>
  Array of entry IDs to duplicate
</ParamField>

<ParamField body="destinationId" type="integer">
  Optional destination folder ID. If not provided, copies are created in the same location.
</ParamField>

## Response

<ResponseField name="entries" type="array">
  Array of newly created duplicate entries
</ResponseField>

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

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST "https://app.drime.cloud/api/v1/file-entries/duplicate?workspaceId=0" \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
    -H "Content-Type: application/json" \
    -d '{
      "entryIds": [123]
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch(
    'https://app.drime.cloud/api/v1/file-entries/duplicate?workspaceId=0',
    {
      method: 'POST',
      headers: {
        'Authorization': 'Bearer YOUR_ACCESS_TOKEN',
        'Content-Type': 'application/json'
      },
      body: JSON.stringify({
        entryIds: [123]
      })
    }
  );

  const { entries } = await response.json();
  console.log('Created duplicates:', entries);
  ```

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

  response = requests.post(
      'https://app.drime.cloud/api/v1/file-entries/duplicate',
      params={'workspaceId': 0},
      headers={'Authorization': 'Bearer YOUR_ACCESS_TOKEN'},
      json={'entryIds': [123]}
  )

  duplicates = response.json()['entries']
  ```
</RequestExample>

<ResponseExample>
  ```json 200 - Success theme={null}
  {
    "status": "success",
    "entries": [
      {
        "id": 124,
        "name": "document (copy).pdf",
        "type": "pdf",
        "file_size": 1048576,
        "parent_id": null,
        "created_at": "2024-01-20T10:00:00.000000Z"
      }
    ]
  }
  ```
</ResponseExample>
