forgot-password
Method: POST
Path: /auth/forgot-password
Tags: Auth
Summary
Forgot password
Description
The Forgot Password API provides a secure mechanism for users to initiate the password recovery process. This API provides one-time password (OTP) token, which facilitas the resetting of user’s account password.
Storefront SDK Usage
SDK Method: sdk.auth.forgotPassword()
Example:
typescript
// Send password reset email
const { data, error } = await sdk.auth.forgotPassword({
email: "customer@example.com"
});
if (error) {
console.error("Password reset failed:", error.message);
} else {
console.log("Reset email sent successfully");
// Show confirmation message to user
}TypeScript Definition
typescript
"forgot-password": {
parameters: {
query?: never;
header?: never;
path?: never;
cookie?: never;
};
requestBody: {
content: {
"application/json": {
/** @description A string representing the email address. */
email: string;
/** @description 10 digit phone number without country code. */
phone: string;
/**
* @description Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.
* Use this key along with phone. Not necessary for email.
*/
country_code: string;
};
};
};
responses: {
/** @description OK */
200: {
headers: {
[name: string]: unknown;
};
content: {
"application/json": {
/** @description A descriptive message confirming the success or failure of the operation. */
message: string;
/** @description Indicates whether the request was successful or failure (true for success, false for failure). */
success: boolean;
/** @description An object containing the response content. */
content: {
/** @description A string representing the OTP token which facilitas the resetting of user’s account password. */
otp_token: string;
};
};
};
};
400: components["responses"]["BadRequest"];
401: components["responses"]["Unauthorized"];
404: components["responses"]["NotFound"];
};
};Component References
| Reference | Resolves To |
|---|---|
components["responses"]["BadRequest"] | BadRequest |
components["responses"]["Unauthorized"] | Unauthorized |
components["responses"]["NotFound"] | NotFound |
Request Body
Content Types: application/json
Responses
200
OK
400
Bad request
401
Not authorized for given operation on the Resource
404
Requested resource not found
OpenAPI Definition
json
{
"tags": [
"Auth"
],
"operationId": "forgot-password",
"summary": "Forgot password",
"description": "The Forgot Password API provides a secure mechanism for users to initiate the password recovery process. This API provides one-time password (OTP) token, which facilitas the resetting of user’s account password.",
"externalDocs": {
"url": "https://llm-docs.commercengine.io/storefront/operations/forgot-password",
"description": "API reference for the forgot-password operation"
},
"requestBody": {
"required": true,
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"email",
"phone",
"country_code"
],
"properties": {
"email": {
"description": "A string representing the email address.",
"type": "string"
},
"phone": {
"description": "10 digit phone number without country code.",
"type": "string"
},
"country_code": {
"description": "Two-letter code begin with a plus sign prefix that identifies different countries. By default it will be +91 if not provided.\nUse this key along with phone. Not necessary for email.",
"type": "string"
}
}
}
}
}
},
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"required": [
"message",
"success",
"content"
],
"properties": {
"message": {
"description": "A descriptive message confirming the success or failure of the operation.",
"type": "string"
},
"success": {
"description": "Indicates whether the request was successful or failure (true for success, false for failure).",
"type": "boolean"
},
"content": {
"description": "An object containing the response content.",
"properties": {
"otp_token": {
"description": "A string representing the OTP token which facilitas the resetting of user’s account password.",
"type": "string"
}
},
"required": [
"otp_token"
],
"type": "object"
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/BadRequest"
},
"401": {
"$ref": "#/components/responses/Unauthorized"
},
"404": {
"$ref": "#/components/responses/NotFound"
}
},
"security": [
{
"Authorization": []
}
],
"x-speakeasy-group": "auth",
"x-speakeasy-ignore": true,
"x-speakeasy-name-override": "forgotPassword"
}Auto-generated from OpenAPI spec and TypeScript definitions