Skip to main content

Endpoint

POST https://api.bunny.build/api/v1/wpp-url/generate

Authentication

HeaderRequiredValue
X-API-KeyYesYour API key (bun_...)
Content-TypeYesapplication/json

Overview

Generate WhatsApp click-to-chat links for any phone number. Bunny normalises the number to international E.164 format and returns a direct wa.me link. If a message is provided, it also returns a pre-filled version with the message URL-encoded.

Use cases

  • Add “Chat on WhatsApp” buttons to landing pages and product pages
  • Generate WhatsApp support links from your CRM
  • Build WhatsApp marketing campaign links with pre-filled messages
  • Automate onboarding flows that open WhatsApp conversations

Details

Phone numbers can be passed with or without country code, spaces, dashes, or parentheses. All formats are normalised automatically. Brazilian numbers (10 or 11 digits without country code) get the +55 prefix added automatically.

Request body

FieldTypeRequiredDescription
phonestringYesPhone number in E.164 format (e.g. +5511999999999)
messagestringNoPre-filled message text (URL-encoded automatically)

Example

{
  "phone": "+5511999999999",
  "message": "Hello, I have a question!"
}

Response

200 OK

FieldTypeDescription
phone_normalizedstringPhone number normalized to digits only (E.164 without the +)
linkstringWhatsApp click-to-chat URL (https://wa.me/{phone_normalized})
link_with_messagestringPre-filled link with the message URL-encoded. Only present when message was provided
Example (without message)
{
  "phone_normalized": "5511999999999",
  "link": "https://wa.me/5511999999999"
}
Example (with message)
{
  "phone_normalized": "5511999999999",
  "link": "https://wa.me/5511999999999",
  "link_with_message": "https://wa.me/5511999999999?text=Hello%2C%20I%20have%20a%20question%21"
}

401 Unauthorized

{
  "detail": "Missing API key. Include X-API-Key header."
}

402 Payment Required

{
  "detail": "Monthly quota exceeded. Upgrade your plan."
}

422 Unprocessable Entity

Invalid phone number.
{
  "detail": "Invalid phone number format"
}

429 Too Many Requests

{
  "detail": "Rate limit exceeded. Try again in 60 seconds."
}

cURL example

curl -X POST https://api.bunny.build/api/v1/wpp-url/generate \
  -H "X-API-Key: bun_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{"phone": "+5511999999999", "message": "Hello, I have a question!"}'