Skip to main content
DELETE
/
v0
/
folders
curl -X DELETE https://api.getagentdrive.com/v0/folders \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "drive_id": "drv_abc123",
    "path": "documents/old/"
  }'
{
  "path": "documents/old/",
  "file_count": 15,
  "message": "This folder contains 15 files. Set confirm to true to delete."
}

Request Body

drive_id
string
required
The ID of the drive containing the folder.
path
string
required
The path of the folder to delete.
confirm
boolean
When false or omitted, returns a preview of how many files would be deleted. Set to true to perform the recursive deletion.
curl -X DELETE https://api.getagentdrive.com/v0/folders \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "drive_id": "drv_abc123",
    "path": "documents/old/"
  }'
{
  "path": "documents/old/",
  "file_count": 15,
  "message": "This folder contains 15 files. Set confirm to true to delete."
}

Response (Preview)

path
string
The path of the folder.
file_count
integer
The number of files that would be deleted.
message
string
A human-readable message describing the impact of the deletion.

Response (Confirmed)

success
boolean
Whether the deletion was successful.
deleted_count
integer
The number of files that were deleted.