Update batch inputs
Edits an existing batch’s inputs, the API equivalent of the dashboard’s edit-batch flow. Use it to re-attach data points, adjust upstream batch allocations, or skip data point types so they are recorded as skipped_input rather than left missing. Each array replaces the current set for that field (it is not merged), and omitting an array is the same as sending it empty. The batch’s model runs are re-staged and recomputed asynchronously, so the response returns the batch immediately, before recomputation finishes. A batch that already has allocations cannot be edited. Requires the write:batch token scope.
Authorizations
Path Parameters
The ledger's friendly ID (e.g. led_aBcD1234eFgH5678).
The batch's friendly ID (e.g. ba_aBcD1234eFgH5678).
Body
Direct (non-calculated) data point friendly IDs to attach as the batch's inputs; calculated data points are ignored. Replaces the current set. Unknown IDs return 422.
Upstream batch allocations. Replaces the current set. An unknown batch_id returns 404.
The friendly IDs of data point types to skip (e.g. dpt_aBcD1234eFgH5678). Each skipped type is recorded as a zero-value skipped_input placeholder so the batch stays auditable. Replaces the current set. Unknown or out-of-config IDs return 422.
Response
Updated batch detail, in the shape GET /batches/{batch_id} returns. The example is abridged.
A batch with its inputs, allocations and rule alerts, as GET /batches/{batch_id} returns it.
"ba_aBcD1234eFgH5678"
State of the underlying model run; null when the run no longer exists.
incomplete, staged, processing, updated, error, null Error message from the underlying model run when state is error; null otherwise.
Link that opens this batch in the Mangrove app, built from the project, ledger and batch friendly IDs. Null when the batch has no ledger.
"https://app.gomangrove.com/nexus/prj_AbCd1234567890Ef/ledger/led_aBcD1234eFgH5678/batch/ba_aBcD1234eFgH5678"
Feedstocks this batch's run drew on — either tagged directly on one of its inputs, or inherited via lineage from an upstream commingled-tank draw (a calculated input that itself drew from a feedstock further upstream). De-duplicated and sorted by name.
Asset associated with the batch when the model partitions by asset (asset or tracking_id_and_asset). null for batches whose model uses any other partition type.
Complete input collection when it has at most 20,000 rows; otherwise null. An empty collection is []. Retrieve omitted inputs through GET /batches/{batch_id}/inputs.
True when the batch has an active (un-dismissed) failing rule result.
Complete failing-rule collection when it has at most 20,000 rows; otherwise null. An empty collection is []. Retrieve omitted alerts through GET /batches/{batch_id}/rule_alerts.