Skip to content

Request an email change

POST
/tenant/stores/{storeRef}/auth/change-email
curl --request POST \
--url https://apibase.ecomweb.app/api/v1/tenant/stores/example/auth/change-email \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'x-storefront-api-key: <x-storefront-api-key>' \
--data '{ "current_password": "s3cret-password", "new_email": "new-address@example.com" }'

Checks the current password and emails a confirmation link to the new address. The email only changes once the link is confirmed with the confirm route. Keep confirmation_binding and send it with the emailed token. Returns 409 with code AUTH_EMAIL_TAKEN when another account has the address.

storeRef
required
string

The store’s ref, as returned by GET /stores.

Media typeapplication/json
object
current_password
required
string
<= 128 characters

Example

s3cret-password
new_email
required
string
<= 255 characters

Example

new-address@example.com
Media typeapplication/json
object
sent
required

Always true: a confirmation link was sent to the new address.

boolean
confirmation_binding
required

A value to keep on the client and send as binding to the change-email confirm route. It is never emailed.

string

Example

{
"sent": true
}

The request is malformed or failed validation.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key is missing, invalid, revoked or expired.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The key may not do this: a missing scope, a readonly key, a publishable key on a Store API route, or a disallowed origin.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}

The request conflicts with the resource’s current state.

Media typeapplication/json
One of:
object
statusCode
required

The HTTP status code.

number
message
required

What went wrong; validation failures list one message per problem.

One of:
string
error

The HTTP status text, such as Bad Request.

string

Example generated

{
"statusCode": 1,
"message": [
"example"
],
"error": "example"
}