Endpoint and authentication
Send JSON with a Bearer token in theAuthorization header. Two kinds of token work:
- The store’s Atlas API token, generated in Store settings under Tracking and connection, API token. It starts with
atl_and is shown once. This is the token to use from your own server and from Zapier or Make. - A Referly REST API key or Zapier API key of the program the store belongs to. Atlas resolves the store from the key.
The store must be live. A store that is not tracking yet, or has been disabled, answers
403 Atlas is not enabled for this program.
Request body
Send one event object, or up to 50 of them underevents:
string
required
Lead, CompleteRegistration, StartTrial, Subscribe or Purchase. Aliases are accepted after lowercasing and dropping anything that is not a letter: generatelead; signup, register, registration; trial, trialstarted; subscription, subscriptionstarted; order, sale. So Sign up and sign_up both mean CompleteRegistration.string
Your id for this conversion, up to 191 characters. Required for
Purchase (your order id). For the other events it is optional: without it Atlas uses userId, then email, as the id, so one person gets one lead, one sign up and so on. Numbers are accepted and stored as strings.string
The person’s email, up to 320 characters. Trimmed; matching ignores case.
string
The person’s phone number, up to 64 characters, ideally in international format.
string
Up to 128 characters.
string
Up to 128 characters.
string
Your customer id, up to 128 characters. Stored as the external id, and used as the conversion id when
id is missing.string
The Atlas visitor id from
referlyAtlas.getVisitorId() in the browser, saved at sign up. It is the surest way to tie the event to the ad click.number
The amount, zero or more. Required for
Purchase. Strings that parse as numbers are accepted.string
Three-letter code. A
Purchase without one uses the store’s currency, or USD when the store has none. Other events may carry no currency.string | number
When it happened: an ISO 8601 string, epoch seconds or epoch milliseconds. Anything more than 5 minutes in the future or older than 90 days is replaced by the time of the request.
string
The person’s IP address, taken from your web request. Your server’s own IP is never used in its place.
string
The person’s browser user agent, up to 1024 characters.
string
The page the conversion happened on, up to 2048 characters.
string
The person’s country as a two-letter code. Stored with the conversion, and used as the billing country of a purchase.
object
Anything you want to see next to the conversion in Atlas, for example
{ "plan": "Pro" }.boolean
true records a test: it shows in Live activity with the Test status and stays out of reports and destinations.Responses and errors
A processed request returns200 with one result per event, in order:
Per-event
rejected messages:
ok is true when at least one event was not rejected. A request with a single event that is rejected comes back 400; a batch always comes back 200, so read results rather than the status code.
Request-level errors return { "ok": false, "error": "..." }:
Rate limits
600 requests per minute per token. A batch counts as one request, so up to 30,000 events a minute fit under the limit. Above it the endpoint answers429 Too many requests. Please slow down.: wait a few seconds and send the batch again.
Retries are safe. A repeated event with the same id is merged, not duplicated.
Duplicates and merging
Atlas deduplicates so that a retried request, a browser event and a server event for the same thing end up as one row:- Purchase: the order id (
id) is the key. A secondPurchasewith the same id is merged into the first (merged). A purchase the tracker recorded in the browser waits 60 seconds for your server’s copy and takes its value and time. - Lead, CompleteRegistration, StartTrial, Subscribe: the key is
id, oruserIdoremailwhenidis missing. On top of that, the same person and the same type within 24 hours merge into one conversion, whatever the ids: the server copy wins the value and the time. A conversion first seen in the browser waits 60 seconds for the server copy.
id in both places, plus the visitorId from the browser, and the two are stitched. See How duplicates are merged.
Each pixel also refuses to send the same event twice within 48 hours; those show as Deduped in Live activity.
Examples
Zapier
Use the Webhooks by Zapier action with the POST event (or Custom Request):- URL:
https://www.referly.so/api/atlas/v1/events - Payload Type:
json - Data: one row per field, for example
eventset toLead,idmapped to the record id from your trigger,emailmapped to the email from your trigger, thenvalueandcurrencywhen you have them. - Headers:
Authorizationset toBearer atl_YOUR_TOKEN, andContent-Typeset toapplication/json.
Make
Add the HTTP module, Make a request:- URL:
https://www.referly.so/api/atlas/v1/events - Method:
POST - Headers:
Authorizationwith the valueBearer atl_YOUR_TOKEN - Body type:
Raw, with Content typeJSON (application/json) - Request content: the JSON event, mapping fields from the previous module, for example the record id into
idand the email intoemail.