---
title: "Batch Create Messages"
method: POST
path: "/messages/batch"
tags: ["Messages"]
---

# Batch Create Messages

`POST /messages/batch`

## Request body

- BatchCreateTaskMessagesRequest
  - `task_id` string, required
  - `contents` TaskMessageContent[], required
    - union
      - TextContent
        - `type` 'text' — The type of the message, in this case `text`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `format` 'markdown' | 'plain' | 'code'
        - `content` string, required — The contents of the text message.
        - `attachments` FileAttachment[], nullable — Optional list of file attachments with structured metadata.
          - `file_id` string, required — The unique ID of the attached file
          - `name` string, required — The name of the file
          - `size` integer, required — The size of the file in bytes
          - `type` string, required — The MIME type or content type of the file
      - ReasoningContent
        - `type` 'reasoning' — The type of the message, in this case `reasoning`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `summary` string[], required — A list of short reasoning summaries
        - `content` string[], nullable — The reasoning content or chain-of-thought text
      - DataContent
        - `type` 'data' — The type of the message, in this case `data`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `data` object, required — The contents of the data message.
      - ToolRequestContent
        - `type` 'tool_request' — The type of the message, in this case `tool_request`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `tool_call_id` string, required — The ID of the tool call that is being requested.
        - `name` string, required — The name of the tool that is being requested.
        - `arguments` object, required — The arguments to the tool.
      - ToolResponseContent
        - `type` 'tool_response' — The type of the message, in this case `tool_response`.
        - `author` 'user' | 'agent', required
        - `style` 'static' | 'active'
        - `tool_call_id` string, required — The ID of the tool call that is being responded to.
        - `name` string, required — The name of the tool that is being responded to.
        - `content` unknown, required
        - `is_error` boolean, nullable — Whether the tool call resulted in an error. `None` when the harness does not report a status.
  - `created_at` string, date-time, nullable — Optional base timestamp. Each message in the batch is stamped with base + i milliseconds to guarantee unique, monotonic ordering. If omitted, the server stamps datetime.now(UTC) at insert time.

## Response `200`

Successful Response

- TaskMessage[]
  - `id` string, nullable — The task message's unique id
  - `task_id` string, required — ID of the task this message belongs to
  - `content` union, required
    - TextContent
      - `type` 'text' — The type of the message, in this case `text`.
      - `author` 'user' | 'agent', required
      - `style` 'static' | 'active'
      - `format` 'markdown' | 'plain' | 'code'
      - `content` string, required — The contents of the text message.
      - `attachments` FileAttachment[], nullable — Optional list of file attachments with structured metadata.
        - `file_id` string, required — The unique ID of the attached file
        - `name` string, required — The name of the file
        - `size` integer, required — The size of the file in bytes
        - `type` string, required — The MIME type or content type of the file
    - ReasoningContent
      - `type` 'reasoning' — The type of the message, in this case `reasoning`.
      - `author` 'user' | 'agent', required
      - `style` 'static' | 'active'
      - `summary` string[], required — A list of short reasoning summaries
      - `content` string[], nullable — The reasoning content or chain-of-thought text
    - DataContent
      - `type` 'data' — The type of the message, in this case `data`.
      - `author` 'user' | 'agent', required
      - `style` 'static' | 'active'
      - `data` object, required — The contents of the data message.
    - ToolRequestContent
      - `type` 'tool_request' — The type of the message, in this case `tool_request`.
      - `author` 'user' | 'agent', required
      - `style` 'static' | 'active'
      - `tool_call_id` string, required — The ID of the tool call that is being requested.
      - `name` string, required — The name of the tool that is being requested.
      - `arguments` object, required — The arguments to the tool.
    - ToolResponseContent
      - `type` 'tool_response' — The type of the message, in this case `tool_response`.
      - `author` 'user' | 'agent', required
      - `style` 'static' | 'active'
      - `tool_call_id` string, required — The ID of the tool call that is being responded to.
      - `name` string, required — The name of the tool that is being responded to.
      - `content` unknown, required
      - `is_error` boolean, nullable — Whether the tool call resulted in an error. `None` when the harness does not report a status.
  - `streaming_status` 'IN_PROGRESS' | 'DONE', nullable
  - `created_at` string, date-time, nullable — The timestamp when the message was created
  - `updated_at` string, date-time, nullable — The timestamp when the message was last updated

## Other responses

- `422` — Validation Error

## Changes

> 55 revisions in range; 4 could not be searched.

- **2026-07-10** `fbecbdbd7dc5` — 2 info
  - added the new optional request property `contents/items/oneOf[subschema #5: ToolResponseContent]/is_error`
  - added the optional property `items/content/oneOf[subschema #5: ToolResponseContent]/is_error` to the response with the `200` status
- **2026-06-23** `94d73d46952b` — 2 warning
  - removed the request property `contents/items/oneOf[subschema #5: ToolResponseContent]/is_error`
  - removed the optional property `items/content/oneOf[subschema #5: ToolResponseContent]/is_error` from the response with the `200` status
- **2026-06-22** `28b893025743` — 2 info
  - added the new optional request property `contents/items/oneOf[subschema #5: ToolResponseContent]/is_error`
  - added the optional property `items/content/oneOf[subschema #5: ToolResponseContent]/is_error` to the response with the `200` status
- **2026-05-13** `dd15bb3a3624` — 1 info
  - added the new optional request property `created_at`

[Change history](https://skmtc.dev/scaleapi/apis/agentex-api/changes/messages/batch/post.md)

---

[API](https://skmtc.dev/scaleapi/apis/agentex-api.md) · [All operations](https://skmtc.dev/scaleapi/apis/agentex-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/scaleapi/agentex-api/revisions/1e0aaafd5780/schema)
