Skip to main content
Text messages are the simplest way to communicate with WhatsApp users.

Basic Example

Send Text Message
curl -X POST https://api.buildwithchirp.com/v1/whatsapp/messages \
  -H "Authorization: Bearer YOUR_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "+15551234567",
    "to": "+15559876543",
    "type": "text",
    "text": {
      "body": "Hello from Chirp!"
    }
  }'

Request Parameters

ParameterTypeRequiredDescription
fromstringYesYour WhatsApp phone number (E.164 format)
tostringYesRecipient’s WhatsApp number (E.164 format)
typestringYesMust be "text"
text.bodystringYesThe message text content
replyTostringNoMessage ID to reply to

Response

Response
{
  "id": "msg_wa_2DbBs7GWhGvVNJGrDXr5RG0mBWI",
  "from": "+15551234567",
  "to": "+15559876543",
  "type": "text",
  "status": "queued",
  "timestamp": "2024-01-15T12:00:00.000Z"
}

Replying to Messages

You can reply to a specific message by including the replyTo parameter:
Reply to Message
curl -X POST https://api.buildwithchirp.com/v1/whatsapp/messages \
  -H "Authorization: Bearer YOUR_APP_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "from": "+15551234567",
    "to": "+15559876543",
    "type": "text",
    "text": {
      "body": "Thanks for your message!"
    },
    "replyTo": "msg_wa_2DbBs7GWhGvVNJGrDXr5RG0mBWI"
  }'
The recipient will see your message as a direct reply to their original message.

Text Formatting

WhatsApp supports basic text formatting:
FormatSyntaxExample
Bold*text*text
Italic_text_text
Strikethrough~text~text
Monospace`text`text
Example with formatting:
Formatted Text
{
  "text": {
    "body": "Hello! Here's your order summary:\n\n*Order #12345*\n_Status:_ Shipped\n~Old price: $50~ *New price: $40*"
  }
}
Text messages are best for ongoing conversations where users have already messaged you first. For initiating contact with users, use Template Messages.