Delete Entity Relations
Learn more about how to use this API to delete all relationships for a specified entity.
Use the Delete Entity Relations to delete all relationships for the specified Entity ID.
The Delete Entity Relations submits a task to perform the requested deletes.
HTTP method and endpoint
Use the following HTTP method and endpoint path to submit the request to delete all relationships for the specified entity.
POST {TenantURL}/entities/{id}/deleteRelations?mode={mode}
The following table describes the endpoint path parameters.
| Parameter | Type | Required | Description |
|---|---|---|---|
id | String | Yes | The unique identifier of the entity whose relationships you want to delete. |
Query parameters
The following table describes the query parameters and their values. A query parameter is a key-value pair added to the end of a URL to modify or refine a request.
| Parameter | Type | Required | Description | Accepted values / Default |
|---|---|---|---|---|
mode | String | No | Denotes the method used to remove relations. | soft or hard. soft marks the relations as deleted, but keeps them in the database. hard removes the relations from the database. Default: soft. |
Request headers
The following request headers must be included.
| Header | Value | Required |
|---|---|---|
Authorization | Bearer <accessToken> | Yes |
For more information, see Authentication API.
Request body
This operation does not require a request body.
Example request
Use the following example to see how a complete request is structured with headers.
POST {TenantURL}/entities/{id}/deleteRelations
Headers: Authorization: Bearer {your-access-token}
Response body
The following table describes the fields returned in the response body.
| Parameter | Type | Description |
|---|---|---|
id | String | Unique identifier of the launched task. |
groupId | String | Identifier of the task group. |
createdTime | Number | Timestamp when the task was created. |
createdBy | String | User who created the task. |
updatedTime | Number | Timestamp when the task was last updated. |
updatedBy | String | User who last updated the task. |
type | String | Internal type of the launched task. |
status | String | Status of the launched task. |
name | String | Name of the launched task. |
createdOnHost | String | Host on which the task was created. |
parallelExecution | Boolean | Indicates whether the task runs in parallel execution mode. |
nodesGroup | String | Node group where the task runs. |
parameters | Object | Task parameters, including tenant, mode, and entity URI list. |
currentState | Object | Current state of the task. |
duration | String | Elapsed task duration. |
Example response
The following example shows a response with the launched delete task details.
{
"id": "b26b8206-60f9-4177-a95e-5d43996c96c0",
"groupId": "09e29bd8-992b-479e-89f9-4efc371ed23f",
"createdTime": 1687834302378,
"createdBy": "john.smith@reltio.com",
"updatedTime": 1687834302378,
"updatedBy": "john.smith@reltio.com",
"type": "com.reltio.businesslogic.tasks.delete.DeleteRelationsTask",
"status": "SCHEDULED",
"name": "Soft Delete Relations",
"createdOnHost": "rlt-l-pg01",
"parallelExecution": false,
"nodesGroup": "default",
"parameters": {
"tenantId": "LocalTenantNew",
"mode": "soft",
"entityUriList": "[\"entities/0000AcP\"]"
},
"currentState": {},
"duration": "0s"
}
Check task status
Use the following request to get information about this task:
GET {TenantURL}/tasks/{taskId}
Headers: Authorization: Bearer {your-access-token}
The response is a JSON object that represents information about the launched manual task that deleted all relations for the specified entity.
- numberOfProcessedObjects - the number of relations that were deleted when the task was launched.
- objectsFailedToDeleteCount - the number of relations that were not deleted.
- objectsFailedToDelete - the IDs of the relations that were not deleted. This list contains a maximum of 100 IDs.
- name - the name of the manual task in the format
<Hard/Soft> Delete Relations. - started - the time when the task was launched.
- throughput - the current speed of the task, which is the number of relations deleted per second.
- tenant - the tenant where the task was launched.
- current - the current time.
The following example shows the task response:
{
"id": "b26b8206-60f9-4177-a95e-5d43996c96c0",
"groupId": "09e29bd8-992b-479e-89f9-4efc371ed23f",
"createdTime": 1687834302378,
"createdBy": "john.smith@reltio.com",
"updatedTime": 1687834302378,
"updatedBy": "john.smith@reltio.com",
"type": "com.reltio.businesslogic.tasks.delete.DeleteRelationsTask",
"status": "COMPLETED",
"name": "Soft Delete Relations",
"createdOnHost": "rlt-l-pg01",
"executedOnHost": "rlt-l-pg01",
"parallelExecution": false,
"nodesGroup": "default",
"startTime": 1687834302744,
"endTime": 1687834304271,
"parameters": {
"tenantId": "LocalTenantNew",
"mode": "soft",
"entityUriList": "[\"entities/0000AcP\"]"
},
"currentState": {
"objectsFailedToDelete": [],
"deletedObjectsCount": 3,
"objectsFailedToDeleteCount": 0,
"numberOfFailedToPublishEvents": 0,
"lastHourThroughput": 0.0,
"numberOfProcessedObjects": 3,
"status": "Completed"
},
"throughput": 3.0,
"duration": "1s"
}