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/"
}'
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/",
"confirm": true
}'
{
"path": "documents/old/",
"file_count": 15,
"message": "This folder contains 15 files. Set confirm to true to delete."
}
{
"success": true,
"deleted_count": 15
}
Folders
Delete Folder
Delete a folder and optionally all of its contents recursively.
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/"
}'
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/",
"confirm": true
}'
{
"path": "documents/old/",
"file_count": 15,
"message": "This folder contains 15 files. Set confirm to true to delete."
}
{
"success": true,
"deleted_count": 15
}
Request Body
string
required
The ID of the drive containing the folder.
string
required
The path of the folder to delete.
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/"
}'
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/",
"confirm": true
}'
{
"path": "documents/old/",
"file_count": 15,
"message": "This folder contains 15 files. Set confirm to true to delete."
}
{
"success": true,
"deleted_count": 15
}
Response (Preview)
string
The path of the folder.
integer
The number of files that would be deleted.
string
A human-readable message describing the impact of the deletion.
Response (Confirmed)
boolean
Whether the deletion was successful.
integer
The number of files that were deleted.
