Skip to content

Visitor.identify

Joins an anonymous Visitor to the Contact they turn out to be, so their earlier visits count.

Action class
None
Approval
Runs on its own
Emits
Visitor.identified
Price
Free
POST https://api.sb/{your-domain}/visitors/identify

Its Inputs, Outputs, Effects and guards quote the hub’s Visitor.identify; this page adds what each Venue honors, its limits and a worked call.

Inputs

NameTypeDefaultMeaning
visitorVisitorRequiredThe Visitor.
contactContactRequiredThe Contact or customer the Visitor is.

Outputs

FieldTypeWhat null means
contactContactNever null: the Contact, with every earlier Visit of the Visitor attached.
visitorVisitorNever null: the Visitor, joined to its Contact from now on.

Effects

Action class

None: no approval rule names it, so it runs within its seat’s Permissions and Limits

Modes
  • try: Returns the Contact with the Visits it would gain; nothing is joined.
  • send: Returns a pending Action at once; Visitor.identified fires when the Visits are moved.
  • do: Joins them and returns both records.
Idempotency

Only with a key: the same Idempotency-Key and input return the first Action, and the same key with other input returns 409. A Visitor already joined to this Contact returns both as they stand; joining it to a second Contact refuses.

Saved or shared

The join, and each earlier Visit now counted for the Contact. It runs on its own at sign-up, sign-in and checkout; a call covers a form or an import.

Emits

Visitor.identified with { visitor, contact, visits }

Performed by

Marketing lead

Price

Free on your own account: the platform charges nothing for the call.

On each Venue

It acts on your own records and reaches no Venue, so every account answers the same way.

What try does

Runs every check the call meets and returns the record as it would be; nothing is stored, sent or posted.

Refuses when

This call has no refusals of its own.

When it waits

In send mode it returns a pending Action, reason: 'running' while the Visits move, and Visitor.identified delivers the result.

TypeScript
await $.Watch.create({
  selector: 'Visitor.identified',
  url: 'https://leaseline.app/hooks/sb'
})

Example

In send mode the call returns its pending Action at once, and the Event below delivers the result.

You, to your agent
Maria just filled the demo form: join her earlier visits to her contact.
Response, in send mode
{
  "mode": "send",
  "action": {
    "$id": "https://api.sb/leaseline.app/actions/action_Sd3kQ9vT2w",
    "operation": "Visitor.identify",
    "status": "pending",
    "reason": "running"
  }
}

To retry, send the same Idempotency-Key: the retry returns the first answer for $0. A new key reads again.

Test values

A sk_test_ key answers these the same way every time, at $0 (every test value).

Test valueAlways returnsWhat it is for
visitor_test_known{"contact":{"visits":3}}Always three earlier Visits, so the first touch that names what they read can be tested.

Used by

None.