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

******************
create_channel_ban
******************



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

  

  Permanently bans a member from a channel. Moderators can't add banned members to a channel. To undo a ban, you first have to ``DeleteChannelBan``, and then ``CreateChannelMembership``. Bans are cleaned up when you delete users or channels.

   

  If you ban a user who is already part of a channel, that user is automatically kicked from the channel.

   

  .. 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 <https://docs.aws.amazon.com/goto/WebAPI/chime-sdk-messaging-2021-05-15/CreateChannelBan>`_  


  **Request Syntax**
  ::

    response = client.create_channel_ban(
        ChannelArn='string',
        MemberArn='string',
        ChimeBearer='string'
    )
    
  :type ChannelArn: string
  :param ChannelArn: **[REQUIRED]** 

    The ARN of the ban request.

    

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

    The ``AppInstanceUserArn`` of the member being banned.

    

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

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

    

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

    
    ::

      {
          'ChannelArn': 'string',
          'Member': {
              'Arn': 'string',
              'Name': 'string'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The ARN of the response to the ban request.

        
      

      - **Member** *(dict) --* 

        The ``ChannelArn`` and ``BannedIdentity`` of the member in the ban response.

        
        

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

          The ARN in an Identity.

          
        

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

          The name in an Identity.

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

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

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

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

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

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

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

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

  