:doc:`CloudWatchRUM <../../rum>` / Client / put_rum_events

**************
put_rum_events
**************



.. py:method:: CloudWatchRUM.Client.put_rum_events(**kwargs)

  

  Sends telemetry events about your application performance and user behavior to CloudWatch RUM. The code snippet that RUM generates for you to add to your application includes ``PutRumEvents`` operations to send this data to RUM.

   

  Each ``PutRumEvents`` operation can send a batch of events from one user session.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/rum-2018-05-10/PutRumEvents>`_  


  **Request Syntax**
  ::

    response = client.put_rum_events(
        Id='string',
        BatchId='string',
        AppMonitorDetails={
            'name': 'string',
            'id': 'string',
            'version': 'string'
        },
        UserDetails={
            'userId': 'string',
            'sessionId': 'string'
        },
        RumEvents=[
            {
                'id': 'string',
                'timestamp': datetime(2015, 1, 1),
                'type': 'string',
                'metadata': 'string',
                'details': 'string'
            },
        ],
        Alias='string'
    )
    
  :type Id: string
  :param Id: **[REQUIRED]** 

    The ID of the app monitor that is sending this data.

    

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

    A unique identifier for this batch of RUM event data.

    

  
  :type AppMonitorDetails: dict
  :param AppMonitorDetails: **[REQUIRED]** 

    A structure that contains information about the app monitor that collected this telemetry information.

    

  
    - **name** *(string) --* 

      The name of the app monitor.

      

    
    - **id** *(string) --* 

      The unique ID of the app monitor.

      

    
    - **version** *(string) --* 

      The version of the app monitor.

      

    
  
  :type UserDetails: dict
  :param UserDetails: **[REQUIRED]** 

    A structure that contains information about the user session that this batch of events was collected from.

    

  
    - **userId** *(string) --* 

      The ID of the user for this user session. This ID is generated by RUM and does not include any personally identifiable information about the user.

      

    
    - **sessionId** *(string) --* 

      The session ID that the performance events are from.

      

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

    An array of structures that contain the telemetry event data.

    

  
    - *(dict) --* 

      A structure that contains the information for one performance event that RUM collects from a user session with your application.

      

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

        A unique ID for this event.

        

      
      - **timestamp** *(datetime) --* **[REQUIRED]** 

        The exact time that this event occurred.

        

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

        The JSON schema that denotes the type of event this is, such as a page load or a new session.

        

      
      - **metadata** *(string) --* 

        Metadata about this event, which contains a JSON serialization of the identity of the user for this session. The user information comes from information such as the HTTP user-agent request header and document interface.

        

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

        A string containing details about the event.

        

      
    

  :type Alias: string
  :param Alias: 

    If the app monitor uses a resource-based policy that requires ``PutRumEvents`` requests to specify a certain alias, specify that alias here. This alias will be compared to the ``rum:alias`` context key in the resource-based policy. For more information, see `Using resource-based policies with CloudWatch RUM <https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-RUM-resource-policies.html>`__.

    

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

    
    ::

      {}
      
    **Response Structure**

    

    - *(dict) --* 
  
  **Exceptions**
  
  *   :py:class:`CloudWatchRUM.Client.exceptions.ResourceNotFoundException`

  
  *   :py:class:`CloudWatchRUM.Client.exceptions.InternalServerException`

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

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

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

  