Skip to main content
DELETE
https://api.pretectum.io
/
v1
/
businessareas
/
{businessAreaId}
/
schemas
/
{schemaId}
/
datasets
/
{datasetId}
/
dataobjects
/
{dataObjectId}
Delete Data Object
curl --request DELETE \
  --url https://api.pretectum.io/v1/businessareas/{businessAreaId}/schemas/{schemaId}/datasets/{datasetId}/dataobjects/{dataObjectId} \
  --header 'Authorization: <authorization>'
The Delete Data Object endpoint allows you to remove a record from a dataset. Deleted records are marked as deleted rather than permanently removed, allowing for potential recovery and audit trail maintenance.

Prerequisites

Authentication

Include your access token in the Authorization header.
Pass the token directly without the “Bearer” prefix.
Authorization: your_access_token

Request

Path Parameters

businessAreaId
string
required
The unique identifier of the business area. You can obtain this from the List Business Areas endpoint.
schemaId
string
required
The unique identifier of the schema. You can obtain this from the List Schemas endpoint.
datasetId
string
required
The unique identifier of the dataset. You can obtain this from the List Datasets endpoint.
dataObjectId
string
required
The unique identifier of the data object to delete. You can obtain this from the List Data Objects endpoint.

Headers

Authorization
string
required
Your access token obtained from the /v1/oauth2/token endpoint. Pass the token directly without the “Bearer” prefix.
Accept
string
default:"application/json"
The response content type. Currently only application/json is supported.

Example Requests

curl -X DELETE "https://api.pretectum.io/v1/businessareas/20240115103000123a1b2c3d4e5f6789012345678901234/schemas/20240115103000456d1e2f3a4b5c6789012345678901234/datasets/20240925152201042a1b2c3d4e5f6789012345678901234/dataobjects/20240601120000123f1a2b3c4d5e6789012345678901234" \
  -H "Authorization: your_access_token" \
  -H "Accept: application/json"

Response

A successful deletion returns a 204 No Content response with no body.

Success Response

HTTP/1.1 204 No Content
The 204 No Content response indicates the deletion was successful. The data object is marked as deleted and will no longer appear in list operations.

Error Responses

Status CodeDescription
401 UnauthorizedInvalid or expired access token. Obtain a new token from /v1/oauth2/token and try again.
403 ForbiddenYour application client does not have permission to delete data objects. Contact your tenant administrator.
404 Not FoundThe specified business area, schema, dataset, or data object does not exist, or you do not have access to it.
500 Internal Server ErrorAn unexpected error occurred on the server. Try again later or contact support.

Soft Delete

Pretectum uses soft delete for data objects:
  • Records are marked as deleted (deleted: true) rather than permanently removed.
  • Deleted records are excluded from list operations and search results.
  • This approach maintains data integrity for audit trails and allows potential recovery.
Deletion is a sensitive operation. Ensure you have proper confirmation workflows in place before deleting data objects, especially in production environments.

Batch Deletion

To delete multiple data objects, call the delete endpoint for each object. For better performance with large batches, consider running deletions in parallel:
async function deleteMultipleDataObjects(businessAreaId, schemaId, datasetId, dataObjectIds) {
  const results = await Promise.allSettled(
    dataObjectIds.map(id =>
      deleteDataObject(businessAreaId, schemaId, datasetId, id)
    )
  );

  const succeeded = results.filter(r => r.status === 'fulfilled' && r.value).length;
  const failed = results.filter(r => r.status === 'rejected' || !r.value).length;

  console.log(`Deleted ${succeeded} objects, ${failed} failed`);
  return { succeeded, failed };
}

const idsToDelete = [
  '20240601120000123f1a2b3c4d5e6789012345678901234',
  '20240601120100456g2b3c4d5e6f7890123456789012345',
  '20240601120200789h3c4d5e6f7g8901234567890123456'
];

await deleteMultipleDataObjects(businessAreaId, schemaId, datasetId, idsToDelete);

Best Practices

  1. Confirm before deleting: Implement confirmation dialogs or double-check logic before executing deletions.
  2. Log deletions: Maintain a record of what was deleted, when, and by whom for audit purposes.
  3. Handle errors gracefully: Not-found errors may indicate the object was already deleted.
  4. Consider permissions: Ensure only authorized users can delete data objects.
  5. Test in non-production first: Verify your deletion logic in a test environment before running in production.