# TourCockpit API 1.0.0

Base URL `https://tourcockpit.com/api/v1`. Bearer API keys (see https://tourcockpit.com/auth.md). The contract is the OpenAPI 3.1 document at https://tourcockpit.com/api/openapi.json; the interactive reference is at https://tourcockpit.com/api/docs. Every endpoint below is generated from that document.

## Endpoints

- `GET /api/v1/tours`: List tours
- `POST /api/v1/tours`: Create a tour
- `GET /api/v1/tours/{id}`: Get a tour
- `PATCH /api/v1/tours/{id}`: Update a tour
- `POST /api/v1/tours/{id}/archive`: Archive a tour
- `GET /api/v1/schedule`: List scheduled instances in a date range
- `PUT /api/v1/schedule/instances`: Place (or reactivate) a tour on a date
- `POST /api/v1/schedule/instances/{id}/cancel`: Cancel a scheduled instance
- `GET /api/v1/bookings`: List bookings
- `POST /api/v1/bookings`: Create a booking
- `GET /api/v1/bookings/{id}`: Get a booking
- `PATCH /api/v1/bookings/{id}`: Update a booking
- `POST /api/v1/bookings/{id}/move`: Move a booking to another instance
- `POST /api/v1/bookings/{id}/cancel`: Cancel a booking
- `GET /api/v1/daily-board`: The Daily Operations Board for a date
- `GET /api/v1/reference/hotels`: List hotels (all=true is manager-only)
- `POST /api/v1/reference/hotels`: Create a hotel
- `PATCH /api/v1/reference/hotels/{id}`: Update a hotel
- `POST /api/v1/reference/hotels/{id}/active`: Retire or restore a hotel
- `GET /api/v1/reference/zones`: List pickup zones in driving order (all=true is manager-only)
- `POST /api/v1/reference/zones`: Create a pickup zone
- `PATCH /api/v1/reference/zones/{id}`: Rename a pickup zone (hotels and grid rows keep pointing at it)
- `POST /api/v1/reference/zones/{id}/active`: Retire or restore a pickup zone
- `GET /api/v1/reference/pickup-times`: The times this company offers (includeRetired=1 is manager-only)
- `POST /api/v1/reference/pickup-times`: Add a pickup time (409 when the company already offers it)
- `PATCH /api/v1/reference/pickup-times/{id}`: Retire or restore a pickup time (rows already holding it keep it)
- `GET /api/v1/reference/tour-zone-pickup-times`: The tour-by-zone pickup grid: every set cell
- `PUT /api/v1/reference/tour-zone-pickup-times`: Replace the whole pickup grid (every time must be one the company offers)
- `GET /api/v1/reference/tour-zone-prices`: The tour-by-zone price grid: every cell the office has overridden
- `PUT /api/v1/reference/tour-zone-prices`: Replace the whole price grid (one bad cell rejects the lot)
- `GET /api/v1/reference/operators`: List operators (all=true is manager-only)
- `POST /api/v1/reference/operators`: Create an operator
- `PATCH /api/v1/reference/operators/{id}`: Update an operator
- `POST /api/v1/reference/operators/{id}/active`: Retire or restore an operator
- `GET /api/v1/reference/drivers`: List the guides and drivers (GUÍA and CHOFER roster) with the languages they speak (all=true is manager-only)
- `GET /api/v1/reference/vehicles`: List the FURGO fleet with each van's seats (all=true is manager-only)
- `GET /api/v1/reference/languages`: List languages
- `GET /api/v1/reports/monthly`: Monthly RIEPILOGO rollup
- `GET /api/v1/audit`: Activity log (change history)
- `GET /api/v1/company`: Get the company and its policy settings
- `PATCH /api/v1/company`: Update company policy settings
- `POST /api/v1/api-keys`: Mint an API key (raw key shown once)
- `GET /api/v1/api-keys`: List API keys (metadata only)
- `POST /api/v1/api-keys/{id}/revoke`: Revoke an API key
- `GET /api/v1/users`: List users (optionally filtered by operator)
- `POST /api/v1/users`: Invite a user (office MANAGER, or OPERATOR when tourOperatorId is set)
- `PATCH /api/v1/users/{id}`: Update a user (name, active)
- `GET /api/v1/operator/board`: The operator's restricted board for a date
- `POST /api/v1/operator/bookings`: Add a booking for the operator
- `PATCH /api/v1/operator/bookings/{id}`: Edit one of the operator's own bookings
- `POST /api/v1/operator/bookings/{id}/cancel`: Cancel one of the operator's own bookings, up to the company's cancellation notice (409 PAST_CANCELLATION_NOTICE after it)
- `GET /api/daily-board/pdf`: Daily Operations Board as a PDF (non-versioned, binary)
