Skip to content

Reset a password

POST
/public/stores/{storeRef}/auth/reset-password
curl --request POST \
--url https://apibase.ecomweb.app/api/v1/public/stores/example/auth/reset-password \
--header 'Content-Type: application/json' \
--header 'x-storefront-api-key: <x-storefront-api-key>' \
--data '{ "token": "example", "new_password": "s3cret-password" }'

Sets a new password using the token from the reset email and revokes every existing session of the account. The password must meet the store’s password policy; read it from the config route. Invalid or expired tokens return 400 with code AUTH_TOKEN_INVALID, and a weak password with AUTH_WEAK_PASSWORD. Rate limited to 20 requests per minute per store and client IP.

storeRef
required
string

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

Media typeapplication/json
object
token
required

Password reset token from the emailed link

string
new_password
required
string
>= 8 characters <= 128 characters

Example

s3cret-password
Media typeapplication/json
object
reset
required

Always true. Every existing session of the account is revoked.

boolean

Example

{
"reset": 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"
}

Too many requests; wait a little before retrying.

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"
}