curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"password": "<string>"
}
'{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"username": "johndoe",
"email": "john.doe@example.com",
"role": "RESIDENT",
"roles": ["RESIDENT"],
"roleDetails": [
{
"id": "7a9b8c3d-1234-5678-90ab-cdef12345678",
"code": "RESIDENT",
"description": "Community Resident"
}
],
"expiresAt": "2026-03-05T15:30:00Z",
"residentInfo": {
"id": "9c8b7a6d-5432-1098-76ab-fedcba987654",
"fullname": "John Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"number": "A-101",
"address": "123 Main Street, Apt 101",
"comunidades": ["1a2b3c4d-5678-90ab-cdef-1234567890ab"],
"comunidad": {
"id": "1a2b3c4d-5678-90ab-cdef-1234567890ab",
"nombre": "Sunset Community",
"direccion": "123 Main Street",
"email": "info@sunsetcommunity.com",
"phone": "+1234567890",
"tipoComunidad": "Residential",
"cantidadViviendas": 150
},
"comunidadesCompletas": [
{
"id": "1a2b3c4d-5678-90ab-cdef-1234567890ab",
"nombre": "Sunset Community",
"direccion": "123 Main Street",
"email": "info@sunsetcommunity.com",
"phone": "+1234567890",
"tipoComunidad": "Residential",
"cantidadViviendas": 150
}
]
}
}
Authenticate a user with username and password to receive a JWT token
curl --request POST \
--url https://api.example.com/api/auth/login \
--header 'Content-Type: application/json' \
--data '
{
"username": "<string>",
"password": "<string>"
}
'{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"username": "johndoe",
"email": "john.doe@example.com",
"role": "RESIDENT",
"roles": ["RESIDENT"],
"roleDetails": [
{
"id": "7a9b8c3d-1234-5678-90ab-cdef12345678",
"code": "RESIDENT",
"description": "Community Resident"
}
],
"expiresAt": "2026-03-05T15:30:00Z",
"residentInfo": {
"id": "9c8b7a6d-5432-1098-76ab-fedcba987654",
"fullname": "John Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"number": "A-101",
"address": "123 Main Street, Apt 101",
"comunidades": ["1a2b3c4d-5678-90ab-cdef-1234567890ab"],
"comunidad": {
"id": "1a2b3c4d-5678-90ab-cdef-1234567890ab",
"nombre": "Sunset Community",
"direccion": "123 Main Street",
"email": "info@sunsetcommunity.com",
"phone": "+1234567890",
"tipoComunidad": "Residential",
"cantidadViviendas": 150
},
"comunidadesCompletas": [
{
"id": "1a2b3c4d-5678-90ab-cdef-1234567890ab",
"nombre": "Sunset Community",
"direccion": "123 Main Street",
"email": "info@sunsetcommunity.com",
"phone": "+1234567890",
"tipoComunidad": "Residential",
"cantidadViviendas": 150
}
]
}
}
Show LoginResidentInfoDto
curl -X POST https://api.happyhabitat.com/api/auth/login \
-H "Content-Type: application/json" \
-d '{
"username": "johndoe",
"password": "SecurePass123"
}'
{
"token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
"userId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"username": "johndoe",
"email": "john.doe@example.com",
"role": "RESIDENT",
"roles": ["RESIDENT"],
"roleDetails": [
{
"id": "7a9b8c3d-1234-5678-90ab-cdef12345678",
"code": "RESIDENT",
"description": "Community Resident"
}
],
"expiresAt": "2026-03-05T15:30:00Z",
"residentInfo": {
"id": "9c8b7a6d-5432-1098-76ab-fedcba987654",
"fullname": "John Doe",
"email": "john.doe@example.com",
"phone": "+1234567890",
"number": "A-101",
"address": "123 Main Street, Apt 101",
"comunidades": ["1a2b3c4d-5678-90ab-cdef-1234567890ab"],
"comunidad": {
"id": "1a2b3c4d-5678-90ab-cdef-1234567890ab",
"nombre": "Sunset Community",
"direccion": "123 Main Street",
"email": "info@sunsetcommunity.com",
"phone": "+1234567890",
"tipoComunidad": "Residential",
"cantidadViviendas": 150
},
"comunidadesCompletas": [
{
"id": "1a2b3c4d-5678-90ab-cdef-1234567890ab",
"nombre": "Sunset Community",
"direccion": "123 Main Street",
"email": "info@sunsetcommunity.com",
"phone": "+1234567890",
"tipoComunidad": "Residential",
"cantidadViviendas": 150
}
]
}
}
| Status Code | Code | Description |
|---|---|---|
| 400 | VALIDATION_ERROR | Missing or invalid request parameters |
| 401 | UNAUTHORIZED | Invalid username or password |
| 500 | INTERNAL_ERROR | Internal server error |