DOCS

Offline conversions API

Send leads, sign-ups and sales from your own servers to Tapper Relay with one POST, matched to the ad click or person and sent to your ad platforms.


Your servers send each lead, sign-up or sale to one address for a protected entity, which holds a website, mobile apps or both. Relay matches it to the ad click or the person behind it and sends it to your ad platforms once your server's events are switched on for your ad account, so they bid on what really happens after the click. The address and your event names are on the Your server (API) source, under Setup > Data sources in the Tapper app.

Authenticate

Send your workspace API key in the Authorization header of every request. Create the key in Settings, API keys. See Settings.

POST /relay/push/<entity id>/events HTTP/1.1
Host: api.tapper.ai
Content-Type: application/json
Authorization: <your API key>
  • Call it from your servers only. The key is a password for your workspace and must never reach a browser or an app.
  • A missing or wrong key gets 401.
  • Owners and admins create API keys.
  • Give the key the permission Send conversions to Relay, and set Entity access to All entities, or to Only selected entities with the entity you send for.

Before the first request

1
Open Your server (API)

In the Tapper app, open Setup > Data sources, then Your server (API), on its Connection tab. Copy the address of your entity, https://api.tapper.ai/relay/push/<entity id>/events, where <entity id> is the entity's ID.

2
Name your events

Under Event names, list each event name your servers send. What each event is sent as, and where it goes, is set on the Relay page. An event with a name that is not listed is refused, so nothing goes out by accident. You can list up to 100 names.

3
Turn on Accept events

While Accept events is off, every request is refused with 403.

What you send

Send a POST with a JSON body:

FieldTypeRequiredWhat it is
eventsList.Yes.1 to 500 events.
testtrue or false.No.true checks the events and stores nothing.

Each event is checked on its own. An event with a problem is refused with its reasons, and the other events in the batch are still accepted. A field this table does not list is refused, not ignored.

FieldTypeRequiredNotes
event_idText.Yes.Your own ID for the event. Up to 120 characters: letters, digits and symbols, with no spaces and no @. Send the same ID on every retry.
event_nameText.Yes.One of the names you listed under Event names. Up to 100 characters.
occurred_atDate and time.Yes.ISO 8601 with Z or an offset, for example 2026-10-31T09:30:00Z. Not in the future, and not more than 30 days old.
valueNumber or text.No.A positive decimal with at most 6 decimals. Needs currency.
currencyText.With value.Three-letter code, for example USD.
email_sha256Text.No.SHA-256 of the email, 64 hexadecimal characters.
phone_sha256Text.No.SHA-256 of the phone number, 64 hexadecimal characters.
gclidText.No.Google's click ID.
fbclidText.No.Meta's click ID.
ttclidText.No.TikTok's click ID.
gbraid, wbraidText.No.Google's other click IDs, where Google set one of them.
msclkidText.No.Microsoft's click ID.
li_fat_idText.No.LinkedIn's click ID.
sccidText.No.Snapchat's click ID.
twclidText.No.X's click ID.
lead_idText.No.The Meta lead ID of a Lead Ad lead, 15 to 17 digits, as text. Relay sends the event to Meta as a stage of that lead.
valuelesstrue or false.No.true for an event that has no value by design, such as a lead stage or a sign-up. It then carries no value. Google takes such an event, and Meta takes it with a lead_id; the other platforms leave it out.
consentGRANTED, DENIED or UNKNOWN.No.Whether the person agreed to ad measurement. Without it, UNKNOWN.

Click IDs are 1 to 255 letters, digits and - _ . ~. Send them exactly as the ad platform set them.

How a conversion is matched

Send a click ID if you have one: gclid, gbraid or wbraid for Google, fbclid for Meta, ttclid for TikTok, msclkid for Microsoft, li_fat_id for LinkedIn, sccid for Snapchat, twclid for X. It is the surest match. Without one, send the hashed email, email_sha256, or the hashed phone number, phone_sha256. Tapper passes the email hash to each platform and the phone hash to every platform but Meta and Snapchat, for their own matching. For Meta Lead Ads, the lead_id matches on its own.

An event with nothing a platform can match on is recorded and not sent. Each platform credits the conversion only when it recognises the person.

Hash email and phone

Hash on your servers, before the request leaves them. Never send a raw email or phone number: an event with a field named like one, for example email or phone, is refused and the reason says to send the hash.

  • Email: trim spaces, convert to lowercase, then SHA-256, as 64 hexadecimal characters.
  • Phone: write it in E.164 form, a +, the country code, then the digits, then SHA-256.

For example, jane.doe@example.com hashes to 86e0b9e56c17cc4d12387e1949b85053fbe73bc3ce5a1188713a9d300cc6133d.

Value and currency

