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."
  }
}
HTTPcodeMeaning
400invalid_payloadBody validation failed.
401missing_api_keyNo Authorization header.
401invalid_api_keyKey unknown or revoked.
403addon_requiredAPI Access add-on not active.
404template_not_foundTemplate name/language does not exist in this business.
400invalid_name / invalid_body / missing_examples / invalid_buttonTemplate validation failed before submission.
400meta_rejectedMeta rejected the submission; read the returned message.
409not_connectedConnect this business to WhatsApp first.
409name_takenA template with this name and language already exists in this business.
409language_requiredMultiple translations match; specify language.
409language_deleting / template_deletedMeta is still deleting the previous version, or the local template is deleted.
422Validation error listMissing, unsupported or malformed fields. The detail field is an array of field errors.
502network_errorMeta 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

FieldTypeRequiredNotes
tostringyesE.164 phone, e.g. +919812345678
textstringeitherFree-form text, max 4096 chars.
templatestringeitherApproved template name.
languagestringnoTemplate language code (default en).
variablesstring[]noOrdered substitutions for {{1}}..{{n}}.
button_variablesobjectfor dynamic URL buttonsDynamic 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

ParamTypeDefaultNotes
limitinteger501–200.
beforeISO-8601 UTC—Return messages older than this timestamp.
afterISO-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.

  1. Call GET /v1/messages and find the received media message.
  2. Use its top-level data[].id (the PingDaily message UUID) in this URL. Do not use media.id or provider_message_id.
  3. 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.

StatusMeaning
401Missing, invalid or revoked key, or inactive business.
403API Access add-on is not active for the key's business.
404Unknown message, another business's message, an outbound message, or no downloadable media.
410Provider media has expired and no archived copy is available.
422The message ID is not a valid UUID.
502 / 503Provider 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

ParamTypeDefaultNotes
limitinteger501–200.
beforeISO-8601 UTC—Return contacts updated before this timestamp.
updated_afterISO-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.

FieldRequiredDescription
nameyes1–120 characters; normalized to lowercase. Letters, numbers and underscores only. Unique per business and language.
languagenoLanguage code, default en_US. Use the same code for status checks and sends.
categoryyesUTILITY, MARKETING or AUTHENTICATION. Meta may change the category.
body_textyes1–1024 characters. Variables must run from {{1}} through {{N}} with text before the first and after the last variable.
examplesfor variablesExample values for review: {"body": ["Anita", "INV-1001"], "header": ["October"]}. Include one body example per variable.
display_namenoFriendly dashboard label, up to 200 characters.
header_typenoTEXT (default), IMAGE, VIDEO or DOCUMENT.
header_textnoText header, up to 60 characters. Do not combine with a media header.
header_media_handlefor media headersA 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_textnoUp to 60 characters, without variables.
buttonsnoUp 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 variables array 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.