Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/Taykl12/Classify/llms.txt

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

Registering a new user creates a Supabase Auth account and, when email confirmation is disabled, immediately provisions a row in the usuarios table and returns a usable JWT session. When email confirmation is enabled (the default in most production environments), Supabase sends a verification email and the response contains only a minimal user object — no tokens are issued until the user confirms their address.

Request

POST /api/auth/register
Content-Type: application/json

Body parameters

email
string
required
The user’s email address. Must be a valid email format and not already registered in Supabase Auth.
password
string
required
The user’s chosen password. Supabase enforces a minimum length of 6 characters by default.
firstName
string
required
The user’s given name. Stored as nombre in the usuarios table and in Supabase user metadata.
lastName
string
required
The user’s family name. Stored as apellido in the usuarios table and in Supabase user metadata.

Responses

Case 1 — Email confirmation required 200 OK

When Supabase requires the user to confirm their email before gaining access, no session is created. The response includes a message and a minimal user object.
message
string
A human-readable notice instructing the user to check their inbox.
user
object
Minimal user record returned before confirmation.
{
  "message": "Check your email to confirm your account.",
  "user": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "email": "ada@example.com"
  }
}

Case 2 — Immediate session 200 OK

When email confirmation is disabled, registration completes in a single step. A row is inserted into usuarios with id_rol = 3 (default role) and a full session is returned.
accessToken
string
Short-lived JWT to use as the Authorization: Bearer token on protected requests.
refreshToken
string
Long-lived token that can be exchanged for a new access token when it expires.
user
object
Full user profile.
{
  "accessToken": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "refreshToken": "v1.refresh-token-value",
  "user": {
    "id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "email": "ada@example.com",
    "firstName": "Ada",
    "lastName": "Lovelace",
    "roleId": 3,
    "roleLabel": "student",
    "profilePhotoUrl": null
  }
}

Error responses

StatusCondition
400One or more required fields are missing from the request body
400Supabase signUp returned an error (e.g. email already in use)
{ "error": "Missing required fields: firstName, lastName" }

Examples

curl -X POST http://localhost:3001/api/auth/register \
  -H "Content-Type: application/json" \
  -d '{
    "email": "ada@example.com",
    "password": "s3cur3P@ss",
    "firstName": "Ada",
    "lastName": "Lovelace"
  }'

Build docs developers (and LLMs) love