Send the value net of tax and refunds, with shipping left out, the same as Relay counts a store order. A value always comes with its currency. Relay sends the value in its own currency, with its code, and the platform converts it. Leave value out for a lead stage or a sign-up and set valueless to true.

No double counting

event_id is the key. Send the same event_id again, for example after a timeout, and Tapper answers duplicate and sends nothing twice. Retrying a whole batch is always safe.

Where events go

Events are sent to your ad accounts on Google, Meta, TikTok, Microsoft, LinkedIn and Snapchat where Relay is on and your Tapper team has switched your server's events on for the ad account. On Meta and TikTok each reaches the platform under its Relay name, TapperRelay followed by the name you chose under Event names, so it shows apart from your pixel events. On Google Ads each goes to the event's own conversion action, which Tapper makes when you switch the event on in Relay > Events; send the gclid for the surest match. Which ad accounts receive them is under Routing.

Example

curl -sS -X POST "https://api.tapper.ai/relay/push/<entity id>/events" \
  -H "Content-Type: application/json" \
  -H "Authorization: $TAPPER_API_KEY" \
  -d @batch.json

batch.json:

{
  "events": [
    {
      "event_id": "lead-48213",
      "event_name": "qualified_lead",
      "occurred_at": "2026-10-31T09:30:00Z",
      "email_sha256": "86e0b9e56c17cc4d12387e1949b85053fbe73bc3ce5a1188713a9d300cc6133d",
      "gclid": "Cj0KCQiAq5bW4o2z",
      "valueless": true
    },
    {
      "event_id": "sale-90017",
      "event_name": "sale",
      "occurred_at": "2026-10-31T10:12:00Z",
      "value": 349.5,
      "currency": "USD",
      "gclid": "EAIaIQobChMIq5bW4o2ziQMV",
      "consent": "GRANTED"
    }
  ]
}
import { createHash } from "node:crypto";
 
const sha256 = (text) => createHash("sha256").update(text).digest("hex");
 
const res = await fetch("https://api.tapper.ai/relay/push/<entity id>/events", {
  method: "POST",
  headers: {
    "Content-Type": "application/json",
    Authorization: process.env.TAPPER_API_KEY,
  },
  body: JSON.stringify({
    events: [
      {
        event_id: "lead-48213",
        event_name: "qualified_lead",
        occurred_at: new Date().toISOString(),
        email_sha256: sha256("jane.doe@example.com".trim().toLowerCase()),
        valueless: true,
      },
    ],
  }),
});
console.log(res.status, await res.json());

The response

A 200 lists what happened to each event. index is its position in events, counting from 0.

{
  "data": {
    "test": false,
    "received": 2,
    "accepted": [
      { "index": 0, "event_id": "lead-48213", "outcome": "stored" }
    ],
    "rejected": [
      {
        "index": 1,
        "event_id": "sale-90017",
        "reasons": ["event_name is not mapped for this endpoint: map it to a Relay event name first."],
        "reason_codes": ["EVENT_NAME_NOT_MAPPED"]
      }
    ]
  }
}
outcomeMeaning
storedRelay has the event. The Relay page shows when it is sent, or why it was not.
duplicateYou sent this event_id before. Nothing was added.
offNo ad account takes your server's events: Sending is Off, or your server's events are not switched on for it. The event was not kept.
validatedA test request. The event passed every check and nothing was stored.

A refusal reason names the field and never repeats what you sent. reason_codes names a refusal of the event's name: EVENT_NAME_NOT_MAPPED, the name is not listed under Event names; EVENT_NAME_COLLIDES, it would reach the platforms as the same event as another listed name; EVENT_NAME_NO_GOOGLE_ACTION, every ad account that would receive it is on Google Ads and has no conversion action for it yet. For any other refusal the list is empty.

Test first

Add "test": true to check a batch without storing anything. Each good event answers validated.

Other answers

StatusCodeWhenWhat to do
400The body is wrong: not JSON, events missing, empty or longer than 500.Fix the body. The errors list names the field.
401The API key is missing or wrong.Check the key.
403API_KEY_SCOPE_MISSINGThe key does not have the scope Send conversions to Relay.Add the scope to the key under Settings, API keys.
403API_KEY_ENTITY_NOT_ALLOWEDThe key's Entity access does not include this entity.Set Entity access to All, or select this entity.
403RELAY_NOT_ON_WORKSPACERelay is not on for this entity.An owner or admin turns it on in Settings, Products.
403RELAY_PUSH_OFFAccept events is off.Turn it on under Setup > Data sources, Your server (API).
404ENTITY_NOT_FOUNDThe address names an entity that is not in your workspace.Check the entity ID in the address.
413The body is larger than 1 MiB.Send fewer events in each batch.
429Your API key made more requests than it may in a minute (1,000 by default). The answer carries a Retry-After header.Wait the number of seconds it names, then carry on.
503Tapper could not store the batch.Send the whole batch again. Your event IDs make that safe.