:doc:`ConnectCases <../../connectcases>` / Client / create_template

***************
create_template
***************



.. py:method:: ConnectCases.Client.create_template(**kwargs)

  

  Creates a template in the Cases domain. This template is used to define the case object model (that is, to define what data can be captured on cases) in a Cases domain. A template must have a unique name within a domain, and it must reference existing field IDs and layout IDs. Additionally, multiple fields with same IDs are not allowed within the same Template. A template can be either Active or Inactive, as indicated by its status. Inactive templates cannot be used to create cases.

   

  Other template APIs are:

   

  
  * `DeleteTemplate <https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_DeleteTemplate.html>`__
   
  * `GetTemplate <https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_GetTemplate.html>`__
   
  * `ListTemplates <https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_ListTemplates.html>`__
   
  * `UpdateTemplate <https://docs.aws.amazon.com/connect/latest/APIReference/API_connect-cases_UpdateTemplate.html>`__
  

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/connectcases-2022-10-03/CreateTemplate>`_  


  **Request Syntax**
  ::

    response = client.create_template(
        domainId='string',
        name='string',
        description='string',
        layoutConfiguration={
            'defaultLayout': 'string'
        },
        requiredFields=[
            {
                'fieldId': 'string'
            },
        ],
        status='Active'|'Inactive',
        rules=[
            {
                'caseRuleId': 'string',
                'fieldId': 'string'
            },
        ],
        tagPropagationConfigurations=[
            {
                'resourceType': 'Cases',
                'tagMap': {
                    'string': 'string'
                }
            },
        ]
    )
    
  :type domainId: string
  :param domainId: **[REQUIRED]** 

    The unique identifier of the Cases domain.

    

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

    A name for the template. It must be unique per domain.

    

  
  :type description: string
  :param description: 

    A brief description of the template.

    

  
  :type layoutConfiguration: dict
  :param layoutConfiguration: 

    Configuration of layouts associated to the template.

    

  
    - **defaultLayout** *(string) --* 

      Unique identifier of a layout.

      

    
  
  :type requiredFields: list
  :param requiredFields: 

    A list of fields that must contain a value for a case to be successfully created with this template.

    

  
    - *(dict) --* 

      List of fields that must have a value provided to create a case.

      

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

        Unique identifier of a field.

        

      
    

  :type status: string
  :param status: 

    The status of the template.

    

  
  :type rules: list
  :param rules: 

    A list of case rules (also known as `case field conditions <https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html>`__) on a template.

    

  
    - *(dict) --* 

      An association representing a case rule acting upon a field. In the Amazon Connect admin website, case rules are known as *case field conditions*. For more information about case field conditions, see `Add case field conditions to a case template <https://docs.aws.amazon.com/connect/latest/adminguide/case-field-conditions.html>`__.

      

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

        Unique identifier of a case rule.

        

      
      - **fieldId** *(string) --* 

        Unique identifier of a field.

        

      
    

  :type tagPropagationConfigurations: list
  :param tagPropagationConfigurations: 

    Defines tag propagation configuration for resources created within a domain. Tags specified here will be automatically applied to resources being created for the specified resource type.

    

  
    - *(dict) --* 

      Defines tag propagation configuration for resources created within a domain. Tags specified here will be automatically applied to resources being created for the specified resource type.

      

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

        Supported resource types for tag propagation. Determines which resources will receive automatically propagated tags.

        

      
      - **tagMap** *(dict) --* **[REQUIRED]** 

        The tags that will be applied to the created resource.

        

      
        - *(string) --* 

        
          - *(string) --* 

          
    
  
    

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

    
    ::

      {
          'templateId': 'string',
          'templateArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **templateId** *(string) --* 

        A unique identifier of a template.

        
      

      - **templateArn** *(string) --* 

        The Amazon Resource Name (ARN) of the newly created template.

        
  
  **Exceptions**
  
  *   :py:class:`ConnectCases.Client.exceptions.InternalServerException`

  
  *   :py:class:`ConnectCases.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`ConnectCases.Client.exceptions.ValidationException`

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

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

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

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

  