> ## Documentation Index
> Fetch the complete documentation index at: https://docs.capedigital.co.ke/llms.txt
> Use this file to discover all available pages before exploring further.

# Edit a message

> Edits the content of a message. Only the original sender may edit it.



## OpenAPI

````yaml /openapi/shared.yaml patch /api/v1/chat/rooms/{room_id}/messages/{message_id}
openapi: 3.0.3
info:
  title: Shared Service API
  version: 1.0.0
  description: |2-

        **Shared Service API** - Comprehensive shared service and management system.

        ## Versionings
        The API uses URL path versioning (e.g., `/api/v1/`, `/api/v2/`).
        Current version: **v1**
        
  contact:
    name: API Support
    email: thakacreations@gmail.com
  license:
    name: thakacreations
servers: []
security: []
paths:
  /api/v1/chat/rooms/{room_id}/messages/{message_id}:
    patch:
      tags:
        - chat
      summary: Edit a message
      description: Edits the content of a message. Only the original sender may edit it.
      operationId: chat_rooms_messages_update
      parameters:
        - in: path
          name: message_id
          schema:
            type: string
            format: uuid
          required: true
        - in: path
          name: room_id
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedMessageEditRequestRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedMessageEditRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedMessageEditRequestRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageUpdateResponse'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    PatchedMessageEditRequestRequest:
      type: object
      properties:
        content:
          type: string
          minLength: 1
    MessageUpdateResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/Message'
      required:
        - data
        - message
        - success
    Message:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        room:
          type: string
          format: uuid
          readOnly: true
        sender:
          type: string
          readOnly: true
        content:
          type: string
          readOnly: true
        url:
          type: string
          readOnly: true
        reply_to_id:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        is_edited:
          type: boolean
          readOnly: true
        edited_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
        read_by:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - content
        - created_at
        - edited_at
        - id
        - is_edited
        - read_by
        - reply_to_id
        - room
        - sender
        - updated_at
        - url
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````