Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/sam-shervin/space7/llms.txt

Use this file to discover all available pages before exploring further.

Overview

Completes the password reset flow by verifying the OTP sent to the user’s email and setting a new password. Call Forgot Password first to obtain the OTP.

Endpoint

POST /api/auth/reset-password

Request

Headers

HeaderValue
Content-Typeapplication/json

Body parameters

email
string
required
The email address associated with the account.
otp
string
required
The one-time password received at the user’s email address.
newPassword
string
required
The new password to set for the account.

Response

Success

...data
object
Confirmation message returned by the server indicating the password was reset.

Error

error
string
Human-readable error message describing why the reset failed.
You must first request an OTP via Forgot Password before calling this endpoint. Submit the OTP exactly as received in the email.

Example

TypeScript
import { SERVER_ENDPOINT } from "@env";

const API = SERVER_ENDPOINT ?? "";

const resetPassword = async (
  email: string,
  otp: string,
  newPassword: string,
) => {
  const res = await fetch(`${API}/api/auth/reset-password`, {
    method: "POST",
    headers: {
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      email,
      otp,
      newPassword,
    }),
  });

  const data = await res.json();

  if (!res.ok) {
    throw new Error(data.error || "Reset password request failed");
  }

  return data;
};

Build docs developers (and LLMs) love