MediaDelete several files

Delete several files

Deletes 1 to 100 files and returns a result for each. Pages that use a deleted file show it as missing. Requires admin role.

curl -X POST "https://api.documentationai.app/api/v1/media/bulk-delete" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_TOKEN" \
  -d '{
  "mediaIds": [
    "123e4567-e89b-12d3-a456-426614174000"
  ]
}'
{
  "deleted": [
    "123e4567-e89b-12d3-a456-426614174000"
  ],
  "failed": [
    {
      "source": "4c1d8a2e-7b3f-4f0a-9d6e-2a5b8c7e1f03",
      "error": "File not found"
    }
  ],
  "reclaimedBytes": 184233
}
POST
/media/bulk-delete
POST
Base URLstring

Target server for requests. Edit to use your own host.

Bearer Token
Bearer Tokenstring
Required

API key generated from the Documentation.AI dashboard (Settings → API Keys). Pass as Authorization: Bearer dai_...

API key generated from the Documentation.AI dashboard (Settings → API Keys). Pass as Authorization: Bearer dai_...
Content-Typestring
Required

The media type of the request body

Options: application/json
mediaIdsarray
Required

The id of each file to delete

Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Bearer token. API key generated from the Documentation.AI dashboard (Settings → API Keys). Pass as Authorization: Bearer dai_...

Body

application/json
mediaIdsarray
Required

The id of each file to delete

Responses

deletedstring[]

Identifiers of the files that were deleted

failedarray

Files that were not deleted, each with the reason

reclaimedBytesinteger

Storage freed by this request, in bytes