Skip to main content
DELETE
/
v2
/
files
/
{collection_id}
/
curl -X DELETE 'https://api.anyformat.ai/v2/files/b2c3d4e5-f6a7-8901-bcde-f12345678901/' \
  -H 'Authorization: Bearer YOUR_API_KEY'
import requests

collection_id = "b2c3d4e5-f6a7-8901-bcde-f12345678901"
url = f"https://api.anyformat.ai/v2/files/{collection_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.delete(url, headers=headers)
print(f"Status: {response.status_code}")
const collectionId = 'b2c3d4e5-f6a7-8901-bcde-f12345678901';
const response = await fetch(`https://api.anyformat.ai/v2/files/${collectionId}/`, {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

console.log(`Status: ${response.status}`);
const collectionId = 'b2c3d4e5-f6a7-8901-bcde-f12345678901';
const response = await fetch(
  `https://api.anyformat.ai/v2/files/${collectionId}/`,
  {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

if (response.status !== 204) {
  const error = await response.json();
  throw new Error(`API error: ${error.error_code}`);
}

console.log('File deleted');
// No response body - file successfully deleted
The collection_id in the URL is the id returned by POST /v2/workflows/{id}/files/ or POST /v2/workflows/{id}/run/.
Deleting a file is permanent and cannot be undone. All associated results will also be deleted. If the file has in-progress processing, processing will be cancelled.
curl -X DELETE 'https://api.anyformat.ai/v2/files/b2c3d4e5-f6a7-8901-bcde-f12345678901/' \
  -H 'Authorization: Bearer YOUR_API_KEY'
import requests

collection_id = "b2c3d4e5-f6a7-8901-bcde-f12345678901"
url = f"https://api.anyformat.ai/v2/files/{collection_id}/"
headers = {
    "Authorization": "Bearer YOUR_API_KEY"
}

response = requests.delete(url, headers=headers)
print(f"Status: {response.status_code}")
const collectionId = 'b2c3d4e5-f6a7-8901-bcde-f12345678901';
const response = await fetch(`https://api.anyformat.ai/v2/files/${collectionId}/`, {
  method: 'DELETE',
  headers: {
    'Authorization': 'Bearer YOUR_API_KEY'
  }
});

console.log(`Status: ${response.status}`);
const collectionId = 'b2c3d4e5-f6a7-8901-bcde-f12345678901';
const response = await fetch(
  `https://api.anyformat.ai/v2/files/${collectionId}/`,
  {
    method: 'DELETE',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY'
    }
  }
);

if (response.status !== 204) {
  const error = await response.json();
  throw new Error(`API error: ${error.error_code}`);
}

console.log('File deleted');
// No response body - file successfully deleted

Authorizations

Authorization
string
header
required

API key issued from app.anyformat.ai/api-key. Send as Authorization: Bearer <key>.

Path Parameters

collection_id
string
required

Response

Successful Response