Clientes (CRM)
Base path: /api/crm
GET /crm/clients
Get all clients.
Auth: Logged in
Query parameters:
| Parameter | Type | Description |
|---|---|---|
search | string | Search by name, email or phone |
page | integer | Page number |
Response: Array of Client objects, or paginated object. Soft-deleted clients are filtered out.
POST /crm/clients
Create a new client.
Auth: Logged in
Request body:
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Full name |
first_name | string | No | First name |
last_name | string | No | Last name |
email | string | No | Email address |
phone | string | No | Phone number |
mobile | string | No | Mobile number |
gender | string | No | Gender |
birthdate | date | No | Date of birth |
address | string | No | Address |
postcode | string | No | Postcode |
city | string | No | City |
labels | string | No | Labels (e.g. "VIP") |
alert_note | string | No | Allergy/warning — shown in orange |
notes | string | No | Notes |
receive_receipt_email | 0/1 | No | Receipt by email |
GET /crm/clients/:id
Get a single client.
Errors: 404 — Not found
PUT /crm/clients/:id
Update a client.
DELETE /crm/clients/:id
Delete a client (soft delete — sets deleted_at).
GET /crm/clients/:id/bookings
Get appointments for a specific client.
GET /crm/clients/:id/ledger
Financial overview (transaction history) for a client.
GET /crm/export
Export client list as CSV.
Auth: Admin