Bulk Delete Relationships
Learn more about how to use the Bulk Delete Relationships task to delete relationships for the specified URIs.
Use Bulk Delete Relationships to delete all relationships for the specified URIs.
HTTP method and endpoint
Use the following HTTP method and endpoint path to submit the request to delete relationships for the specified URIs.
POST {TenantURL}/relations/deleteByUris?mode={mode}
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 the relations. | soft or hard. soft: marks relations as deleted, but keeps them in the database. hard: removes 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 requires a request body. Provide a JSON array of relationship URIs to delete.
Each array item must be a relationship URI, such as relations/0000KCz.
Example request
Use the following example to see how a complete request is structured with headers and a JSON body.
POST {TenantURL}/relations/deleteByUris?mode=soft
Headers: Authorization: Bearer {your-access-token}
[
"relations/0000KCz",
"relations/0000OTF"
]
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 relationship 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": "f5a31183-427e-4cce-b03b-951b076c72f5",
"groupId": "42b56ced-f0c0-43e8-9c21-af28c009d0da",
"createdTime": 1687838581111,
"createdBy": "user@example.com",
"updatedTime": 1687838581111,
"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",
"relationUriList": "[\r\n \"relations/0000KCz\",\r\n \"relations/0000OTF\"\r\n]"
},
"currentState": {},
"duration": "0s"
}
Check task status
Use the following request to get information about the submitted 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": "f5a31183-427e-4cce-b03b-951b076c72f5",
"groupId": "42b56ced-f0c0-43e8-9c21-af28c009d0da",
"createdTime": 1687838581111,
"createdBy": "john.smith@reltio.com",
"updatedTime": 1687838581111,
"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": 1687838581326,
"endTime": 1687838590873,
"parameters": {
"tenantId": "LocalTenantNew",
"mode": "soft",
"relationUriList": "[\r\n \"relations/0000KCz\",\r\n \"relations/0000OTF\"\r\n]"
},
"currentState": {
"objectsFailedToDelete": [],
"deletedObjectsCount": 2,
"objectsFailedToDeleteCount": 0,
"numberOfFailedToPublishEvents": 0,
"lastHourThroughput": 0.0,
"numberOfProcessedObjects": 2,
"status": "Completed"
},
"throughput": 0.22222222,
"duration": "9s"
}