Ads · Conversions

Send events to every destination

Sends events to every destination.

POSThttps://api.pozy.ai/v1/events
Facebook and Instagram, Google Workspace, TikTok, LinkedIn, Pinterest and RedditsendEvents

Guide: Conversions API

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

  • profileIdstringrequired
  • eventsarray of objectrequired

    At least 1 item. Up to 1000 items.

    11 child fields
    • eventNamestringrequired
    • eventTimeintegerrequired
    • eventIdstringrequired
    • valuenumber
    • currencystring
    • userobjectrequired
      15 child fields
      • emailstring
      • phonestring
      • firstNamestring
      • lastNamestring
      • externalIdstring
      • ipAddressstring
      • userAgentstring
      • countrystring
      • citystring
      • statestring
      • zipstring
      • dobstring
      • genderstring
      • leadIdstring
      • clickIdsobject
        9 child fields
        • fbcstring
        • fbpstring
        • gclidstring
        • gbraidstring
        • wbraidstring
        • li_fat_idstring
        • epikstring
        • rdt_cidstring
        • rdt_uuidstring
    • itemsarray of object
      5 child fields
      • idstring
      • namestring
      • pricenumber
      • quantityinteger
      • categorystring
    • sourceUrlstring (URL)
    • actionSourcestring

      One of web, app, offline, crm, phone_call, system_generated, business_messaging.

    • messagingobject
      7 child fields
      • channelstringrequired

        One of whatsapp, messenger, instagram_direct.

      • wabaIdstring
      • ctwaClidstring
      • pageIdstring
      • instagramBusinessAccountIdstring
      • pageScopedUserIdstring
      • instagramScopedUserIdstring
    • platformDataobject
  • destinationsarray of object

    At least 1 item. Up to 20 items.

    • accountIdstringrequired
    • destinationIdstringrequired
  • consentobject
    • adUserDatastring

      One of GRANTED, DENIED.

    • adPersonalizationstring

      One of GRANTED, DENIED.

  • testCodestring

Example

curl -X POST "https://api.pozy.ai/v1/events" \
  -H "Authorization: Bearer $POZY_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
  "profileId": "6a0b6573846efc28aaa9a3ff",
  "events": [
    {
      "eventName": "Acme",
      "eventTime": 1,
      "eventId": "60c89d0a2e8d4a8ebed77064",
      "user": {
        "email": "alex@example.com",
        "phone": "+14155550123",
        "firstName": "Acme"
      }
    }
  ]
}'

Response

200 on success

  • eventsReceivedinteger
  • storedboolean
  • testCodestring

    Can be null.

  • destinationsarray of object
    7 child fields
    • accountIdstring
    • destinationIdstring
    • platformstring

      One of metaads, googleads, linkedinads, tiktokads, openaiads, pinterestads, redditads.

    • eventsSentinteger
    • eventsFailedinteger
    • failuresarray of object
      4 child fields
      • eventIndexinteger
      • eventIdstring
      • messagestring
      • codestring or integer
    • errorstring
200 response
{
  "eventsReceived": 1,
  "stored": true,
  "testCode": "string",
  "destinations": [
    {
      "accountId": "696e0b682d0a31188e7a2ba9",
      "destinationId": "68320031250f5d01a73ce89b",
      "platform": "metaads",
      "eventsSent": 1,
      "eventsFailed": 1,
      "failures": [
        {
          "eventIndex": 1,
          "eventId": "60c89d0a2e8d4a8ebed77064",
          "message": "Hello from Pozy",
          "code": "string"
        }
      ],
      "error": "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 Conversions