Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/GaelCeballos/Smart_Enviro_Backend/llms.txt

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

The register endpoint creates a new user account in Smart Enviro Backend. On success, it returns a 201 Created response without issuing a token — clients must call POST /api/login separately to obtain a bearer token and begin an authenticated session.
Endpoint
FieldValue
MethodPOST
Path/api/register
Auth requiredNo

Request Body

name
string
required
Display name for the user. Maximum 255 characters.
email
string
required
Must be a valid email address and unique across all existing user accounts. Registration fails with 422 if the email is already taken.
password
string
required
Account password. Minimum 8 characters. Stored as a bcrypt hash — the plain-text value is never persisted.
password_confirmation
string
required
Must exactly match the value provided in password. Used by Laravel’s confirmed validation rule.

Request Example

curl -X POST http://localhost/api/register \
  -H "Content-Type: application/json" \
  -d '{
    "name": "Jane Doe",
    "email": "[email protected]",
    "password": "supersecret",
    "password_confirmation": "supersecret"
  }'

Responses

201 Created — Registration successful

The user record was created successfully. No token is issued.
{"status": "success", "message": "Registro exitoso"}
status
string
Always "success" on a 201 response.
message
string
Human-readable confirmation message ("Registro exitoso").

422 Unprocessable Entity — Validation error

Returned when any field fails validation. Common causes:
  • email is already registered to an existing account
  • password and password_confirmation do not match
  • password is shorter than 8 characters
  • A required field is missing or empty
Laravel returns a standard validation error body with an errors object keyed by field name, e.g.:
{
  "message": "The email has already been taken.",
  "errors": {
    "email": ["The email has already been taken."]
  }
}

After registering, call POST /api/login with the same email and password to receive a bearer token. Registration alone does not create a session.

Build docs developers (and LLMs) love