:doc:`ivschat <../../ivschat>` / Client / delete_message

**************
delete_message
**************



.. py:method:: ivschat.Client.delete_message(**kwargs)

  

  Sends an event to a specific room which directs clients to delete a specific message; that is, unrender it from view and delete it from the client’s chat history. This event’s ``EventName`` is ``aws:DELETE_MESSAGE``. This replicates the `DeleteMessage <https://docs.aws.amazon.com/ivs/latest/chatmsgapireference/actions-deletemessage-publish.html>`__ WebSocket operation in the Amazon IVS Chat Messaging API.

  

  See also: `AWS API Documentation <https://docs.aws.amazon.com/goto/WebAPI/ivschat-2020-07-14/DeleteMessage>`_  


  **Request Syntax**
  ::

    response = client.delete_message(
        roomIdentifier='string',
        id='string',
        reason='string'
    )
    
  :type roomIdentifier: string
  :param roomIdentifier: **[REQUIRED]** 

    Identifier of the room where the message should be deleted. Currently this must be an ARN.

    

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

    ID of the message to be deleted. This is the ``Id`` field in the received message (see `Message (Subscribe) <https://docs.aws.amazon.com/ivs/latest/chatmsgapireference/actions-message-subscribe.html>`__ in the Chat Messaging API).

    

  
  :type reason: string
  :param reason: 

    Reason for deleting the message.

    

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

    
    ::

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

    

    - *(dict) --* 
      

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

        Operation identifier, generated by Amazon IVS Chat.

        
  
  **Exceptions**
  
  *   :py:class:`ivschat.Client.exceptions.ThrottlingException`

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

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

  
  *   :py:class:`ivschat.Client.exceptions.PendingVerification`

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

  