Skip to main content
POST
Mint a visitor identity token

Authorizations

Authorization
string
header
required

A Custral API key, created in Settings → Developers → Applications, sent as Authorization: Bearer sk_…. The X-Api-Key header is also accepted and takes precedence. Use a secret key (sk_…) from your server; a publishable key (pk_…) may hold only objects:read and usage:write. Never expose a secret key in a browser.

Body

application/json
externalId
string
required

Your own id for the signed-in user. This is the identity; up to 255 characters.

Maximum string length: 255
Example:

"usr_8812"

email
string

Their email, if you hold one. A value over 255 characters is dropped.

Example:

"gavin@hooli.com"

name
string

Their display name, if you hold one.

Example:

"Gavin Belson"

phone
string

Their phone number, if you hold one.

expiresIn
integer
default:600

Lifetime in seconds. Clamped to 30–3600; missing, zero or negative uses the default. A value that is not a number is refused.

Response

200 - application/json

The token.

data
object
reqId
string

A per-request id (req_…). Quote it to support when reporting a problem.

Example:

"req_2a1f9c8e7b6d5"