ChimeSDKMessaging / Client / create_channel

create_channel#

ChimeSDKMessaging.Client.create_channel(**kwargs)#

Creates a channel to which you can add users and send messages.

Restriction: You can’t change a channel’s privacy.

Note

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.

See also: AWS API Documentation

Request Syntax

response = client.create_channel(
    AppInstanceArn='string',
    Name='string',
    Mode='UNRESTRICTED'|'RESTRICTED',
    Privacy='PUBLIC'|'PRIVATE',
    Metadata='string',
    ClientRequestToken='string',
    Tags=[
        {
            'Key': 'string',
            'Value': 'string'
        },
    ],
    ChimeBearer='string',
    ChannelId='string',
    MemberArns=[
        'string',
    ],
    ModeratorArns=[
        'string',
    ],
    ElasticChannelConfiguration={
        'MaximumSubChannels': 123,
        'TargetMembershipsPerSubChannel': 123,
        'MinimumMembershipPercentage': 123
    },
    ExpirationSettings={
        'ExpirationDays': 123,
        'ExpirationCriterion': 'CREATED_TIMESTAMP'|'LAST_MESSAGE_TIMESTAMP'
    }
)
Parameters:
  • AppInstanceArn (string) –

    [REQUIRED]

    The ARN of the channel request.

  • Name (string) –

    [REQUIRED]

    The name of the channel.

  • Mode (string) – The channel mode: UNRESTRICTED or RESTRICTED. Administrators, moderators, and channel members can add themselves and other members to unrestricted channels. Only administrators and moderators can add members to restricted channels.

  • Privacy (string) – The channel’s privacy level: PUBLIC or PRIVATE. Private channels aren’t discoverable by users outside the channel. Public channels are discoverable by anyone in the AppInstance.

  • Metadata (string) – The metadata of the creation request. Limited to 1KB and UTF-8.

  • ClientRequestToken (string) –

    [REQUIRED]

    The client token for the request. An Idempotency token.

    This field is autopopulated if not provided.

  • Tags (list) –

    The tags for the creation request.

    • (dict) –

      A tag object containing a key-value pair.

      • Key (string) – [REQUIRED]

        The key in a tag.

      • Value (string) – [REQUIRED]

        The value in a tag.

  • ChimeBearer (string) –

    [REQUIRED]

    The ARN of the AppInstanceUser or AppInstanceBot that makes the API call.

  • ChannelId (string) – The ID of the channel in the request.

  • MemberArns (list) –

    The ARNs of the channel members in the request.

    • (string) –

  • ModeratorArns (list) –

    The ARNs of the channel moderators in the request.

    • (string) –

  • ElasticChannelConfiguration (dict) –

    The attributes required to configure and create an elastic channel. An elastic channel can support a maximum of 1-million users, excluding moderators.

    • MaximumSubChannels (integer) – [REQUIRED]

      The maximum number of SubChannels that you want to allow in the elastic channel.

    • TargetMembershipsPerSubChannel (integer) – [REQUIRED]

      The maximum number of members allowed in a SubChannel.

    • MinimumMembershipPercentage (integer) – [REQUIRED]

      The minimum allowed percentage of TargetMembershipsPerSubChannel users. Ceil of the calculated value is used in balancing members among SubChannels of the elastic channel.

  • ExpirationSettings (dict) –

    Settings that control the interval after which the channel is automatically deleted.

    • ExpirationDays (integer) – [REQUIRED]

      The period in days after which the system automatically deletes a channel.

    • ExpirationCriterion (string) – [REQUIRED]

      The conditions that must be met for a channel to expire.

Return type:

dict

Returns:

Response Syntax

{
    'ChannelArn': 'string'
}

Response Structure

  • (dict) –

    • ChannelArn (string) –

      The ARN of the channel.

Exceptions

  • ChimeSDKMessaging.Client.exceptions.BadRequestException

  • ChimeSDKMessaging.Client.exceptions.ForbiddenException

  • ChimeSDKMessaging.Client.exceptions.UnauthorizedClientException

  • ChimeSDKMessaging.Client.exceptions.ConflictException

  • ChimeSDKMessaging.Client.exceptions.ResourceLimitExceededException

  • ChimeSDKMessaging.Client.exceptions.ThrottledClientException

  • ChimeSDKMessaging.Client.exceptions.ServiceUnavailableException

  • ChimeSDKMessaging.Client.exceptions.ServiceFailureException