Starts the ledger over.
Destructive. Cancels every open batch (settling its human task and closing its conversation), deletes every item, effect and dedupe key, and moves the cursor to an empty position under a new version so an in-flight pass loses its write. The items' transitions are kept as history. Refused with 409 when `confirmItems` is not the ledger's current item count, or while a running pass holds a claim. The effects' external targets are not touched — the next pass performs them again.
Authorization
Bearer JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.
In: header
Path Parameters
The trigger identifier.
uuidThe tenant identifier
The confirmed item count and the reason.
How many items the ledger currently holds, as the caller read it. Refused (409) when wrong.
int32Why — required; recorded on every batch the purge cancels.
1 <= length <= 4000Response Body
curl -X POST "https://api.fruxon.com/v1/tenants/string/triggers/497f6eca-6276-4993-bfeb-53cbbbba6f08/ledger:purge" \ -H "Content-Type: application/json" \ -d '{ "confirmItems": 0, "reason": "string" }'{
"itemsDeleted": 0,
"effectsDeleted": 0,
"transitionsDeleted": 0,
"dedupeKeysDeleted": 0,
"batchesCancelled": 0,
"cursor": {
"ledgerId": "00000000-0000-0000-0000-000000000000",
"value": "string",
"version": 0,
"lastScanStartedAt": 0,
"lastScanCompletedAt": 0,
"lastItemAdmittedAt": 0,
"updatedAt": 0,
"updatedByRunId": "00000000-0000-0000-0000-000000000000",
"stageHolds": [
{
"stageId": "string",
"until": 0,
"reason": "string",
"violationType": "UNSPECIFIED",
"refusals": 0,
"since": 0,
"heldTurns": 0
}
]
}
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}{
"type": "string",
"title": "string",
"status": 0,
"detail": "string",
"instance": "string",
"property1": null,
"property2": null
}What each pass admitted, dispatched, finished and spent.
Ledger passes, newest first, with transition counts and attributed execution cost. Cost may increase after firedAt while the pass's executions finish; an immediate read can therefore report less than the final cost.
What the automation spent in the current budget window, agent by agent.
Every agent the automation spends through, not only the ones its stages run per item: a question held as a conversation spends through the agent that holds it — its opening turn, every reply, the notices it posts and the outcome it tells — and none of those runs is named by a transition, so the funnel and the item costs cannot see them. Each agent's spend is split into what it was for. The window is the agents' own budget window (UTC, calendar-aligned), so a row here and that agent's limit are measured over the same span. An agent that also works elsewhere — chat, another automation — spends more against its limit than it spent here; that difference is the reason to read the two together. Production runs only; refused runs cost nothing and are not counted.