Delete Library Documents
Creates a job to delete documents from the library. This allows you to to perform batch document deletions, aiding in the automation of document cleanup processes.
The Delete Library Document job deletes documents using the fully qualified path. You can provide multiple document identifiers (UUIDs or paths) in a comma-separated list.
Prior to deleting, you can list files or use the Inbox/Outbox Explorer to view details of files. Use the Download REST API to download the file.
Using this REST API requires prerequisites, such as understanding how to use jobs. See Prerequisites. Be sure that you understand how to use jobs as described in Managing Jobs. For additional details, see Job Types.
Before using the REST resources, you must understand how to access the REST resources and other important concepts. See Implementation Best Practices for Cloud EPM REST APIs.
Required Roles
Service Administrator
Request
Supported Media Types: application/json
Parameters
The following table summarizes the client request parameters specific to this job. For additional parameters that are common to all jobs, see Execute a Job.
Table 8-38 Parameters
Name | Description | Required | Default |
---|---|---|---|
jobType |
Delete Artifacts From Library, Delete Library Documents, or DELETE_ARTIFACTS_FROM_LIBRARY (all values are supported) | Yes | None |
jobName |
The name of this job. Example: Delete_Quarterly_Sales | No | Delete Library Documents |
idOrFullyQualifiedNames |
Comma-separated list of document identifiers (UUIDs or paths) being deleted | Yes | None |
removeEmptyParentFolders |
Boolean parameter that controls whether empty parent folders
should be deleted after document removal. When set to
|
No | false |
errorFile |
The error file name, in the default download location, which contains the details (including errors) of the operation. Any existing error file with the same name is overwritten. If you don’t provide the extension in Use the Inbox/Outbox Explorer to view the details of the error file. Use the Download REST API to download the file. |
No | false |
For a sample URL, see Sample URL and Payload in Execute a Job.
Example payloads
Example #1: Deleting a single document by a fully qualified path
{
"jobType": "DELETE_ARTIFACTS_FROM_LIBRARY",
"jobName": "Delete Monthly Report",
"parameters": {
"idsOrFullyQualifiedNames": ["Library/Reports/MonthlySales.xlsx"]
}
}
Example #2: Deleting multiple documents by fully qualified paths
{
"jobType": "DELETE_ARTIFACTS_FROM_LIBRARY",
"jobName": "BatchDeleteDocuments",
"parameters": {
"idsOrFullyQualifiedNames": [
"Library/Reports/QuarterlySales.xlsx",
"Library/Reports/AnnualBudget.xlsx"
],
"errorFile": "BatchDeleteLog.log"
}
}
Example #3: Deleting a single document using the UUID
{
"jobType": "DELETE_ARTIFACTS_FROM_LIBRARY",
"jobName": "Delete Single Document",
"parameters": {
"idsOrFullyQualifiedNames": ["a9e8e37c-85ea-4c99-0000-c72160e3335f"],
"errorFile": "DeleteSingle.log"
}
}
Example #4: Deleting documents using mixed identifiers (UUID and path)
{
"jobType": "DELETE_ARTIFACTS_FROM_LIBRARY",
"jobName": "Delete Mixed Identifiers",
"parameters": {
"idsOrFullyQualifiedNames": [
"a9e8e37c-85ea-4c99-0000-c72160e3335f",
"Library/Reports/FinancialSummary.xlsx"
],
"errorFile": "DeleteMixed.log"
}
}
Example #5: Deleting documents and empty parent folders
{
"jobType": "DELETE_ARTIFACTS_FROM_LIBRARY",
"jobName": "CleanupDocumentsAndFolders",
"parameters": {
"idsOrFullyQualifiedNames": [
"Library/Forecast Reports/SampleFolder1/LastDocument.xlsx",
"Library/Plan Reports/SampleFolder2/LastDocument.xlsx"
],
"removeEmptyParentFolders": true,
"errorFile": "CleanupLog.log"
}
}