Skip to main content

Get User Profile

GET /auth/profile.php
Retrieve user profile information by user ID or email.

Query Parameters

userId
integer
User ID to retrieve
email
string
Email address to retrieve
Provide either userId or email, not both.

Response

success
boolean
Operation success status
user
object
User profile object with location

Request Example

curl -X GET "https://76.13.114.194/auth/profile.php?userId=456" \
  -H "Accept: application/json"

Response Example

Success
{
  "success": true,
  "user": {
    "id": 456,
    "uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "nombre": "Carlos",
    "apellido": "Rodríguez",
    "email": "carlos.rodriguez@example.com",
    "telefono": "+573001234567",
    "tipo_usuario": "pasajero",
    "calificacion": 4.8,
    "creado_en": "2024-01-15T10:30:00.000Z",
    "actualizado_en": "2024-03-15T14:30:00.000Z",
    "location": {
      "id": 89,
      "usuario_id": 456,
      "direccion": "Carrera 15 #85-30",
      "latitud": 4.6814,
      "longitud": -74.0479,
      "ciudad": "Bogotá",
      "departamento": "Cundinamarca",
      "pais": "Colombia",
      "codigo_postal": null,
      "es_principal": true
    }
  }
}

Update User Profile

POST /auth/profile_update.php
Update user profile information.

Request Body

userId
integer
required
User ID to update
name
string
Updated first name
lastName
string
Updated last name
phone
string
Updated phone number
address
string
Updated street address
latitude
number
Updated location latitude
longitude
number
Updated location longitude
lat
number
Alternative latitude field
lng
number
Alternative longitude field
city
string
Updated city
state
string
Updated department/state
country
string
Updated country

Response

success
boolean
Update success status
message
string
Success or error message
user
object
Updated user profile

Request Example

curl -X POST https://76.13.114.194/auth/profile_update.php \
  -H "Content-Type: application/json" \
  -d '{
    "userId": 456,
    "name": "Carlos Alberto",
    "phone": "+573009876543"
  }'

Response Example

Success
{
  "success": true,
  "message": "Perfil actualizado exitosamente",
  "user": {
    "id": 456,
    "uuid": "7c9e6679-7425-40de-944b-e07fc1f90ae7",
    "nombre": "Carlos Alberto",
    "apellido": "Rodríguez Gómez",
    "email": "carlos.rodriguez@example.com",
    "telefono": "+573009876543",
    "tipo_usuario": "pasajero",
    "actualizado_en": "2024-03-15T16:45:00.000Z"
  }
}

Error Responses

404
Not Found
User not found
400
Bad Request
Invalid request parameters
500
Internal Server Error
Server error

Notes

Location updates (address, coordinates, city, etc.) will update the user’s primary location record.
The email address cannot be changed through this endpoint for security reasons.

See Also

Build docs developers (and LLMs) love