Skip to main content
POST
/
v0
/
files
/
{id}
/
copy
curl -X POST https://api.getagentdrive.com/v0/files/file_xyz789/copy \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "destination_path": "backups/report-copy.pdf",
    "destination_drive_id": "drv_def456"
  }'
{
  "id": "file_new123",
  "drive_id": "drv_def456",
  "path": "backups/report-copy.pdf",
  "filename": "report-copy.pdf",
  "mime_type": "application/pdf",
  "size": 24576,
  "content_hash": "sha256:abcdef1234567890",
  "content_preview": null,
  "tags": ["report", "2026"],
  "metadata": { "author": "Jane Doe" },
  "created_at": "2026-03-19T09:00:00Z",
  "updated_at": "2026-03-19T09:00:00Z"
}

Path Parameters

id
string
required
The unique identifier of the file to copy.

Request Body

destination_path
string
required
The path for the new copy of the file.
destination_drive_id
string
The ID of the drive to copy the file to. Defaults to the same drive as the source file.
curl -X POST https://api.getagentdrive.com/v0/files/file_xyz789/copy \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "destination_path": "backups/report-copy.pdf",
    "destination_drive_id": "drv_def456"
  }'
{
  "id": "file_new123",
  "drive_id": "drv_def456",
  "path": "backups/report-copy.pdf",
  "filename": "report-copy.pdf",
  "mime_type": "application/pdf",
  "size": 24576,
  "content_hash": "sha256:abcdef1234567890",
  "content_preview": null,
  "tags": ["report", "2026"],
  "metadata": { "author": "Jane Doe" },
  "created_at": "2026-03-19T09:00:00Z",
  "updated_at": "2026-03-19T09:00:00Z"
}

Response

Returns the newly created file record. See Get File for the full response schema.