APIDeleted record

Get deleted records

GET
/public/v1/deleted-records

List the records of one type that were deleted from your company, oldest deletion first. Use it alongside the updated_datetime filter of that type's list endpoint to keep a copy of your data in sync (Incremental Sync): list endpoints leave deleted records out by default, so a copy synced from them never learns of a deletion on its own. Each record_type is the type of one endpoint, such as ORDER for GET /public/v1/orders or COMPANY_GROUP for GET /public/v1/company-groups.

Every deletion is listed, including the ones caused by deleting something else, such as an order's invoices or a product's batches; each is listed under its own type. A voided invoice or payment is not deleted; it stays on its list endpoint with its new status. A record that is restored after it was deleted leaves this list and comes back on its list endpoint with a new updated_datetime.

Deletions are kept for 90 days. If your copy was last synced longer ago than that, reconcile it as in Incremental Sync step 7 before resuming.

A deletion becomes visible here once its change is committed, which can be shortly after its deleted_datetime, and this endpoint is eventually consistent: a deletion can take up to 1 second to appear. When you poll with deleted_datetime, use the same lower bound as your list calls (Incremental Sync) and ignore records you already removed.

Results are paginated. Follow the next_page URL in the response to fetch the following page.

Required permission: the same as the endpoint of record_type (for example orders_permissions_view for ORDER); tags and unit types need none. Team restrictions do not apply here: every deletion of that type in your company is listed.

Authorization

Bearer
headerAuthorizationBearer <token>

API token generated in Distru (Settings → Distru API). Send it on every request as Authorization: Bearer YOUR_API_TOKEN.

Query Parameters

record_type*string

Required. The kind of deleted record to list. Each request lists one kind; make one request per kind you sync.

Value in"ADJUSTMENT""ASSEMBLY""BATCH""BIN""CHARGE_PRESET""COMPANY""COMPANY_GROUP""CONTACT""COST_TYPE""CREDIT""CUSTOM_FIELD""DRIVER""INVOICE""LICENSE""LOCATION""MENU""ORDER""PACKAGE""PAYMENT""PAYMENT_METHOD""PAYMENT_TERM""PRICE_TIER""PRODUCT""PRODUCT_CATEGORY""PRODUCT_GROUP""PRODUCT_POS_MAPPING""PRODUCT_SUBCATEGORY""PURCHASE""RETURN""STRAIN""TAG""TASK""TAX""TEST_RESULT""UNIT_TYPE""USER""VEHICLE"
deleted_datetime?string

Filter by deletion datetime, given as an inclusive after,before range of ISO 8601 timestamps separated by a comma. Either bound may be left empty: after, keeps only records deleted on or after after; ,before only those deleted on or before before; after,before keeps those inside the closed range. A range with both bounds empty is rejected.

page?string

Page selector. Page size is fixed by the server; paginate by following the next_page URL in each response rather than building page selectors yourself — it is null on the last page. next_page uses page[after]=<cursor>, an opaque token marking where the next page resumes; pass it back exactly as given, and only to the endpoint that issued it. This is seek-based, so every page stays fast no matter how deep you page.

Response Body

A list of deleted records

*/*
  1. response

A collection of deleted records

data?array<>

Deleted Records

next_page?string

URL for the next page of results; null when there is no next page

Example Request
curl -X GET 'https://app.distru.com/public/v1/deleted-records?record_type=ORDER'
Example Response
{  "data": [    {      "deleted_datetime": "2026-01-01T01:00:00.000000Z",      "record_id": "6c6c02bc-ee0d-46d3-8504-938c68035f4e",      "record_type": "ORDER"    },    {      "deleted_datetime": "2026-01-01T02:00:00.000000Z",      "record_id": "a342d2e9-d67a-40c6-a6e9-3892060b6eb2",      "record_type": "ORDER"    }  ],  "next_page": null}