Identify Handle
Says to whom the handle of a browser belongs. The body has one of three forms.
{ handle, participant }: this browser belongs to the participant. Send it once, at the identity
moment (the creation of the account or the group), when the fact that counts comes later, for
example a signup at email verification. A signup sent at account creation can send the handle in
identify instead. Do not identify at sign-in, verification, or account linking. The call creates
the participant when the Project does not have it, and enrolls it at sign-up: in each active
referral Program whose enrollAtSignup is not false, where it was never enrolled, with its referral
code. While the participant limit of the Workspace pauses new enrollments, it enrolls nothing.
{ handle, reference }: this browser belongs to the person of a flow that starts before the account
exists and can end on another device or in a hosted login, such as a magic link or a one-time
code. reference.key is your key of the flow, unique in the Project and bound to its challenge (for
example a digest of the magic-link token); a key is never used again. The call that names an unknown
key creates its reference, which expires at reference.expiresAt: after the receipt and at most 90
days after it; the default is 24 hours after it. An expired reference gets 409.
{ reference, participant }: the account of the flow exists. The reference resolves once to the
participant, and the handles identified to it then belong to the participant. The same participant
again returns the first result; another participant, or a reference that expired before it resolved,
gets 409. A key that no handle named yet is created resolved, so the two calls can come in either
order. It enrolls the participant at sign-up, as the first form does.
A handle is identified once: the same target again returns the first identification, and another
target gets 409. An unknown handle, or a handle of another Project, gets 404. observedAt is the
time of the identity moment; the default is the receipt. A caller clock can run ahead: an observedAt up
to 5 minutes after the receipt records the receipt, and a later one gets 400. The click window
of a handle ends at its identification, also when its reference resolves later. A fact uses only the
identifications and resolves that RefRef received at or before the fact; a fact never waits for one.
Authorization
WorkspaceApiKey Workspace-owned Better Auth API key of one environment (Sandbox or Live); it authorizes the Projects of that environment in its Workspace. A Project of the other environment returns 403 ENVIRONMENT_MISMATCH. Never expose it in the browser.
In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
application/json
application/json
application/json
application/json
application/json
application/json
curl -X POST "https://example.com/v1/identify" \ -H "Content-Type: application/json" \ -d '{ "projectId": "string", "handle": "string", "participant": { "kind": "individual", "externalId": "string" } }'{ "success": true, "identificationId": "string", "handle": "string", "identifiedAt": "string", "participantId": "string"}Get Widget Payout Details GET
The cash payouts of the participant that the Widget token names, in the Project of the token's Program. The token needs the widget:read scope. Only USD cash Rewards that RefRef pays out count: a participant without one is not eligible, and so is a participant that the Project does not have yet; the route creates no participant. canSave tells whether the token can save the details (widget:payout).
Initialize Widget POST
Initializes the Widget for the participant and the referral Program that the Widget token names. The request has no body. The token needs the widget:read scope. An affiliate or loyalty Program gets 400 INVALID_REQUEST. The response is not cached (Cache-Control: private, no-store).