Bulk Data Operations: Delete
Overview
The Bulk Data Operations (BDO) Delete API endpoint lets you soft delete or hard delete record collections containing submission data stored in the Unqork platform. You can make a delete request using curl, Postman, or any other service that supports a POST request.
To discover how to set up API calls using a third-party program, view our Testing API Endpoints Using Third-Party Applications article.
You can test the BDO Delete endpoint using the Unqork Services page. To access the Unqork Services page, enter the following address into your browser: https://{environment}.unqork.io/fbu/uapi/docs/documentation/#/Bulk%20Operations/delete. Replace {environment} with the name of your Unqork environment.
Understanding Soft Delete and Hard Delete
The BDO Delete operation contains two stages of functionality: soft delete and hard delete. The first time you run the BDO Delete Operations on a set of records, it soft deletes (archives) them. Running the operation again on the same set of records using the destroy query parameter hard deletes all archived records, including records that were archived at an earlier time.
Soft Delete
The first time the BDO Delete operation runs on one or more records, it soft deletes (archives) them. Soft delete removes records from the application's Record Collections, but retains them in the database. This functionality allows you to recover the records at a later time.
While this feature is in early access, Unqork recommends exporting a copy of the record collection before deleting it. Please reach out to your Unqork representative if a record collection has been soft deleted and needs to be recovered.
Hard Delete
Running the BDO Delete operation a second time on the same set of records using the destroy: trueparameter permanently and irreversibly deletes the records. Doing so is useful for records containingPII or other sensitive information that should not be retained for regulatory or safety reasons.
Deleting Submission Data Using Bulk Data Operations
The BDO Delete operation uses the HTTP POST method and the following endpoint: https://{environment}.unqork.io/fbu/uapi/bulk-operations/delete. Replace {environment} with the name of your Unqork environment.
BDO Delete removes a maximum of 500,000 records per operation. Collections larger than 500k require the operation to be run multiple times.
To make calls using third-party programs, you must add an authorization key/value pair to the header. To learn more, view our Testing API Endpoints Using Third-Party Applications article.
Query String Parameters
{
"destroy": Boolean
}
The following parameter is available for the Bulk Data Operation Delete endpoint:
Parameter |
Data Type |
Description |
Required |
---|---|---|---|
destroy |
Boolean |
After soft deleting a set of records, permanently delete them by adding the destroy=truequery to the BDO endpoint. Then, run the operation again. For examplehttps://envName.unqork.io/fbu/uapi/bulk-operations/delete?destroy=true. This setting has no effect if records have not been soft deleted first. |
No |
Body Parameters
{
"dataModelOrModuleId": "string",
"name": "string"
"dateFieldToFilterOn": "created",
"dateFieldStartToFilterOn": "string",
"dateFieldEndToFilterOn": "string",
}
The following fields are available for the Bulk Data Operation Delete schema:
Key |
Possible Values |
Description |
Required |
---|---|---|---|
dataModelOrModuleId |
string (no spaces) |
Specify the Data Model ID, or Module ID, containing the data you want to import. To find a Data Model's ID value, view our How to: Query Data Model Records Data article. |
Yes |
name |
string |
Enter a value to name the import operation by. Names can include spaces. This value also displays in the Job Tracker's File Name column. |
Yes |
dateFieldToFilterOn |
created modified deleted |
Filter deleted data by the following values:
The deleted filter requires the destroy query parameter to be set to true. The destroy=true query finds archived records and hard deletes them. You can identify archived records by the date listed under the deleted property. When using the dateFieldToFilterOn field, you must include dateFieldEndToFilterOn or dateFieldStartToFilterOn, or both in your request. |
Optional |
dateFieldStartToFilterOn |
string (YYYY-MM-DDTHH:mm:ss:sssZ) |
Delete data recorded after this date. Enter the date and time in ISO 8601 Format (UTC). For example, setting this key's value to 2024-10-17T18:02:55.101Z would delete data recorded after October 17th, 2024 at 6:02:55.101PM Zulu time. To delete data from a specific time frame, use dateFieldStartToFilterOn as the start date, and dateFieldEndToFilterOn as the end date. |
Optional |
dateFieldEndToFilterOn |
string (YYYY-MM-DDTHH:mm:ss:sssZ) |
Delete data records up to this date. Enter the date and time in ISO 8601 Format (UTC). For example, setting this key's value to 2024-10-17T18:02:55.101Z would delete data recorded before October 17th, 2024 at 6:02:55.101PM Zulu time. To delete data from a specific time frame, use dateFieldStartToFilterOn as the start date and dateFieldEndToFilterOn as the end date. |
Optional |
Example Response
Below is an example response when deleting records:
{
"id": "6728e46499610f86e6fac431",
"created": 1730733156824,
"modified": 1730733156824,
"createdBy": "creatorName@creatorCompany.com",
"modifiedBy": "creatorName@creatorCompany.com",
"data": {
"type": "DELETE",
"collection": "658c3c6b70573db027a0f3a2",
"dataLocation": {
"database": "unqork",
"collection": "submissions",
"entityType": "MODULE"
},
"name": "Delete Example",
"steps": [
{
"stepType": "DELETE",
"status": "created",
"options": {
"delete": {
"mode": "DELETE",
"dataSource": "MODULE",
"targetRecords": "ARCHIVED"
}
},
"collection": "658c3c6b70573db027a0f3a2",
"dataLocation": {
"database": "unqork",
"collection": "submissions",
"entityType": "MODULE"
}
}
],
}
}
Viewing a Bulk Data Delete Operation Job's Details
After starting a Bulk Data Delete, you can view the job details using the /fbu/uapi/bulk-operations/job/{jobId} endpoint and the GET method. Copy the BDO Delete response's id value and replace the job detail's {jobId}placeholder with it. For example, https://{environment}.unqork.io/fbu/uapi/bulk-operations/job/67169684ec1bf4776fa760a5.
Example Job Details Response
Below is an example of a Job Details endpoint response:
{
"id": "6728e46499610f86e6fac431",
"created": 1730733156824,
"modified": 1730733283591,
"createdBy": "creatorName@companyName.com",
"modifiedBy": null,
"data": {
"type": "DELETE",
"collection": "658c3c6270573d1027a0f3a2",
"dataLocation": {
"database": "unqork",
"collection": "submissions",
"entityType": "MODULE"
},
"name": "Delete Example",
"steps": [
{
"stepType": "DELETE",
"id": "658c3c6270573d1027a0f3a2",
"status": "completed",
"options": {
"delete": {
"mode": "DELETE",
"dataSource": "MODULE",
"targetRecords": "ARCHIVED"
}
},
"dataLocation": {
"database": "unqork",
"collection": "submissions",
"entityType": "MODULE"
},
"collection": "658c3c6b7057db027a0f3a2",
"details": {
"dataLocation": {
"database": "unqork",
"collection": "submissions",
"entityType": "MODULE"
},
"chunks": [
{
"chunkQueueId": "0",
"status": "completed",
"docs": {
"total": 32,
"processed": 32
},
"auditFileKey": "unqorkResource/audit/6728e48799610f86e6fac432/0.json.gz",
"startTime": "2024-11-04T15:14:10.970Z",
"endTime": "2024-11-04T15:14:11.278Z"
}
],
"docs": {
"total": 32,
"processed": 32
}
}
}
],
"status": "completed"
}
}
Using the above example response, the following properties might be important for Creator processes or pipeline development:
Response Property | Description | Example |
---|---|---|
status |
The current status of the operation. The overall operation status is displayed at the bottom of the data object. When troubleshooting, review the status property contained in each stepType of thesteps array. This value is also reflected in the Job Tracker's Job Status column. Status values include:
|
Copy
|
docs |
Located in the details object, the docsobject displays the following properties:
|
Copy
|
Resources