Locations API
Auto-generated from the OpenAPI spec. Run
node docs-site/scripts/fetch-openapi.jsto regenerate.
GET /api/v1/locations
List Locations
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
include_inactive | query | No | boolean | |
status | query | No | "active" | "inactive" | "all". Takes precedence over include_inactive when provided — "inactive" is evaluated fully server-side, so the response's total/pagination reflect the filtered count rather than the broad set. Omit to keep today's include_inactive-only behavior. | |
removed | query | No | boolean | Default false excludes removed locations. true shows only removed locations (the "Removed" tab), regardless of include_inactive. |
search | query | No | ||
page | query | No | integer | |
page_size | query | No | integer |
Responses
- 200 — Successful Response
- 422 — Validation Error
POST /api/v1/locations
Create Location
Request body
| Field | Required | Type | Description |
|---|---|---|---|
name | Yes | string | |
address | No | string | |
latitude | No | number | |
longitude | No | number | |
phone | No | string |
Responses
- 201 — Successful Response
- 422 — Validation Error
GET /api/v1/locations/public
List Locations Public
Minimal location picker for ANY authenticated role (client or
instructor, not just manager) — e.g. the mobile app's classes/bookings/
appointments location filter. Deliberately separate from the manager-only
GET /api/v1/locations above rather than widening that endpoint's auth:
this route is intentionally narrow — active, non-removed locations only,
id+name only, no search/pagination/include_inactive params. A GET on a
literal /public path is registered on this router; there is no
GET /\{location_id\} route on this router (only PUT/DELETE/PATCH use that
path shape, which are different HTTP methods and so can never shadow this
one), so there is no FastAPI route-ordering hazard here.
Responses
- 200 — Successful Response
PUT /api/v1/locations/{location_id}
Update Location
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
location_id | path | Yes | integer |
Request body
| Field | Required | Type | Description |
|---|---|---|---|
name | No | string | |
address | No | string | |
latitude | No | number | |
longitude | No | number | |
phone | No | string | |
is_active | No | boolean |
Responses
- 200 — Successful Response
- 422 — Validation Error
DELETE /api/v1/locations/{location_id}
Deactivate Location
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
location_id | path | Yes | integer |
Responses
- 204 — Successful Response
- 422 — Validation Error
DELETE /api/v1/locations/{location_id}/remove
Remove Location
Soft-delete a location. Never blocked by historical references.
Removed locations are hidden from the default/active list but remain in
the DB (visible via GET /locations?removed=true) and can be restored
via PATCH /restore — every scheduled class / historical record that
references this location keeps resolving correctly either way.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
location_id | path | Yes | integer |
Responses
- 204 — Successful Response
- 409
LOCATION_ALREADY_REMOVED— This location has already been removed. - 422 — Validation Error
PATCH /api/v1/locations/{location_id}/restore
Restore Location
Clears removed_at, moving the location back out of the "Removed" tab
and into the normal active/inactive lists.
Parameters
| Name | In | Required | Type | Description |
|---|---|---|---|---|
location_id | path | Yes | integer |
Responses
- 200 — Successful Response
- 409
LOCATION_NOT_REMOVED— This location has not been removed. - 422 — Validation Error