openapi: 3.0.0
info:
  title: Evolution Foundation - Evolution Go - Send Message
  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:
  /send/contact:
    post:
      description: Send a contact message
      summary: Send a contact message
      responses:
        '200':
          description: Contact message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  messageId:
                    type: string
              example:
                data:
                  Info:
                    Chat: "5511999999999@s.whatsapp.net"
                    Sender: "5511888888888:24@s.whatsapp.net"
                    IsFromMe: true
                    IsGroup: false
                    AddressingMode: ""
                    SenderAlt: ""
                    RecipientAlt: ""
                    BroadcastListOwner: ""
                    BroadcastRecipients: null
                    ID: "3EB0000000000000000004"
                    ServerID: 0
                    Type: "ContactMessage"
                    PushName: ""
                    Timestamp: "2026-01-15T10:30:00.000000-03:00"
                    Category: ""
                    Multicast: false
                    MediaType: ""
                    Edit: ""
                    MsgBotInfo:
                      EditType: ""
                      EditTargetID: ""
                      EditSenderTimestampMS: "0001-01-01T00:00:00Z"
                    MsgMetaInfo:
                      TargetID: ""
                      TargetSender: ""
                      TargetChat: ""
                      DeprecatedLIDSession: null
                      ThreadMessageID: ""
                      ThreadMessageSenderJID: ""
                    VerifiedName: null
                    DeviceSentMeta: null
                  Message:
                    contactMessage:
                      displayName: "Contact Name"
                      vcard: "\nBEGIN:VCARD\nVERSION:3.0\nFN:Contact Name\nORG:Company;\nTEL;type=CELL;type=VOICE;waid=5511999999999:5511999999999\nEND:VCARD"
                      contextInfo: {}
                  MessageContextInfo:
                    stanzaID: ""
                    participant: ""
                    quotedMessage:
                      conversation: ""
                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. Contact and recipient information are required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/contact
                  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: /send/contact
                  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 send contact message
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/contact
                  method: POST
        '404':
          description: Not Found - Recipient or contact not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Recipient or contact not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/contact
                  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: /send/contact
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendContact'
        description: Message data
  /send/link:
    post:
      description: Send a link message
      summary: Send a link message
      responses:
        '200':
          description: Link message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  messageId:
                    type: string
              example:
                data:
                  Info:
                    Chat: "5511999999999@s.whatsapp.net"
                    Sender: "5511888888888:24@s.whatsapp.net"
                    IsFromMe: true
                    IsGroup: false
                    AddressingMode: ""
                    SenderAlt: ""
                    RecipientAlt: ""
                    BroadcastListOwner: ""
                    BroadcastRecipients: null
                    ID: "3EB0000000000000000005"
                    ServerID: 0
                    Type: "ExtendedTextMessage"
                    PushName: ""
                    Timestamp: "2026-01-15T10:30:00.000000-03:00"
                    Category: ""
                    Multicast: false
                    MediaType: ""
                    Edit: ""
                    MsgBotInfo:
                      EditType: ""
                      EditTargetID: ""
                      EditSenderTimestampMS: "0001-01-01T00:00:00Z"
                    MsgMetaInfo:
                      TargetID: ""
                      TargetSender: ""
                      TargetChat: ""
                      DeprecatedLIDSession: null
                      ThreadMessageID: ""
                      ThreadMessageSenderJID: ""
                    VerifiedName: null
                    DeviceSentMeta: null
                  Message:
                    extendedTextMessage:
                      text: "message text https://example.com"
                      matchedText: "https://example.com"
                      description: "Page description"
                      title: "Page Title"
                      JPEGThumbnail: "#"
                      contextInfo: {}
                  MessageContextInfo:
                    stanzaID: ""
                    participant: ""
                    quotedMessage:
                      conversation: ""
                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. Link and recipient information are required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/link
                  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: /send/link
                  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 send link message
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/link
                  method: POST
        '404':
          description: Not Found - Recipient not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Recipient not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/link
                  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: /send/link
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendLink'
        description: Message data
  /send/location:
    post:
      description: Send a location message
      summary: Send a location message
      responses:
        '200':
          description: Location message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  messageId:
                    type: string
              example:
                data:
                  Info:
                    Chat: "5511999999999@s.whatsapp.net"
                    Sender: "5511888888888:24@s.whatsapp.net"
                    IsFromMe: true
                    IsGroup: false
                    AddressingMode: ""
                    SenderAlt: ""
                    RecipientAlt: ""
                    BroadcastListOwner: ""
                    BroadcastRecipients: null
                    ID: "3EB0000000000000000006"
                    ServerID: 0
                    Type: "LocationMessage"
                    PushName: ""
                    Timestamp: "2026-01-15T10:30:00.000000-03:00"
                    Category: ""
                    Multicast: false
                    MediaType: ""
                    Edit: ""
                    MsgBotInfo:
                      EditType: ""
                      EditTargetID: ""
                      EditSenderTimestampMS: "0001-01-01T00:00:00Z"
                    MsgMetaInfo:
                      TargetID: ""
                      TargetSender: ""
                      TargetChat: ""
                      DeprecatedLIDSession: null
                      ThreadMessageID: ""
                      ThreadMessageSenderJID: ""
                    VerifiedName: null
                    DeviceSentMeta: null
                  Message:
                    locationMessage:
                      degreesLatitude: -16.505538233564373
                      degreesLongitude: -151.7422770494996
                      name: "Location Name"
                      address: "Location Address"
                      contextInfo: {}
                  MessageContextInfo:
                    stanzaID: ""
                    participant: ""
                    quotedMessage:
                      conversation: ""
                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. Location and recipient information are required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/location
                  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: /send/location
                  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 send location message
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/location
                  method: POST
        '404':
          description: Not Found - Recipient not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Recipient not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/location
                  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: /send/location
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendLocation'
        description: Message data
  /send/media:
    post:
      description: Send a media message
      summary: Send a media message
      responses:
        '200':
          description: Media message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  messageId:
                    type: string
              example:
                data:
                  Info:
                    Chat: "5511999999999@s.whatsapp.net"
                    Sender: "5511888888888:24@s.whatsapp.net"
                    IsFromMe: true
                    IsGroup: false
                    AddressingMode: ""
                    SenderAlt: ""
                    RecipientAlt: ""
                    BroadcastListOwner: ""
                    BroadcastRecipients: null
                    ID: "3EB0000000000000000007"
                    ServerID: 0
                    Type: "DocumentMessage"
                    PushName: ""
                    Timestamp: "2026-01-15T10:30:00.000000-03:00"
                    Category: ""
                    Multicast: false
                    MediaType: ""
                    Edit: ""
                    MsgBotInfo:
                      EditType: ""
                      EditTargetID: ""
                      EditSenderTimestampMS: "0001-01-01T00:00:00Z"
                    MsgMetaInfo:
                      TargetID: ""
                      TargetSender: ""
                      TargetChat: ""
                      DeprecatedLIDSession: null
                      ThreadMessageID: ""
                      ThreadMessageSenderJID: ""
                    VerifiedName: null
                    DeviceSentMeta: null
                  Message:
                    documentWithCaptionMessage:
                      message:
                        documentMessage:
                          URL: "https://mmg.whatsapp.net/..."
                          mimetype: "application/pdf"
                          fileSHA256: "base64-encoded-hash"
                          fileLength: 71689
                          mediaKey: "base64-encoded-key"
                          fileName: "file.pdf"
                          fileEncSHA256: "base64-encoded-hash"
                          directPath: "/v/t62.7119-24/..."
                          contextInfo: {}
                          caption: "caption text"
                  MessageContextInfo:
                    stanzaID: ""
                    participant: ""
                    quotedMessage:
                      conversation: ""
                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. Media and recipient information are required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/media
                  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: /send/media
                  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 send media message
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/media
                  method: POST
        '404':
          description: Not Found - Recipient not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Recipient not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/media
                  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: /send/media
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendMedia'
        description: Message data
  /send/poll:
    post:
      description: Send a poll message
      summary: Send a poll message
      responses:
        '200':
          description: Poll message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  messageId:
                    type: string
              example:
                data:
                  Info:
                    Chat: "5511999999999@s.whatsapp.net"
                    Sender: "5511888888888:24@s.whatsapp.net"
                    IsFromMe: true
                    IsGroup: false
                    AddressingMode: ""
                    SenderAlt: ""
                    RecipientAlt: ""
                    BroadcastListOwner: ""
                    BroadcastRecipients: null
                    ID: "3EB0000000000000000008"
                    ServerID: 0
                    Type: "PollCreationMessage"
                    PushName: ""
                    Timestamp: "2026-01-15T10:30:00.000000-03:00"
                    Category: ""
                    Multicast: false
                    MediaType: ""
                    Edit: ""
                    MsgBotInfo:
                      EditType: ""
                      EditTargetID: ""
                      EditSenderTimestampMS: "0001-01-01T00:00:00Z"
                    MsgMetaInfo:
                      TargetID: ""
                      TargetSender: ""
                      TargetChat: ""
                      DeprecatedLIDSession: null
                      ThreadMessageID: ""
                      ThreadMessageSenderJID: ""
                    VerifiedName: null
                    DeviceSentMeta: null
                  Message:
                    messageContextInfo:
                      messageSecret: "base64-encoded-secret"
                    pollCreationMessage:
                      name: "poll question"
                      options:
                      - optionName: "option1"
                      - optionName: "option2"
                      selectableOptionsCount: 0
                      contextInfo: {}
                  MessageContextInfo:
                    stanzaID: ""
                    participant: ""
                    quotedMessage:
                      conversation: ""
                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. Poll and recipient information are required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/poll
                  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: /send/poll
                  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 send poll message
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/poll
                  method: POST
        '404':
          description: Not Found - Recipient not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Recipient not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/poll
                  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: /send/poll
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendPoll'
        description: Message data
  /send/sticker:
    post:
      description: Send a sticker message
      summary: Send a sticker message
      responses:
        '200':
          description: Sticker message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  messageId:
                    type: string
              example:
                data:
                  Info:
                    Chat: "5511999999999@s.whatsapp.net"
                    Sender: "5511888888888:24@s.whatsapp.net"
                    IsFromMe: true
                    IsGroup: false
                    AddressingMode: ""
                    SenderAlt: ""
                    RecipientAlt: ""
                    BroadcastListOwner: ""
                    BroadcastRecipients: null
                    ID: "3EB0000000000000000009"
                    ServerID: 0
                    Type: "StickerMessage"
                    PushName: ""
                    Timestamp: "2026-01-15T10:30:00.000000-03:00"
                    Category: ""
                    Multicast: false
                    MediaType: ""
                    Edit: ""
                    MsgBotInfo:
                      EditType: ""
                      EditTargetID: ""
                      EditSenderTimestampMS: "0001-01-01T00:00:00Z"
                    MsgMetaInfo:
                      TargetID: ""
                      TargetSender: ""
                      TargetChat: ""
                      DeprecatedLIDSession: null
                      ThreadMessageID: ""
                      ThreadMessageSenderJID: ""
                    VerifiedName: null
                    DeviceSentMeta: null
                  Message:
                    stickerMessage:
                      URL: "https://mmg.whatsapp.net/..."
                      fileSHA256: "base64-encoded-hash"
                      fileEncSHA256: "base64-encoded-hash"
                      mediaKey: "base64-encoded-key"
                      mimetype: "image/webp"
                      directPath: "/o1/v/t24/..."
                      fileLength: 8640
                      contextInfo: {}
                  MessageContextInfo:
                    stanzaID: ""
                    participant: ""
                    quotedMessage:
                      conversation: ""
                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. Sticker and recipient information are required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/sticker
                  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: /send/sticker
                  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 send sticker message
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/sticker
                  method: POST
        '404':
          description: Not Found - Recipient not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Recipient not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/sticker
                  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: /send/sticker
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendSticker'
        description: Message data
  /send/text:
    post:
      description: Send a text message
      summary: Send a text message
      responses:
        '200':
          description: Text message sent successfully
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                    example: true
                  message:
                    type: string
                  messageId:
                    type: string
              example:
                data:
                  Info:
                    Chat: "5511999999999@s.whatsapp.net"
                    Sender: "5511888888888:24@s.whatsapp.net"
                    IsFromMe: true
                    IsGroup: false
                    AddressingMode: ""
                    SenderAlt: ""
                    RecipientAlt: ""
                    BroadcastListOwner: ""
                    BroadcastRecipients: null
                    ID: "3EB0000000000000000010"
                    ServerID: 0
                    Type: "ExtendedTextMessage"
                    PushName: ""
                    Timestamp: "2026-01-15T10:30:00.000000-03:00"
                    Category: ""
                    Multicast: false
                    MediaType: ""
                    Edit: ""
                    MsgBotInfo:
                      EditType: ""
                      EditTargetID: ""
                      EditSenderTimestampMS: "0001-01-01T00:00:00Z"
                    MsgMetaInfo:
                      TargetID: ""
                      TargetSender: ""
                      TargetChat: ""
                      DeprecatedLIDSession: null
                      ThreadMessageID: ""
                      ThreadMessageSenderJID: ""
                    VerifiedName: null
                    DeviceSentMeta: null
                  Message:
                    extendedTextMessage:
                      text: "message text"
                      contextInfo: {}
                  MessageContextInfo:
                    stanzaID: ""
                    participant: ""
                    quotedMessage:
                      conversation: ""
                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. Text and recipient information are required.
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/text
                  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: /send/text
                  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 send text message
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/text
                  method: POST
        '404':
          description: Not Found - Recipient not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
              example:
                success: false
                error:
                  code: NOT_FOUND
                  message: Recipient not found
                meta:
                  timestamp: '2024-01-15T10:30:00Z'
                  path: /send/text
                  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: /send/text
                  method: POST
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/SendText'
        description: Message data
