Skip to main content
DELETE
/
prod
/
v1
/
files
Delete multiple files
curl --request DELETE \
  --url https://api.orion.file.ai/prod/v1/files \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "fileIds": [
    "8123612d-187c-44eb-8ac6-214e68506b7e",
    "8123612d-187c-44eb-8ac6-214e68506b7f"
  ]
}
'
{
  "success": true
}

Documentation Index

Fetch the complete documentation index at: https://docs.file.ai/llms.txt

Use this file to discover all available pages before exploring further.

The fileIds field is used to specify the files that should be deleted. The files that are specified in the fileIds field will be deleted. If a files is not specified in the fileIds field, the files will not be deleted.

Overview

Permanently deletes multiple files from the system. This is a bulk operation that allows you to remove several files in a single request.
Warning: This action is irreversible.

Request Parameters

Request Body

The request body must contain a JSON object with the following structure:
PropertyTypeRequiredDescription
fileIdsstringYesComma-separated list of file UUIDs to be deleted

Request Examples

Single File Deletion

{
  "fileIds": "8123612d-187c-44eb-8ac6-214e68506b7e"
}

Multiple Files Deletion

{
  "fileIds": "8123612d-187c-44eb-8ac6-214e68506b7e,8123612d-187c-44eb-8ac6-214e68506b7f,9234723e-298d-55fc-9bd7-325f79617c8g"
}

Success Response (200 OK)

{
  "success": true
}

Error Responses

400 Bad Request

{
  "error": "Invalid request",
  "message": "fileIds parameter is required and cannot be empty"
}

403 Bad Request

{
  "message": "Access denied. You are in readonly mode.",
  "error": "Forbidden",
  "statusCode": 403
}

422 Bad Request

{
  "message": "Invalid fileIds.",
  "error": "Unprocessable Entity",
  "statusCode": 422
}

Important Notes

  • Irreversible Action: Deleted files cannot be recovered. Ensure you have proper backups before deletion.
  • UUID Format: File IDs must be valid UUIDs in the format xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx.
  • Comma Separation: When providing multiple file IDs as a string, separate them with commas without spaces.
  • Batch Processing: The endpoint processes all file IDs in a single transaction where possible.
  • Partial Failures: If some files cannot be deleted, the operation will complete for valid files and return error details for failed ones.
  • Permission Checks: Each file deletion is subject to individual permission validation.

File ID Requirements

  • Must be valid UUID format (36 characters including hyphens)
  • File must exist in the system
  • User must have delete permissions for each file
  • Maximum recommended batch size: 100 files per request

Use Cases

  • Bulk cleanup of temporary or processed files
  • User-initiated deletion of selected files from file manager
  • Automated cleanup processes removing expired files
  • Storage management operations to free up space
  • Data privacy compliance for user data deletion requests

Best Practices

  • Validate file ownership before deletion
  • Implement confirmation dialogs for user-facing operations
  • Log deletion activities for audit purposes
  • Check file dependencies before deletion
  • Use reasonable batch sizes to avoid timeouts
  • Handle partial failures gracefully in your application logic

Authorizations

x-api-key
string
header
required

API key for authentication

Body

application/json

Delete multiple files input

The body is of type string.

Response

The files are deleted

success
boolean