> ## 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.

# Accept or reject a DM request

> Accepting creates (or reuses) the DM room between the two users. Only the recipient can meaningfully act on a pending request.



## OpenAPI

````yaml /openapi/shared.yaml patch /api/v1/chat/dm-requests/{request_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/dm-requests/{request_id}:
    patch:
      tags:
        - chat
      summary: Accept or reject a DM request
      description: >-
        Accepting creates (or reuses) the DM room between the two users. Only
        the recipient can meaningfully act on a pending request.
      operationId: chat_dm_requests_update
      parameters:
        - in: path
          name: request_id
          schema:
            type: string
            format: uuid
          required: true
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PatchedDMRequestActionRequestRequest'
          application/x-www-form-urlencoded:
            schema:
              $ref: '#/components/schemas/PatchedDMRequestActionRequestRequest'
          multipart/form-data:
            schema:
              $ref: '#/components/schemas/PatchedDMRequestActionRequestRequest'
      responses:
        '200':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/DMRequestUpdateResponse'
          description: ''
      security:
        - bearerAuth: []
components:
  schemas:
    PatchedDMRequestActionRequestRequest:
      type: object
      properties:
        action:
          enum:
            - accept
            - reject
          type: string
          description: |-
            * `accept` - accept
            * `reject` - reject
          x-spec-enum-id: 5f16d67796b09e01
    DMRequestUpdateResponse:
      type: object
      properties:
        success:
          type: boolean
        message:
          type: string
        data:
          $ref: '#/components/schemas/DMRequest'
      required:
        - data
        - message
        - success
    DMRequest:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        from_user_id:
          type: string
          format: uuid
          readOnly: true
        to_user_id:
          type: string
          format: uuid
          readOnly: true
        group_id:
          type: string
          readOnly: true
        document_id:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        status:
          enum:
            - PENDING
            - ACCEPTED
            - REJECTED
          type: string
          description: |-
            * `PENDING` - Pending
            * `ACCEPTED` - Accepted
            * `REJECTED` - Rejected
          x-spec-enum-id: 313afc0526efe9a0
          readOnly: true
        room:
          allOf:
            - $ref: '#/components/schemas/ChatRoom'
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - document_id
        - from_user_id
        - group_id
        - id
        - room
        - status
        - to_user_id
        - updated_at
    ChatRoom:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        name:
          type: string
          readOnly: true
        room_type:
          enum:
            - DIRECT
            - GROUP
          type: string
          description: |-
            * `DIRECT` - Direct Message
            * `GROUP` - Group Chat
          x-spec-enum-id: 322c4b92920d49e4
          readOnly: true
        group_id:
          type: string
          readOnly: true
        document_id:
          type: string
          format: uuid
          readOnly: true
          nullable: true
        created_by:
          type: string
          readOnly: true
        is_active:
          type: boolean
          readOnly: true
        members:
          type: array
          items:
            $ref: '#/components/schemas/ChatRoomMember'
          readOnly: true
        unread_count:
          type: string
          readOnly: true
        created_at:
          type: string
          format: date-time
          readOnly: true
        updated_at:
          type: string
          format: date-time
          readOnly: true
      required:
        - created_at
        - created_by
        - document_id
        - group_id
        - id
        - is_active
        - members
        - name
        - room_type
        - unread_count
        - updated_at
    ChatRoomMember:
      type: object
      properties:
        id:
          type: string
          format: uuid
          readOnly: true
        user:
          type: string
          readOnly: true
        role:
          enum:
            - ADMIN
            - MEMBER
          type: string
          description: |-
            * `ADMIN` - Admin
            * `MEMBER` - Member
          x-spec-enum-id: 87a5cd738f31a971
          readOnly: true
        joined_at:
          type: string
          format: date-time
          readOnly: true
        last_read_at:
          type: string
          format: date-time
          readOnly: true
          nullable: true
      required:
        - id
        - joined_at
        - last_read_at
        - role
        - user
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: 'Enter your JWT token in the format: Bearer <token>'

````