Start a profile
/v1/shoppers/auth/startMakes an anonymous shopper profile and returns its token. Keep the
token on the device and send it as X-Shopper-Token on every other
shopper call.
An anonymous profile belongs to your organization: its token opens it
only with your organization's key. It lasts 180 days from its last use.
Confirming an email (auth/code, then auth/verify) saves it to that
email, after which it lasts until the shopper deletes it and works with
any organization's key.
You rarely need to call this first. Signals, remember, size with
save: true and auth/code make a profile themselves when no token is
sent, and return its token in the same response. Sent with a valid
token, this returns that profile and a renewed token instead of making
another.
Every shopper endpoint is metered as api.v1.shoppers. Until your plan
carries that resource, calls draw on the chat's allowance
(api.v2.agent.chat); the X-RateLimit-Resource header says which was
charged.
Headers
1The shopper's profile token, from auth/start, auth/verify or any call that made a profile. Optional here.
Response
The token to keep and send as X-Shopper-Token. Renewed on every call that returns it; good for 400 days.
A profile in words. Never the vectors behind it.
true once the shopper confirmed an email: the profile is theirs, lasts until they delete it, and works at every store that runs Stylor.
The confirmed email. Null on an anonymous profile.
Styles learnt from their reactions, strongest first. At most four per slot.
Kinds of whole look they liked, strongest first.
Styles they passed on often enough to say.
Labels they clearly lean toward, read from their reactions, never said by them ("colour: black"). At most 8.
Labels they clearly lean away from. At most 8.
What they told you, kept with remember.
Sizes they wear, by brand or store.
Their body measurements in centimetres, and how they like things to fit. Null when none are kept.
Reactions learnt from.
Errors
23Every error is JSON with a single error string unless noted. Match on the status code; the message is for humans.
Request body must be valid JSON.A body was sent and could not be parsed as JSON. The body is optional.
Request body must be a JSON object.A body was sent and parsed to something other than a JSON object.
That shopper token is not valid here. Start a profile or sign in again.X-Shopper-Token was sent but is not a profile token, has expired, names a deleted profile, or is another organization's anonymous profile. Drop it and call again without one.
Shopper profiles are switched off for this organization.The organization turned shopper profiles off in its agent settings. Nothing is made, read or kept.
curl -X POST "https://stylor.ai/api/v1/shoppers/auth/start" \
-H "Authorization: Bearer $STYLOR_API_KEY"{
"token": "eyJ2IjoxLCJ0eXAiOiJwcm9maWxlIiwicCI6IjRmM2Ei…",
"profile": {
"saved": false,
"email": null,
"styles": [],
"outfits": [],
"avoidStyles": [],
"likes": [],
"avoids": [],
"notes": [],
"sizes": [],
"body": null,
"signals": 0
}
}