Configurable Layout (batch_items)
Configurable Layout (batch_items)
The batch_items field lets you control exactly how content is arranged on the participant task screen. Instead of a fixed, sequential layout, you describe your task as a set of pages, rows, and columns, and place dataset stimuli, display content, and input questions wherever you want them.
This unlocks layouts such as side-by-side evaluations, mixed display and input blocks, and multi-column comparisons — all defined declaratively when you create or update a Batch.
Configurable layout is available for AI Task Builder Batches only (not Collections or Survey Builder), and is set up via the API. dataset_field items require a V4 dataset with a schema — see Defining a Dataset Schema.
When to use batch_items
When batch_items is set, instructions are defined inline within the layout rather than through the standalone instructions endpoint — giving you full control over where they appear relative to dataset stimuli and display content. See Relationship to the standalone instructions endpoint.
Structure
batch_items is a four-level nested structure:
- A page repeats once per dataset row by default. Set
display_positionto"intro"or"outro"to render a page once instead — see Intro and outro pages below. For the current single-task Batch use case,batch_itemstypically contains a single repeating page, optionally preceded or followed by an intro/outro page. - A row stacks vertically down the screen.
- A column sits horizontally within a row (maximum 2 per row).
- An item is a single component rendered top-to-bottom within its column.
Intro and outro pages (display_position)
By default, every page in batch_items repeats once per dataset row (datapoint). Set a page’s display_position to render it once instead — before or after the repeating pages:
Pages with display_position set to "intro" or "outro" may only contain rich_text or image content blocks. They have no per-datapoint data context and no participant response is recorded against them, so dataset_field items and instruction items (free_text, multiple_choice, multiple_choice_with_free_text, free_text_with_unit, file_upload) are rejected on intro/outro pages.
Column item types
Each item in a column is a tagged object discriminated by its type field. There are three categories.
Dataset fields
Pull a value from your dataset schema into the layout.
Only fields typed text, image_url, audio_url, or video_url can be referenced. Fields typed metadata or task_group_id are not participant-visible and are rejected.
dataset_field items support text, image, audio, and video fields. For audio_url and video_url hosting requirements and validation behaviour, see Defining a Dataset Schema.
Content blocks (display-only)
Static content defined inline. These use the same schemas as content blocks elsewhere in AI Task Builder.
rich_text
image
Instructions (inputs)
Input questions defined inline. These use the standard AI Task Builder instruction input schemas — the same ones documented in Instructions. Supported types:
free_textfree_text_with_unitmultiple_choicemultiple_choice_with_free_textfile_upload
Instruction items are validated against the same input schemas used for standalone Instructions. Refer to that page for the full set of fields available on each input type.
Example: side-by-side evaluation
A comparison layout with per-column ratings and a shared free-text follow-up. The first row shows shared guidance; the second row places each image and its rating in its own column; the third row collects reasoning across the full width. Here each image is displayed with an image content block.
Setting batch_items
Provide batch_items when creating (or updating) a Batch, alongside your dataset and task details.
Validation runs at Batch creation and update time, before any participant-facing tasks are generated. An invalid batch_items value is rejected with a 422 response listing every offending item and its position:
Each issue pinpoints the item by its zero-based page, row, column, and item index, along with the item type and (for dataset_field items) the offending field.
Constraints and validation
Structural
- Maximum 2 columns per row.
- No limit on the number of rows.
- No limit on the number of items within a column.
- Each page must contain at least one row; each row at least one column; each column at least one item.
- Pages with
display_positionset to"intro"or"outro"may only containrich_text/imagecontent blocks — see Intro and outro pages above.
Dataset fields
fieldmust match a field in the dataset schema with typetext,image_url,audio_url, orvideo_url.metadataandtask_group_idfields are rejected — they are not participant-visible.- The same
fieldmay not appear more than once across a page.
Instructions and content blocks
- Instruction items are validated against the existing instruction input schemas (the same validation applied to standalone instructions).
- Content block items are validated against the existing content block schemas.
Relationship to the standalone instructions endpoint
There are two ways to define instructions on a Batch, and they are mutually exclusive:
- Standalone endpoint (legacy):
POST /api/v1/data-collection/batches/{batch_id}/instructions— see Working with Batches. Used whenbatch_itemsis not set. - Inline in
batch_items: instruction items defined directly in the layout.
When batch_items is set, the inline instructions are the source of truth. The standalone instructions endpoints are deprecated for such Batches and reject create and update calls with a 422.
The standalone instructions endpoint is deprecated for Batches that use batch_items and is scheduled for removal — manage instructions via batch_items instead. batch_items is never added automatically to existing Batches.
If the dataset schema changes after a Batch is created and a dataset_field reference becomes invalid (for example, the field is removed from the schema), this is surfaced as a warning at schema mutation time.
Extensibility
The layout model is designed to grow without breaking existing batch_items values:
- New component types (for example additional input types or display blocks) are additive — existing layouts remain valid.
- Multi-page tasks are supported by the array structure from the start.
- The wider participant task model (Sections → Pages → Components) maps cleanly onto this structure: each page is a Body page, and each column item is a component.
By using AI Task Builder, you agree to our AI Task Builder Terms.