> ## Documentation Index
> Fetch the complete documentation index at: https://cometchat-22654f5b-docs-flutter-sdk-mark-as-unread.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Update message

> This endpoint is responsible for editing the message, The moderation status is recalculated based on the app's configured rules for the edited message.



## OpenAPI

````yaml put /moderation/messages/{id}
openapi: 3.0.0
info:
  title: Chat APIs
  description: Manage messages, users, groups for a particular app using our Chat API.
  version: '3.0'
servers:
  - url: https://{appid}.api-{region}.cometchat.io/v3
    variables:
      appid:
        default: appId
        description: (Required) App ID
      region:
        enum:
          - us
          - eu
          - in
        default: us
        description: Select Region
security: []
tags:
  - name: API Keys
    description: The API keys are used to authorise the APIs
  - name: Roles
    description: The roles are used to give user access rights
  - name: Users
    description: The REST collection for users.
  - name: Auth Tokens
    description: The auth tokens are used to login end users using client SDKs.
  - name: Blocked Users
    description: The REST collections for blocked users.
  - name: Friends
    description: List,add and remove friends by passing UID in path variables
  - name: Groups
    description: The REST collections for groups.
  - name: Banned Users
    description: Ban and Unban user by passing other UID in path variables.
  - name: Group Members
    description: The REST collections for group members.
  - name: Messages
    description: The REST collections for messages.
  - name: Conversations
    description: The REST collections for conversations.
  - name: Restrict Features
    description: Allows Restricting Features
  - name: Metrics
    description: Allows accessing Data Metrics
  - name: Triggers
    description: Allows adding triggers to a webhook.
  - name: Webhooks
    description: Allows accessing Webhooks.
  - name: Notifications
    description: Allows configuring Notifications core.
  - name: Moderation
    description: The REST collections for Moderations.
paths:
  /moderation/messages/{id}:
    put:
      tags:
        - Moderation
      summary: Update message
      description: >-
        This endpoint is responsible for editing the message, The moderation
        status is recalculated based on the app's configured rules for the
        edited message.
      operationId: chat-api-update-message-moderation
      parameters:
        - name: id
          in: path
          description: Id of the message whose details are to be fetched.
          required: true
          schema:
            type: string
          examples:
            string:
              summary: Message ID
              value: ''
      requestBody:
        content:
          application/json:
            schema:
              properties:
                data:
                  $ref: '#/components/schemas/moderationMessageData'
              type: object
            examples:
              Update Moderation Message:
                summary: Update Moderation Message
                value:
                  data:
                    text: This message has been updated.
      responses:
        '200':
          description: Update Message(s)
          content:
            application/json:
              schema:
                type: object
              example:
                data:
                  id: '1'
                  conversationId: cometchat-uid-1_user_cometchat-uid-2
                  sender: cometchat-uid-2
                  receiverType: user
                  receiver: cometchat-uid-1
                  category: message
                  type: text
                  data:
                    text: heyaya, I'm updated
                    entities:
                      receiver:
                        entity:
                          avatar: >-
                            https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-1.webp
                          createdAt: 1751644824
                          lastActiveAt: 1751644824
                          name: Andrew Joseph
                          role: default
                          status: offline
                          uid: cometchat-uid-1
                        entityType: user
                      sender:
                        entity:
                          avatar: >-
                            https://assets.cometchat.io/sampleapp/v2/users/cometchat-uid-2.webp
                          conversationId: cometchat-uid-1_user_cometchat-uid-2
                          createdAt: 1751644824
                          lastActiveAt: 1751644824
                          name: George Alan
                          role: default
                          status: offline
                          uid: cometchat-uid-2
                        entityType: user
                    moderation:
                      status: approved
                  sentAt: 1750335220
                  editedAt: 1751645607
                  editedBy: cometchat-uid-1
                  updatedAt: 1751644906
      security:
        - apiKey: []
components:
  schemas:
    moderationMessageData:
      description: Can contain any additional properties except for the key properties.
      properties:
        text:
          description: >-
            The meaning of the `data.text` property depends on the values of
            `category` and `type`:

            1. When `category` is `'message'` and `type` is `'text'`, it
            represents the text content of the message.

            2. When `category` is `'message'` and `type` is not `'text'`, it
            represents the caption associated with the attachment.
          type: string
        customData:
          description: when category==”custom”, this property can have any JSON object.
          type: object
        attachments:
          description: >-
            For the messages with image, video, audio or file type (i.e.
            category=="message" && type !="text"), the property contains an
            array of attachment objects.
          type: array
          items:
            required:
              - name
              - mimeType
              - extension
              - url
            properties:
              url:
                description: >-
                  Contains the URL of the attachment. The developer has to make
                  sure that the URL is accessible while calling the API. The API
                  will be downloading the attachment from its current location
                  and upload it to CometChat’s attachment storage.
                type: string
              name:
                description: Name of the attachment.
                type: string
              mimeType:
                description: Mime Type of attachment.
                type: string
              extension:
                description: The extension of the attachment.
                type: string
              size:
                description: The size of the attachment(in bytes).
                type: string
            type: object
        metadata:
          type: object
      type: object
  securitySchemes:
    apiKey:
      type: apiKey
      description: API Key with fullAccess scope(i.e. Rest API Key from the Dashboard).
      name: apikey
      in: header

````