Clients API
Auto-generated from the OpenAPI spec. Run
node docs-site/scripts/fetch-openapi.jsto regenerate.
GET /api/v1/clients/me
Get Own Profile
Responses
- 200 — Successful Response
PUT /api/v1/clients/me
Update Own Profile
Request body
| Field | Required | Type | Description |
|---|---|---|---|
full_name | No | string | |
phone | No | string | |
date_of_birth | No | string | |
notes | No | string | |
billing_name | No | string | |
billing_address | No | string | |
tax_id | No | string | |
is_active | No | boolean |
Responses
- 200 — Successful Response
- 422 — Validation Error
PUT /api/v1/clients/me/push-token
Update Push Token
Responses
- 200 — Successful Response
- 422 — Validation Error
GET /api/v1/clients
List Clients
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
search | query | No | ||
active_only | query | No | boolean | |
page | query | No | integer | |
page_size | query | No | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
POST /api/v1/clients
Create Client
Create a client from the backoffice (no password yet). Sends invitation email.
Request body
| Field | Required | Type | Description |
|---|---|---|---|
full_name | Yes | string | |
email | Yes | string | |
phone | No | string |
Responses
- 201 — Successful Response
- 422 — Validation Error
GET /api/v1/clients/{client_id}
Get Client
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
client_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
PUT /api/v1/clients/{client_id}
Update Client
Update a client's profile.
Also doubles as the genuine, reversible deactivate/reactivate path:
passing is_active: false/true flips the flag directly, leaving
full_name/email/phone/date_of_birth/notes untouched — same generic-PUT-
reactivation convention as locations/class_templates/membership_types/
products/promo_codes/waivers/staff-pay-components/gift-cards in this
codebase. This is deliberately distinct from anonymize_client (DELETE
/clients/{id} below), which is an irreversible GDPR action that wipes PII
and always sets is_active=False as a side effect — that endpoint is
unchanged by this addition and remains independently reachable.
Downstream effect: Client.is_active is already enforced at the
authentication boundary (app/auth.py::get_current_client and the login
handlers in app/routers/auth.py both reject an inactive client with
"not found or inactive" / AUTH_ACCOUNT_INACTIVE). So deactivating a
client here immediately blocks their next login and invalidates any
already-issued token's client-facing endpoints on next use; reactivating
restores both. No new authorization logic was added — this only feeds
into that existing check. Booking creation itself is not separately
gated on Client.is_active (a manager booking on a client's behalf via
POST /bookings does not check it), but that's an existing gap unrelated
to this endpoint, not something this task should build out.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
client_id | path | Yes | integer |
Request body
| Field | Required | Type | Description |
|---|---|---|---|
full_name | No | string | |
phone | No | string | |
date_of_birth | No | string | |
notes | No | string | |
billing_name | No | string | |
billing_address | No | string | |
tax_id | No | string | |
is_active | No | boolean |
Responses
- 200 — Successful Response
- 422 — Validation Error
DELETE /api/v1/clients/{client_id}
Anonymize Client
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
client_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
POST /api/v1/clients/{client_id}/photo
Upload Client Photo
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
client_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
DELETE /api/v1/clients/{client_id}/photo
Remove Client Photo
Clear a client's profile photo without uploading a replacement.
Idempotent: calling this when no photo is set is a no-op success, not a 404 — the end state (no photo) is what the caller asked for either way.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
client_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
GET /api/v1/clients/{client_id}/bookings
Get Client Bookings
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
client_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
GET /api/v1/clients/{client_id}/memberships
Get Client Memberships
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
client_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error