:doc:`MailManager <../../mailmanager>` / Client / create_archive

**************
create_archive
**************



.. py:method:: MailManager.Client.create_archive(**kwargs)

  

  Creates a new email archive resource for storing and retaining emails.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/mailmanager-2023-10-17/CreateArchive>`_  


  **Request Syntax**
  ::

    response = client.create_archive(
        ClientToken='string',
        ArchiveName='string',
        Retention={
            'RetentionPeriod': 'THREE_MONTHS'|'SIX_MONTHS'|'NINE_MONTHS'|'ONE_YEAR'|'EIGHTEEN_MONTHS'|'TWO_YEARS'|'THIRTY_MONTHS'|'THREE_YEARS'|'FOUR_YEARS'|'FIVE_YEARS'|'SIX_YEARS'|'SEVEN_YEARS'|'EIGHT_YEARS'|'NINE_YEARS'|'TEN_YEARS'|'PERMANENT'
        },
        KmsKeyArn='string',
        Tags=[
            {
                'Key': 'string',
                'Value': 'string'
            },
        ]
    )
    
  :type ClientToken: string
  :param ClientToken: 

    A unique token Amazon SES uses to recognize retries of this request.

    This field is autopopulated if not provided.

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

    A unique name for the new archive.

    

  
  :type Retention: dict
  :param Retention: 

    The period for retaining emails in the archive before automatic deletion.

    .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``RetentionPeriod``. 

  
    - **RetentionPeriod** *(string) --* 

      The enum value sets the period for retaining emails in an archive.

      

    
  
  :type KmsKeyArn: string
  :param KmsKeyArn: 

    The Amazon Resource Name (ARN) of the KMS key for encrypting emails in the archive.

    

  
  :type Tags: list
  :param Tags: 

    The tags used to organize, track, or control access for the resource. For example, { "tags": {"key1":"value1", "key2":"value2"} }.

    

  
    - *(dict) --* 

      A key-value pair (the value is optional), that you can define and assign to Amazon Web Services resources.

      

    
      - **Key** *(string) --* **[REQUIRED]** 

        The key of the key-value tag.

        

      
      - **Value** *(string) --* **[REQUIRED]** 

        The value of the key-value tag.

        

      
    

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

    
    ::

      {
          'ArchiveId': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 

      The response from creating a new email archive.

      
      

      - **ArchiveId** *(string) --* 

        The unique identifier for the newly created archive.

        
  
  **Exceptions**
  
  *   :py:class:`MailManager.Client.exceptions.ValidationException`

  
  *   :py:class:`MailManager.Client.exceptions.AccessDeniedException`

  
  *   :py:class:`MailManager.Client.exceptions.ServiceQuotaExceededException`

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

  
  *   :py:class:`MailManager.Client.exceptions.ThrottlingException`

  