Purge a File

Permanently removes a file from the system. When a file is purged, all its revisions and associated content are also removed, and the file can no longer be restored by the Restore a Deleted File command.

The Purge a File command starts an asynchronous task to perform the removal. This means that there might be a short window of time between the start and finish of the purge process during which the deleted file might still be referenced by another process.

Note: For more information about this command, including descriptions of any path and request parameters, request body schema, response codes and schemas, and payload examples, refer to the online API reference for this command at the following web page:

Purge a file

URI

https://bartendercloud.com/api/librarian/files/{fileId}/purge

Note: The bartendercloud.com domain that is referenced in the URI and in the code example that follows must be replaced with the contents of the DataCenterURI claim that is extracted from your access token. For more information, refer to Extracting the DataCenterURI Claim.

Path Parameters

fileId

Type: String

Specifies the ID of the file to purge. Required.

Query Parameters

None.

Example

Request body: None.

Response: None.

Copy
var client = new HttpClient();
client.DefaultRequestHeaders.Add("Authorization", $"Bearer {accessToken}");

HttpResponseMessage msg = await _httpClient.DeleteAsync($"https://bartendercloud.com/api/librarian/files/{fileId}/purge");
if (msg.IsSuccessStatusCode)
{
    return;
}