Undo Item Batch
item.undo_batchUndo a whole batch written by item.create_many, item.update_many or item.update_where, in one step, naming the batchId it returned and the sheetId it wrote: a create batch deletes the rows it created that still exist; an update batch restores each field's previous value unless it was changed since (those are reported as conflicts and kept). Only the user who ran the batch (or the org owner) can undo it, once, within 7 days. Use it when the user asks to undo a bulk change. Effects workflows already had (emails, external calls) are not reverted. When the agent this app signs in as has Ask first on for this, the call waits for its manager's approval and returns status: "pending_approval"; nothing changes until they approve. Pass reason (and targetNotes per target) so the approver sees why.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"batchId": "<batchId>",
"sheetId": "<sheetId>"
},
"name": "item.undo_batch"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| reason | No | Why you are doing this, in one sentence the approver reads if Ask first holds the call | |
| batchId | Yes | The batchId item.create_many or item.update_many returned | |
| sheetId | Yes | The sheet the batch wrote, as that call returned it | |
| targetNotes | No | A short note per target, keyed by the id or Index you pass |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| note | No | What undo does not revert; tell the user | |
| status | No | ||
| message | No | ||
| approver | No | Who decides it | |
| reverted | No | Rows deleted (create batch) or restored (update batch) | |
| conflicts | No | Rows with fields changed since the batch; those fields were kept, not restored | |
| approvalId | No | The approval the call waits on | |
| alreadyGone | No | Rows of the batch deleted since; nothing to undo for them |