Check rows before creating a batch
validate_batchChecks batch rows against a template and reports every problem by row index and field, without saving anything or spending credits. It runs the same row checks as create_batch, so rows that pass here are accepted there, while create_batch saves nothing if any row fails. Each row comes back as the server understood it (layer keys, text, and each image resolved to its asset id and file name), so a misread value shows before any credits are spent. A layer name two layers share is refused with their ids: fill each by id and tell the user, who can rename one. It does not measure text, so copy longer than the template's sample can still overflow its box. Needs templates:read.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | Yes | 1 to 500 rows. Each keys a layer by its name (case aside) or id, the key get_template_inputs gives, to a plain value: text as a string, an image as an asset id or file name, or { asset, fit, zoom, panX, panY } and { text, visible } when framing or visibility changes. rowExample in get_template_inputs is a ready row. With columns, a row is instead an array of cells in column order, which keeps large batches small. null leaves a layer at the template's own value. Layers left out keep the template's value, or the one in defaults. | |
| pageId | No | One page of the template (the designer connection's page_id). A template's pages are separate designs, each with its own inputs; the first page when omitted. | |
| columns | No | For array rows: the layer key of each cell, in order, like a spreadsheet header | |
| defaults | No | Values every row gets unless it gives its own, such as a logo or call to action shared by all rows | |
| templateId | Yes | Template ID returned by search_templates |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rows | No | Each row as the server understood it, keyed by layer key, images as { asset, name } | |
| valid | Yes | True when every row passes | |
| issues | Yes | Every problem found; empty when valid | |
| rowCount | Yes | ||
| validRows | Yes | ||
| invalidRows | Yes | ||
| sharedNames | No | Layer names more than one layer has; rows key those layers by id. Mention them to the user. |