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

*******************************
put_channel_expiration_settings
*******************************



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

  

  Sets the number of days before the channel is automatically deleted.

   

  .. note::

    

    
    * 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.
    

    

  

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


  **Request Syntax**
  ::

    response = client.put_channel_expiration_settings(
        ChannelArn='string',
        ChimeBearer='string',
        ExpirationSettings={
            'ExpirationDays': 123,
            'ExpirationCriterion': 'CREATED_TIMESTAMP'|'LAST_MESSAGE_TIMESTAMP'
        }
    )
    
  :type ChannelArn: string
  :param ChannelArn: **[REQUIRED]** 

    The ARN of the channel.

    

  
  :type ChimeBearer: string
  :param ChimeBearer: 

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

    

  
  :type ExpirationSettings: dict
  :param ExpirationSettings: 

    Settings that control the interval after which a channel is 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.

      

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

    
    ::

      {
          'ChannelArn': 'string',
          'ExpirationSettings': {
              'ExpirationDays': 123,
              'ExpirationCriterion': 'CREATED_TIMESTAMP'|'LAST_MESSAGE_TIMESTAMP'
          }
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

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

        The channel ARN.

        
      

      - **ExpirationSettings** *(dict) --* 

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

        
        

        - **ExpirationDays** *(integer) --* 

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

          
        

        - **ExpirationCriterion** *(string) --* 

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

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

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

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

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

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

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

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

  