Skip to main content
POST
Bulk Delete Wastes by Filters

Bulk Delete Wastes by Filters

Delete all waste records that match a set of filter criteria. This endpoint uses a two-step workflow: first fetch the waste list with filters applied (which returns a filter_hash), then call this endpoint with that hash to confirm you are deleting exactly what you saw.
Permanent Action: Deleting waste records is permanent and cannot be undone. All associated emissions data will be removed from your organization’s totals.

How It Works

  1. Call GET /v1/wastes with your desired filters — the response includes a filter_hash field.
  2. Call this endpoint with the same query filters and pass the filter_hash in the request body.
  3. The API verifies the hash matches the current filter results to prevent stale-data race conditions.

Request

Headers

string
required
Your API key for authenticationExample: sk_live_1234567890abcdef
string
required
Your organization UUIDExample: a8315ef3-dd50-43f8-b7ce-d839e68d51fa

Body Parameters

string
required
The hash returned in the filter_hash field of the waste list response. Confirms you are deleting exactly the records you saw.Example: "a3f1c2e4b5d6a7b8"

Query Parameters

facility_id is required. At least one additional filter parameter is required.
string
required
The UUID of the facility to scope the deletion toExample: 660e8400-e29b-41d4-a716-446655440000
array[string]
Filter by record statusAvailable values: active, uploaded, success, loading, pending, in_progress, review, in_review, errorExample: status[]=error&status[]=loading
string
Filter records with a start date on or after this date (YYYY-MM-DD)Example: 2024-01-01
string
Filter records with an end date on or before this date (YYYY-MM-DD)Example: 2024-12-31
array[string]
Filter by source file UUIDs (e.g. to delete all records imported from a specific file)
string
Filter records created on or after this datetime (ISO 8601)Example: 2024-01-01T00:00:00Z
string
Filter records created on or before this datetime (ISO 8601)Example: 2024-12-31T23:59:59Z
string
Filter by CO2e calculation statusAvailable values: calculated, not_calculatedExample: co2e_status=not_calculated
array[string]
Filter by waste identification names or invoice numbers
array[string]
Filter by LER (European Waste List) codes
array[string]
Filter by RD (recovery/disposal) codes

Response

Returns 200 OK with a JSON summary of the operation.
integer
Number of waste records successfully deleted
array[string]
UUIDs of successfully deleted waste records
integer
Number of records that failed to delete
array[string]
UUIDs of records that failed to delete
string
Human-readable summary of the operation

Example

Successful Response

Common Errors

401 Unauthorized

Cause: Missing or invalid API key

409 Conflict — Filter Hash Mismatch

Cause: The filter_hash does not match the current filter results. The underlying data changed between the list call and the delete call.
Solution: Re-fetch the waste list with the same filters to get a fresh filter_hash, then retry.

422 Unprocessable Entity — No Filters Provided

Cause: Only facility_id was provided. At least one additional filter is required to prevent accidental mass deletion.

422 Validation Error

Cause: Invalid query parameter value

List Wastes

Retrieve waste records and obtain the filter_hash

Bulk Delete Wastes

Delete specific waste records by ID

Unique Values

Get unique values for waste fields

Create Waste

Add a new waste record