Track lead events
Endpoint
POST /track/lead
Track a lead conversion event for a short link. This endpoint creates a lead event and upserts a customer record.
POST /track/leadAuthentication
Requires authentication with an API key that has the conversionsWrite scope.
Request Body
Accepts a single object (not an array). All fields are required unless marked optional.
Deferred Tracking
Send clickId as an empty string ("") to attribute the lead to the customer's most recent lead click. This fails if the customer has no previous leads.
Retries create lead events
Every accepted POST creates a new lead event, including a retry. This includes caller retries. Repeated requests with the same customerExternalId reuse the active customer but create separate leads. No **Idempotency-Key** header is accepted, promised, or required. Retry only when another lead conversion is intended.
Capture clickId in the browser
If you don't already have a clickId, use the Browser attribution script to persist `hoko_id` and pass it to this endpoint. See [Browser attribution script](https://docs.hoko.to/track/analytics-js).