---
title: "POST /messages/batch"
method: POST
path: "/messages/batch"
---

# POST /messages/batch

`POST /messages/batch`

Sends messages to a channel.

## Request body

- object
  - `channelName` string, required — The name of the channel where the messages are sent.
  - `messages` Message[], required — <p>The list of messages to be sent. Each message has the format: { "messageId": "string", "payload": "string"}.</p> <p>The field names of message payloads (data) that you send to IoT Analytics:</p> <ul> <li> <p>Must contain only alphanumeric characters and undescores (_). No other special characters are allowed.</p> </li> <li> <p>Must begin with an alphabetic character or single underscore (_).</p> </li> <li> <p>Cannot contain hyphens (-).</p> </li> <li> <p>In regular expression terms: "^[A-Za-z_]([A-Za-z0-9]*|[A-Za-z0-9][A-Za-z0-9_]*)$". </p> </li> <li> <p>Cannot be more than 255 characters.</p> </li> <li> <p>Are case insensitive. (Fields named foo and FOO in the same payload are considered duplicates.)</p> </li> </ul> <p>For example, {"temp_01": 29} or {"_temp_01": 29} are valid, but {"temp-01": 29}, {"01_temp": 29} or {"__temp_01": 29} are invalid in message payloads. </p>
    - `messageId` string, required — The ID you want to assign to the message. Each <code>messageId</code> must be unique within each batch sent.
    - `payload` string, required — The payload of the message. This can be a JSON string or a base64-encoded string representing binary data, in which case you must decode it by means of a pipeline activity.

## Response `200`

Success

- BatchPutMessageResponse
  - `batchPutMessageErrorEntries` BatchPutMessageErrorEntry[] — A list of any errors encountered when sending the messages to the channel.
    - `messageId` string — The ID of the message that caused the error. See the value corresponding to the <code>messageId</code> key in the message object.
    - `errorCode` string — The code associated with the error.
    - `errorMessage` string — The message associated with the error.

## Other responses

- `480` — ResourceNotFoundException
- `481` — InvalidRequestException
- `482` — InternalFailureException
- `483` — ServiceUnavailableException
- `484` — ThrottlingException

---

[API](https://skmtc.net/aws/apis/iotanalytics.md) · [All operations](https://skmtc.net/aws/apis/iotanalytics/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/aws/iotanalytics/versions/e78558b7408d/schema)
