Skip to main content
POST
/
auth
/
register.php
Register User
curl --request POST \
  --url https://api.example.com/auth/register.php \
  --header 'Accept: <accept>' \
  --header 'Content-Type: <content-type>' \
  --data '
{
  "name": "<string>",
  "lastName": "<string>",
  "email": "<string>",
  "phone": "<string>",
  "password": "<string>",
  "address": "<string>",
  "latitude": 123,
  "longitude": 123,
  "lat": 123,
  "lng": 123,
  "city": "<string>",
  "state": "<string>",
  "country": "<string>"
}
'
{
  "400": {},
  "500": {},
  "success": true,
  "message": "<string>",
  "user": {
    "id": 123,
    "uuid": "<string>",
    "nombre": "<string>",
    "apellido": "<string>",
    "email": "<string>",
    "telefono": "<string>",
    "tipo_usuario": "<string>",
    "creado_en": "<string>",
    "actualizado_en": "<string>",
    "location": {
      "id": 123,
      "usuario_id": 123,
      "direccion": "<string>",
      "latitud": 123,
      "longitud": 123,
      "ciudad": "<string>",
      "departamento": "<string>",
      "pais": "<string>",
      "es_principal": true
    }
  }
}

Endpoint

POST /auth/register.php
Register a new user account in the Viax platform. Supports registration for passengers, drivers, and other user types.

Headers

Content-Type
string
required
Must be application/json
Accept
string
required
Must be application/json

Request Body

name
string
required
User’s first name
lastName
string
required
User’s last name
email
string
required
Valid email address. Must be unique in the system.
phone
string
required
Phone number with country code (e.g., +573001234567)
password
string
required
User password. Should be at least 8 characters.
address
string
Street address
latitude
number
Location latitude in decimal degrees
longitude
number
Location longitude in decimal degrees
lat
number
Alternative field for latitude (backend accepts both)
lng
number
Alternative field for longitude (backend accepts both)
city
string
City name
state
string
Department/state name
country
string
default:"Colombia"
Country name

Response

success
boolean
required
Indicates if registration was successful
message
string
Success or error message
user
object
Created user object

Request Example

curl -X POST https://76.13.114.194/auth/register.php \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -d '{
    "name": "Carlos",
    "lastName": "Rodríguez",
    "email": "[email protected]",
    "phone": "+573001234567",
    "password": "SecurePass123!",
    "address": "Carrera 15 #85-30",
    "latitude": 4.6814,
    "longitude": -74.0479,
    "city": "Bogotá",
    "state": "Cundinamarca",
    "country": "Colombia"
  }'

Response Example

{
  "success": true,
  "message": "Usuario registrado exitosamente",
  "user": {
    "id": 456,
    "uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "nombre": "Carlos",
    "apellido": "Rodríguez",
    "email": "[email protected]",
    "telefono": "+573001234567",
    "tipo_usuario": "pasajero",
    "creado_en": "2024-03-15T14:30:00.000Z",
    "actualizado_en": null,
    "calificacion": null,
    "location": {
      "id": 89,
      "usuario_id": 456,
      "direccion": "Carrera 15 #85-30",
      "latitud": 4.6814,
      "longitud": -74.0479,
      "ciudad": "Bogotá",
      "departamento": "Cundinamarca",
      "pais": "Colombia",
      "es_principal": true,
      "creado_en": "2024-03-15T14:30:00.000Z"
    }
  }
}

Error Responses

400
Bad Request
Invalid input data or email already registered
500
Internal Server Error
Server error during registration process

Notes

After successful registration, the user can immediately login using the /auth/login.php endpoint.
Passwords are hashed on the server. Never store plain-text passwords on the client.

See Also

Build docs developers (and LLMs) love