POST dms.request.objects.delete (Webhook)

As of Version2021 Summer
HTTP MethodPOST
Response FormatJSON
Description

The webhook is triggered if the object or version to delete exists and is deletable, i.e., if the user has sufficient permissions and if the object is not a non-empty folder.

The body contains an object list with the active version or the version to delete of the object(s).

The predicate is applied to every single object in the list. The webhook is triggered for the whole object list as soon as one object satisfies the predicate.

Changing Deletion to a Metadata Update

As of 2023 Spring, it is possible to turn a deletion request into a metadata update via webhook. The following rules apply:

  • The webhook has to change the options parameter action from 200 (stands for deletion) to 300 (stands for metadata update). If the webhook is triggered by a batch deletion request, the action has to be adjusted for all objects in the list.
  • The webhook can additionally change values of the objects' metadata properties.
  • In the audit trail, an entry with 300 OBJECT_METADATA_CHANGED will be created instead of the deletion audit entries 202 OBJECT_FLAGGED_FOR_DELETE and 200 OBJECT_DELETED.
  • If further webhooks of the same type are configured, they get the modified objects list in the body as usual, but they are not allowed to change the action value back to 200.
  • With the modified object list, a POST update with waitForSearchConsistency=true is internally performed.
  • The webhook entry point can only be reached with a delete permission on the objectsThere is no additional check for a write permission.
  • The processing chain after the last webhook of type dms.request.objects.delete is now the metadata update chain. Thus, system hook entry points of other types later in the deletion procession chain are not reached anymore (e.g., webhook dms.response.objects.delete or AMQP hook dms.response.delete). Instead, the webhook entry points of the metadata update chain are passed and such webhooks can be triggered.
  • It is not possible to change the deletion of a single version (action 220) into a metadata update.
Requirements for External EndpointThe target URL must be a POST endpoint accepting and returning a list of objects.
Affected API Requests and Action Codes/History Codes
Called by ServiceAPI-gateway service
HeaderAuthorization-Header
Example Request Body
{
	"objects": [
		{
			"properties": {
				"system:traceId": {
					"value": "adcb4edd823fca4c"
				},
				"system:objectTypeId": {
					"value": "document"
				},
				"system:versionNumber": {
					"value": 3
				},
				"testString": {
					"value": "new test import"
				},
				"system:createdBy": {
					"value": "275c826c-6a61-4e89-9512-8d935a1631e5"
				},
				"system:creationDate": {
					"value": "2020-07-23T13:12:34.370Z"
				},
				"system:lastModificationDate": {
					"value": "2020-07-23T13:12:35.910Z"
				},
				"system:baseTypeId": {
					"value": "system:document"
				},
				"system:tenant": {
					"value": "default"
				},
				"system:lastModifiedBy": {
					"value": "275c826c-6a61-4e89-9512-8d935a1631e5"
				},
				"system:objectId": {
					"value": "9ce1ab26-1a6b-4bc2-aa4b-2b099bff7468"
				}
			},
			"contentStreams": [
				{
					"contentStreamId": "4710AB82-C1B4-11EA-B395-49C30F249D00",
					"archivePath": "default/DOCUMENT/71/0A/B/",
					"length": 431397,
					"mimeType": "application/octet-stream",
					"digest": "11857B6FAD61E41AFB3E7398BA1BA4BFB6B0A5422762FF41A0907BC0BFF7748F",
					"repositoryId": "repo252"
				}
			],
			"options": {
				"action": 200,
				"detail": "OBJECT_DELETED",
				"tenant": "default",
				"user": "root",
				"authorities": [
					"ACL_ADMIN",
					"YUUVIS_TENANT_ADMIN",
					"uma_authorization"
				]
			}
		}
	]
}
Example Predicate

Check if the object type is appEmail:email:

spel:'appEmail:email'.equals(properties['system:objectTypeId']['value'])