Skip to main content
POST
/
integrations
/
external
/
chats
/
{id}
/
messages
Envio de mensagem para chat
curl --request POST \
  --url https://api.wegly.com.br/integrations/external/chats/{id}/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "type": "text",
  "body": "Olá, tudo bem?"
}
'
{
  "total": 123,
  "records": [
    {
      "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "from_me": true,
      "body_text": "<string>",
      "content_payload": {},
      "reactions": [
        {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "emoji": "<string>",
          "reactor_wa_id": "<string>",
          "reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "created_at": "2023-11-07T05:31:56Z"
        }
      ],
      "meta_timestamp": "<string>",
      "is_history": true,
      "history_phase": 123,
      "history_chunk_order": 123,
      "history_progress": 123,
      "is_media_placeholder": true,
      "agent": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "user": {
          "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
          "name": "<string>",
          "avatar": "<string>"
        }
      },
      "user": {
        "id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
        "name": "<string>",
        "avatar": "<string>"
      },
      "crm_marketing_lead_source": [
        {}
      ]
    }
  ]
}

Authorizations

Authorization
string
header
required

Utilize o token de integração no header Authorization: Bearer {token}. O domínio de origem (Origin/Referer) deve respeitar allowed_domain, quando configurado na chave.

Path Parameters

id
string<uuid>
required

UUID do chat que receberá a mensagem.

Body

Payload para envio de mensagem textual, template ou mídia em um chat existente.

type
enum<string>

Tipo de mensagem aceito no endpoint principal. Mensagens interativas e de localização possuem endpoints próprios.

Available options:
text,
reaction,
image,
video,
audio,
document,
template,
call
body
string

Texto da mensagem ou legenda de mídia, conforme o tipo enviado.

reference_wamid
string

Identificador da mensagem do WhatsApp que será respondida, quando houver.

Maximum string length: 200
template
object
template_fields
object[]

Response

Mensagem enviada e registrada no chat.

total
integer

Quantidade de mensagens retornadas pela operação.

records
object[]