Skip to main content

channels

Creates, updates, deletes, gets or lists a channels resource.

Overview

Namechannels
TypeResource
Idaws.chime_sdk_messaging.channels

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
channelsarrayThe information about each channel.
next_tokenstringThe token returned from previous API requests until the number of channels is reached. (pattern: <code>.*</code>)

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
list_channelsselectapp-instance-arn, x-amz-chime-bearer, regionprivacy, max-results, next-tokenLists all Channels created under a single Chime App as a paginated list. You can specify filters to narrow results. Functionality & restrictions Use privacy = PUBLIC to retrieve all public channels in the account. Only an AppInstanceAdmin can set privacy = PRIVATE to list the private channels in an account. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
describe_channelselectchannel_arn, x-amz-chime-bearer, regionReturns the full details of a channel in an Amazon Chime AppInstance. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
search_channelsselectregionx-amz-chime-bearer, max-results, next-tokenAllows the ChimeBearer to search channels by channel members. Users or bots can search across the channels that they belong to. Users in the AppInstanceAdmin role can search across all channels. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header. This operation isn't supported for AppInstanceUsers with a large number of memberships.
create_channelinsertx-amz-chime-bearer, region, AppInstanceArn, Name, ClientRequestTokenCreates a channel to which you can add users and send messages. Restriction: You can't change a channel's privacy. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
update_channelupdatechannel_arn, x-amz-chime-bearer, regionUpdate a channel's attributes. Restriction: You can't change a channel's privacy. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
put_channel_expiration_settingsreplacechannel_arn, regionx-amz-chime-bearerSets the number of days before the channel is automatically deleted. A background process deletes expired channels within 6 hours of expiration. Actual deletion times may vary. Expired channels that have not yet been deleted appear as active, and you can update their expiration settings. The system honors the new settings. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
delete_channeldeletechannel_arn, x-amz-chime-bearer, regionImmediately makes a channel and its memberships inaccessible and marks them for deletion. This is an irreversible process. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUserArn or AppInstanceBot that makes the API call as the value in the header.
batch_create_channel_membershipexecchannel_arn, x-amz-chime-bearer, region, MemberArnsAdds a specified number of users and bots to a channel.
send_channel_messageexecchannel_arn, x-amz-chime-bearer, region, Content, Type, Persistence, ClientRequestTokenSends a message to a particular channel that the member is a part of. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header. Also, STANDARD messages can be up to 4KB in size and contain metadata. Metadata is arbitrary, and you can use it in a variety of ways, such as containing a link to an attachment. CONTROL messages are limited to 30 bytes and do not contain metadata.
redact_channel_messageexecchannel_arn, message_id, x-amz-chime-bearer, regionRedacts message content and metadata. The message exists in the back end, but the action returns null content, and the state shows as redacted. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.
update_channel_read_markerexecchannel_arn, x-amz-chime-bearer, regionThe details of the time when a user last read messages in a channel. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
app-instance-arnstringThe ARN of the AppInstance.
channel_arnstringThe ARN of the channel.
message_idstringThe ID of the message being redacted.
regionstringAWS region (default: us-east-1)
x-amz-chime-bearerstringThe ARN of the AppInstanceUser or AppInstanceBot that makes the API call.
max-resultsintegerThe maximum number of channels that you want returned.
next-tokenstringThe token returned from previous API requests until the number of channels is reached.
privacystringThe privacy setting. PUBLIC retrieves all the public channels. PRIVATE retrieves private channels. Only an AppInstanceAdmin can retrieve private channels.
x-amz-chime-bearerstringThe ARN of the AppInstanceUser or AppInstanceBot that makes the API call.

SELECT examples

Lists all Channels created under a single Chime App as a paginated list. You can specify filters to narrow results. Functionality & restrictions Use privacy = PUBLIC to retrieve all public channels in the account. Only an AppInstanceAdmin can set privacy = PRIVATE to list the private channels in an account. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

SELECT
channels,
next_token
FROM aws.chime_sdk_messaging.channels
WHERE `app-instance-arn` = '{{ app-instance-arn }}' -- required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' -- required
AND region = '{{ region }}' -- required
AND privacy = '{{ privacy }}'
AND `max-results` = '{{ max-results }}'
AND `next-token` = '{{ next-token }}'
;

INSERT examples

Creates a channel to which you can add users and send messages. Restriction: You can't change a channel's privacy. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

INSERT INTO aws.chime_sdk_messaging.channels (
AppInstanceArn,
Name,
Mode,
Privacy,
Metadata,
ClientRequestToken,
Tags,
ChannelId,
MemberArns,
ModeratorArns,
ElasticChannelConfiguration,
ExpirationSettings,
`x-amz-chime-bearer`,
region
)
SELECT
'{{ AppInstanceArn }}' /* required */,
'{{ Name }}' /* required */,
'{{ Mode }}',
'{{ Privacy }}',
'{{ Metadata }}',
'{{ ClientRequestToken }}' /* required */,
'{{ Tags }}',
'{{ ChannelId }}',
'{{ MemberArns }}',
'{{ ModeratorArns }}',
'{{ ElasticChannelConfiguration }}',
'{{ ExpirationSettings }}',
'{{ x-amz-chime-bearer }}',
'{{ region }}'
RETURNING
channel_arn
;

UPDATE examples

Update a channel's attributes. Restriction: You can't change a channel's privacy. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

UPDATE aws.chime_sdk_messaging.channels
SET
Name = '{{ Name }}',
Mode = '{{ Mode }}',
Metadata = '{{ Metadata }}'
WHERE
channel_arn = '{{ channel_arn }}' --required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' --required
AND region = '{{ region }}' --required
RETURNING
channel_arn;

REPLACE examples

Sets the number of days before the channel is automatically deleted. A background process deletes expired channels within 6 hours of expiration. Actual deletion times may vary. Expired channels that have not yet been deleted appear as active, and you can update their expiration settings. The system honors the new settings. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUser or AppInstanceBot that makes the API call as the value in the header.

REPLACE aws.chime_sdk_messaging.channels
SET
ExpirationSettings = '{{ ExpirationSettings }}'
WHERE
channel_arn = '{{ channel_arn }}' --required
AND region = '{{ region }}' --required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer}}'
RETURNING
channel_arn,
expiration_settings;

DELETE examples

Immediately makes a channel and its memberships inaccessible and marks them for deletion. This is an irreversible process. The x-amz-chime-bearer request header is mandatory. Use the ARN of the AppInstanceUserArn or AppInstanceBot that makes the API call as the value in the header.

DELETE FROM aws.chime_sdk_messaging.channels
WHERE channel_arn = '{{ channel_arn }}' --required
AND `x-amz-chime-bearer` = '{{ x-amz-chime-bearer }}' --required
AND region = '{{ region }}' --required
;

Lifecycle Methods

Adds a specified number of users and bots to a channel.

EXEC aws.chime_sdk_messaging.channels.batch_create_channel_membership
@channel_arn='{{ channel_arn }}' --required,
@x-amz-chime-bearer='{{ x-amz-chime-bearer }}' --required,
@region='{{ region }}' --required
@@json=
'{
"Type": "{{ Type }}",
"MemberArns": "{{ MemberArns }}",
"SubChannelId": "{{ SubChannelId }}"
}'
;