Skip to main content
Manage password reset functionality for user accounts.

Forgot Password

Initiate the password reset process by sending a reset token to the user’s email.

Authentication

This endpoint does not require authentication.

Request Body

email
string
required
User’s email address. A password reset token will be sent to this email if it exists in the system.

Response

isSuccess
boolean
Indicates whether the password reset email was sent successfully.
succeeded
boolean
Alias for isSuccess. Indicates whether the operation succeeded.
error
object
Error information if the operation failed.
errors
object[]
Array of error objects if the operation failed.

Error Responses

{
  "isSuccess": false,
  "succeeded": false,
  "error": {
    "code": "Validation.Failed",
    "description": "El email no es válido"
  },
  "errors": [
    {
      "code": "Validation.Failed",
      "description": "El email no es válido"
    }
  ]
}
curl -X POST https://api.sapfiai.com/authentication/forgot-password \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]"
  }'
{
  "isSuccess": true,
  "succeeded": true,
  "error": {
    "code": "",
    "description": ""
  },
  "errors": []
}

Reset Password

Reset the user’s password using the token received via email.

Authentication

This endpoint does not require authentication. Use the reset token from the email.

Request Body

email
string
required
User’s email address.
token
string
required
Password reset token received via email.
newPassword
string
required
New password for the account. Must meet the following requirements:
  • Minimum 8 characters
  • At least one uppercase letter
  • At least one lowercase letter
  • At least one number
  • At least one special character
confirmPassword
string
required
Password confirmation. Must match the newPassword field.

Response

isSuccess
boolean
Indicates whether the password reset was successful.
succeeded
boolean
Alias for isSuccess. Indicates whether the operation succeeded.
error
object
Error information if the operation failed.
errors
object[]
Array of error objects if the operation failed.

Error Responses

{
  "isSuccess": false,
  "succeeded": false,
  "error": {
    "code": "PasswordReset.InvalidToken",
    "description": "Invalid or expired reset token"
  },
  "errors": [
    {
      "code": "PasswordReset.InvalidToken",
      "description": "Invalid or expired reset token"
    }
  ]
}
curl -X POST https://api.sapfiai.com/authentication/reset-password \
  -H "Content-Type: application/json" \
  -d '{
    "email": "[email protected]",
    "token": "reset-token-from-email",
    "newPassword": "NewSecureP@ssw0rd",
    "confirmPassword": "NewSecureP@ssw0rd"
  }'
{
  "isSuccess": true,
  "succeeded": true,
  "error": {
    "code": "",
    "description": ""
  },
  "errors": []
}

Build docs developers (and LLMs) love