API reference
Email change
Customer API: GET /email-change, POST /email-change, POST /email-change/verify
The new address a verification code was sent to, if a change is in progress.
Response 200
pendingobject | nullrequiredpending.emailstringrequiredThe new address the code was sent to.
pending.expiresAtstringrequired
curl -X GET "https://{site}/api/v1/customer/email-change" \
-H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN"Sends a 6-digit verification code to the new address. The customer stays signed in. Fails with EMAIL_IN_USE when another customer of the site already uses the address (accounts are not merged). Limited to 5 requests per hour per customer; a new request replaces the previous code.
Request body
emailstringrequiredThe new address; the code is sent there.
localestringLocale for the verification email; defaults to the customer's locale.
Response 200
pendingobject | nullrequiredpending.emailstringrequiredThe new address the code was sent to.
pending.expiresAtstringrequired
Errors
INVALID_EMAIL400SAME_EMAIL400EMAIL_IN_USE409RATE_LIMITED429SERVICE_UNAVAILABLE503SEND_FAILED502SHARED_SENDER_PAUSED503
curl -X POST "https://{site}/api/v1/customer/email-change" \
-H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'Replaces the account email and its sign-in identity. Existing sessions stay valid. Five wrong attempts invalidate the code.
Request body
codestringrequired
Response 200
emailstringrequired
Errors
INVALID_CODE400CODE_EXPIRED410TOO_MANY_ATTEMPTS429EMAIL_IN_USE409
curl -X POST "https://{site}/api/v1/customer/email-change/verify" \
-H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
-H "Content-Type: application/json" \
-d '{}'