curl --request GET \
--url https://api.example.com/api/clients{
"user_id": "<string>",
"email": "<string>",
"name": "<string>",
"surname": "<string>",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"postal_code": "<string>",
"gender": "<string>",
"birth_date": "<string>",
"role": "<string>",
"status": "<string>",
"avatar": "<string>",
"document_type": "<string>",
"document_number": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"_count": {
"client_bookings": 123,
"consents": 123,
"debts": 123
},
"statusCode": 123,
"statusMessage": "<string>"
}Retrieve a list of all clients with optional search filtering
curl --request GET \
--url https://api.example.com/api/clients{
"user_id": "<string>",
"email": "<string>",
"name": "<string>",
"surname": "<string>",
"phone": "<string>",
"address": "<string>",
"city": "<string>",
"country": "<string>",
"postal_code": "<string>",
"gender": "<string>",
"birth_date": "<string>",
"role": "<string>",
"status": "<string>",
"avatar": "<string>",
"document_type": "<string>",
"document_number": "<string>",
"created_at": "<string>",
"updated_at": "<string>",
"_count": {
"client_bookings": 123,
"consents": 123,
"debts": 123
},
"statusCode": 123,
"statusMessage": "<string>"
}USER role (clients) in the system. Supports optional text search across multiple fields. The response includes booking, consent, and debt counts for each client.
search=john will match clients with “John” in their name, surname, email, or phone.USER for clients (enum: ADMIN, USER)ON, OFF). Default is ONDNI, PASSPORT, NIE). Default is DNIcurl --request GET \
--url 'https://your-domain.com/api/clients' \
--header 'Cookie: your-session-token'
curl --request GET \
--url 'https://your-domain.com/api/clients?search=maria' \
--header 'Cookie: your-session-token'
[
{
"user_id": "550e8400-e29b-41d4-a716-446655440000",
"email": "[email protected]",
"name": "Maria",
"surname": "Garcia",
"phone": "+34612345678",
"address": "Calle Mayor 123",
"city": "Madrid",
"country": "Spain",
"postal_code": "28013",
"gender": "female",
"birth_date": "1990-05-15",
"role": "USER",
"status": "ON",
"avatar": "",
"document_type": "DNI",
"document_number": "12345678A",
"created_at": "2024-01-15T10:30:00.000Z",
"updated_at": "2024-03-01T14:20:00.000Z",
"_count": {
"client_bookings": 12,
"consents": 2,
"debts": 0
}
}
]
{
"statusCode": 500,
"statusMessage": "Error al obtener clientes"
}
role: 'USER' to exclude admin userscreated_at in descending order (newest first)password field is always excluded from responsesserver/api/clients/index.get.ts