WhatsApp · WhatsApp

Send WhatsApp conversion event

Sends a WhatsApp conversion event.

POSThttps://api.pozy.ai/v1/whatsapp/conversions
sendWhatsAppConversion

Guide: Connect WhatsApp

Request

Send your API key as Authorization: Bearer pz_live_.... Read-only keys cannot call it. Keys with the ads resource group disabled get 403 resource_group_disabled. Authentication

Request body

application/json, required

  • accountIdstringrequired
  • eventNamestringrequired

    One of LeadSubmitted, QualifiedLead, Purchase, AddToCart, InitiateCheckout, ViewContent, OrderCreated, OrderCanceled, OrderReturned.

  • eventTimenumber
  • eventIdstringrequired
  • conversationIdstring
  • phoneE164string
  • valuenumber
  • currencystring

    3 to 3 characters.

  • contentIdsarray of string
  • emailstring (email)
  • externalIdstring
  • testCodestring

Example

curl -X POST "https://api.pozy.ai/v1/whatsapp/conversions" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "accountId": "696e0b682d0a31188e7a2ba9",
  "eventName": "LeadSubmitted",
  "eventId": "60c89d0a2e8d4a8ebed77064"
}'

Response

200 on success

  • platformstring

    One of metaads.

  • eventsReceivedinteger
  • eventsFailedinteger
  • failuresarray of object
    • eventIndexinteger
    • eventIdstring
    • messagestring
    • codestring or integer
    • platformErrorobject
  • traceIdstring
  • testCodestring

    Can be null.

200 response
{
  "platform": "metaads",
  "eventsReceived": 1,
  "eventsFailed": 1,
  "failures": [
    {
      "eventIndex": 1,
      "eventId": "60c89d0a2e8d4a8ebed77064",
      "message": "Hello from Pozy",
      "code": "string",
      "platformError": {}
    }
  ],
  "traceId": "6aa41aeffa864e6ffa88403d",
  "testCode": "string"
}

Errors

Errors use one shape: { error, type, code, param?, details? }. The ones you are most likely to see here:

400invalid_request_errorA parameter or body field is missing or invalid. param names it.
401authentication_errorThe API key is missing, revoked or expired.
403permission_errorThe key is read-only, scoped to other profiles, or has this resource group disabled.
429rate_limit_errorToo many requests this minute. Wait for Retry-After seconds.

Every code is listed in Errors.

More in WhatsApp