Skip to main content

Locations API

Auto-generated from the OpenAPI spec. Run node docs-site/scripts/fetch-openapi.js to regenerate.

GET /api/v1/locations​

List Locations

Parameters

NameInRequiredTypeDescription
include_inactivequeryNoboolean
statusqueryNo"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.
removedqueryNobooleanDefault false excludes removed locations. true shows only removed locations (the "Removed" tab), regardless of include_inactive.
searchqueryNo
pagequeryNointeger
page_sizequeryNointeger

Responses

  • 200 — Successful Response
  • 422 — Validation Error

POST /api/v1/locations​

Create Location

Request body

FieldRequiredTypeDescription
nameYesstring
addressNostring
latitudeNonumber
longitudeNonumber
phoneNostring

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

NameInRequiredTypeDescription
location_idpathYesinteger

Request body

FieldRequiredTypeDescription
nameNostring
addressNostring
latitudeNonumber
longitudeNonumber
phoneNostring
is_activeNoboolean

Responses

  • 200 — Successful Response
  • 422 — Validation Error

DELETE /api/v1/locations/{location_id}​

Deactivate Location

Parameters

NameInRequiredTypeDescription
location_idpathYesinteger

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

NameInRequiredTypeDescription
location_idpathYesinteger

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

NameInRequiredTypeDescription
location_idpathYesinteger

Responses

  • 200 — Successful Response
  • 409 LOCATION_NOT_REMOVED — This location has not been removed.
  • 422 — Validation Error