Skip to content

Bind a browser to a person

POST
/v1/identify
curl --request POST \
--url https://stitch-collector-dev.magic-blocks.workers.dev/v1/identify \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "anon_id": "3f1a8c2e-9b4d-4a71-8e2f-0c5d6a7b8e91", "traits": { "email": "jane.doe@example.com", "phone": "(415) 555-0132" }, "external_ids": { "relcu_contact_id": "88213" } }'

The bind-at-birth call. Post the page’s anon_id together with the contact id the moment a contact is created, and the entire prior browsing history attaches to that person deterministically. Also sent on every authenticated sign-in: it is idempotent and repairs drift. Who sends it is the owner’s business — a form handler, a CRM, a portal, an agent, or a middleware in front of them; Stitch sees a key and a payload. Email and phone are hashed inside the Worker and never stored in plaintext.

Media type application/json

At least one of traits.email, traits.phone or an external_ids entry: an anon_id on its own identifies nobody and is a 400. Posting an anon_id together with a contact id binds the entire prior browsing history to the person in one call.

object
anon_id
string
traits

Normalised and SHA-256’d inside the Worker before anything touches storage. The plaintext exists only for the request.

object
email
string format: email
phone

Any formatting; normalised to E.164 before hashing.

string
external_ids

Your systems’ ids for the person. Unrecognised keys are ignored.

object
relcu_contact_id

The contact id in whatever is the system of record for contacts (today, likely the CRM): the spine id. octopus_id and los_contact_id are accepted as the same thing.

string
octopus_id
string
los_contact_id
string
relcu_lead_id
string
vesta_borrower_id
string
vesta_loan_number
string
magicblocks_contact_id
string

The person this browser now belongs to.

Media type application/json
object
person_id
required
string format: uuid
created
required

Whether this call created the person.

boolean
merges
required

How many previously separate persons this call joined.

integer
Example
{
"person_id": "01fa113c-ae40-4671-851f-29707ed6c2da",
"created": true,
"merges": 0
}

Malformed JSON or a payload missing what the endpoint needs. The body says which.

Media type application/json
object
error
required

What was wrong, in a sentence. A 401 carries unauthorized and nothing more.

string
Example generated
{
"error": "example"
}

No key, or a key the collector does not know. Nothing was written.

Media type application/json
object
error
required

What was wrong, in a sentence. A 401 carries unauthorized and nothing more.

string
Example
{
"error": "unauthorized"
}

Only the method shown is served.