const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['acxV5LHMEsG2hMSNb4umbn', 'bxcV5LHMEsG2hMSNb4umbn']})
};
fetch('https://api.supermemory.ai/v3/documents/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.supermemory.ai/v3/documents/bulk"
payload = { "ids": ["acxV5LHMEsG2hMSNb4umbn", "bxcV5LHMEsG2hMSNb4umbn"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.supermemory.ai/v3/documents/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"acxV5LHMEsG2hMSNb4umbn",
"bxcV5LHMEsG2hMSNb4umbn"
]
}
'{
"success": true,
"deletedCount": 2,
"errors": [
{
"id": "<string>",
"error": "<string>"
}
],
"containerTags": [
"<string>"
]
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}Bulk delete documents
Bulk delete documents by IDs or container tags
const options = {
method: 'DELETE',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({ids: ['acxV5LHMEsG2hMSNb4umbn', 'bxcV5LHMEsG2hMSNb4umbn']})
};
fetch('https://api.supermemory.ai/v3/documents/bulk', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.supermemory.ai/v3/documents/bulk"
payload = { "ids": ["acxV5LHMEsG2hMSNb4umbn", "bxcV5LHMEsG2hMSNb4umbn"] }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.delete(url, json=payload, headers=headers)
print(response.text)curl --request DELETE \
--url https://api.supermemory.ai/v3/documents/bulk \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"ids": [
"acxV5LHMEsG2hMSNb4umbn",
"bxcV5LHMEsG2hMSNb4umbn"
]
}
'{
"success": true,
"deletedCount": 2,
"errors": [
{
"id": "<string>",
"error": "<string>"
}
],
"containerTags": [
"<string>"
]
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}{
"error": "<string>",
"details": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Body
Request body for bulk deleting documents by IDs or container tags
Array of document IDs to delete (max 100 at once)
1 - 100 elementsArray of container tags - all documents in these containers will be deleted
1100^[a-zA-Z0-9_:-]+$Delete documents matching this filepath. Exact match for full paths, prefix match if ending with /
Response
Bulk deletion completed successfully
Response for bulk document deletion
Whether the bulk deletion was successful
true
Number of documents successfully deleted
2
Array of errors for documents that couldn't be deleted (only applicable when deleting by IDs)
Show child attributes
Show child attributes
Container tags that were processed (only applicable when deleting by container tags)
Was this page helpful?