DELETE
/
v3
/
documents
/
bulk
Bulk delete documents
const url = 'https://api.supermemory.ai/v3/documents/bulk';
const options = {
  method: 'DELETE',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"ids":["acxV5LHMEsG2hMSNb4umbn","bxcV5LHMEsG2hMSNb4umbn"]}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
{
  "success": true,
  "deletedCount": 2,
  "errors": [
    {
      "id": "<string>",
      "error": "<string>"
    }
  ],
  "containerTags": [
    "user_123",
    "project_123"
  ]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json

Request body for bulk deleting documents by IDs or container tags

ids
string[]

Array of document IDs to delete (max 100 at once)

Required array length: 1 - 100 elements
Example:
[
"acxV5LHMEsG2hMSNb4umbn",
"bxcV5LHMEsG2hMSNb4umbn"
]
containerTags
string[]

Array of container tags - all documents in these containers will be deleted

Minimum length: 1
Example:
["user_123", "project_123"]

Response

Bulk deletion completed successfully

Response for bulk document deletion

success
boolean
required

Whether the bulk deletion was successful

Example:

true

deletedCount
number
required

Number of documents successfully deleted

Example:

2

errors
object[]

Array of errors for documents that couldn't be deleted (only applicable when deleting by IDs)

containerTags
string[]

Container tags that were processed (only applicable when deleting by container tags)

Example:
["user_123", "project_123"]