Overview v1
The PingDaily REST API lets you send and receive WhatsApp messages and submit templates for approval from your own applications using the WhatsApp Business account you have already connected inside PingDaily.
For read-only lead-system integrations, use GET /v1/messages,
GET /v1/contacts and GET /v1/whatsapp/account.
Sending messages is optional and is not required for inbound sync.
Base URL: https://api.pingdaily.app
Request bodies use JSON. Responses are JSON except media downloads, which return file bytes. All timestamps are ISO 8601 UTC.
Authentication
Every request must include an API key in the
Authorization header:
Authorization: Bearer pd_live_XXXXXXXXXXXXXXXXXXXXXXXX
Generate keys under Sidebar → API Access → API Keys after installing the API Access add-on. The plaintext key is shown once at creation time — copy it into your secret manager immediately.
Errors
Business and provider errors return JSON in the shape:
{
"detail": {
"code": "invalid_api_key",
"message": "API key is invalid or has been revoked."
}
}
| HTTP | code | Meaning |
|---|---|---|
| 400 | invalid_payload | Body validation failed. |
| 401 | missing_api_key | No Authorization header. |
| 401 | invalid_api_key | Key unknown or revoked. |
| 403 | addon_required | API Access add-on not active. |
| 404 | template_not_found | Template name/language does not exist in this business. |
| 400 | invalid_name / invalid_body / missing_examples / invalid_button | Template validation failed before submission. |
| 400 | meta_rejected | Meta rejected the submission; read the returned message. |
| 409 | not_connected | Connect this business to WhatsApp first. |
| 409 | name_taken | A template with this name and language already exists in this business. |
| 409 | language_required | Multiple translations match; specify language. |
| 409 | language_deleting / template_deleted | Meta is still deleting the previous version, or the local template is deleted. |
| 422 | Validation error list | Missing, unsupported or malformed fields. The detail field is an array of field errors. |
| 502 | network_error | Meta could not be reached; inspect the saved template before retrying. |
Send a message
POST /v1/messages
Provide exactly one of text (only inside the 24-hour customer-care window) or an approved template.
Request body
| Field | Type | Required | Notes |
|---|---|---|---|
| to | string | yes | E.164 phone, e.g. +919812345678 |
| text | string | either | Free-form text, max 4096 chars. |
| template | string | either | Approved template name. |
| language | string | no | Template language code (default en). |
| variables | string[] | no | Ordered substitutions for {{1}}..{{n}}. |
| button_variables | object | for dynamic URL buttons | Dynamic URL values keyed by zero-based button index, e.g. {"0": "login-token"}. Send the variable suffix/value, not the complete template URL. |
Example — free text
curl https://api.pingdaily.app/v1/messages \
-H "Authorization: Bearer $PINGDAILY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919812345678",
"text": "Hi Rahul, your invoice is ready."
}'
Example — template
curl https://api.pingdaily.app/v1/messages \
-H "Authorization: Bearer $PINGDAILY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919812345678",
"template": "invoice_due_reminder",
"language": "en",
"variables": ["Rahul", "INV-2091", "20 Aug 2026"]
}'
Example — Chopda login OTP with dynamic URL button
curl https://api.pingdaily.app/v1/messages \
-H "Authorization: Bearer $PINGDAILY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919812345678",
"template": "chopda_login_otp_v1",
"language": "en_US",
"variables": ["654321"],
"button_variables": {"0": "dynamic-url-value"}
}'
For button index 0, PingDaily generates a Meta
button component with sub_type: "url" and
passes dynamic-url-value as its text parameter.
Response
{
"ok": true,
"provider": "meta-user",
"provider_message_id": "wamid.HBg...",
"status": "sent",
"error": null
}
List messages
GET /v1/messages
Returns inbound messages received on your connected WhatsApp number. This endpoint is read-only and is the recommended historical sync source for lead systems.
Query parameters
| Param | Type | Default | Notes |
|---|---|---|---|
| limit | integer | 50 | 1–200. |
| before | ISO-8601 UTC | — | Return messages older than this timestamp. |
| after | ISO-8601 UTC | — | Return messages received after this timestamp for incremental sync. |
Example
curl "https://api.pingdaily.app/v1/messages?limit=20" \ -H "Authorization: Bearer $PINGDAILY_API_KEY"
Response
{
"data": [
{
"id": "0b9c...",
"direction": "inbound",
"contact_id": "7f2a...",
"from_phone": "+919812345678",
"message_type": "text",
"text": "Sure, sending it now.",
"provider_message_id": "wamid.HBg...",
"media": null,
"referral": {
"source_type": "ad",
"source_id": "2385...",
"headline": "August consultation offer"
},
"raw": {
"id": "wamid.HBg...",
"type": "text",
"referral": { "source_type": "ad" }
},
"received_at": "2026-08-20T09:31:20.512Z",
"created_at": "2026-08-20T09:31:20.512Z"
}
],
"next_cursor": "2026-08-20T09:31:20.512Z"
}
Click-to-WhatsApp referral data
When Meta includes Click-to-WhatsApp ad attribution on the inbound
webhook, PingDaily returns it as referral and also keeps
the original provider payload in raw. Meta only sends
referral/campaign fields when the user enters via a CTWA ad; normal
organic messages have referral: null.
Download message media
GET /v1/messages/{message_id}/media
Download an image, document, audio, video or sticker received by the business that owns your API key. Requires an active API Access add-on.
- Call
GET /v1/messagesand find the received media message. - Use its top-level
data[].id(the PingDaily message UUID) in this URL. Do not usemedia.idorprovider_message_id. - Send the same API key and save the binary response to a file.
curl --fail --show-error \ "https://api.pingdaily.app/v1/messages/$MESSAGE_ID/media" \ -H "Authorization: Bearer $PINGDAILY_API_KEY" \ --output received-image.jpg
The filename above is an example; choose an extension appropriate to the
received file. Success returns 200 with file bytes,
Content-Type, an attachment Content-Disposition,
and Cache-Control: private, no-store. This is not a JSON or
base64 response. It does not redirect or require a Meta access token.
The archived copy is preferred, with a provider download fallback.
A message's media.url may be missing or expired; this endpoint
does not depend on your integration handling that URL. Downloaded files
should be treated as untrusted customer attachments.
| Status | Meaning |
|---|---|
| 401 | Missing, invalid or revoked key, or inactive business. |
| 403 | API Access add-on is not active for the key's business. |
| 404 | Unknown message, another business's message, an outbound message, or no downloadable media. |
| 410 | Provider media has expired and no archived copy is available. |
| 422 | The message ID is not a valid UUID. |
| 502 / 503 | Provider or storage temporarily unavailable. Retry later with backoff. |
Errors use the usual JSON detail format. This endpoint
cannot download another business's files, even when both businesses share
a login number. Outbound media and arbitrary URL downloads are not supported.
List contacts
GET /v1/contacts
Returns contacts for the API key owner. Use this with
GET /v1/messages to hydrate a lead system before
processing new inbound replies.
Query parameters
| Param | Type | Default | Notes |
|---|---|---|---|
| limit | integer | 50 | 1–200. |
| before | ISO-8601 UTC | — | Return contacts updated before this timestamp. |
| updated_after | ISO-8601 UTC | — | Return contacts updated after this timestamp for incremental sync. |
Example
curl "https://api.pingdaily.app/v1/contacts?limit=100" \ -H "Authorization: Bearer $PINGDAILY_API_KEY"
Response
{
"data": [
{
"id": "7f2a...",
"name": "Rahul Sharma",
"phone": "+919812345678",
"email": "rahul@example.com",
"company_name": "Sharma Textiles",
"tags": ["lead"],
"metadata": {"auto_created_from_inbound": true},
"opted_out_at": null,
"last_inbound_at": "2026-08-20T09:31:20.512Z",
"created_at": "2026-08-20T09:31:20.512Z",
"updated_at": "2026-08-20T09:31:20.512Z"
}
],
"next_cursor": null
}
Connected WhatsApp account
GET /v1/whatsapp/account
Returns the WhatsApp Business Account and phone-number metadata PingDaily has cached from Meta for this account.
Example
curl https://api.pingdaily.app/v1/whatsapp/account \ -H "Authorization: Bearer $PINGDAILY_API_KEY"
Response
{
"connected": true,
"phone_number_id": "1216484484884364",
"waba_id": "919738311179258",
"display_phone_number": "+91 97262 98740",
"verified_name": "PingDaily",
"business_name": "EPAGESTORE",
"quality_rating": "HIGH",
"messaging_limit": "TIER_1K",
"phone_status": "CONNECTED",
"account_review_status": "APPROVED",
"name_status": "APPROVED",
"platform_type": "WHATSAPP_BUSINESS_APP",
"code_verification_status": "VERIFIED",
"connected_at": "2026-08-25T08:52:21.000Z",
"metadata_refreshed_at": "2026-08-25T08:52:21.000Z"
}
Webhook signature verification
PingDaily receives WhatsApp webhooks directly from Meta and verifies
X-Hub-Signature-256 using the configured Meta App Secret.
API Access integrations do not need to expose their own webhook endpoint
for phase-one read-only sync; poll /v1/messages and
/v1/contacts using timestamp cursors.
If PingDaily later adds partner outbound webhooks, they will be signed
with an HMAC header and documented separately. Today, the public API is
authenticated with Authorization: Bearer API keys.
Create a template
POST /v1/templates
Validate and submit a WhatsApp template to Meta. Requires an active API Access subscription and a connected WhatsApp Business Account. The API key determines the business and its WABA. A workspace header, login phone or another business ID cannot redirect the submission.
A 201 Created response means Meta accepted the
submission, not that it approved the template. The returned status is
normally PENDING. Use the name and language to check its
status, and send messages only when it is APPROVED.
| Field | Required | Description |
|---|---|---|
| name | yes | 1–120 characters; normalized to lowercase. Letters, numbers and underscores only. Unique per business and language. |
| language | no | Language code, default en_US. Use the same code for status checks and sends. |
| category | yes | UTILITY, MARKETING or AUTHENTICATION. Meta may change the category. |
| body_text | yes | 1–1024 characters. Variables must run from {{1}} through {{N}} with text before the first and after the last variable. |
| examples | for variables | Example values for review: {"body": ["Anita", "INV-1001"], "header": ["October"]}. Include one body example per variable. |
| display_name | no | Friendly dashboard label, up to 200 characters. |
| header_type | no | TEXT (default), IMAGE, VIDEO or DOCUMENT. |
| header_text | no | Text header, up to 60 characters. Do not combine with a media header. |
| header_media_handle | for media headers | A valid Meta upload handle for the sample file, not a URL or storage key. Public API file upload is not included; use the dashboard for its media-upload workflow. |
| footer_text | no | Up to 60 characters, without variables. |
| buttons | no | Up to 3 buttons: URL (text, url), PHONE_NUMBER (text, phone_number), or QUICK_REPLY (text). Button text is at most 25 characters. |
Unknown fields are rejected, including user_id,
waba_id and internal media-storage keys.
AUTHENTICATION uses the same preset as the dashboard: a copy-code button,
security recommendation and 10-minute expiry. Meta generates its standard
authentication wording; custom components do not override that preset.
Example
curl https://api.pingdaily.app/v1/templates \
-H "Authorization: Bearer $PINGDAILY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "invoice_payment_update",
"language": "en_US",
"category": "UTILITY",
"display_name": "Invoice payment update",
"body_text": "Hi {{1}}, payment for invoice {{2}} has been received. Thank you.",
"examples": {"body": ["Anita", "INV-1001"]},
"footer_text": "Your billing team",
"buttons": [{"type": "URL", "text": "View account", "url": "https://example.com/account"}]
}'
Response (201)
{
"name": "invoice_payment_update",
"language": "en_US",
"category": "UTILITY",
"status": "PENDING",
"source": "user",
"display_name": "Invoice payment update",
"meta_template_id": "123456789012345",
"rejection_reason": null,
"last_synced_at": "2026-10-30T08:00:00Z",
"header_type": "TEXT",
"header_text": null,
"body_text": "Hi {{1}}, payment for invoice {{2}} has been received. Thank you.",
"footer_text": "Your billing team",
"variables": [
{"key": "1", "label": "Body · Variable 1", "location": "body", "placeholder": "1", "example": "Anita", "required": true},
{"key": "2", "label": "Body · Variable 2", "location": "body", "placeholder": "2", "example": "INV-1001", "required": true}
],
"buttons": [{"type": "URL", "text": "View account", "url": "https://example.com/account", "phone_number": null}]
}
The template appears in the same business's dashboard under WhatsApp
→ Templates. It enters GET /v1/templates only after approval.
Repeating a successful creation returns 409 name_taken;
use the status endpoints instead of repeatedly submitting it.
List templates
GET /v1/templates
Returns every APPROVED template that lives on your own WhatsApp Business Account (BYO). Shared PingDaily catalog templates are intentionally not exposed here.
Example
curl https://api.pingdaily.app/v1/templates \ -H "Authorization: Bearer $PINGDAILY_API_KEY"
Response
{
"data": [
{
"name": "invoice_due_reminder",
"language": "en_US",
"category": "UTILITY",
"status": "APPROVED",
"source": "user"
}
]
}
Get a template
GET /v1/templates/{name}
Fetch a single template plus its variables. Use this to know
exactly how many values to pass in variables when
calling Send a message, and in what order. Only BYO
templates on your own WABA are returned.
Add ?language=en_US to select a translation. Without it,
a unique name still works; multiple matching translations return
409 language_required. This endpoint returns locally recorded
statuses including PENDING and REJECTED, with rejection_reason,
meta_template_id and last_synced_at. It does not
contact Meta; use the refresh endpoint below for a fresh check.
Variable keys
- Body placeholders
{{1}}, {{2}}, ...get keys"1","2", ... - Header placeholders are prefixed
h("h1"). Headers are optional and only present on BYO templates. - The
variablesarray in the response is already in the correct order — pass values in that order to/v1/messages.
Example
curl https://api.pingdaily.app/v1/templates/invoice_due_reminder \ -H "Authorization: Bearer $PINGDAILY_API_KEY"
Response
{
"name": "invoice_due_reminder",
"language": "en_US",
"category": "UTILITY",
"status": "APPROVED",
"source": "user",
"display_name": "Invoice due reminder",
"header_type": "TEXT",
"header_text": "Hi {{1}}",
"body_text": "Your invoice {{1}} is due on {{2}}.",
"footer_text": "PingDaily",
"variables": [
{"key": "h1", "label": "Header \u00b7 Variable 1", "location": "header",
"placeholder": "1", "example": "Rahul", "required": true},
{"key": "1", "label": "Body \u00b7 Variable 1", "location": "body",
"placeholder": "1", "example": "INV-2091", "required": true},
{"key": "2", "label": "Body \u00b7 Variable 2", "location": "body",
"placeholder": "2", "example": "20 Aug 2026", "required": true}
],
"buttons": null
}
Then send it:
curl https://api.pingdaily.app/v1/messages \
-H "Authorization: Bearer $PINGDAILY_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"to": "+919812345678",
"template": "invoice_due_reminder",
"language": "en_US",
"variables": ["Rahul", "INV-2091", "20 Aug 2026"]
}'
Refresh template status
POST /v1/templates/{name}/sync?language=en_US
Fetch the selected business template's latest status and category from Meta and save the result. Returns the same template detail shape as GET. Supply language when multiple translations exist. No request body is needed.
curl -X POST 'https://api.pingdaily.app/v1/templates/invoice_payment_update/sync?language=en_US' \ -H "Authorization: Bearer $PINGDAILY_API_KEY"
Check periodically while review is pending; avoid tight polling loops.
A successful refresh is not an approval guarantee. Wait for
APPROVED before sending. For REJECTED, inspect
rejection_reason and revise through the dashboard or submit
a corrected template with a different name. Edit and delete endpoints
are not part of this public API.
Roadmap
- Delivery status webhooks.
- Media send helpers.
Missing something? Email support@pingdaily.app.