components:
  schemas:
    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
    QuotedMessage:
      type: object
      properties:
        messageId:
          type: string
        participant:
          type: string
    SendContact:
      type: object
      properties:
        delay:
          type: integer
        id:
          type: string
        mentionAll:
          type: boolean
        mentionedJid:
          type: string
        number:
          type: string
        quoted:
          $ref: '#/components/schemas/QuotedMessage'
        vcard:
          $ref: '#/components/schemas/VCard'
    SendLink:
      type: object
      properties:
        delay:
          type: integer
        description:
          type: string
        id:
          type: string
        imgUrl:
          type: string
        mentionAll:
          type: boolean
        mentionedJid:
          type: string
        number:
          type: string
        quoted:
          $ref: '#/components/schemas/QuotedMessage'
        text:
          type: string
        title:
          type: string
        url:
          type: string
    SendLocation:
      type: object
      properties:
        address:
          type: string
        delay:
          type: integer
        id:
          type: string
        latitude:
          type: number
        longitude:
          type: number
        mentionAll:
          type: boolean
        mentionedJid:
          type: string
        name:
          type: string
        number:
          type: string
        quoted:
          $ref: '#/components/schemas/QuotedMessage'
    SendMedia:
      type: object
      properties:
        caption:
          type: string
        delay:
          type: integer
        filename:
          type: string
        id:
          type: string
        mentionAll:
          type: boolean
        mentionedJid:
          type: string
        number:
          type: string
        quoted:
          $ref: '#/components/schemas/QuotedMessage'
        type:
          type: string
        url:
          type: string
    SendPoll:
      type: object
      properties:
        delay:
          type: integer
        id:
          type: string
        maxAnswer:
          type: integer
        mentionAll:
          type: boolean
        mentionedJid:
          type: string
        number:
          type: string
        options:
          items:
            type: string
          type: array
        question:
          type: string
        quoted:
          $ref: '#/components/schemas/QuotedMessage'
    SendSticker:
      type: object
      properties:
        delay:
          type: integer
        id:
          type: string
        mentionAll:
          type: boolean
        mentionedJid:
          type: string
        number:
          type: string
        quoted:
          $ref: '#/components/schemas/QuotedMessage'
        sticker:
          type: string
    SendText:
      type: object
      properties:
        delay:
          type: integer
        id:
          type: string
        mentionAll:
          type: boolean
        mentionedJid:
          type: string
        number:
          type: string
        quoted:
          $ref: '#/components/schemas/QuotedMessage'
        text:
          type: string
    VCard:
      type: object
      properties:
        fullName:
          type: string
        organization:
          type: string
        phone:
          type: string
