Bulk Delete Entities

​

Bulk delete entities by id in a single request.

Each id is soft-deleted exactly as the single DELETE /{entity_id} deletes it, with the same access: the record is marked deleted, leaves normal reads, and can be read again with include_deleted=true on /filter. Each id succeeds or fails on its own; the status is 206 Partial Content when any fails, or when a record was deleted but the work that follows its delete (such as a sync) did not run. A repeated id is deleted once. A record of a company hidden from the caller is answered as a missing one: not deleted, and reported in failedIds as not found.

The service's delete gate (validate_entity_deletes) runs once, with every id the caller may see, before anything is deleted. If it refuses any of them the whole request fails with its status, usually 403, as a bulk update does.

At most 500 ids per request; a larger one is refused with 413 before anything is deleted.

Args: delete_request: {"ids": [...]}, the ids of the records to delete.

Returns: JSON object with: - successfulCount (int): number of records deleted - failedCount (int): number of ids not deleted - successfulIds (List[str]): ids deleted - failedIds (List[str]): ids not deleted (not found, already deleted, or failed) - errors (Dict[str,str]): mapping of failed id → reason - followUpErrors (Dict[str,str]): ids that were deleted (and are in successfulIds) whose follow-up work did not run → reason

Body·

required
application/json
  • Ids of the records to delete. A repeated id is deleted once.

Responses

  • application/json
  • application/json
Request Example for post/bulk/delete
curl https://crm.dreamhub.ai/api/v1/deals/bulk/delete \
  --request POST \
  --header 'Content-Type: application/json' \
  --header 'Authorization: Bearer YOUR_SECRET_TOKEN' \
  --data '{
  "ids": [
    ""
  ]
}'
{
  "additionalProperty": "anything"
}