:doc:`ChimeSDKMessaging <../../chime-sdk-messaging>` / Client / batch_create_channel_membership

*******************************
batch_create_channel_membership
*******************************



.. py:method:: ChimeSDKMessaging.Client.batch_create_channel_membership(**kwargs)

  

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

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-messaging-2021-05-15/BatchCreateChannelMembership>`_  


  **Request Syntax**
  ::

    response = client.batch_create_channel_membership(
        ChannelArn='string',
        Type='DEFAULT'|'HIDDEN',
        MemberArns=[
            'string',
        ],
        ChimeBearer='string',
        SubChannelId='string'
    )
    
  :type ChannelArn: string
  :param ChannelArn: **[REQUIRED]** 

    The ARN of the channel to which you're adding users or bots.

    

  
  :type Type: string
  :param Type: 

    The membership type of a user, ``DEFAULT`` or ``HIDDEN``. Default members are always returned as part of ``ListChannelMemberships``. Hidden members are only returned if the type filter in ``ListChannelMemberships`` equals ``HIDDEN``. Otherwise hidden members are not returned. This is only supported by moderators.

    

  
  :type MemberArns: list
  :param MemberArns: **[REQUIRED]** 

    The ARNs of the members you want to add to the channel. Only ``AppInstanceUsers`` and ``AppInstanceBots`` can be added as a channel member.

    

  
    - *(string) --* 

    

  :type ChimeBearer: string
  :param ChimeBearer: **[REQUIRED]** 

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

    

  
  :type SubChannelId: string
  :param SubChannelId: 

    The ID of the SubChannel in the request.

     

    .. note::

      

      Only required when creating membership in a SubChannel for a moderator in an elastic channel.

      

    

  
  
  :rtype: dict
  :returns: 
    
    **Response Syntax**

    
    ::

      {
          'BatchChannelMemberships': {
              'InvitedBy': {
                  'Arn': 'string',
                  'Name': 'string'
              },
              'Type': 'DEFAULT'|'HIDDEN',
              'Members': [
                  {
                      'Arn': 'string',
                      'Name': 'string'
                  },
              ],
              'ChannelArn': 'string',
              'SubChannelId': 'string'
          },
          'Errors': [
              {
                  'MemberArn': 'string',
                  'ErrorCode': 'BadRequest'|'Conflict'|'Forbidden'|'NotFound'|'PreconditionFailed'|'ResourceLimitExceeded'|'ServiceFailure'|'AccessDenied'|'ServiceUnavailable'|'Throttled'|'Throttling'|'Unauthorized'|'Unprocessable'|'VoiceConnectorGroupAssociationsExist'|'PhoneNumberAssociationsExist',
                  'ErrorMessage': 'string'
              },
          ]
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **BatchChannelMemberships** *(dict) --* 

        The list of channel memberships in the response.

        
        

        - **InvitedBy** *(dict) --* 

          The identifier of the member who invited another member.

          
          

          - **Arn** *(string) --* 

            The ARN in an Identity.

            
          

          - **Name** *(string) --* 

            The name in an Identity.

            
      
        

        - **Type** *(string) --* 

          The membership types set for the channel members.

          
        

        - **Members** *(list) --* 

          The users successfully added to the request.

          
          

          - *(dict) --* 

            The details of a user or bot.

            
            

            - **Arn** *(string) --* 

              The ARN in an Identity.

              
            

            - **Name** *(string) --* 

              The name in an Identity.

              
        
      
        

        - **ChannelArn** *(string) --* 

          The ARN of the channel to which you're adding members.

          
        

        - **SubChannelId** *(string) --* 

          The ID of the SubChannel.

          
    
      

      - **Errors** *(list) --* 

        If the action fails for one or more of the memberships in the request, a list of the memberships is returned, along with error codes and error messages.

        
        

        - *(dict) --* 

          A list of failed member ARNs, error codes, and error messages.

          
          

          - **MemberArn** *(string) --* 

            The ``AppInstanceUserArn`` of the member that the service couldn't add.

            
          

          - **ErrorCode** *(string) --* 

            The error code.

            
          

          - **ErrorMessage** *(string) --* 

            The error message.

            
      
    
  
  **Exceptions**
  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ServiceFailureException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ServiceUnavailableException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.UnauthorizedClientException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.BadRequestException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.NotFoundException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ForbiddenException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ThrottledClientException`

  
  *   :py:class:`ChimeSDKMessaging.Client.exceptions.ResourceLimitExceededException`

  