Bulk Delete / Trash Files or Folders
Soft-deletes or trashes multiple files and folders in a single request
PUT
/
medias
/
delete-files
Bulk Delete / Trash Files or Folders
curl --request PUT \
--url https://services.leadconnectorhq.com/medias/delete-files \
--header 'Content-Type: application/json' \
--data '
{
"filesToBeDeleted": [
{
"_id": "686f630df0d3166d68fbcec2"
}
],
"altType": "location",
"altId": "sx6wyHhbFdRXh302LLNR",
"status": "deleted"
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
filesToBeDeleted: [{_id: '686f630df0d3166d68fbcec2'}],
altType: 'location',
altId: 'sx6wyHhbFdRXh302LLNR',
status: 'deleted'
})
};
fetch('https://services.leadconnectorhq.com/medias/delete-files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/medias/delete-files"
payload = {
"filesToBeDeleted": [{ "_id": "686f630df0d3166d68fbcec2" }],
"altType": "location",
"altId": "sx6wyHhbFdRXh302LLNR",
"status": "deleted"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)Body
application/json
Response
200 - application/json
Successful response
Last modified on March 8, 2026
Was this page helpful?
Bulk Delete / Trash Files or Folders
curl --request PUT \
--url https://services.leadconnectorhq.com/medias/delete-files \
--header 'Content-Type: application/json' \
--data '
{
"filesToBeDeleted": [
{
"_id": "686f630df0d3166d68fbcec2"
}
],
"altType": "location",
"altId": "sx6wyHhbFdRXh302LLNR",
"status": "deleted"
}
'const options = {
method: 'PUT',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
filesToBeDeleted: [{_id: '686f630df0d3166d68fbcec2'}],
altType: 'location',
altId: 'sx6wyHhbFdRXh302LLNR',
status: 'deleted'
})
};
fetch('https://services.leadconnectorhq.com/medias/delete-files', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://services.leadconnectorhq.com/medias/delete-files"
payload = {
"filesToBeDeleted": [{ "_id": "686f630df0d3166d68fbcec2" }],
"altType": "location",
"altId": "sx6wyHhbFdRXh302LLNR",
"status": "deleted"
}
headers = {"Content-Type": "application/json"}
response = requests.put(url, json=payload, headers=headers)
print(response.text)