---
title: "Set channel data"
method: PUT
path: "/v1/objects/{collection}/{object_id}/channel_data/{channel_id}"
tags: ["Channel data", "Objects"]
---

# Set channel data

`PUT /v1/objects/{collection}/{object_id}/channel_data/{channel_id}`

Sets the channel data for the specified object and channel. If no object exists in the current environment for the given `collection` and `object_id`, Knock will create the object as part of this request.

## Path parameters

- `object_id` string, required
- `collection` string, required
- `channel_id` string, uuid, required

## Request body

- ChannelDataRequest — A request to set channel data for a type of channel.
  - `data` union, required — Channel data for a given channel type.
    - object — Push channel data.
      - `tokens` string[], required — A list of push channel tokens.
    - object — Push channel data.
      - `devices` object[], required — A list of devices. Each device contains a token, and optionally a locale and timezone.
        - `locale` string, nullable — The locale of the object. Used for [message localization](/concepts/translations).
        - `timezone` string, nullable — The timezone of the object. Must be a valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Used for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
        - `token` string, required — The device token to send the push notification to.
    - object — AWS SNS push channel data.
      - `target_arns` string[], required — A list of platform endpoint ARNs. See [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
    - object — AWS SNS push channel data.
      - `devices` object[], required — A list of devices. Each device contains a target_arn, and optionally a locale and timezone.
        - `locale` string, nullable — The locale of the object. Used for [message localization](/concepts/translations).
        - `target_arn` string, required — The ARN of a platform endpoint associated with a platform application and a device token. See [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
        - `timezone` string, nullable — The timezone of the object. Must be a valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Used for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
    - object — OneSignal channel data.
      - `player_ids` string[], required — A list of OneSignal player IDs.
    - object — Slack channel data.
      - `connections` union[], required — List of Slack channel connections.
        - union — A Slack connection, either an access token or an incoming webhook
          - object — A Slack connection token.
            - `access_token` string, nullable — A Slack access token.
            - `channel_id` string, nullable — A Slack channel ID from the Slack provider.
            - `user_id` string, nullable — A Slack user ID from the Slack provider.
          - object — A Slack connection incoming webhook.
            - `url` string, required — The URL of the incoming webhook for a Slack connection.
      - `token` object, nullable — A Slack connection token.
        - `access_token` string, nullable, required — A Slack access token.
    - object — Microsoft Teams channel data.
      - `connections` union[], required — List of Microsoft Teams connections.
        - union
          - object — Microsoft Teams token connection.
            - `ms_teams_channel_id` string, uuid, nullable — Microsoft Teams channel ID.
            - `ms_teams_team_id` string, uuid, nullable — Microsoft Teams team ID.
            - `ms_teams_tenant_id` string, uuid, nullable — Microsoft Teams tenant ID.
            - `ms_teams_user_id` string, uuid, nullable — Microsoft Teams user ID.
          - object — Microsoft Teams incoming webhook connection.
            - `incoming_webhook` object, required — Microsoft Teams incoming webhook.
              - …
      - `ms_teams_tenant_id` string, uuid, nullable — Microsoft Teams tenant ID.
    - object — Discord channel data.
      - `connections` union[], required — List of Discord channel connections.
        - union — Discord channel connection, either a channel connection or an incoming webhook connection.
          - object — Discord channel connection.
            - `channel_id` string, required — Discord channel ID.
          - object — Discord incoming webhook connection.
            - `incoming_webhook` object, required — Discord incoming webhook object.
              - …

## Response `200`

OK

- ChannelData — Channel data for a given channel type.
  - `__typename` string, required — The typename of the schema.
  - `channel_id` string, uuid, required — The unique identifier for the channel.
  - `data` union, required — Channel data for a given channel type.
    - object — Push channel data.
      - `devices` object[], required — A list of devices. Each device contains a token, and optionally a locale and timezone.
        - `locale` string, nullable — The locale of the object. Used for [message localization](/concepts/translations).
        - `timezone` string, nullable — The timezone of the object. Must be a valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Used for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
        - `token` string, required — The device token to send the push notification to.
      - `tokens` string[], required — A list of push channel tokens.
    - object — AWS SNS push channel data.
      - `devices` object[], required — A list of devices. Each device contains a target_arn, and optionally a locale and timezone.
        - `locale` string, nullable — The locale of the object. Used for [message localization](/concepts/translations).
        - `target_arn` string, required — The ARN of a platform endpoint associated with a platform application and a device token. See [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
        - `timezone` string, nullable — The timezone of the object. Must be a valid [tz database time zone string](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones). Used for [recurring schedules](/concepts/schedules#scheduling-workflows-with-recurring-schedules-for-recipients).
      - `target_arns` string[], required — A list of platform endpoint ARNs. See [Setting up an Amazon SNS platform endpoint for mobile notifications](https://docs.aws.amazon.com/sns/latest/dg/mobile-platform-endpoint.html).
    - object — OneSignal channel data.
      - `player_ids` string[], required — A list of OneSignal player IDs.
    - object — Slack channel data.
      - `connections` union[], required — List of Slack channel connections.
        - union — A Slack connection, either an access token or an incoming webhook
          - object — A Slack connection token.
            - `access_token` string, nullable — A Slack access token.
            - `channel_id` string, nullable — A Slack channel ID from the Slack provider.
            - `user_id` string, nullable — A Slack user ID from the Slack provider.
          - object — A Slack connection incoming webhook.
            - `url` string, required — The URL of the incoming webhook for a Slack connection.
      - `token` object, nullable — A Slack connection token.
        - `access_token` string, nullable, required — A Slack access token.
    - object — Microsoft Teams channel data.
      - `connections` union[], required — List of Microsoft Teams connections.
        - union
          - object — Microsoft Teams token connection.
            - `ms_teams_channel_id` string, uuid, nullable — Microsoft Teams channel ID.
            - `ms_teams_team_id` string, uuid, nullable — Microsoft Teams team ID.
            - `ms_teams_tenant_id` string, uuid, nullable — Microsoft Teams tenant ID.
            - `ms_teams_user_id` string, uuid, nullable — Microsoft Teams user ID.
          - object — Microsoft Teams incoming webhook connection.
            - `incoming_webhook` object, required — Microsoft Teams incoming webhook.
              - …
      - `ms_teams_tenant_id` string, uuid, nullable — Microsoft Teams tenant ID.
    - object — Discord channel data.
      - `connections` union[], required — List of Discord channel connections.
        - union — Discord channel connection, either a channel connection or an incoming webhook connection.
          - object — Discord channel connection.
            - `channel_id` string, required — Discord channel ID.
          - object — Discord incoming webhook connection.
            - `incoming_webhook` object, required — Discord incoming webhook object.
              - …
  - `provider` 'push_fcm' | 'push_apns' | 'push_aws_sns' | 'push_expo' | 'push_one_signal' | 'chat_slack' | 'chat_ms_teams' | 'chat_discord' | 'http_knock_webhook' — The type of provider.

## Changes

- **2025-11-07** `1584eaacf779` — 1 info
  - added `#/components/schemas/PushChannelDataDevicesOnly, #/components/schemas/AWSSNSPushChannelDataDevicesOnly` to the `data` request property `oneOf` list
- **2025-10-27** `40ca41599f57` — 2 breaking, 2 info
  - removed `#/components/schemas/PushChannelData, #/components/schemas/OneSignalChannelData, #/components/schemas/AwsSnsPushChannelData` from the `data` request property `oneOf` list
  - added `#/components/schemas/PushChannelDataFull, #/components/schemas/AWSSNSPushChannelDataFull, #/components/schemas/OneSignalChannelDataPlayerIdsOnly` to the `data` response property `oneOf` list for the response status `200`
  - added `#/components/schemas/PushChannelDataTokensOnly, #/components/schemas/AWSSNSPushChannelDataTargetARNsOnly, #/components/schemas/OneSignalChannelDataPlayerIdsOnly` to the `data` request property `oneOf` list
  - removed `#/components/schemas/PushChannelData, #/components/schemas/OneSignalChannelData, #/components/schemas/AwsSnsPushChannelData` from the `data` response property `oneOf` list for the response status `200`
- …earlier changes not shown

[Full history](https://skmtc.dev/knocklabs/apis/knock-api/changes/v1/objects/:collection/:object_id/channel_data/:channel_id/put.md)

---

[API](https://skmtc.dev/knocklabs/apis/knock-api.md) · [All operations](https://skmtc.dev/knocklabs/apis/knock-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/knocklabs/knock-api/revisions/4b8499dddbc5/schema)
