Skip to content

Send messages

Send a contact

Send 1 to 10 contact cards over WhatsApp with POST /v1/messages and type contacts, with name, phone numbers and emails.

type: "contacts" sends contact cards that the recipient can save with one tap. WhatsApp only. The fields shared by every type (to, reply_to, typing, delay_ms, the 24 h window) are in Common fields.

contacts is a list of 1 to 10 cards.

Field Rule
contacts[].name.formatted_name Required, 1 to 256 characters
contacts[].name.first_name Optional, up to 128 characters
contacts[].name.last_name Optional, up to 128 characters
contacts[].phones Optional, up to 10 items
contacts[].phones[].phone 1 to 64 characters
contacts[].phones[].type Optional, up to 32 characters (e.g. CELL, WORK)
contacts[].phones[].wa_id Optional, up to 64 characters: the number on WhatsApp, for the chat button
contacts[].emails Optional, up to 10 items
contacts[].emails[].email 1 to 128 characters
contacts[].emails[].type Optional, up to 32 characters
Janela do terminal
curl https://api.messajo.com/v1/messages \
-H "Authorization: Bearer $MESSAJO_API_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d '{
"connection_id": "conn_...",
"to": "5511999999999",
"type": "contacts",
"contacts": [
{
"name": { "formatted_name": "Ana Souza", "first_name": "Ana", "last_name": "Souza" },
"phones": [{ "phone": "+55 11 98888-7777", "type": "CELL", "wa_id": "5511988887777" }],
"emails": [{ "email": "[email protected]", "type": "WORK" }]
}
]
}'

The response is the same as for a text message (201, status: "queued"); see Response.

  • 422 outside_service_window: a contact is a free-form message, so it only goes out within 24 hours of the recipient’s last message. Outside the window, use a template.
  • 422 type_not_supported_by_channel: Instagram or Messenger connection. Contacts are WhatsApp only.
  • 400 validation_failed: empty list or more than 10 cards, missing formatted_name, a size limit exceeded, or an unknown field.