Deleting Documents
Documents can be deleted from custom data sources either by batch id
or guid
.
Deleting by batch
When documents are uploaded, they will be assigned a batch id
(if one is not already provided). This ID can then be used to delete that same batch of documents.
curl -X POST 'https://api.brandwatch.com/content/delete' \
-H 'authorization: bearer xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxx' \
-H 'content-type: application/json' \
-d '{"contentSource": NUMERIC_ID,"batch": BATCH_ID}'
Deleting individual documents
It is also possible to delete individual documents. This can be done for up to 1,000 documents at a time. As seen in the example below, items
will contain one element for each document you want to delete. That item can have either a guid
or url
field to indicate which document to delete.
If the document contains both a
url
and aguid
, then theguid
is required to delete it.
curl -X POST 'https://api.brandwatch.com/content/delete' \
-H 'authorization: bearer xxxxxx-xxxxxx-xxxxxx-xxxxxx-xxxx' \
-H 'content-type: application/json' \
-d '{"contentSource": NUMERIC_ID,"items": [{"guid": "AGUID","URL": "AURL"}]}'
Please note that deletes happen asynchronously - this means if you re-upload documents with the same
batch id
orguid
very quickly after sending a delete, there is a chance that the delete might run after the documents are uploaded. Therefore it's important to ensure you allow some time for deletes to have occurred first.
Updated over 3 years ago