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

Creates a new user account with a username, email, and password. On success, an OTP is sent to the provided email address. The account is not active until the OTP is verified.

Endpoint

POST /api/auth/signup

Request

Headers

HeaderValue
Content-Typeapplication/json

Body parameters

username
string
required
The desired display name for the new account.
email
string
required
The email address for the account. An OTP will be sent here.
password
string
required
The password for the new account.

Response

Success

status
number
HTTP status code of the response (e.g. 200).
...data
object
Additional user data returned by the server on successful signup.

Error

error
string
Human-readable error message describing why signup failed.
After a successful signup, an OTP is sent to the provided email address. You must call Verify OTP to activate the account.

Example

TypeScript
import { SERVER_ENDPOINT } from "@env";

const API = SERVER_ENDPOINT ?? "";

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

  const data = await res.json();

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

  return {
    status: res.status,
    ...data,
  };
};

Build docs developers (and LLMs) love