---
title: "POST /channels"
method: POST
path: "/channels"
---

# POST /channels

`POST /channels`

Used to create a channel. A channel collects data from an MQTT topic and archives the raw, unprocessed messages before publishing the data to a pipeline.

## Request body

- object
  - `channelName` string, required — The name of the channel.
  - `channelStorage` object — Where channel data is stored. You may choose one of <code>serviceManagedS3</code>, <code>customerManagedS3</code> storage. If not specified, the default is <code>serviceManagedS3</code>. This can't be changed after creation of the channel.
    - `serviceManagedS3` object — Used to store channel data in an S3 bucket managed by IoT Analytics. You can't change the choice of S3 storage after the data store is created.
    - `customerManagedS3` object — Used to store channel data in an S3 bucket that you manage. If customer managed storage is selected, the <code>retentionPeriod</code> parameter is ignored. You can't change the choice of S3 storage after the data store is created.
      - `bucket` string, required — The name of the S3 bucket in which channel data is stored.
      - `keyPrefix` string — (Optional) The prefix used to create the keys of the channel data objects. Each object in an S3 bucket has a key that is its unique identifier in the bucket. Each object in a bucket has exactly one key. The prefix must end with a forward slash (/).
      - `roleArn` string, required — The ARN of the role that grants IoT Analytics permission to interact with your Amazon S3 resources.
  - `retentionPeriod` object — How long, in days, message data is kept.
    - `unlimited` boolean — If true, message data is kept indefinitely.
    - `numberOfDays` integer — The number of days that message data is kept. The <code>unlimited</code> parameter must be false.
  - `tags` Tag[] — Metadata which can be used to manage the channel.
    - `key` string, required — The tag's key.
    - `value` string, required — The tag's value.

## Response `201`

Success

- CreateChannelResponse
  - `channelName` string — The name of the channel.
  - `channelArn` string — The ARN of the channel.
  - `retentionPeriod` object — How long, in days, message data is kept for the channel.
    - `unlimited` boolean — If true, message data is kept indefinitely.
    - `numberOfDays` integer — The number of days that message data is kept. The <code>unlimited</code> parameter must be false.

## Other responses

- `480` — InvalidRequestException
- `481` — ResourceAlreadyExistsException
- `482` — InternalFailureException
- `483` — ServiceUnavailableException
- `484` — ThrottlingException
- `485` — LimitExceededException

---

[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)
