Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ALEJ4NDRO2025/urban-store/llms.txt

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

The registration endpoint creates a new Urban Store user account and immediately triggers an email containing a 6-digit verification code. The account is set to is_verified=False at creation time, meaning the user cannot log in until they complete the email verification step. Passwords are hashed with bcrypt before being stored — plain-text passwords are never persisted.

Endpoint

POST /api/users/register/

Authentication

None required. This endpoint is publicly accessible.

Request Body

email
string
required
A valid, unique email address. Returns a 400 validation error if the address is already registered in the system.
password
string
required
The user’s chosen password. Must be at least 6 characters long. Stored as a bcrypt hash — the plain-text value is never persisted.
first_name
string
required
The user’s first name. Maximum 100 characters.
last_name
string
required
The user’s last name. Maximum 100 characters.

Request Example

curl -X POST https://your-domain.com/api/users/register/ \
  -H "Content-Type: application/json" \
  -d '{
    "email": "alex@example.com",
    "password": "mysecret123",
    "first_name": "Alex",
    "last_name": "Rivera"
  }'

Response — 201 Created

A successful registration returns HTTP 201 with the confirmation message and the registered email address.
{
  "message": "Usuario registrado. Revisa tu correo para obtener el código de verificación.",
  "email": "alex@example.com"
}
message
string
Human-readable confirmation that the user was created and that a verification email has been dispatched.
email
string
The email address the verification code was sent to.

What Happens After Registration

Once the record is saved, the API:
  1. Generates a cryptographically random 6-digit numeric code (random.randint(100000, 999999)).
  2. Stores the code in verification_token and sets verification_token_expires to 24 hours from now (UTC).
  3. Records last_verification_sent_at and resets verification_attempts to 0.
  4. Sends a styled HTML email to the registered address with the code prominently displayed.
The code expires exactly 24 hours after it was issued. After expiry the user must request a new code via the resend endpoint.

Error Responses

StatusBodyCause
400{ "email": ["Este email ya está registrado"] }Email already exists in the database
400{ "password": ["Ensure this field has at least 6 characters."] }Password shorter than 6 characters
400{ "email": ["Enter a valid email address."] }Malformed email format
400{ "first_name": [...] }first_name missing or exceeds 100 chars
400{ "last_name": [...] }last_name missing or exceeds 100 chars

A newly registered account cannot log in until the email is verified. To complete verification, call POST /api/users/verify-code/ with the email and the 6-digit code from the email. If the code has expired or was lost, use POST /api/users/resend-verification/ to request a new one.

Build docs developers (and LLMs) love