Deleted Documents

The deleted-documents resource can be used to obtain a list of all the documents that have been deleted from the API since a specified time. A typical use case would be where a client wishes to maintain an up-to-date view of the events on a linear channel’s schedule, and therefore needs to know which events have been recently removed from that schedule.

The Request

The core syntax for a deleted-documents request is as follows:
https://{{ApiEndpoint}}/deleted-documents?deletedSince={{DeletionDate}}&api_key={{ApiKey}}
Here, DeletionDate should be a date/time in ISO 8601 format, e.g. 2019-10-17T00:00:00. This will return a list of all the documents that have been deleted from all stores, irrespective of type. Adding the following parameter will filter the results to list only the documents deleted from a specific store since the DeletionDate:
&storeType={{StoreType}}
where StoreType can be any of contentinstance, contributor or source. If StoreType is contentinstance, adding the following parameter will filter the results to list only the contentinstance documents of a specific type deleted since the DeletionDate:
&hierarchyLevel={{HierarchyLevel}}
where HierarchyLevel can be any of series, season, multiPartProgram, programVariation or event.

The Response

The response is an array of JSON objects with the following schema:
    {
        "documentId": "847504563",
        "deleteDateTime": "2019-10-17T04:00:15.0Z",
        "storeType": "contentinstance",
        "hierarchyLevel": "event",
        "storeId": "standardericisson"
    },
Here the documentId value will be the primary ID of whatever type of document was deleted. So if a contentinstance/event document was deleted, the documentId will contain the internalIds.eventId of the deleted document. Note that:
  • This resource does not return a paged list of results, and
  • If an API includes linear channel metadata, the documents for all events that aired in the recent past will be routinely deleted from the API, and
  • This means that responses from this resource can get very big.