openapi: 3.0.0
info:
  title: Evolution Foundation - Evolution Go - Instance
  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
security:
- ApiKeyAuth: []
paths:
  /instance/all:
    get:
      description: Get all instances
      summary: Get all instances
      responses:
        '200':
          description: All instances retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  instances:
                    type: array
                    items:
                      type: object
              example:
                data:
                - id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                  name: "test"
                  token: "f0e1d2c3-b4a5-6789-0abc-def123456789"
                  webhook: ""
                  rabbitmqEnable: ""
                  websocketEnable: ""
                  natsEnable: ""
                  jid: ""
                  qrcode: ""
                  connected: false
                  expiration: 0
                  disconnect_reason: ""
                  events: ""
                  os_name: "Evolution GO"
                  proxy: ""
                  client_name: "evolution"
                  createdAt: "2026-01-15T10:30:00.000000-03:00"
                  alwaysOnline: false
                  rejectCall: false
                  msgRejectCall: ""
                  readMessages: false
                  ignoreGroups: false
                  ignoreStatus: false
                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
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/all
                  method: GET
        '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: /instance/all
                  method: GET
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to get all instances
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/all
                  method: GET
        '404':
          description: Not Found - Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Resource not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/all
                  method: GET
        '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: /instance/all
                  method: GET
  /instance/connect:
    post:
      description: Connect to instance with the provided data
      summary: Connect to instance
      responses:
        '200':
          description: Instance connected successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                data:
                  eventString: "MESSAGE,SEND_MESSAGE,READ_RECEIPT,PRESENCE,HISTORY_SYNC,CHAT_PRESENCE,CALL,CONNECTION,LABEL,CONTACT,GROUP,NEWSLETTER,QRCODE"
                  jid: ""
                  webhookUrl: "https://your-webhook-url.com/webhook"
                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. Instance information is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/connect
                  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: /instance/connect
                  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 connect to instance
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/connect
                  method: POST
        '404':
          description: Not Found - Instance not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/connect
                  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: /instance/connect
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/ConnectInstance'
        description: Instance data
  /instance/create:
    post:
      description: Creates a new instance with the provided data
      summary: Create a new instance
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateInstance'
        description: Instance data
      responses:
        '200':
          description: Instance created successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  instance:
                    type: object
              example:
                data:
                  id: "a1b2c3d4-e5f6-7890-abcd-ef1234567890"
                  name: "test"
                  token: "f0e1d2c3-b4a5-6789-0abc-def123456789"
                  webhook: ""
                  rabbitmqEnable: ""
                  websocketEnable: ""
                  natsEnable: ""
                  jid: ""
                  qrcode: ""
                  connected: false
                  expiration: 0
                  disconnect_reason: ""
                  events: ""
                  os_name: "Evolution GO"
                  proxy: ""
                  client_name: "evolution"
                  createdAt: "2026-01-15T10:30:00.000000-03:00"
                  alwaysOnline: false
                  rejectCall: false
                  msgRejectCall: ""
                  readMessages: false
                  ignoreGroups: false
                  ignoreStatus: false
                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. Instance information is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/create
                  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: /instance/create
                  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 create instance
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/create
                  method: POST
        '404':
          description: Not Found - Resource not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Resource not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/create
                  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: /instance/create
                  method: POST
  /instance/delete/{instanceId}:
    delete:
      operationId: deleteInstanceById
      description: Delete instance
      summary: Delete instance
      parameters:
      - description: Instance Id
        in: path
        name: instanceId
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Instance deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                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. Instance ID is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/delete/{instanceId}
                  method: DELETE
        '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: /instance/delete/{instanceId}
                  method: DELETE
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to delete instance
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/delete/{instanceId}
                  method: DELETE
        '404':
          description: Not Found - Instance not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/delete/{instanceId}
                  method: DELETE
        '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: /instance/delete/{instanceId}
                  method: DELETE
  /instance/disconnect:
    post:
      description: Disconnect from instance
      summary: Disconnect from instance
      responses:
        '200':
          description: Instance disconnected successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                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
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/disconnect
                  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: /instance/disconnect
                  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 disconnect from instance
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/disconnect
                  method: POST
        '404':
          description: Not Found - Instance not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/disconnect
                  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: /instance/disconnect
                  method: POST
  /instance/logout:
    delete:
      description: Logout from instance
      summary: Logout from instance
      responses:
        '200':
          description: Instance logged out successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                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
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/logout
                  method: DELETE
        '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: /instance/logout
                  method: DELETE
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to logout from instance
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/logout
                  method: DELETE
        '404':
          description: Not Found - Instance not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/logout
                  method: DELETE
        '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: /instance/logout
                  method: DELETE
  /instance/pair:
    post:
      description: Request pairing code
      summary: Request pairing code
      responses:
        '200':
          description: Pairing code retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  pairingCode:
                    type: string
              example:
                data:
                  PairingCode: ""
                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. Instance information is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/pair
                  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: /instance/pair
                  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 request pairing code
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/pair
                  method: POST
        '404':
          description: Not Found - Instance not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/pair
                  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: /instance/pair
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/PairInstance'
        description: Instance data
  /instance/proxy/{instanceId}:
    delete:
      description: Delete proxy
      summary: Delete proxy
      parameters:
      - description: Instance id
        in: path
        name: instanceId
        required: true
        schema:
          type: string
      responses:
        '200':
          description: Proxy deleted successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
              example:
                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. Instance ID is required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/proxy/{instanceId}
                  method: DELETE
        '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: /instance/proxy/{instanceId}
                  method: DELETE
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to delete proxy
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/proxy/{instanceId}
                  method: DELETE
        '404':
          description: Not Found - Instance or proxy not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance or proxy not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/proxy/{instanceId}
                  method: DELETE
        '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: /instance/proxy/{instanceId}
                  method: DELETE
  /instance/qr:
    get:
      description: Get instance QR code
      summary: Get instance QR code
      responses:
        '200':
          description: Instance QR code retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  qrCode:
                    type: string
              example:
                data:
                  Qrcode: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAA..."
                  Code: "2@AbCdEfGhIjKlMnOpQrStUvWxYz0123456789..."
                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
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/qr
                  method: GET
        '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: /instance/qr
                  method: GET
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to get instance QR code
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/qr
                  method: GET
        '404':
          description: Not Found - Instance not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/qr
                  method: GET
        '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: /instance/qr
                  method: GET
  /instance/status:
    get:
      description: Get instance status
      summary: Get instance status
      responses:
        '200':
          description: Instance status retrieved successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  status:
                    type: string
              example:
                data:
                  Connected: true
                  LoggedIn: false
                  Name: ""
                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
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/status
                  method: GET
        '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: /instance/status
                  method: GET
        '403':
          description: Forbidden - Insufficient permissions
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: FORBIDDEN
                  message: Insufficient permissions to get instance status
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/status
                  method: GET
        '404':
          description: Not Found - Instance not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Instance not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /instance/status
                  method: GET
        '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: /instance/status
                  method: GET
components:
  schemas:
    ConnectInstance:
      type: object
      properties:
        immediate:
          type: boolean
        phone:
          type: string
        subscribe:
          items:
            type: string
          type: array
        webhookUrl:
          type: string
    CreateInstance:
      type: object
      properties:
        name:
          type: string
        proxy:
          $ref: '#/components/schemas/ProxyConfig'
        token:
          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
    PairInstance:
      type: object
      properties:
        phone:
          type: string
        subscribe:
          items:
            type: string
          type: array
    ProxyConfig:
      type: object
      properties:
        address:
          type: string
        password:
          type: string
        port:
          type: string
        username:
          type: string
    gin.H:
      additionalProperties: {}
      type: object
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: apikey
      description: API Key for authentication (global or instance-specific)
