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

# Enviar Comando

> Envia um comando para um canal



## OpenAPI

````yaml POST /api/v1/message/SendCommand
openapi: 3.0.4
info:
  title: MessageFy API
  description: >-
    API de mensageria multi-canal do MessageFy. Envie e receba mensagens via
    WhatsApp, HTTP, Telegram e outros canais com uma API unificada.
  version: v1
servers:
  - url: https://api-dev.messagefy.io
security:
  - apiKey: []
tags:
  - name: Me
  - name: Configure
  - name: DeleteMessage
  - name: EditMessage
  - name: MessageOutbox
  - name: SearchMessage
  - name: SendMessage
  - name: Account
  - name: ApiKey
  - name: Channel
  - name: Outbox
paths:
  /api/v1/message/SendCommand:
    post:
      tags:
        - SendMessage
      requestBody:
        content:
          application/json; v=1.0:
            schema:
              type: object
              properties:
                packageId:
                  type: string
                  format: uuid
                  nullable: true
                correlationId:
                  type: string
                  nullable: true
                originPackageId:
                  type: string
                  format: uuid
                  nullable: true
                channelId:
                  type: string
                  format: uuid
                organizationID:
                  type: string
                  format: uuid
                  nullable: true
                organizationName:
                  type: string
                  nullable: true
                accountId:
                  type: string
                  format: uuid
                  nullable: true
                accountName:
                  type: string
                  nullable: true
                content:
                  type: object
                  anyOf:
                    - title: Confirmar Passkey
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - PASSKEY_CONFIRM
                          type: string
                        abort:
                          type: boolean
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Importar Sessão
                      required:
                        - creds
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_IMPORT
                          type: string
                        creds: {}
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (QR Code)
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_QR_CODE
                          type: string
                        enableHistoryOnConnect:
                          type: boolean
                        historyMessageLimit:
                          type: integer
                          format: int32
                        historyDateLimit:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (Pareamento)
                      required:
                        - mobileNumber
                        - enableHistoryOnConnect
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_PAIR_CODE
                          type: string
                        mobileNumber:
                          type: string
                        enableHistoryOnConnect:
                          type: boolean
                        historyMessageLimit:
                          type: integer
                          format: int32
                        historyDateLimit:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (Link)
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_LINK
                          type: string
                        financialManagerId:
                          type: string
                          format: uuid
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Status do Dispositivo
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - STATUS
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Contatos
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - CONTACTS
                          type: string
                        query:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Informações do Grupo
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GROUP_INFO
                          type: string
                        groupJid:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Grupos
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GROUPS
                          type: string
                        query:
                          type: string
                          nullable: true
                        page:
                          type: integer
                          format: int32
                        pageSize:
                          type: integer
                          format: int32
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Digitação
                      required:
                        - to
                        - commandType
                      properties:
                        type:
                          enum:
                            - START_TYPING
                          type: string
                        to:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Parar Digitação
                      required:
                        - to
                        - commandType
                      properties:
                        type:
                          enum:
                            - STOP_TYPING
                          type: string
                        to:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Informações do Contato
                      required:
                        - phoneNumber
                        - commandType
                      properties:
                        type:
                          enum:
                            - CONTACT_INFO
                          type: string
                        phoneNumber:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Últimas Mensagens
                      required:
                        - chatJID
                        - commandType
                      properties:
                        type:
                          enum:
                            - GET_LAST_MESSAGES
                          type: string
                        chatJID:
                          type: string
                        messageId:
                          type: string
                          nullable: true
                        count:
                          type: integer
                          format: int32
                          nullable: true
                        fromMe:
                          type: boolean
                          nullable: true
                        messageTimestamp:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Inscrição de Presença
                      required:
                        - id
                        - commandType
                      properties:
                        type:
                          enum:
                            - PRESENCE_SUBSCRIPTION
                          type: string
                        id:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Conversas
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GET_CHATS
                          type: string
                        page:
                          type: integer
                          format: int32
                        pageSize:
                          type: integer
                          format: int32
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Desconectar Sessão
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - DISCONNECT
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Marcar como Lido
                      required:
                        - messageIds
                        - chatId
                        - commandType
                      properties:
                        type:
                          enum:
                            - MARK_READ
                          type: string
                        messageIds:
                          type: array
                          items:
                            type: string
                        chatId:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                timestamp:
                  type: string
                  format: date-time
                echoMessage:
                  type: boolean
                  nullable: true
                providerMetadata:
                  type: object
                  additionalProperties:
                    type: string
                  nullable: true
          text/json; v=1.0:
            schema:
              type: object
              properties:
                packageId:
                  type: string
                  format: uuid
                  nullable: true
                correlationId:
                  type: string
                  nullable: true
                originPackageId:
                  type: string
                  format: uuid
                  nullable: true
                channelId:
                  type: string
                  format: uuid
                organizationID:
                  type: string
                  format: uuid
                  nullable: true
                organizationName:
                  type: string
                  nullable: true
                accountId:
                  type: string
                  format: uuid
                  nullable: true
                accountName:
                  type: string
                  nullable: true
                content:
                  type: object
                  anyOf:
                    - title: Confirmar Passkey
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - PASSKEY_CONFIRM
                          type: string
                        abort:
                          type: boolean
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Importar Sessão
                      required:
                        - creds
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_IMPORT
                          type: string
                        creds: {}
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (QR Code)
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_QR_CODE
                          type: string
                        enableHistoryOnConnect:
                          type: boolean
                        historyMessageLimit:
                          type: integer
                          format: int32
                        historyDateLimit:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (Pareamento)
                      required:
                        - mobileNumber
                        - enableHistoryOnConnect
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_PAIR_CODE
                          type: string
                        mobileNumber:
                          type: string
                        enableHistoryOnConnect:
                          type: boolean
                        historyMessageLimit:
                          type: integer
                          format: int32
                        historyDateLimit:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (Link)
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_LINK
                          type: string
                        financialManagerId:
                          type: string
                          format: uuid
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Status do Dispositivo
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - STATUS
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Contatos
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - CONTACTS
                          type: string
                        query:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Informações do Grupo
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GROUP_INFO
                          type: string
                        groupJid:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Grupos
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GROUPS
                          type: string
                        query:
                          type: string
                          nullable: true
                        page:
                          type: integer
                          format: int32
                        pageSize:
                          type: integer
                          format: int32
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Digitação
                      required:
                        - to
                        - commandType
                      properties:
                        type:
                          enum:
                            - START_TYPING
                          type: string
                        to:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Parar Digitação
                      required:
                        - to
                        - commandType
                      properties:
                        type:
                          enum:
                            - STOP_TYPING
                          type: string
                        to:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Informações do Contato
                      required:
                        - phoneNumber
                        - commandType
                      properties:
                        type:
                          enum:
                            - CONTACT_INFO
                          type: string
                        phoneNumber:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Últimas Mensagens
                      required:
                        - chatJID
                        - commandType
                      properties:
                        type:
                          enum:
                            - GET_LAST_MESSAGES
                          type: string
                        chatJID:
                          type: string
                        messageId:
                          type: string
                          nullable: true
                        count:
                          type: integer
                          format: int32
                          nullable: true
                        fromMe:
                          type: boolean
                          nullable: true
                        messageTimestamp:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Inscrição de Presença
                      required:
                        - id
                        - commandType
                      properties:
                        type:
                          enum:
                            - PRESENCE_SUBSCRIPTION
                          type: string
                        id:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Conversas
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GET_CHATS
                          type: string
                        page:
                          type: integer
                          format: int32
                        pageSize:
                          type: integer
                          format: int32
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Desconectar Sessão
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - DISCONNECT
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Marcar como Lido
                      required:
                        - messageIds
                        - chatId
                        - commandType
                      properties:
                        type:
                          enum:
                            - MARK_READ
                          type: string
                        messageIds:
                          type: array
                          items:
                            type: string
                        chatId:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                timestamp:
                  type: string
                  format: date-time
                echoMessage:
                  type: boolean
                  nullable: true
                providerMetadata:
                  type: object
                  additionalProperties:
                    type: string
                  nullable: true
          application/*+json; v=1.0:
            schema:
              type: object
              properties:
                packageId:
                  type: string
                  format: uuid
                  nullable: true
                correlationId:
                  type: string
                  nullable: true
                originPackageId:
                  type: string
                  format: uuid
                  nullable: true
                channelId:
                  type: string
                  format: uuid
                organizationID:
                  type: string
                  format: uuid
                  nullable: true
                organizationName:
                  type: string
                  nullable: true
                accountId:
                  type: string
                  format: uuid
                  nullable: true
                accountName:
                  type: string
                  nullable: true
                content:
                  type: object
                  anyOf:
                    - title: Confirmar Passkey
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - PASSKEY_CONFIRM
                          type: string
                        abort:
                          type: boolean
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Importar Sessão
                      required:
                        - creds
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_IMPORT
                          type: string
                        creds: {}
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (QR Code)
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_QR_CODE
                          type: string
                        enableHistoryOnConnect:
                          type: boolean
                        historyMessageLimit:
                          type: integer
                          format: int32
                        historyDateLimit:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (Pareamento)
                      required:
                        - mobileNumber
                        - enableHistoryOnConnect
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_PAIR_CODE
                          type: string
                        mobileNumber:
                          type: string
                        enableHistoryOnConnect:
                          type: boolean
                        historyMessageLimit:
                          type: integer
                          format: int32
                        historyDateLimit:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Sessão (Link)
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - SESSION_START_LINK
                          type: string
                        financialManagerId:
                          type: string
                          format: uuid
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Status do Dispositivo
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - STATUS
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Contatos
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - CONTACTS
                          type: string
                        query:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Informações do Grupo
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GROUP_INFO
                          type: string
                        groupJid:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Grupos
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GROUPS
                          type: string
                        query:
                          type: string
                          nullable: true
                        page:
                          type: integer
                          format: int32
                        pageSize:
                          type: integer
                          format: int32
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Iniciar Digitação
                      required:
                        - to
                        - commandType
                      properties:
                        type:
                          enum:
                            - START_TYPING
                          type: string
                        to:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Parar Digitação
                      required:
                        - to
                        - commandType
                      properties:
                        type:
                          enum:
                            - STOP_TYPING
                          type: string
                        to:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Informações do Contato
                      required:
                        - phoneNumber
                        - commandType
                      properties:
                        type:
                          enum:
                            - CONTACT_INFO
                          type: string
                        phoneNumber:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Últimas Mensagens
                      required:
                        - chatJID
                        - commandType
                      properties:
                        type:
                          enum:
                            - GET_LAST_MESSAGES
                          type: string
                        chatJID:
                          type: string
                        messageId:
                          type: string
                          nullable: true
                        count:
                          type: integer
                          format: int32
                          nullable: true
                        fromMe:
                          type: boolean
                          nullable: true
                        messageTimestamp:
                          type: string
                          nullable: true
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Inscrição de Presença
                      required:
                        - id
                        - commandType
                      properties:
                        type:
                          enum:
                            - PRESENCE_SUBSCRIPTION
                          type: string
                        id:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Listar Conversas
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - GET_CHATS
                          type: string
                        page:
                          type: integer
                          format: int32
                        pageSize:
                          type: integer
                          format: int32
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Desconectar Sessão
                      required:
                        - commandType
                      properties:
                        type:
                          enum:
                            - DISCONNECT
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                    - title: Marcar como Lido
                      required:
                        - messageIds
                        - chatId
                        - commandType
                      properties:
                        type:
                          enum:
                            - MARK_READ
                          type: string
                        messageIds:
                          type: array
                          items:
                            type: string
                        chatId:
                          type: string
                        commandType:
                          type: string
                        timestamp:
                          type: string
                          format: date-time
                timestamp:
                  type: string
                  format: date-time
                echoMessage:
                  type: boolean
                  nullable: true
                providerMetadata:
                  type: object
                  additionalProperties:
                    type: string
                  nullable: true
        required: true
      responses:
        '200':
          description: OK
        '400':
          description: Bad Request
          content:
            text/plain; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            application/json; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/json; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '401':
          description: Unauthorized
          content:
            text/plain; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            application/json; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/json; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
        '404':
          description: Not Found
          content:
            text/plain; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            application/json; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
            text/json; v=1.0:
              schema:
                $ref: '#/components/schemas/ProblemDetails'
components:
  schemas:
    ProblemDetails:
      type: object
      properties:
        type:
          type: string
          nullable: true
        title:
          type: string
          nullable: true
        status:
          type: integer
          format: int32
          nullable: true
        detail:
          type: string
          nullable: true
        instance:
          type: string
          nullable: true
  securitySchemes:
    apiKey:
      type: apiKey
      description: >-
        Chave de API fornecida pelo painel administrativo do MessageFy. Enviada
        no header de cada requisição. O gateway APISIX valida a chave e injeta
        os headers X-Consumer-* automaticamente.
      name: X-API-KEY
      in: header

````