FruxonDocs
Agent NetworkTriggers

Starts the ledger over.

Destructive. Cancels every open batch (settling its human task and closing its conversation), deletes every item, effect and transition, and moves the cursor to an empty position under a new version so an in-flight pass loses its write. 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.

POST
/v1/tenants/{tenant}/triggers/{trigger}/ledger:purge
AuthorizationBearer <token>

JWT Authorization header using the Bearer scheme. Enter 'Bearer' [space] and then your token.

In: header

Path Parameters

trigger*string

The trigger identifier.

Formatuuid
tenant*string

The tenant identifier

The confirmed item count and the reason.

confirmItems*integer

How many items the ledger currently holds, as the caller read it. Refused (409) when wrong.

Formatint32
reason*string

Why — required; recorded on every batch the purge cancels.

Length1 <= length <= 4000
[key: string]?never

Response 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,
  "batchesCancelled": 0,
  "cursor": {
    "ledgerId": "00000000-0000-0000-0000-000000000000",
    "value": "string",
    "version": 0,
    "lastScanCompletedAt": 0,
    "lastItemAdmittedAt": 0,
    "updatedAt": 0,
    "updatedByRunId": "00000000-0000-0000-0000-000000000000"
  }
}
{
  "type": "string",
  "title": "string",
  "status": 0,
  "detail": "string",
  "instance": "string",
  "property1": null,
  "property2": null
}
Empty
Empty
{
  "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
}