Click lead data API
How to bind contact details to a click with /api/v1/lead, without a form-data file log.
/api/v1/lead saves the email, phone and name in click data. It works without an API token on the tracking domain and campaign domains. This separate analytics and CAPI function does not submit an application to an affiliate network or create a form-data file log.
Binding data to a click
The /api/v1/lead address accepts GET and POST. The data is passed in the address parameters or in the request body: as a regular form or as FormData.
| Parameter | What to pass |
|---|---|
click_id, subid or aff_sub | The click ID. Required |
email | |
phone | Phone |
first_name, name or fname | First name |
last_name or lname | Last name |
secret | The applicable network or legacy source secret, if set |
At least one data field is required. The tracker answers a POST with the text ok, and a GET with a transparent 1×1 image.
You can send the data with a script, as in the template below, or with a regular HTML form and a pixel. In the HTML of a page opened through the campaign link, the tracker routes root-relative paths in action and src attributes to the page folder, but it does not change the /api/v1/lead address: action="/api/v1/lead" reaches the tracker — see Hosted pages.
Ready-made form in the editor
- Open Offers («Офферы») or Landing pages («Лендинги»).
- In the row of the hosted page, click Editor («Редактор»).
- Click + File («+ Файл»).
- In the Template («Заготовка») block, choose HTML + lead form («HTML + форма лида»).
- Check the File path («Путь файла»). The editor fills in
index.html, orpage.htmlif such a file already exists. - Click Create («Создать»).
The file gets a page with a form with the first_name and phone fields and a submit script:
<form id="lead-form">
<input name="first_name" placeholder="Name" required>
<input name="phone" placeholder="Phone" required>
<button type="submit">Submit</button>
</form>
<script>
document.getElementById('lead-form').addEventListener('submit', function (e) {
var fd = new FormData(e.target);
fd.append('click_id', '{click_id}');
navigator.sendBeacon('/api/v1/lead', fd);
});
</script>The {click_id} macro is replaced with the click ID on a page opened through the campaign link. A preview has no real click. Check intake through a test campaign link rather than the preview. Working with files is described on File editor, versions and export.
Secrets and repeated submissions
/api/v1/lead validates the incoming postback secret: first the served offer's network, falling back to legacy source protection if the new setting is absent. A wrong or missing required secret returns 401. The form template does not add a secret itself.
Without a required secret, the request only fills empty fields. A correctly supplied applicable secret allows submitted fields to replace saved values; omitted fields are retained. Do not expose the secret in visitor-accessible form code.
Where the lead data is shown
The block is visible to the owner and the admin.
- Open the campaign statistics.
- Go to the Click log («Лог кликов») tab.
- Click the click row.
The click window has the Lead data block with the Email, Phone («Телефон»), First name («Имя») and Last name («Фамилия») rows. Empty rows are not shown. If no form was submitted for the click, the block says “no data (the lead did not submit the form)” («нет данных (лид не отправлял форму)»). The click card in the Logs («Логи») section does not show contacts — it shows only the time the form data was updated.
The tracker also inserts this data into the Facebook Conversions API event when the email, phone or name did not arrive in the postback.
In release 20261101.1, HTTP 200 means the request has been saved in the lead queue; the click card may receive its contact data later. An accepted queued request does not necessarily produce an entry in Logs → Postbacks. Check the click card and, as the owner or admin, GET /api/v1/maintenance/lead-queue for queue counters without contact data.
Limits
- 600 requests per minute from one IP.
- 1 MiB per request body.
- GET parameters, a regular POST form and
multipart/form-dataare accepted; JSON is not a format of this endpoint.
Errors and checks
| HTTP | Message | What to check |
|---|---|---|
| 400 | click_id (или subid) обязателен | The click ID was passed |
| 400 | invalid form encoding | The request body is a valid form or multipart/form-data |
| 404 | click not found | The click exists; the macro did not remain literal text |
| 401 | invalid secret | The current required secret was sent by a server handler |
| 413 | lead form exceeds 1 MiB | The request body is no larger than 1 MiB |
| 422 | нет данных лида (email/phone/name) | At least one contact field was sent |
| 422 | Данные лида превышают допустимый размер (lead data exceeds the allowed size) | Email up to 512 bytes, phone up to 128 bytes, first and last name up to 256 bytes each |
| 429 | слишком много запросов, попробуйте позже | The request limit for the IP |
| 503 | temporary error, retry later | A temporary failure: the lead could not be queued or the click could not be checked. The response has the Retry-After: 5 header — repeat the request |
| 503 | clickhouse unavailable | Analytics and server availability |
Use a test click and recipient: the request response, click data and the affiliate network receiving an application are separate checks. Calling navigator.sendBeacon does not itself confirm server receipt. Do not resubmit a real application only because a thank-you page did not appear.
The form-data file log has been removed. A custom leads.php handler remains an ordinary page PHP file; the PHP rules and page protection apply separately.