Kanorio

API reference

Email change

Customer API: GET /email-change, POST /email-change, POST /email-change/verify

Base URL https://{site}/api/v1/customerErrorsPagination

Pending email change

GET/email-change
beta

The new address a verification code was sent to, if a change is in progress.

Response 200

  • pendingobject | nullrequired
  • pending.emailstringrequired

    The new address the code was sent to.

  • pending.expiresAtstringrequired
curlTypeScript
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

  • emailstringrequired

    The new address; the code is sent there.

  • localestring

    Locale for the verification email; defaults to the customer's locale.

Response 200

  • pendingobject | nullrequired
  • pending.emailstringrequired

    The new address the code was sent to.

  • pending.expiresAtstringrequired

Errors

  • INVALID_EMAIL 400
  • SAME_EMAIL 400
  • EMAIL_IN_USE 409
  • RATE_LIMITED 429
  • SERVICE_UNAVAILABLE 503
  • SEND_FAILED 502
  • SHARED_SENDER_PAUSED 503
curlTypeScript
curl -X POST "https://{site}/api/v1/customer/email-change" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'

Confirm the new email with the code

POST/email-change/verify
beta

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_CODE 400
  • CODE_EXPIRED 410
  • TOO_MANY_ATTEMPTS 429
  • EMAIL_IN_USE 409
curlTypeScript
curl -X POST "https://{site}/api/v1/customer/email-change/verify" \
  -H "Authorization: Bearer $KANORIO_CUSTOMER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'