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

***********
create_case
***********



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

  

  

  .. note::

    

    If you provide a value for ``PerformedBy.UserArn`` you must also have `connect\:DescribeUser <https://docs.aws.amazon.com/connect/latest/APIReference/API_DescribeUser.html>`__ permission on the User ARN resource that you provide

    

   

  Creates a case in the specified Cases domain. Case system and custom fields are taken as an array id/value pairs with a declared data types.

   

  When creating a case from a template that has tag propagation configurations, the specified tags are automatically applied to the case.

   

  The following fields are required when creating a case:

   

  
  * ``customer_id`` - You must provide the full customer profile ARN in this format: ``arn:aws:profile:your_AWS_Region:your_AWS_account ID:domains/your_profiles_domain_name/profiles/profile_ID``
   
  * ``title``
  

  

  

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


  **Request Syntax**
  ::

    response = client.create_case(
        domainId='string',
        templateId='string',
        fields=[
            {
                'id': 'string',
                'value': {
                    'stringValue': 'string',
                    'doubleValue': 123.0,
                    'booleanValue': True|False,
                    'emptyValue': {}
                    ,
                    'userArnValue': 'string'
                }
            },
        ],
        clientToken='string',
        performedBy={
            'userArn': 'string',
            'customEntity': 'string'
        },
        tags={
            'string': 'string'
        }
    )
    
  :type domainId: string
  :param domainId: **[REQUIRED]** 

    The unique identifier of the Cases domain.

    

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

    A unique identifier of a template.

    

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

    An array of objects with field ID (matching ListFields/DescribeField) and value union data.

    

  
    - *(dict) --* 

      Object for case field values.

      

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

        Unique identifier of a field.

        

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

        Union of potential field value types.

        .. note::    This is a Tagged Union structure. Only one of the     following top level keys can be set: ``stringValue``, ``doubleValue``, ``booleanValue``, ``emptyValue``, ``userArnValue``. 

      
        - **stringValue** *(string) --* 

          String value type.

          

        
        - **doubleValue** *(float) --* 

          Can be either null, or have a Double number value type. Only one value can be provided.

          

        
        - **booleanValue** *(boolean) --* 

          Can be either null, or have a Boolean value type. Only one value can be provided.

          

        
        - **emptyValue** *(dict) --* 

          An empty value.

          

        
        
        - **userArnValue** *(string) --* 

          Represents the user that performed the audit.

          

        
      
    

  :type clientToken: string
  :param clientToken: 

    A unique, case-sensitive identifier that you provide to ensure the idempotency of the request. If not provided, the Amazon Web Services SDK populates this field. For more information about idempotency, see `Making retries safe with idempotent APIs <https://aws.amazon.com/builders-library/making-retries-safe-with-idempotent-APIs/>`__.

    This field is autopopulated if not provided.

  
  :type performedBy: dict
  :param performedBy: 

    Represents the entity that performed the action.

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

  
    - **userArn** *(string) --* 

      Represents the Amazon Connect ARN of the user.

      

    
    - **customEntity** *(string) --* 

      Any provided entity.

      

    
  
  :type tags: dict
  :param tags: 

    A map of of key-value pairs that represent tags on a resource. Tags are used to organize, track, or control access for this resource.

    

  
    - *(string) --* 

    
      - *(string) --* 

      


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

    
    ::

      {
          'caseId': 'string',
          'caseArn': 'string'
      }
      
    **Response Structure**

    

    - *(dict) --* 
      

      - **caseId** *(string) --* 

        A unique identifier of the case.

        
      

      - **caseArn** *(string) --* 

        The Amazon Resource Name (ARN) of the case.

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

  