openapi: 3.0.0
info:
  title: Evolution Foundation - Evolution Go - Chat
  description: Go implementation of Evolution
  version: '1.0'
servers:
- url: http://localhost:8080/
  description: Development server (HTTP)
- url: https://localhost:8080/
  description: Development server (HTTPS)
- url: '{customUrl}'
  description: Custom server
  variables:
    customUrl:
      default: https://your-instance.com
      description: Enter your server URL
paths:
  /chat/archive:
    post:
      description: Archive a chat
      summary: Archive a chat
      responses:
        '200':
          description: Chat archived successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                data:
                  timestamp: "0001-01-01 00:00:00 +0000 UTC"
                message: "success"
        '400':
          description: Bad Request - Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request data. Chat information is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/archive
                  method: POST
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing API key
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/archive
                  method: POST
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to archive chat
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/archive
                  method: POST
        '404':
          description: Not Found - Chat not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Chat not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/archive
                  method: POST
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/archive
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatBody'
        description: Chat
  /chat/mute:
    post:
      description: Mute a chat
      summary: Mute a chat
      responses:
        '200':
          description: Chat muted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                data:
                  timestamp: "0001-01-01 00:00:00 +0000 UTC"
                message: "success"
        '400':
          description: Bad Request - Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request data. Chat information is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/mute
                  method: POST
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing API key
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/mute
                  method: POST
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to mute chat
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/mute
                  method: POST
        '404':
          description: Not Found - Chat not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Chat not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/mute
                  method: POST
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/mute
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatBody'
        description: Chat
  /chat/pin:
    post:
      description: Pin a chat
      summary: Pin a chat
      responses:
        '200':
          description: Chat pinned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                data:
                  timestamp: "0001-01-01 00:00:00 +0000 UTC"
                message: "success"
        '400':
          description: Bad Request - Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request data. Chat information is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/pin
                  method: POST
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing API key
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/pin
                  method: POST
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to pin chat
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/pin
                  method: POST
        '404':
          description: Not Found - Chat not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Chat not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/pin
                  method: POST
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/pin
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatBody'
        description: Chat
  /chat/unpin:
    post:
      description: Unpin a chat
      summary: Unpin a chat
      responses:
        '200':
          description: Chat unpinned successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                data:
                  timestamp: "0001-01-01 00:00:00 +0000 UTC"
                message: "success"
        '400':
          description: Bad Request - Invalid input data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: BAD_REQUEST
                  message: Invalid request data. Chat information is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/unpin
                  method: POST
        '401':
          description: Unauthorized - Invalid or missing API key
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: UNAUTHORIZED
                  message: Invalid or missing API key
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/unpin
                  method: POST
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to unpin chat
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/unpin
                  method: POST
        '404':
          description: Not Found - Chat not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Chat not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/unpin
                  method: POST
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: INTERNAL_SERVER_ERROR
                  message: An unexpected error occurred
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /chat/unpin
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ChatBody'
        description: Chat
components:
  schemas:
    ChatBody:
      type: object
      properties:
        number:
          type: string
    ErrorResponse:
      type: object
      required:
      - success
      - error
      properties:
        success:
          type: boolean
          example: false
        error:
          type: object
          required:
          - code
          - message
          properties:
            code:
              type: string
            message:
              type: string
        meta:
          type: object
          properties:
            timestamp:
              type: string
              format: date-time
            path:
              type: string
            method:
              type: string
