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": "<string>",
"reference_wamid": "<string>",
"template": {
"name": "<string>",
"language": "<string>"
},
"template_fields": [
{
"component": "HEADER",
"type": "TEXT",
"index": 123,
"button_index": 123,
"card_index": 123,
"value": "<string>"
}
]
}
'{
"total": 123,
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "sent",
"body_text": "<string>",
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"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>"
},
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mime_type": "<string>",
"file_name": "<string>",
"is_downloaded": true,
"url": "<string>"
},
"call": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "COMPLETED",
"direction": "INBOUND",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"recording_processed": true,
"recording_available": true,
"has_recording": true
},
"quoted_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "sent",
"body_text": "<string>",
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"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>"
},
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mime_type": "<string>",
"file_name": "<string>",
"is_downloaded": true,
"url": "<string>"
},
"page": 2
},
"crm_marketing_lead_source": [
{}
]
}
]
}Envia mensagem de texto, template ou mídia para o chat informado. Aceita multipart/form-data para anexos. Não aceita interactive/location nesta rota dedicada.
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": "<string>",
"reference_wamid": "<string>",
"template": {
"name": "<string>",
"language": "<string>"
},
"template_fields": [
{
"component": "HEADER",
"type": "TEXT",
"index": 123,
"button_index": 123,
"card_index": 123,
"value": "<string>"
}
]
}
'{
"total": 123,
"records": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "sent",
"body_text": "<string>",
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"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>"
},
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mime_type": "<string>",
"file_name": "<string>",
"is_downloaded": true,
"url": "<string>"
},
"call": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "COMPLETED",
"direction": "INBOUND",
"started_at": "2023-11-07T05:31:56Z",
"ended_at": "2023-11-07T05:31:56Z",
"duration_ms": 123,
"recording_processed": true,
"recording_available": true,
"has_recording": true
},
"quoted_message": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"type": "text",
"origin": "INBOUND",
"from_me": true,
"sent_via": "CONTACT",
"status": "sent",
"body_text": "<string>",
"reactions": [
{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"emoji": "<string>",
"actor": "CONTACT",
"reactor_wa_id": "<string>",
"reactor_user_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_at": "2023-11-07T05:31:56Z"
}
],
"meta_timestamp": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"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>"
},
"media": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"mime_type": "<string>",
"file_name": "<string>",
"is_downloaded": true,
"url": "<string>"
},
"page": 2
},
"crm_marketing_lead_source": [
{}
]
}
]
}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.
UUID do chat.
text, reaction, image, video, audio, document, template Texto da mensagem. Obrigatório para type=text e type=reaction.
WAMID da mensagem alvo para reações ou respostas.
Show child attributes
Show child attributes