Documentation sections

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.

ParameterWhat to pass
click_id, subid or aff_subThe click ID. Required
emailEmail
phonePhone
first_name, name or fnameFirst name
last_name or lnameLast name
secretThe 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.

Tip.

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

  1. Open Offers («Офферы») or Landing pages («Лендинги»).
  2. In the row of the hosted page, click Editor («Редактор»).
  3. Click + File («+ Файл»).
  4. In the Template («Заготовка») block, choose HTML + lead form («HTML + форма лида»).
  5. Check the File path («Путь файла»). The editor fills in index.html, or page.html if such a file already exists.
  6. Click Create («Создать»).

The file gets a page with a form with the first_name and phone fields and a submit script:

html
<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.

  1. Open the campaign statistics.
  2. Go to the Click log («Лог кликов») tab.
  3. 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-data are accepted; JSON is not a format of this endpoint.

Errors and checks

HTTPMessageWhat to check
400click_id (или subid) обязателенThe click ID was passed
400invalid form encodingThe request body is a valid form or multipart/form-data
404click not foundThe click exists; the macro did not remain literal text
401invalid secretThe current required secret was sent by a server handler
413lead form exceeds 1 MiBThe 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
503temporary error, retry laterA 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
503clickhouse unavailableAnalytics 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.

Updated Need help? ↗