Operations
A batch is a list of operations. ASTra supports 27 kinds. Each has an action name, and many have an operation field that picks a variant, such as table with updateCell or deleteRow.
What an operation looks like
Operations are plain JSON. Content operations name a node with target (act on this node) or anchor (put something next to this node, with a position of before or after).
operations
[
{ "action": "replace", "target": "3FC95CAC", "text": "1. Executive Summary (Q4)" },
{ "action": "insert", "type": "paragraph", "anchor": "3FC95CAC", "position": "after", "text": "New paragraph." },
{ "action": "style", "target": "3FC95CAC", "bold": true },
{ "action": "table", "operation": "updateCell", "target": "<tableNodeId>", "rowIndex": 0, "columnIndex": 0, "text": "Cell" },
{ "action": "comment", "operation": "insert", "target": "3FC95CAC", "text": "Please review." },
{ "action": "delete", "target": "<nodeId>" }
]Run astra batch --schema to print a canonical example of the most common operations. The full parameters of every variant are in the schema of the execute_batch tool.
All 27 operations
Content
insert | Add a paragraph, heading, table, image, chart, divider or page break before or after a node. |
replace | Replace the text of a node while keeping its style. |
delete | Remove a node. |
move | Move a node to a new position. |
Formatting
style | Change bold, italic, underline, colour, size and alignment of a node. |
clearFormat | Remove direct formatting so a node follows its style again. |
namedStyle | Apply a named Word style such as Heading1 to a node. |
Tables and page structure
table | Edit a table: cells, rows, columns, merging and splitting, borders, shading, widths, alignment and repeating header rows. |
section | Set the number of columns in a section, or split and merge sections. |
pageSetup | Set paper size, orientation, margins and columns. |
pageBorder | Add a border around the page. |
coverPage | Add a cover page. |
Rich elements
chart | Insert or update a native Word chart, for example column, line or combination charts. |
image | Insert an image, resize it, and set its alt text. |
equation | Insert an equation as native Word math. |
callout | Insert a highlighted note box. |
field | Insert a table of contents, page number or word count, or update fields. |
list | Create a numbered or bulleted list, continue one, change a level, or remove list formatting. |
References and annotations
footnote | Add a footnote. |
endnote | Add an endnote. |
hyperlink | Add a link to a web address or a bookmark. |
bookmark | Add a bookmark. |
comment | Add a comment, or reply to one. |
headerFooter | Set or remove header and footer content. |
watermark | Add a text watermark. |
Revisions and properties
trackedChange | Accept or reject all tracked changes, or insert or delete text as a tracked change. |
metadata | Set document properties such as title, author, subject and keywords. |
All or nothing. If any operation in a batch fails, none of the batch is applied. See Core concepts.