{
  "openapi": "3.1.0",
  "info": {
    "title": "Stage Fleet Services API",
    "version": "1.0.0",
    "summary": "Fleet services, on cue.",
    "description": "The Stage Fleet Services API gives fleets access to services across the PMC network of locations. **Register your fleet. Request services.** Search for a service near your vehicle, reserve it, and manage the reservation from check-in to check-out.\n\n1. **Register your fleet**: add vehicles with `POST /vehicles` or in batches of up to 1,000.\n2. **Request services**: list the catalog with `GET /services`, search for locations offering a service with `GET /locations`, reserve it with `POST /reservations`, and follow the reservation through check-in and check-out.\n\n## Authentication\n\nSend a secret API key from the dashboard as a bearer token: `Authorization: Bearer <API key>`. Only bearer authentication is supported. Keys are opaque strings; do not rely on their length or format. Keys are for servers only; never ship them in apps or browsers.\n\n## Workspaces\n\nEach API key belongs to exactly one workspace of your fleet. A workspace is `sandbox` or `production`:\n\n- The **sandbox** workspace is for building and testing: locations mirror real ones, sandbox reservations use the sandbox's own capacity, and nothing is sent to a location. You get it when your fleet signs up.\n- The **production** workspace holds your real vehicles and reservations. PMC creates it when it approves your fleet.\n\nKeys look the same in both: the workspace a key belongs to decides whether a request works on sandbox or production data. Create keys in the workspace you want them to act on.\n\nBoth use the same base URL. Workspaces never share data: every object carries `livemode` (`true` in the production workspace), and an ID from another workspace returns `404 not_found`. `GET /account` shows the key's `workspace`.\n\n## Base URL\n\nThere is one base URL, `https://fleet.parkingmgt.com/fleet/v1`, for sandbox and production workspaces alike. During early access, your base URL is shown in the dashboard instead.\n\n## Requests\n\n- JSON bodies and responses, with snake_case fields. IDs are UUIDs; treat them as opaque strings.\n- Times are ISO-8601, returned in UTC.\n- Lists are cursor-paginated: pass `limit` and the previous page's `next_cursor` as `cursor`.\n- Mutating `POST`s accept an `Idempotency-Key`. Retrying with the same key within 24 hours returns the original response instead of acting twice.\n- Mutable resources return an `ETag`. Send it as `If-Match` on `PATCH` to avoid overwriting a concurrent change (`412 precondition_failed`).\n- Every response carries a `Request-Id` header (also `request_id` in errors). Include it when you contact support.\n- Rate limits apply per API key: 25 requests per second for keys of a sandbox workspace, 100 for keys of the production workspace. Over the limit you get `429 rate_limited` with `Retry-After` and `RateLimit-*` headers; `GET /account` shows your key's limit.\n\n## Errors\n\nErrors use RFC 9457 problem details with `Content-Type: application/problem+json`. The exception is `401`: authentication is checked before the request reaches Stage, so its body may not be problem+json. Branch on `code`, which is stable; `title` and `detail` are for people. `type` links to this section. Validation errors add `errors[]`, one entry per field (`field` as a dot path, `message`, `code`).\n\n```json\n{\n  \"type\": \"https://fleet.parkingmgt.com/docs/reference?error=capacity-unavailable#description/errors\",\n  \"title\": \"Capacity unavailable\",\n  \"status\": 409,\n  \"detail\": \"No capacity left for parking at eec93d2d-5729-441b-99b2-f764872ca895 between 2026-11-02T15:00:00Z and 2026-11-02T16:00:00Z.\",\n  \"instance\": \"/fleet/v1/reservations\",\n  \"code\": \"capacity_unavailable\",\n  \"request_id\": \"c4a1e9b2-7f3d-4e58-9a06-2b8d5f1c3e74\"\n}\n```\n\n| Code | Status | Meaning | What to do |\n|---|---|---|---|\n| `invalid_request` | 400 | The request could not be parsed: malformed JSON, an unsupported content type, or a malformed header. | Send `Content-Type: application/json` with a valid JSON body and check header formats. |\n| `validation_failed` | 400 | One or more fields failed validation, for example `end_at` is not after `start_at`. `errors[]` lists each field (as a dot path) with a message. | Fix the fields listed in `errors[]`. Request bodies are strict, so unknown fields are rejected too. |\n| `unauthorized` | 401 | The `Authorization` header is missing, malformed, or holds an unknown or revoked key. Authentication is checked before the request reaches Stage, so the body of a `401` may not be problem+json: branch on the status. | Send `Authorization: Bearer <API key>` with an active key from the dashboard. |\n| `forbidden` | 403 | The key is valid but the fleet may not make this request: the fleet is `pending` or `suspended`. | Contact your PMC representative about the fleet's status. |\n| `insufficient_scope` | 403 | The key does not have the scope the endpoint requires. | Create a key with the required scope. A `:write` scope implies the matching `:read` scope. |\n| `not_found` | 404 | The resource does not exist in the key's workspace. Workspaces never share data, so an ID from another workspace (for example a sandbox ID sent with a production key) is not found. | Check the ID, and that the key belongs to the workspace the resource was created in. |\n| `conflict` | 409 | The request conflicts with current state, for example the vehicle already has an overlapping reservation, or a vehicle with active reservations is being deleted. Rarely, under heavy load, concurrent requests kept changing the same capacity or reservation until Stage stopped retrying; nothing was changed. | Fetch the resource, resolve the conflict, and retry. When nothing conflicts (the detail says a concurrent request touched the same items), retry with a new `Idempotency-Key`. |\n| `idempotency_key_reused` | 409 | The `Idempotency-Key` was already used with a different request body. | Use a new key for each distinct request. Reuse a key only to retry the identical request. |\n| `capacity_unavailable` | 409 | The location has no capacity left for the service for some part of the requested time. | Try the next location, or another time. Search with `start_at` and `end_at` to see `available` first. |\n| `invalid_state_transition` | 409 | The action is not allowed in the reservation's current status, for example cancelling a `checked_in` reservation, or checking in before check-in opens (30 minutes before `start_at`) or after `end_at`. | Retrieve the reservation and check its `status` and times before retrying. |\n| `duplicate_vehicle` | 409 | A vehicle with this `external_id`, or an active vehicle with this plate, already exists in this workspace. | Update the existing vehicle, or use the batch endpoint with `upsert: true`. |\n| `precondition_failed` | 412 | The `If-Match` header does not match the resource's current `ETag`: it changed since you read it. | Retrieve the resource again, reapply your change, and send the new `ETag`. |\n| `unprocessable` | 422 | The request is well formed but cannot be fulfilled as asked. | Read `detail` and `errors[]` for the specific reason. |\n| `outside_operating_hours` | 422 | The requested time does not fit the location's operating hours. | Check `hours` on the location (in its `timezone`) and request a time inside them, or pick a location that is always open. |\n| `vehicle_not_eligible` | 422 | The vehicle cannot be used for this request, for example it is `inactive`. | Retrieve the vehicle and check its `status`. Set it `active` with `PATCH /vehicles/{id}`, or create the reservation for another vehicle. |\n| `service_not_offered` | 422 | The location does not offer the requested service to your fleet. | Check `services[]` on the location, or search with `service_id` set. |\n| `service_not_available` | 422 | Your fleet cannot use the requested service: it is not in the services `GET /services` lists for your fleet (PMC has paused it, it is not enabled for your fleet, or the key is unknown). Existing reservations for it are not affected. | Call `GET /services` and pass one of the listed `id`s as `service_id`. Contact your PMC representative to enable a service for your fleet. |\n| `rate_limited` | 429 | The key exceeded its rate limit. | Wait `Retry-After` seconds, then retry. Watch the `RateLimit-*` headers to pace requests. |\n| `internal_error` | 500 | Something went wrong on our side. | Retry with backoff and the same `Idempotency-Key`. If it persists, contact support with the `request_id`. |\n| `service_unavailable` | 503 | Stage is temporarily unavailable or busy (for example during a traffic surge); nothing was changed. | Retry after `Retry-After` seconds (with exponential backoff) and the same `Idempotency-Key`. |\n\nNew codes may be added; handle an unknown code by its HTTP status. Retry network errors, `429`, `500`, and `503` with backoff and the same `Idempotency-Key`. Fix other `4xx` errors before retrying.",
    "contact": {
      "name": "Stage",
      "url": "https://fleet.parkingmgt.com/docs"
    }
  },
  "servers": [
    {
      "url": "https://fleet.parkingmgt.com/fleet/v1",
      "description": "Stage Fleet Services API v1"
    }
  ],
  "security": [
    {
      "ApiKeyAuth": []
    }
  ],
  "tags": [
    {
      "name": "Account",
      "description": "Who is calling: the fleet, workspace, API key, and rate limit behind a request. Call it at startup as an integration health check."
    },
    {
      "name": "Services",
      "description": "The services your fleet can reserve across the PMC network. PMC owns the catalog and decides which services each fleet can use."
    },
    {
      "name": "Locations",
      "description": "Search for PMC locations that offer a service near a point, with availability for the time you need."
    },
    {
      "name": "Reservations",
      "description": "Reserve a service at a location for a vehicle, then follow the reservation through check-in and check-out. Change or cancel it as plans change."
    },
    {
      "name": "Vehicles",
      "description": "Register your fleet one vehicle at a time or in batches of up to 1,000, and delete vehicles in bulk."
    },
    {
      "name": "Webhooks",
      "description": "Signed reservation status notifications. Manage endpoints here; send test events and rotate signing secrets in the dashboard."
    }
  ],
  "components": {
    "headers": {
      "RequestId": {
        "description": "Unique request identifier (a UUID). Include it when contacting support.",
        "schema": {
          "type": "string",
          "example": "c4a1e9b2-7f3d-4e58-9a06-2b8d5f1c3e74"
        }
      },
      "ETag": {
        "description": "Entity tag of the returned resource. Send as `If-Match` to make a conditional update.",
        "schema": {
          "type": "string",
          "example": "\"3\""
        }
      },
      "RetryAfter": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer",
          "example": 1
        }
      },
      "RateLimitLimit": {
        "schema": {
          "type": "integer",
          "example": 100
        }
      },
      "RateLimitRemaining": {
        "schema": {
          "type": "integer",
          "example": 0
        }
      },
      "RateLimitReset": {
        "schema": {
          "type": "integer",
          "example": 1
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is malformed or failed validation (`invalid_request`, `validation_failed`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Missing, invalid, or revoked credentials (`unauthorized`). Authentication is checked before the request reaches Stage, so the body is best-effort and may not be problem+json.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Forbidden": {
        "description": "The key lacks the required scope, or the fleet may not make this request (`insufficient_scope`, `forbidden`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource does not exist in the key's workspace (`not_found`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Conflict": {
        "description": "The request conflicts with current state (`conflict`, `capacity_unavailable`, `invalid_state_transition`, `idempotency_key_reused`, `duplicate_vehicle`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "PreconditionFailed": {
        "description": "`If-Match` did not match the current `ETag` (`precondition_failed`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "Unprocessable": {
        "description": "The request is valid but cannot be fulfilled (`unprocessable`, `outside_operating_hours`, `vehicle_not_eligible`, `service_not_offered`).",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "Rate limit exceeded (`rate_limited`). Retry after `Retry-After` seconds.",
        "headers": {
          "Request-Id": {
            "$ref": "#/components/headers/RequestId"
          },
          "Retry-After": {
            "$ref": "#/components/headers/RetryAfter"
          },
          "RateLimit-Limit": {
            "$ref": "#/components/headers/RateLimitLimit"
          },
          "RateLimit-Remaining": {
            "$ref": "#/components/headers/RateLimitRemaining"
          },
          "RateLimit-Reset": {
            "$ref": "#/components/headers/RateLimitReset"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Problem"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "ApiKeyAuth": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "API key",
        "description": "Secret API key from the Stage dashboard. Each key belongs to exactly one workspace, which decides whether requests act on sandbox or production data."
      }
    },
    "schemas": {
      "FieldError": {
        "type": "object",
        "properties": {
          "field": {
            "type": "string",
            "description": "Dot path of the offending field.",
            "example": "end_at"
          },
          "message": {
            "type": "string",
            "example": "Must be after start_at"
          },
          "code": {
            "type": "string",
            "example": "custom"
          }
        },
        "required": [
          "field",
          "message"
        ]
      },
      "Problem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string",
            "description": "URI identifying the problem type. It opens the Errors section of the API reference.",
            "example": "https://fleet.parkingmgt.com/docs/reference?error=validation-failed#description/errors"
          },
          "title": {
            "type": "string",
            "example": "Validation failed"
          },
          "status": {
            "type": "integer",
            "minimum": 400,
            "maximum": 599,
            "example": 400
          },
          "detail": {
            "type": "string",
            "example": "The request body is invalid."
          },
          "instance": {
            "type": "string",
            "example": "/fleet/v1/reservations"
          },
          "code": {
            "type": "string",
            "description": "Stable machine-readable code. One of: `invalid_request`, `validation_failed`, `unauthorized`, `forbidden`, `insufficient_scope`, `not_found`, `conflict`, `idempotency_key_reused`, `capacity_unavailable`, `invalid_state_transition`, `duplicate_vehicle`, `precondition_failed`, `unprocessable`, `outside_operating_hours`, `vehicle_not_eligible`, `service_not_offered`, `service_not_available`, `rate_limited`, `internal_error`, `service_unavailable`.",
            "example": "validation_failed"
          },
          "request_id": {
            "type": "string",
            "description": "The request ID (a UUID), the same value as the `Request-Id` header.",
            "example": "c4a1e9b2-7f3d-4e58-9a06-2b8d5f1c3e74"
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "code",
          "request_id"
        ],
        "description": "RFC 9457 problem details (`application/problem+json`)."
      },
      "ReservationStatus": {
        "type": "string",
        "enum": [
          "confirmed",
          "checked_in",
          "completed",
          "cancelled",
          "no_show",
          "expired"
        ],
        "description": "Lifecycle: `confirmed` → `checked_in` → `completed`. Terminal alternatives: `cancelled`, `no_show`, `expired`."
      },
      "AccessMethod": {
        "type": "string",
        "enum": [
          "open"
        ],
        "description": "How a vehicle enters the location and how the reservation is checked in and out. `open`: the vehicle drives in, and your system checks the reservation in and out via the API."
      },
      "ReservationAccess": {
        "type": "object",
        "properties": {
          "method": {
            "$ref": "#/components/schemas/AccessMethod"
          },
          "plate": {
            "type": [
              "string",
              "null"
            ],
            "description": "Plate authorized for the reservation when the access method needs one. Null for `open` access.",
            "example": null
          },
          "instructions": {
            "type": [
              "string",
              "null"
            ],
            "example": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\". Check in and out through the API."
          }
        },
        "required": [
          "method",
          "plate",
          "instructions"
        ],
        "description": "How the vehicle enters the location, copied from the location when the reservation is made."
      },
      "ServiceEventSource": {
        "type": "string",
        "enum": [
          "api",
          "admin",
          "system"
        ],
        "description": "Who recorded the change. `api`: your system (or your team in the Fleet Console). `admin`: PMC staff. `system`: Stage itself, for example a no-show or an overstay found by the reservation sweeper."
      },
      "Metadata": {
        "type": "object",
        "additionalProperties": {
          "type": "string",
          "maxLength": 500
        },
        "description": "Free-form string key/value pairs (up to 50 keys, keys ≤ 40 chars, values ≤ 500 chars).",
        "example": {
          "driver_shift": "night"
        }
      },
      "Reservation": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "reservation"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The reservation's ID (UUID).",
            "example": "ee8aced1-100f-45fa-a267-8fa27978f9e3"
          },
          "status": {
            "$ref": "#/components/schemas/ReservationStatus"
          },
          "location": {
            "type": "string",
            "format": "uuid",
            "description": "The location's ID (UUID).",
            "example": "eec93d2d-5729-441b-99b2-f764872ca895"
          },
          "vehicle": {
            "type": "string",
            "format": "uuid",
            "description": "The vehicle's ID (UUID).",
            "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
          },
          "service_id": {
            "type": "string",
            "format": "uuid",
            "description": "The catalog service's ID (UUID), as listed by `GET /services`.",
            "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
          },
          "start_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "end_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the vehicle will be done. Null for an open-ended reservation (created without `end_at`): the vehicle stays until it checks out, and `hold_until` tells how long capacity is held.",
            "example": "2026-11-02T14:00:00Z"
          },
          "hold_until": {
            "type": "string",
            "format": "date-time",
            "description": "Capacity is held for the vehicle until this time, and check-in closes then. Equal to `end_at` when the reservation has an end. For an open-ended reservation: `start_at` plus the first hold period (a few hours), or earlier when the location closes first; while the vehicle is checked in, Stage extends the hold an hour at a time as long as capacity allows (`reservation.updated`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "access": {
            "$ref": "#/components/schemas/ReservationAccess"
          },
          "checked_in_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "check_in_source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ServiceEventSource"
              },
              {
                "type": "null"
              }
            ]
          },
          "checked_out_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "check_out_source": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ServiceEventSource"
              },
              {
                "type": "null"
              }
            ]
          },
          "cancelled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "cancellation_reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "Reason given when the reservation was cancelled or marked a no-show."
          },
          "external_reference": {
            "type": [
              "string",
              "null"
            ],
            "example": "trip-88213"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "livemode": {
            "type": "boolean",
            "description": "True for data in a production workspace, false for a sandbox workspace."
          }
        },
        "required": [
          "object",
          "id",
          "status",
          "location",
          "vehicle",
          "service_id",
          "start_at",
          "end_at",
          "hold_until",
          "access",
          "checked_in_at",
          "check_in_source",
          "checked_out_at",
          "check_out_source",
          "cancelled_at",
          "cancellation_reason",
          "external_reference",
          "metadata",
          "updated_at",
          "created_at",
          "livemode"
        ]
      },
      "ReservationWebhookEvent": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "event"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The webhook event's ID (UUID).",
            "example": "aaadd77c-987a-46da-9d5f-b5cd96803a0a"
          },
          "api_version": {
            "type": "string",
            "example": "2026-11-01"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "livemode": {
            "type": "boolean",
            "description": "True for data in a production workspace, false for a sandbox workspace."
          },
          "type": {
            "type": "string",
            "enum": [
              "reservation.confirmed",
              "reservation.updated",
              "reservation.checked_in",
              "reservation.completed",
              "reservation.cancelled",
              "reservation.no_show",
              "reservation.expired"
            ]
          },
          "data": {
            "type": "object",
            "properties": {
              "object": {
                "$ref": "#/components/schemas/Reservation"
              }
            },
            "required": [
              "object"
            ]
          }
        },
        "required": [
          "object",
          "id",
          "api_version",
          "created_at",
          "livemode",
          "type",
          "data"
        ]
      },
      "WebhookEvent": {
        "oneOf": [
          {
            "$ref": "#/components/schemas/ReservationWebhookEvent"
          }
        ],
        "discriminator": {
          "propertyName": "type",
          "mapping": {
            "reservation.confirmed": "#/components/schemas/ReservationWebhookEvent",
            "reservation.updated": "#/components/schemas/ReservationWebhookEvent",
            "reservation.checked_in": "#/components/schemas/ReservationWebhookEvent",
            "reservation.completed": "#/components/schemas/ReservationWebhookEvent",
            "reservation.cancelled": "#/components/schemas/ReservationWebhookEvent",
            "reservation.no_show": "#/components/schemas/ReservationWebhookEvent",
            "reservation.expired": "#/components/schemas/ReservationWebhookEvent"
          }
        },
        "description": "Webhook payload. Signed with HMAC-SHA256 in the `Stage-Signature` header as `t=<unix seconds>,v1=<hex>` over `<t>.<raw body>`. Reject signatures older than 300 seconds."
      },
      "Scope": {
        "type": "string",
        "enum": [
          "locations:read",
          "reservations:read",
          "reservations:write",
          "vehicles:read",
          "vehicles:write",
          "webhooks:read",
          "webhooks:write"
        ],
        "description": "API key permission. A `:write` scope implies the matching `:read` scope."
      },
      "WorkspaceType": {
        "type": "string",
        "enum": [
          "sandbox",
          "production"
        ],
        "description": "`sandbox`: for building and testing (mirrored locations, booked from the sandbox's own capacity). `production`: real locations and vehicles, created when PMC approves the fleet. An API key acts on the workspace it belongs to."
      },
      "FleetStatus": {
        "type": "string",
        "enum": [
          "pending",
          "sandbox",
          "production",
          "suspended"
        ],
        "description": "`sandbox` fleets have their sandbox workspace only; `production` fleets also have a production workspace."
      },
      "AccountFleet": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The fleet's ID (UUID).",
            "example": "3de8244e-8fcd-44d5-ada3-561ef75e26d2"
          },
          "name": {
            "type": "string",
            "example": "Northside Rideshare Co."
          },
          "status": {
            "$ref": "#/components/schemas/FleetStatus"
          }
        },
        "required": [
          "id",
          "name",
          "status"
        ]
      },
      "AccountWorkspace": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The workspace's ID (UUID).",
            "example": "ec955a02-3694-4138-aac9-c9d361704dee"
          },
          "name": {
            "type": "string",
            "example": "Sandbox"
          },
          "type": {
            "$ref": "#/components/schemas/WorkspaceType"
          }
        },
        "required": [
          "id",
          "name",
          "type"
        ],
        "description": "The workspace the API key belongs to. Each key belongs to exactly one workspace, and workspaces never share data."
      },
      "AccountKey": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The API key's ID (UUID).",
            "example": "4d585f88-af48-4015-ad30-2d74559dc6ec"
          },
          "name": {
            "type": "string",
            "example": "Dispatch backend"
          },
          "mask": {
            "type": "string",
            "description": "The key's first 4 and last 8 characters, safe to log.",
            "example": "e1j0...rlEPUdyY"
          },
          "scopes": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Scope"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When the key stops working; null when it does not expire.",
            "example": "2026-11-02T14:00:00Z"
          }
        },
        "required": [
          "id",
          "name",
          "mask",
          "scopes",
          "created_at",
          "expires_at"
        ],
        "description": "The API key that authenticated the request; null for dashboard sessions."
      },
      "AccountRateLimit": {
        "type": "object",
        "properties": {
          "limit": {
            "type": "integer",
            "minimum": 1,
            "description": "Requests allowed per window for this key (same value as the `RateLimit-Limit` header).",
            "example": 25
          },
          "window_seconds": {
            "type": "integer",
            "minimum": 1,
            "example": 1
          }
        },
        "required": [
          "limit",
          "window_seconds"
        ]
      },
      "Account": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "account"
            ]
          },
          "fleet": {
            "$ref": "#/components/schemas/AccountFleet"
          },
          "workspace": {
            "$ref": "#/components/schemas/AccountWorkspace"
          },
          "livemode": {
            "type": "boolean",
            "description": "True when the workspace is `production`, false when it is `sandbox`."
          },
          "key": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AccountKey"
              },
              {
                "type": "null"
              }
            ]
          },
          "rate_limit": {
            "$ref": "#/components/schemas/AccountRateLimit"
          },
          "api_version": {
            "type": "string",
            "description": "The dated version of response and webhook payload shapes.",
            "example": "2026-11-01"
          }
        },
        "required": [
          "object",
          "fleet",
          "workspace",
          "livemode",
          "key",
          "rate_limit",
          "api_version"
        ],
        "description": "Who is calling: the fleet, workspace, API key, and rate limit behind the request. Use it as an integration health check."
      },
      "CatalogServiceStatus": {
        "type": "string",
        "enum": [
          "available",
          "coming_soon"
        ],
        "description": "`available`: your fleet can search for and reserve the service. `GET /services` lists only available services; `coming_soon` is reserved for announcing services before they open."
      },
      "Service": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "service"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The service's ID (UUID). Pass it as `service_id` when you search for locations, check availability and create reservations.",
            "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
          },
          "name": {
            "type": "string",
            "example": "Parking"
          },
          "description": {
            "type": "string",
            "example": "A space for a vehicle at a location, from a short stay between trips to overnight."
          },
          "status": {
            "$ref": "#/components/schemas/CatalogServiceStatus"
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "description",
          "status"
        ],
        "description": "A service your fleet can reserve. PMC owns the catalog and decides which services each fleet can use."
      },
      "ServiceList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Service"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. Null on the last page."
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "Address": {
        "type": "object",
        "properties": {
          "line1": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "example": "55 E Monroe St"
          },
          "line2": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200,
            "example": null
          },
          "city": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "example": "Chicago"
          },
          "region": {
            "type": "string",
            "minLength": 1,
            "maxLength": 100,
            "description": "State or province code.",
            "example": "IL"
          },
          "postal_code": {
            "type": "string",
            "minLength": 1,
            "maxLength": 20,
            "example": "60603"
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "ISO 3166-1 alpha-2.",
            "example": "US"
          }
        },
        "required": [
          "line1",
          "line2",
          "city",
          "region",
          "postal_code",
          "country"
        ]
      },
      "Coordinates": {
        "type": "object",
        "properties": {
          "lat": {
            "type": "number",
            "minimum": -90,
            "maximum": 90,
            "example": 41.8781
          },
          "lng": {
            "type": "number",
            "minimum": -180,
            "maximum": 180,
            "example": -87.6298
          }
        },
        "required": [
          "lat",
          "lng"
        ]
      },
      "DayHours": {
        "type": "object",
        "properties": {
          "open": {
            "type": "string",
            "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$",
            "example": "06:00"
          },
          "close": {
            "type": "string",
            "pattern": "^(([01]\\d|2[0-3]):[0-5]\\d|24:00)$",
            "description": "Local closing time. `24:00` means midnight; a value earlier than `open` means the window runs past midnight.",
            "example": "22:00"
          }
        },
        "required": [
          "open",
          "close"
        ],
        "description": "Open window in the location time zone. `00:00`–`24:00` is open all day."
      },
      "WeeklyHours": {
        "type": "object",
        "properties": {
          "monday": {
            "$ref": "#/components/schemas/DayHours"
          },
          "tuesday": {
            "$ref": "#/components/schemas/DayHours"
          },
          "wednesday": {
            "$ref": "#/components/schemas/DayHours"
          },
          "thursday": {
            "$ref": "#/components/schemas/DayHours"
          },
          "friday": {
            "$ref": "#/components/schemas/DayHours"
          },
          "saturday": {
            "$ref": "#/components/schemas/DayHours"
          },
          "sunday": {
            "$ref": "#/components/schemas/DayHours"
          }
        },
        "required": [
          "monday",
          "tuesday",
          "wednesday",
          "thursday",
          "friday",
          "saturday",
          "sunday"
        ],
        "description": "Hours per weekday; `null` means closed that day."
      },
      "OperatingHours": {
        "type": "object",
        "properties": {
          "always_open": {
            "type": "boolean",
            "description": "Open 24/7. When true, `weekly` is null."
          },
          "weekly": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WeeklyHours"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "always_open",
          "weekly"
        ],
        "example": {
          "always_open": true,
          "weekly": null
        }
      },
      "LocationService": {
        "type": "object",
        "properties": {
          "service_id": {
            "type": "string",
            "format": "uuid",
            "description": "The catalog service's ID (UUID), as listed by `GET /services`.",
            "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
          },
          "capacity": {
            "type": "integer",
            "minimum": 0,
            "description": "Capacity held for fleets for this service at this location (for example, parking spaces).",
            "example": 40
          },
          "available": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 0,
            "description": "Capacity free for the requested time (or right now if no time was given). Null when not computed.",
            "example": 12
          }
        },
        "required": [
          "service_id",
          "capacity",
          "available"
        ],
        "description": "A service offered at a location."
      },
      "Location": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "location"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The location's ID (UUID).",
            "example": "eec93d2d-5729-441b-99b2-f764872ca895"
          },
          "name": {
            "type": "string",
            "example": "Monroe Street Garage"
          },
          "address": {
            "$ref": "#/components/schemas/Address"
          },
          "coordinates": {
            "$ref": "#/components/schemas/Coordinates"
          },
          "timezone": {
            "type": "string",
            "description": "IANA time zone.",
            "example": "America/Chicago"
          },
          "distance_meters": {
            "type": "number",
            "minimum": 0,
            "description": "Distance from the search point. Present only in geo search results.",
            "example": 420
          },
          "access_method": {
            "$ref": "#/components/schemas/AccessMethod"
          },
          "access_instructions": {
            "type": [
              "string",
              "null"
            ],
            "example": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
          },
          "hours": {
            "$ref": "#/components/schemas/OperatingHours"
          },
          "height_limit_cm": {
            "type": [
              "integer",
              "null"
            ],
            "exclusiveMinimum": 0,
            "description": "Posted clearance in centimeters, for information; null when none is recorded. Stage does not check vehicle height, so compare it with your vehicles yourself.",
            "example": 210
          },
          "amenities": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "example": [
              "restrooms",
              "covered",
              "security"
            ]
          },
          "services": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/LocationService"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "livemode": {
            "type": "boolean",
            "description": "True for data in a production workspace, false for a sandbox workspace."
          }
        },
        "required": [
          "object",
          "id",
          "name",
          "address",
          "coordinates",
          "timezone",
          "access_method",
          "access_instructions",
          "hours",
          "height_limit_cm",
          "amenities",
          "services",
          "created_at",
          "livemode"
        ]
      },
      "LocationList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Location"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. Null on the last page."
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "Availability": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "availability"
            ]
          },
          "location": {
            "type": "string",
            "format": "uuid",
            "description": "The location's ID (UUID).",
            "example": "eec93d2d-5729-441b-99b2-f764872ca895"
          },
          "service_id": {
            "type": "string",
            "format": "uuid",
            "description": "The catalog service's ID (UUID), as listed by `GET /services`.",
            "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
          },
          "start_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "end_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "available": {
            "type": "integer",
            "minimum": 0,
            "description": "Capacity free across the whole requested time (the minimum over that time).",
            "example": 12
          },
          "capacity": {
            "type": "integer",
            "minimum": 0,
            "example": 40
          },
          "bookable": {
            "type": "boolean",
            "description": "True if a reservation for exactly this time would be accepted right now."
          },
          "reason": {
            "type": [
              "string",
              "null"
            ],
            "description": "When `bookable` is false, the error code a reservation would get, such as `capacity_unavailable` or `outside_operating_hours`.",
            "example": null
          }
        },
        "required": [
          "object",
          "location",
          "service_id",
          "start_at",
          "end_at",
          "available",
          "capacity",
          "bookable",
          "reason"
        ]
      },
      "CreateReservationRequest": {
        "type": "object",
        "properties": {
          "location": {
            "type": "string",
            "format": "uuid",
            "description": "The location's ID (UUID).",
            "example": "eec93d2d-5729-441b-99b2-f764872ca895"
          },
          "vehicle": {
            "type": "string",
            "format": "uuid",
            "description": "The vehicle's ID (UUID).",
            "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
          },
          "service_id": {
            "type": "string",
            "format": "uuid",
            "description": "The service to reserve: an `id` from `GET /services` that the location offers. A service your fleet cannot use is `422 service_not_available`.",
            "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
          },
          "start_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the vehicle needs the service. Defaults to now.",
            "example": "2026-11-02T14:00:00Z"
          },
          "end_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the vehicle will be done. Must be after `start_at`. Omit it for an open-ended reservation: the vehicle stays until it checks out (see `hold_until`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "external_reference": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128,
            "description": "Your reference (trip, shift, or job ID).",
            "example": "trip-88213"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        },
        "required": [
          "location",
          "vehicle",
          "service_id"
        ],
        "additionalProperties": false
      },
      "ReservationList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Reservation"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. Null on the last page."
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "UpdateReservationRequest": {
        "type": "object",
        "properties": {
          "start_at": {
            "type": "string",
            "format": "date-time",
            "description": "New start. Only allowed while `confirmed`.",
            "example": "2026-11-02T14:00:00Z"
          },
          "end_at": {
            "type": "string",
            "format": "date-time",
            "description": "New end (extend or shorten). On an open-ended reservation it sets a fixed end (shorter or longer than `hold_until`, but in the future).",
            "example": "2026-11-02T14:00:00Z"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        },
        "additionalProperties": false
      },
      "CancelReservationRequest": {
        "type": "object",
        "properties": {
          "reason": {
            "type": "string",
            "minLength": 1,
            "maxLength": 500,
            "example": "Trip cancelled by rider"
          }
        },
        "additionalProperties": false
      },
      "CheckInRequest": {
        "type": "object",
        "properties": {
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened. Defaults to now.",
            "example": "2026-11-02T14:00:00Z"
          },
          "coordinates": {
            "$ref": "#/components/schemas/Coordinates"
          }
        },
        "additionalProperties": false
      },
      "CheckOutRequest": {
        "type": "object",
        "properties": {
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "When it happened. Defaults to now.",
            "example": "2026-11-02T14:00:00Z"
          },
          "coordinates": {
            "$ref": "#/components/schemas/Coordinates"
          }
        },
        "additionalProperties": false
      },
      "VehicleBodyType": {
        "type": "string",
        "enum": [
          "sedan",
          "suv",
          "minivan",
          "van",
          "truck",
          "other"
        ]
      },
      "FuelType": {
        "type": "string",
        "enum": [
          "gasoline",
          "diesel",
          "hybrid",
          "plug_in_hybrid",
          "electric",
          "hydrogen",
          "other"
        ],
        "description": "What powers the vehicle. The basis for future energy services such as EV charging. On a vehicle, `null` means unknown; omitted on create, it defaults to `null`."
      },
      "VehicleStatus": {
        "type": "string",
        "enum": [
          "active",
          "inactive"
        ]
      },
      "Vehicle": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "vehicle"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The vehicle's ID (UUID).",
            "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
          },
          "external_id": {
            "type": "string",
            "example": "car-1042"
          },
          "plate": {
            "type": "string",
            "example": "7ABC123"
          },
          "plate_state": {
            "type": "string",
            "example": "IL"
          },
          "vin": {
            "type": [
              "string",
              "null"
            ],
            "example": "5YJ3E1EA7KF317000"
          },
          "make": {
            "type": [
              "string",
              "null"
            ],
            "example": "Toyota"
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "example": "Camry"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "example": 2024
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "example": "white"
          },
          "body_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VehicleBodyType"
              },
              {
                "type": "null"
              }
            ]
          },
          "fuel_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FuelType"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_driverless": {
            "type": "boolean",
            "description": "True for a driverless vehicle, one that operates without a human driver."
          },
          "status": {
            "$ref": "#/components/schemas/VehicleStatus"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "livemode": {
            "type": "boolean",
            "description": "True for data in a production workspace, false for a sandbox workspace."
          }
        },
        "required": [
          "object",
          "id",
          "external_id",
          "plate",
          "plate_state",
          "vin",
          "make",
          "model",
          "year",
          "color",
          "body_type",
          "fuel_type",
          "is_driverless",
          "status",
          "metadata",
          "updated_at",
          "created_at",
          "livemode"
        ]
      },
      "CreateVehicleRequest": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9._:\\-/]+$",
            "description": "Your identifier for the vehicle. Unique per fleet.",
            "example": "car-1042"
          },
          "plate": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10,
            "pattern": "^[A-Z0-9][A-Z0-9 -]*$",
            "description": "License plate. Trimmed and uppercased.",
            "example": "7ABC123"
          },
          "plate_state": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Issuing state/province (2 letters). Uppercased.",
            "example": "IL"
          },
          "vin": {
            "type": "string",
            "pattern": "^[A-HJ-NPR-Z0-9]{17}$",
            "example": "5YJ3E1EA7KF317000"
          },
          "make": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50,
            "example": "Toyota"
          },
          "model": {
            "type": "string",
            "minLength": 1,
            "maxLength": 50,
            "example": "Camry"
          },
          "year": {
            "type": "integer",
            "minimum": 1980,
            "maximum": 2100,
            "example": 2024
          },
          "color": {
            "type": "string",
            "minLength": 1,
            "maxLength": 30,
            "example": "white"
          },
          "body_type": {
            "$ref": "#/components/schemas/VehicleBodyType"
          },
          "fuel_type": {
            "allOf": [
              {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/FuelType"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              {
                "default": null
              }
            ]
          },
          "is_driverless": {
            "type": "boolean",
            "default": false,
            "description": "True for a driverless vehicle, one that operates without a human driver. Default `false`."
          },
          "status": {
            "allOf": [
              {
                "$ref": "#/components/schemas/VehicleStatus"
              },
              {
                "default": "active"
              }
            ]
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        },
        "required": [
          "external_id",
          "plate",
          "plate_state"
        ],
        "additionalProperties": false
      },
      "VehicleList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vehicle"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. Null on the last page."
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "UpdateVehicleRequest": {
        "type": "object",
        "properties": {
          "external_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 64,
            "pattern": "^[A-Za-z0-9._:\\-/]+$",
            "description": "Your identifier for the vehicle. Unique per fleet.",
            "example": "car-1042"
          },
          "plate": {
            "type": "string",
            "minLength": 1,
            "maxLength": 10,
            "pattern": "^[A-Z0-9][A-Z0-9 -]*$",
            "description": "License plate. Trimmed and uppercased.",
            "example": "7ABC123"
          },
          "plate_state": {
            "type": "string",
            "pattern": "^[A-Z]{2}$",
            "description": "Issuing state/province (2 letters). Uppercased.",
            "example": "IL"
          },
          "vin": {
            "type": [
              "string",
              "null"
            ],
            "pattern": "^[A-HJ-NPR-Z0-9]{17}$",
            "example": "5YJ3E1EA7KF317000"
          },
          "make": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 50,
            "example": "Toyota"
          },
          "model": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 50,
            "example": "Camry"
          },
          "year": {
            "type": [
              "integer",
              "null"
            ],
            "minimum": 1980,
            "maximum": 2100,
            "example": 2024
          },
          "color": {
            "type": [
              "string",
              "null"
            ],
            "minLength": 1,
            "maxLength": 30,
            "example": "white"
          },
          "body_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/VehicleBodyType"
              },
              {
                "type": "null"
              }
            ]
          },
          "fuel_type": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/FuelType"
              },
              {
                "type": "null"
              }
            ]
          },
          "is_driverless": {
            "type": "boolean",
            "description": "True for a driverless vehicle, one that operates without a human driver."
          },
          "status": {
            "$ref": "#/components/schemas/VehicleStatus"
          },
          "metadata": {
            "$ref": "#/components/schemas/Metadata"
          }
        },
        "additionalProperties": false,
        "description": "Omitted fields are unchanged; `null` clears a nullable field."
      },
      "DeletedObject": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "object": {
            "type": "string"
          },
          "deleted": {
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "id",
          "object",
          "deleted"
        ]
      },
      "VehicleRowError": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "description": "Zero-based index in the request array.",
            "example": 3
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ],
            "example": "car-1045"
          },
          "code": {
            "type": "string",
            "example": "validation_failed"
          },
          "message": {
            "type": "string",
            "example": "plate: Use letters, digits, spaces, and hyphens"
          },
          "field": {
            "type": [
              "string",
              "null"
            ],
            "example": "plate"
          }
        },
        "required": [
          "index",
          "external_id",
          "code",
          "message",
          "field"
        ]
      },
      "VehicleBatchResult": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "vehicle_batch_result"
            ]
          },
          "created": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vehicle"
            }
          },
          "updated": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Vehicle"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VehicleRowError"
            }
          }
        },
        "required": [
          "object",
          "created",
          "updated",
          "errors"
        ],
        "description": "Partial success: valid rows are written, failures are reported per row."
      },
      "VehicleBatchRequest": {
        "type": "object",
        "properties": {
          "vehicles": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/CreateVehicleRequest"
            },
            "minItems": 1,
            "maxItems": 1000,
            "description": "Up to 1000 vehicles."
          },
          "upsert": {
            "type": "boolean",
            "default": false,
            "description": "When true, vehicles whose `external_id` already exists are updated instead of reported as errors."
          }
        },
        "required": [
          "vehicles"
        ],
        "additionalProperties": false
      },
      "VehicleBatchDeleteError": {
        "type": "object",
        "properties": {
          "index": {
            "type": "integer",
            "minimum": 0,
            "description": "Zero-based index of the first occurrence in the request array.",
            "example": 2
          },
          "id": {
            "type": [
              "string",
              "null"
            ],
            "description": "Vehicle ID: the requested one, or the matched vehicle's when deleting by `external_ids`. Null when no vehicle matched an `external_id`.",
            "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
          },
          "external_id": {
            "type": [
              "string",
              "null"
            ],
            "description": "The requested `external_id`, or the matched vehicle's when deleting by `ids`. Null when no vehicle matched an `id`.",
            "example": "car-1045"
          },
          "code": {
            "type": "string",
            "enum": [
              "not_found",
              "conflict"
            ],
            "description": "`not_found`: no such vehicle (or already deleted). `conflict`: the vehicle has `confirmed` or `checked_in` reservations, or was modified concurrently.",
            "example": "conflict"
          },
          "message": {
            "type": "string",
            "example": "Vehicle 7da8aca7-40fc-47d8-a1b1-2bb93405532d has 1 active reservation (ee8aced1-100f-45fa-a267-8fa27978f9e3). Cancel or complete them first."
          }
        },
        "required": [
          "index",
          "id",
          "external_id",
          "code",
          "message"
        ]
      },
      "VehicleBatchDeleteResult": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "vehicle_batch_delete_result"
            ]
          },
          "deleted": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "description": "The vehicle's ID (UUID).",
                  "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
                },
                "external_id": {
                  "type": "string",
                  "example": "car-1042"
                }
              },
              "required": [
                "id",
                "external_id"
              ]
            },
            "description": "Vehicles deleted by this request, in request order."
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/VehicleBatchDeleteError"
            }
          }
        },
        "required": [
          "object",
          "deleted",
          "errors"
        ],
        "description": "Partial success: every listed vehicle that can be deleted is deleted; the others are reported in `errors`."
      },
      "VehicleBatchDeleteRequest": {
        "type": "object",
        "properties": {
          "ids": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "description": "The vehicle's ID (UUID).",
              "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
            },
            "minItems": 1,
            "maxItems": 1000,
            "description": "Vehicle IDs to delete, up to 1000. Provide either `ids` or `external_ids`."
          },
          "external_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "pattern": "^[A-Za-z0-9._:\\-/]+$",
              "description": "Your identifier for the vehicle. Unique per fleet.",
              "example": "car-1042"
            },
            "minItems": 1,
            "maxItems": 1000,
            "description": "Your `external_id`s of the vehicles to delete, up to 1000. Provide either `ids` or `external_ids`."
          }
        },
        "additionalProperties": false,
        "description": "Exactly one of `ids` or `external_ids`. Repeated entries are de-duplicated: each vehicle is processed once, at the index of its first occurrence."
      },
      "ServiceEventType": {
        "type": "string",
        "enum": [
          "reserved",
          "updated",
          "checked_in",
          "checked_out",
          "cancelled",
          "no_show",
          "expired",
          "overstay"
        ]
      },
      "ServiceEvent": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "service_event"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The service event's ID (UUID).",
            "example": "f1f47e4a-a2c8-40a3-92ac-5ecc0e6b06d4"
          },
          "vehicle": {
            "type": "string",
            "format": "uuid",
            "description": "The vehicle's ID (UUID).",
            "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
          },
          "reservation": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The reservation's ID (UUID).",
            "example": "ee8aced1-100f-45fa-a267-8fa27978f9e3"
          },
          "location": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The location's ID (UUID).",
            "example": "eec93d2d-5729-441b-99b2-f764872ca895"
          },
          "service_id": {
            "type": [
              "string",
              "null"
            ],
            "format": "uuid",
            "description": "The catalog service's ID (UUID), as listed by `GET /services`.",
            "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
          },
          "type": {
            "$ref": "#/components/schemas/ServiceEventType"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "source": {
            "$ref": "#/components/schemas/ServiceEventSource"
          },
          "details": {
            "type": "object",
            "additionalProperties": {},
            "description": "Event-specific details.",
            "example": {
              "coordinates": {
                "lat": 41.8807,
                "lng": -87.6256
              },
              "distance_meters": 12
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "livemode": {
            "type": "boolean",
            "description": "True for data in a production workspace, false for a sandbox workspace."
          }
        },
        "required": [
          "object",
          "id",
          "vehicle",
          "reservation",
          "location",
          "service_id",
          "type",
          "occurred_at",
          "source",
          "details",
          "created_at",
          "livemode"
        ],
        "description": "Append-only vehicle service history entry."
      },
      "ServiceEventList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ServiceEvent"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. Null on the last page."
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "WebhookEventType": {
        "type": "string",
        "enum": [
          "reservation.confirmed",
          "reservation.updated",
          "reservation.checked_in",
          "reservation.completed",
          "reservation.cancelled",
          "reservation.no_show",
          "reservation.expired"
        ]
      },
      "WebhookDisabledReason": {
        "type": "string",
        "enum": [
          "user",
          "auto_disabled"
        ],
        "description": "Why the endpoint is disabled; null while enabled."
      },
      "WebhookEndpoint": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "webhook_endpoint"
            ]
          },
          "id": {
            "type": "string",
            "format": "uuid",
            "description": "The webhook endpoint's ID (UUID).",
            "example": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca"
          },
          "url": {
            "type": "string",
            "example": "https://fleet.example.com/webhooks/stage"
          },
          "description": {
            "type": [
              "string",
              "null"
            ]
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            }
          },
          "enabled": {
            "type": "boolean"
          },
          "disabled_reason": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/WebhookDisabledReason"
              },
              {
                "type": "null"
              }
            ]
          },
          "disabled_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "secret": {
            "type": "string",
            "pattern": "^whsec_[A-Za-z0-9]{32}$",
            "description": "Signing secret. Returned only when the endpoint is created or its secret is rotated.",
            "example": "whsec_3f9aK2mQ8xL1pR7tV4nB6cD0eF5gH2jZ"
          },
          "previous_secret_expires_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "After a rotation, deliveries are signed with both the new and the previous secret (two `v1` entries in `Stage-Signature`) until this time.",
            "example": "2026-11-02T14:00:00Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
            "example": "2026-11-02T14:00:00Z"
          },
          "livemode": {
            "type": "boolean",
            "description": "True for data in a production workspace, false for a sandbox workspace."
          }
        },
        "required": [
          "object",
          "id",
          "url",
          "description",
          "events",
          "enabled",
          "disabled_reason",
          "disabled_at",
          "previous_secret_expires_at",
          "updated_at",
          "created_at",
          "livemode"
        ]
      },
      "CreateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri",
            "description": "Must be `https://` and resolve to a public address. Loopback URLs (`http://localhost`, `127.0.0.1`, `[::1]`) are accepted only for sandbox workspace endpoints on a local API.",
            "example": "https://fleet.example.com/webhooks/stage"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            },
            "minItems": 1
          },
          "description": {
            "type": "string",
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean",
            "default": true
          }
        },
        "required": [
          "url",
          "events"
        ],
        "additionalProperties": false
      },
      "WebhookEndpointList": {
        "type": "object",
        "properties": {
          "object": {
            "type": "string",
            "enum": [
              "list"
            ]
          },
          "data": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpoint"
            }
          },
          "has_more": {
            "type": "boolean"
          },
          "next_cursor": {
            "type": [
              "string",
              "null"
            ],
            "description": "Pass as `cursor` to fetch the next page. Null on the last page."
          }
        },
        "required": [
          "object",
          "data",
          "has_more",
          "next_cursor"
        ]
      },
      "UpdateWebhookEndpointRequest": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "maxLength": 2048,
            "format": "uri",
            "description": "Must be `https://` and resolve to a public address. Loopback URLs (`http://localhost`, `127.0.0.1`, `[::1]`) are accepted only for sandbox workspace endpoints on a local API.",
            "example": "https://fleet.example.com/webhooks/stage"
          },
          "events": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventType"
            },
            "minItems": 1
          },
          "description": {
            "type": [
              "string",
              "null"
            ],
            "maxLength": 200
          },
          "enabled": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    },
    "parameters": {}
  },
  "paths": {
    "/account": {
      "get": {
        "operationId": "getAccount",
        "tags": [
          "Account"
        ],
        "summary": "Retrieve the account",
        "description": "The fleet, workspace, API key, and rate limit behind the request. `workspace` shows which workspace the key belongs to (`sandbox` or `production`). Any valid key can call it, so it doubles as an integration health check.",
        "security": [
          {
            "ApiKeyAuth": []
          }
        ],
        "responses": {
          "200": {
            "description": "The calling account.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Account"
                },
                "example": {
                  "object": "account",
                  "fleet": {
                    "id": "3de8244e-8fcd-44d5-ada3-561ef75e26d2",
                    "name": "Northside Rideshare Co.",
                    "status": "production"
                  },
                  "workspace": {
                    "id": "ec955a02-3694-4138-aac9-c9d361704dee",
                    "name": "Sandbox",
                    "type": "sandbox"
                  },
                  "livemode": false,
                  "key": {
                    "id": "4d585f88-af48-4015-ad30-2d74559dc6ec",
                    "name": "Dispatch backend",
                    "mask": "e1j0...rlEPUdyY",
                    "scopes": [
                      "locations:read",
                      "reservations:write",
                      "vehicles:write",
                      "webhooks:read"
                    ],
                    "created_at": "2026-11-01T15:04:05Z",
                    "expires_at": null
                  },
                  "rate_limit": {
                    "limit": 25,
                    "window_seconds": 1
                  },
                  "api_version": "2026-11-01"
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/services": {
      "get": {
        "operationId": "listServices",
        "tags": [
          "Services"
        ],
        "summary": "List services",
        "description": "The services your fleet can search for and reserve right now: services PMC has enabled and enabled for your fleet. Pass a service's `id` as `service_id` in `GET /locations`, `GET /locations/{id}/availability` and `POST /reservations`; a service that is not listed is `422 service_not_available` there. The list can change when PMC enables or pauses a service; existing reservations are not affected.\n\nRequires scope `locations:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "locations:read"
            ]
          }
        ],
        "responses": {
          "200": {
            "description": "The services your fleet can use.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceList"
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "service",
                      "id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                      "name": "Parking",
                      "description": "A space for a vehicle at a location, from a short stay between trips to overnight.",
                      "status": "available"
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/locations": {
      "get": {
        "operationId": "searchLocations",
        "tags": [
          "Locations"
        ],
        "summary": "Search locations",
        "description": "Returns locations within `radius_meters` of a point where your fleet can reserve `service_id`, nearest first. Supply `start_at` and `end_at` to get `available` capacity for that time. A `service_id` your fleet cannot use (not listed by `GET /services`) is `422 service_not_available`.\n\nRequires scope `locations:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "locations:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "description": "Page size (1–100).",
              "example": 20
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "description": "Opaque cursor from a previous `next_cursor`."
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "type": "number",
              "minimum": -90,
              "maximum": 90,
              "example": 41.8781
            },
            "required": true,
            "name": "lat",
            "in": "query"
          },
          {
            "schema": {
              "type": "number",
              "minimum": -180,
              "maximum": 180,
              "example": -87.6298
            },
            "required": true,
            "name": "lng",
            "in": "query"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50000,
              "default": 5000,
              "description": "Search radius in meters (max 50000).",
              "example": 5000
            },
            "required": false,
            "name": "radius_meters",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The service you need: an `id` from `GET /services`. Only locations where your fleet can reserve it are returned. A service your fleet cannot use (not listed by `GET /services`) is `422 service_not_available`.",
              "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
            },
            "required": true,
            "name": "service_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Start of the time you need. Supply with `end_at` to get availability.",
              "example": "2026-11-02T14:00:00Z"
            },
            "required": false,
            "name": "start_at",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "End of the time you need. Must be after `start_at`.",
              "example": "2026-11-02T14:00:00Z"
            },
            "required": false,
            "name": "end_at",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Locations sorted by distance.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationList"
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "location",
                      "id": "eec93d2d-5729-441b-99b2-f764872ca895",
                      "name": "Monroe Street Garage",
                      "address": {
                        "line1": "55 E Monroe St",
                        "line2": null,
                        "city": "Chicago",
                        "region": "IL",
                        "postal_code": "60603",
                        "country": "US"
                      },
                      "coordinates": {
                        "lat": 41.8807,
                        "lng": -87.6256
                      },
                      "timezone": "America/Chicago",
                      "distance_meters": 420,
                      "access_method": "open",
                      "access_instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\".",
                      "hours": {
                        "always_open": true,
                        "weekly": null
                      },
                      "height_limit_cm": 210,
                      "amenities": [
                        "restrooms",
                        "covered",
                        "security"
                      ],
                      "services": [
                        {
                          "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                          "capacity": 40,
                          "available": 12
                        }
                      ],
                      "created_at": "2026-11-01T15:04:05Z",
                      "livemode": false
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/locations/{id}": {
      "get": {
        "operationId": "getLocation",
        "tags": [
          "Locations"
        ],
        "summary": "Retrieve a location",
        "description": "Hours, access method and instructions, and the services offered at the location.\n\nRequires scope `locations:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "locations:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The location's ID (UUID).",
              "example": "eec93d2d-5729-441b-99b2-f764872ca895"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The location.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Location"
                },
                "example": {
                  "object": "location",
                  "id": "eec93d2d-5729-441b-99b2-f764872ca895",
                  "name": "Monroe Street Garage",
                  "address": {
                    "line1": "55 E Monroe St",
                    "line2": null,
                    "city": "Chicago",
                    "region": "IL",
                    "postal_code": "60603",
                    "country": "US"
                  },
                  "coordinates": {
                    "lat": 41.8807,
                    "lng": -87.6256
                  },
                  "timezone": "America/Chicago",
                  "access_method": "open",
                  "access_instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\".",
                  "hours": {
                    "always_open": true,
                    "weekly": null
                  },
                  "height_limit_cm": 210,
                  "amenities": [
                    "restrooms",
                    "covered",
                    "security"
                  ],
                  "services": [
                    {
                      "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                      "capacity": 40,
                      "available": 12
                    }
                  ],
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/locations/{id}/availability": {
      "get": {
        "operationId": "getLocationAvailability",
        "tags": [
          "Locations"
        ],
        "summary": "Check availability",
        "description": "Capacity available for a service for the time you need (`start_at` → `end_at`). `bookable` and `reason` tell you whether a reservation for exactly that time would be accepted right now.\n\nRequires scope `locations:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "locations:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The location's ID (UUID).",
              "example": "eec93d2d-5729-441b-99b2-f764872ca895"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The service you need: an `id` from `GET /services`.",
              "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
            },
            "required": true,
            "name": "service_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
              "example": "2026-11-02T14:00:00Z"
            },
            "required": true,
            "name": "start_at",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
              "example": "2026-11-02T14:00:00Z"
            },
            "required": true,
            "name": "end_at",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "Availability for the requested time.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Availability"
                },
                "example": {
                  "object": "availability",
                  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                  "start_at": "2026-11-02T14:00:00Z",
                  "end_at": "2026-11-02T17:00:00Z",
                  "available": 12,
                  "capacity": 40,
                  "bookable": true,
                  "reason": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/reservations": {
      "post": {
        "operationId": "createReservation",
        "tags": [
          "Reservations"
        ],
        "summary": "Create a reservation",
        "description": "Reserves `service_id` at a location for a vehicle from `start_at` (default: now) to `end_at`, usually a location returned by `GET /locations`. Capacity is held synchronously: `201` with status `confirmed` and the `access` instructions for the location. Omit `end_at` for an open-ended reservation (a vehicle waiting until it is needed): it holds capacity until `hold_until`, extended while the vehicle is checked in. Returns `409 capacity_unavailable` if the location has no capacity left for that service and time, and `422 service_not_available` if your fleet cannot use the service (see `GET /services`).\n\nRequires scope `reservations:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "reservations:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "Unique key (for example a UUID) that makes retries safe. Replays within 24 hours return the original response; reusing a key with a different body returns 409 `idempotency_key_reused`.",
              "example": "0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f"
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateReservationRequest"
              },
              "example": {
                "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                "start_at": "2026-11-02T14:00:00Z",
                "end_at": "2026-11-02T17:00:00Z",
                "external_reference": "trip-88213"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The confirmed reservation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservation"
                },
                "example": {
                  "object": "reservation",
                  "id": "ee8aced1-100f-45fa-a267-8fa27978f9e3",
                  "status": "confirmed",
                  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                  "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                  "start_at": "2026-11-02T14:00:00Z",
                  "end_at": "2026-11-02T17:00:00Z",
                  "hold_until": "2026-11-02T17:00:00Z",
                  "access": {
                    "method": "open",
                    "plate": null,
                    "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
                  },
                  "checked_in_at": null,
                  "check_in_source": null,
                  "checked_out_at": null,
                  "check_out_source": null,
                  "cancelled_at": null,
                  "cancellation_reason": null,
                  "external_reference": "trip-88213",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "operationId": "listReservations",
        "tags": [
          "Reservations"
        ],
        "summary": "List reservations",
        "description": "Newest first. Filter by `status`, `location`, `vehicle`, `service_id`, `external_reference`, or start time.\n\nRequires scope `reservations:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "reservations:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "description": "Page size (1–100).",
              "example": 20
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "description": "Opaque cursor from a previous `next_cursor`."
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ReservationStatus"
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The location's ID (UUID).",
              "example": "eec93d2d-5729-441b-99b2-f764872ca895"
            },
            "required": false,
            "name": "location",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The vehicle's ID (UUID).",
              "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
            },
            "required": false,
            "name": "vehicle",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The catalog service's ID (UUID), as listed by `GET /services`.",
              "example": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60"
            },
            "required": false,
            "name": "service_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "external_reference",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Only reservations with `start_at` at or after this time.",
              "example": "2026-11-02T14:00:00Z"
            },
            "required": false,
            "name": "starts_after",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "Only reservations with `start_at` before this time.",
              "example": "2026-11-02T14:00:00Z"
            },
            "required": false,
            "name": "starts_before",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of reservations.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReservationList"
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "reservation",
                      "id": "ee8aced1-100f-45fa-a267-8fa27978f9e3",
                      "status": "confirmed",
                      "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                      "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                      "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                      "start_at": "2026-11-02T14:00:00Z",
                      "end_at": "2026-11-02T17:00:00Z",
                      "hold_until": "2026-11-02T17:00:00Z",
                      "access": {
                        "method": "open",
                        "plate": null,
                        "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
                      },
                      "checked_in_at": null,
                      "check_in_source": null,
                      "checked_out_at": null,
                      "check_out_source": null,
                      "cancelled_at": null,
                      "cancellation_reason": null,
                      "external_reference": "trip-88213",
                      "metadata": {},
                      "updated_at": "2026-11-01T15:04:05Z",
                      "created_at": "2026-11-01T15:04:05Z",
                      "livemode": false
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/reservations/{id}": {
      "get": {
        "operationId": "getReservation",
        "tags": [
          "Reservations"
        ],
        "summary": "Retrieve a reservation",
        "description": "The current status, times, and access instructions. Returns an `ETag` to send as `If-Match` when you change it.\n\nRequires scope `reservations:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "reservations:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The reservation's ID (UUID).",
              "example": "ee8aced1-100f-45fa-a267-8fa27978f9e3"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The reservation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservation"
                },
                "example": {
                  "object": "reservation",
                  "id": "ee8aced1-100f-45fa-a267-8fa27978f9e3",
                  "status": "confirmed",
                  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                  "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                  "start_at": "2026-11-02T14:00:00Z",
                  "end_at": "2026-11-02T17:00:00Z",
                  "hold_until": "2026-11-02T17:00:00Z",
                  "access": {
                    "method": "open",
                    "plate": null,
                    "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
                  },
                  "checked_in_at": null,
                  "check_in_source": null,
                  "checked_out_at": null,
                  "check_out_source": null,
                  "cancelled_at": null,
                  "cancellation_reason": null,
                  "external_reference": "trip-88213",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateReservation",
        "tags": [
          "Reservations"
        ],
        "summary": "Extend or change a reservation",
        "description": "Changes the requested time. `start_at` can change only while `confirmed`; `end_at` can change while `confirmed` or `checked_in` (extend only once checked in). Setting `end_at` on an open-ended reservation gives it a fixed end (any time in the future, also once checked in). Availability is re-checked. Changing the time of a reservation for a service your fleet can no longer use (see `GET /services`) is `422 service_not_available`; the reservation itself stays valid.\n\nRequires scope `reservations:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "reservations:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The reservation's ID (UUID).",
              "example": "ee8aced1-100f-45fa-a267-8fa27978f9e3"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Apply the change only if the resource `ETag` matches.",
              "example": "\"3\""
            },
            "required": false,
            "name": "If-Match",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateReservationRequest"
              },
              "example": {
                "end_at": "2026-11-02T18:00:00Z"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated reservation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservation"
                },
                "example": {
                  "object": "reservation",
                  "id": "ee8aced1-100f-45fa-a267-8fa27978f9e3",
                  "status": "confirmed",
                  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                  "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                  "start_at": "2026-11-02T14:00:00Z",
                  "end_at": "2026-11-02T18:00:00Z",
                  "hold_until": "2026-11-02T17:00:00Z",
                  "access": {
                    "method": "open",
                    "plate": null,
                    "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
                  },
                  "checked_in_at": null,
                  "check_in_source": null,
                  "checked_out_at": null,
                  "check_out_source": null,
                  "cancelled_at": null,
                  "cancellation_reason": null,
                  "external_reference": "trip-88213",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/reservations/{id}/cancel": {
      "post": {
        "operationId": "cancelReservation",
        "tags": [
          "Reservations"
        ],
        "summary": "Cancel a reservation",
        "description": "Cancels a `confirmed` reservation and releases the capacity immediately.\n\nRequires scope `reservations:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "reservations:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The reservation's ID (UUID).",
              "example": "ee8aced1-100f-45fa-a267-8fa27978f9e3"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "Unique key (for example a UUID) that makes retries safe. Replays within 24 hours return the original response; reusing a key with a different body returns 409 `idempotency_key_reused`.",
              "example": "0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f"
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CancelReservationRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The cancelled reservation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservation"
                },
                "example": {
                  "object": "reservation",
                  "id": "ee8aced1-100f-45fa-a267-8fa27978f9e3",
                  "status": "cancelled",
                  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                  "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                  "start_at": "2026-11-02T14:00:00Z",
                  "end_at": "2026-11-02T17:00:00Z",
                  "hold_until": "2026-11-02T17:00:00Z",
                  "access": {
                    "method": "open",
                    "plate": null,
                    "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
                  },
                  "checked_in_at": null,
                  "check_in_source": null,
                  "checked_out_at": null,
                  "check_out_source": null,
                  "cancelled_at": "2026-11-02T12:00:00Z",
                  "cancellation_reason": "Trip cancelled by rider",
                  "external_reference": "trip-88213",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/reservations/{id}/check-in": {
      "post": {
        "operationId": "checkInReservation",
        "tags": [
          "Reservations"
        ],
        "summary": "Check in",
        "description": "Checks in a `confirmed` reservation (`checked_in`). Check-in opens 30 minutes before `start_at` and closes at `hold_until` (the end of the reservation). Your system calls it when the vehicle enters.\n\nRequires scope `reservations:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "reservations:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The reservation's ID (UUID).",
              "example": "ee8aced1-100f-45fa-a267-8fa27978f9e3"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "Unique key (for example a UUID) that makes retries safe. Replays within 24 hours return the original response; reusing a key with a different body returns 409 `idempotency_key_reused`.",
              "example": "0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f"
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckInRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The checked-in reservation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservation"
                },
                "example": {
                  "object": "reservation",
                  "id": "ee8aced1-100f-45fa-a267-8fa27978f9e3",
                  "status": "checked_in",
                  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                  "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                  "start_at": "2026-11-02T14:00:00Z",
                  "end_at": "2026-11-02T17:00:00Z",
                  "hold_until": "2026-11-02T17:00:00Z",
                  "access": {
                    "method": "open",
                    "plate": null,
                    "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
                  },
                  "checked_in_at": "2026-11-02T14:03:00Z",
                  "check_in_source": "api",
                  "checked_out_at": null,
                  "check_out_source": null,
                  "cancelled_at": null,
                  "cancellation_reason": null,
                  "external_reference": "trip-88213",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/reservations/{id}/check-out": {
      "post": {
        "operationId": "checkOutReservation",
        "tags": [
          "Reservations"
        ],
        "summary": "Check out",
        "description": "Checks out a `checked_in` reservation, which completes it (`completed`) and releases the capacity. Your system calls it when the vehicle leaves.\n\nRequires scope `reservations:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "reservations:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The reservation's ID (UUID).",
              "example": "ee8aced1-100f-45fa-a267-8fa27978f9e3"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "Unique key (for example a UUID) that makes retries safe. Replays within 24 hours return the original response; reusing a key with a different body returns 409 `idempotency_key_reused`.",
              "example": "0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f"
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CheckOutRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The completed reservation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Reservation"
                },
                "example": {
                  "object": "reservation",
                  "id": "ee8aced1-100f-45fa-a267-8fa27978f9e3",
                  "status": "completed",
                  "location": "eec93d2d-5729-441b-99b2-f764872ca895",
                  "vehicle": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "service_id": "5f1c2a8e-3b47-4d9a-8e6f-1c2d3b4a5e60",
                  "start_at": "2026-11-02T14:00:00Z",
                  "end_at": "2026-11-02T17:00:00Z",
                  "hold_until": "2026-11-02T17:00:00Z",
                  "access": {
                    "method": "open",
                    "plate": null,
                    "instructions": "Enter on Monroe St. Use lanes 3–4 marked \"Fleet\"."
                  },
                  "checked_in_at": "2026-11-02T14:03:00Z",
                  "check_in_source": "api",
                  "checked_out_at": "2026-11-02T16:51:00Z",
                  "check_out_source": "api",
                  "cancelled_at": null,
                  "cancellation_reason": null,
                  "external_reference": "trip-88213",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/vehicles": {
      "post": {
        "operationId": "createVehicle",
        "tags": [
          "Vehicles"
        ],
        "summary": "Create a vehicle",
        "description": "`external_id` must be unique within the workspace.\n\nRequires scope `vehicles:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "vehicles:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "Unique key (for example a UUID) that makes retries safe. Replays within 24 hours return the original response; reusing a key with a different body returns 409 `idempotency_key_reused`.",
              "example": "0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f"
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateVehicleRequest"
              },
              "example": {
                "external_id": "car-1042",
                "plate": "7abc123",
                "plate_state": "il",
                "make": "Toyota",
                "model": "Camry",
                "year": 2024,
                "body_type": "sedan",
                "fuel_type": "hybrid"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created vehicle.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Vehicle"
                },
                "example": {
                  "object": "vehicle",
                  "id": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "external_id": "car-1042",
                  "plate": "7ABC123",
                  "plate_state": "IL",
                  "vin": "4T1B11HK5KU000000",
                  "make": "Toyota",
                  "model": "Camry",
                  "year": 2024,
                  "color": "white",
                  "body_type": "sedan",
                  "fuel_type": "hybrid",
                  "is_driverless": false,
                  "status": "active",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "operationId": "listVehicles",
        "tags": [
          "Vehicles"
        ],
        "summary": "List vehicles",
        "description": "Requires scope `vehicles:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "vehicles:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "description": "Page size (1–100).",
              "example": 20
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "description": "Opaque cursor from a previous `next_cursor`."
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/VehicleStatus"
            },
            "required": false,
            "name": "status",
            "in": "query"
          },
          {
            "schema": {
              "type": "string"
            },
            "required": false,
            "name": "external_id",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 10,
              "pattern": "^[A-Z0-9][A-Z0-9 -]*$",
              "description": "License plate. Trimmed and uppercased.",
              "example": "7ABC123"
            },
            "required": false,
            "name": "plate",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/FuelType"
            },
            "required": false,
            "name": "fuel_type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ],
              "description": "Only driverless (`true`) or human-driven (`false`) vehicles."
            },
            "required": false,
            "name": "is_driverless",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64,
              "description": "Search: vehicles whose plate or `external_id` contains this text. Plates match ignoring case, spaces and dashes; `external_id` matches the text as given, in upper case, or in lower case.",
              "example": "1042"
            },
            "required": false,
            "name": "q",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of vehicles.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleList"
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "vehicle",
                      "id": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                      "external_id": "car-1042",
                      "plate": "7ABC123",
                      "plate_state": "IL",
                      "vin": "4T1B11HK5KU000000",
                      "make": "Toyota",
                      "model": "Camry",
                      "year": 2024,
                      "color": "white",
                      "body_type": "sedan",
                      "fuel_type": "hybrid",
                      "is_driverless": false,
                      "status": "active",
                      "metadata": {},
                      "updated_at": "2026-11-01T15:04:05Z",
                      "created_at": "2026-11-01T15:04:05Z",
                      "livemode": false
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/vehicles/{id}": {
      "get": {
        "operationId": "getVehicle",
        "tags": [
          "Vehicles"
        ],
        "summary": "Retrieve a vehicle",
        "description": "Requires scope `vehicles:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "vehicles:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The vehicle's ID (UUID).",
              "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The vehicle.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Vehicle"
                },
                "example": {
                  "object": "vehicle",
                  "id": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "external_id": "car-1042",
                  "plate": "7ABC123",
                  "plate_state": "IL",
                  "vin": "4T1B11HK5KU000000",
                  "make": "Toyota",
                  "model": "Camry",
                  "year": 2024,
                  "color": "white",
                  "body_type": "sedan",
                  "fuel_type": "hybrid",
                  "is_driverless": false,
                  "status": "active",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateVehicle",
        "tags": [
          "Vehicles"
        ],
        "summary": "Update a vehicle",
        "description": "Requires scope `vehicles:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "vehicles:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The vehicle's ID (UUID).",
              "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Apply the change only if the resource `ETag` matches.",
              "example": "\"3\""
            },
            "required": false,
            "name": "If-Match",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateVehicleRequest"
              },
              "example": {
                "status": "inactive"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated vehicle.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Vehicle"
                },
                "example": {
                  "object": "vehicle",
                  "id": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "external_id": "car-1042",
                  "plate": "7ABC123",
                  "plate_state": "IL",
                  "vin": "4T1B11HK5KU000000",
                  "make": "Toyota",
                  "model": "Camry",
                  "year": 2024,
                  "color": "white",
                  "body_type": "sedan",
                  "fuel_type": "hybrid",
                  "is_driverless": false,
                  "status": "inactive",
                  "metadata": {},
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteVehicle",
        "tags": [
          "Vehicles"
        ],
        "summary": "Delete a vehicle",
        "description": "Fails with `409 conflict` while the vehicle has `confirmed` or `checked_in` reservations. Service history is retained.\n\nRequires scope `vehicles:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "vehicles:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The vehicle's ID (UUID).",
              "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deletion confirmation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedObject"
                },
                "example": {
                  "id": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                  "object": "vehicle",
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/vehicles/batch": {
      "post": {
        "operationId": "batchVehicles",
        "tags": [
          "Vehicles"
        ],
        "summary": "Create or upsert vehicles in bulk",
        "description": "Up to 1,000 vehicles per request. Valid rows are written; invalid rows are returned in `errors` with their array index. Set `upsert` to update existing vehicles by `external_id`.\n\nRequires scope `vehicles:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "vehicles:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "Unique key (for example a UUID) that makes retries safe. Replays within 24 hours return the original response; reusing a key with a different body returns 409 `idempotency_key_reused`.",
              "example": "0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f"
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VehicleBatchRequest"
              },
              "example": {
                "upsert": true,
                "vehicles": [
                  {
                    "external_id": "car-1042",
                    "plate": "7ABC123",
                    "plate_state": "IL"
                  },
                  {
                    "external_id": "car-1043",
                    "plate": "7ABC124",
                    "plate_state": "Illinois"
                  }
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-row results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleBatchResult"
                },
                "example": {
                  "object": "vehicle_batch_result",
                  "created": [
                    {
                      "object": "vehicle",
                      "id": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                      "external_id": "car-1042",
                      "plate": "7ABC123",
                      "plate_state": "IL",
                      "vin": "4T1B11HK5KU000000",
                      "make": "Toyota",
                      "model": "Camry",
                      "year": 2024,
                      "color": "white",
                      "body_type": "sedan",
                      "fuel_type": "hybrid",
                      "is_driverless": false,
                      "status": "active",
                      "metadata": {},
                      "updated_at": "2026-11-01T15:04:05Z",
                      "created_at": "2026-11-01T15:04:05Z",
                      "livemode": false
                    }
                  ],
                  "updated": [],
                  "errors": [
                    {
                      "index": 1,
                      "external_id": "car-1043",
                      "code": "validation_failed",
                      "message": "plate_state: Must be a 2-letter state or province code",
                      "field": "plate_state"
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/vehicles/batch-delete": {
      "post": {
        "operationId": "deleteVehiclesBatch",
        "tags": [
          "Vehicles"
        ],
        "summary": "Delete vehicles in bulk",
        "description": "Deletes up to 1000 vehicles, identified by `ids` or by `external_ids` (exactly one of the two). Same rules as deleting one vehicle: deletion is soft, service history is retained, and the `external_id` and plate become free to reuse. Partial success: deletable vehicles are deleted and the rest are reported in `errors` with their array index and code `not_found` or `conflict` (`confirmed` or `checked_in` reservations). Repeated entries are de-duplicated.\n\nRequires scope `vehicles:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "vehicles:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "Unique key (for example a UUID) that makes retries safe. Replays within 24 hours return the original response; reusing a key with a different body returns 409 `idempotency_key_reused`.",
              "example": "0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f"
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VehicleBatchDeleteRequest"
              },
              "example": {
                "external_ids": [
                  "car-1042",
                  "car-1099",
                  "car-1043"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Per-vehicle results.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VehicleBatchDeleteResult"
                },
                "example": {
                  "object": "vehicle_batch_delete_result",
                  "deleted": [
                    {
                      "id": "7da8aca7-40fc-47d8-a1b1-2bb93405532d",
                      "external_id": "car-1042"
                    }
                  ],
                  "errors": [
                    {
                      "index": 1,
                      "id": null,
                      "external_id": "car-1099",
                      "code": "not_found",
                      "message": "Vehicle with external_id car-1099 was not found"
                    },
                    {
                      "index": 2,
                      "id": "9cdd700f-cf4f-4d24-9d25-bb76fb7fd915",
                      "external_id": "car-1043",
                      "code": "conflict",
                      "message": "Vehicle 9cdd700f-cf4f-4d24-9d25-bb76fb7fd915 has 1 active reservation (ee8aced1-100f-45fa-a267-8fa27978f9e3). Cancel or complete them first."
                    }
                  ]
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/vehicles/{id}/history": {
      "get": {
        "operationId": "getVehicleHistory",
        "tags": [
          "Vehicles"
        ],
        "summary": "List vehicle service history",
        "description": "Append-only service events (reserved, updated, checked in, checked out, cancelled, no-show, expired, overstay), newest first.\n\nRequires scope `vehicles:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "vehicles:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The vehicle's ID (UUID).",
              "example": "7da8aca7-40fc-47d8-a1b1-2bb93405532d"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "description": "Page size (1–100).",
              "example": 20
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "description": "Opaque cursor from a previous `next_cursor`."
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          },
          {
            "schema": {
              "$ref": "#/components/schemas/ServiceEventType"
            },
            "required": false,
            "name": "type",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
              "example": "2026-11-02T14:00:00Z"
            },
            "required": false,
            "name": "since",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "format": "date-time",
              "description": "ISO-8601 timestamp. Responses are always UTC (`Z`).",
              "example": "2026-11-02T14:00:00Z"
            },
            "required": false,
            "name": "until",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of service events.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ServiceEventList"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/webhook-endpoints": {
      "post": {
        "operationId": "createWebhookEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Create a webhook endpoint",
        "description": "The signing `secret` is returned only in this response.\n\nRequires scope `webhooks:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "webhooks:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 255,
              "description": "Unique key (for example a UUID) that makes retries safe. Replays within 24 hours return the original response; reusing a key with a different body returns 409 `idempotency_key_reused`.",
              "example": "0b9c2f7e-8f4b-4c1e-9a77-5d1c2b3a4e5f"
            },
            "required": false,
            "name": "Idempotency-Key",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              },
              "example": {
                "url": "https://fleet.example.com/webhooks/stage",
                "events": [
                  "reservation.checked_in",
                  "reservation.completed"
                ],
                "description": "Dispatch"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The created endpoint, including its secret.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                },
                "example": {
                  "object": "webhook_endpoint",
                  "id": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca",
                  "url": "https://fleet.example.com/webhooks/stage",
                  "description": "Dispatch",
                  "events": [
                    "reservation.checked_in",
                    "reservation.completed"
                  ],
                  "enabled": true,
                  "disabled_reason": null,
                  "disabled_at": null,
                  "secret": "whsec_3f9aK2mQ8xL1pR7tV4nB6cD0eF5gH2jZ",
                  "previous_secret_expires_at": null,
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "get": {
        "operationId": "listWebhookEndpoints",
        "tags": [
          "Webhooks"
        ],
        "summary": "List webhook endpoints",
        "description": "Requires scope `webhooks:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "webhooks:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20,
              "description": "Page size (1–100).",
              "example": 20
            },
            "required": false,
            "name": "limit",
            "in": "query"
          },
          {
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "description": "Opaque cursor from a previous `next_cursor`."
            },
            "required": false,
            "name": "cursor",
            "in": "query"
          }
        ],
        "responses": {
          "200": {
            "description": "A page of endpoints.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointList"
                },
                "example": {
                  "object": "list",
                  "data": [
                    {
                      "object": "webhook_endpoint",
                      "id": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca",
                      "url": "https://fleet.example.com/webhooks/stage",
                      "description": "Dispatch",
                      "events": [
                        "reservation.checked_in",
                        "reservation.completed"
                      ],
                      "enabled": true,
                      "disabled_reason": null,
                      "disabled_at": null,
                      "previous_secret_expires_at": null,
                      "updated_at": "2026-11-01T15:04:05Z",
                      "created_at": "2026-11-01T15:04:05Z",
                      "livemode": false
                    }
                  ],
                  "has_more": false,
                  "next_cursor": null
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    },
    "/webhook-endpoints/{id}": {
      "get": {
        "operationId": "getWebhookEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Retrieve a webhook endpoint",
        "description": "Requires scope `webhooks:read`.",
        "security": [
          {
            "ApiKeyAuth": [
              "webhooks:read"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The webhook endpoint's ID (UUID).",
              "example": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "The endpoint.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                },
                "example": {
                  "object": "webhook_endpoint",
                  "id": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca",
                  "url": "https://fleet.example.com/webhooks/stage",
                  "description": "Dispatch",
                  "events": [
                    "reservation.checked_in",
                    "reservation.completed"
                  ],
                  "enabled": true,
                  "disabled_reason": null,
                  "disabled_at": null,
                  "previous_secret_expires_at": null,
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "patch": {
        "operationId": "updateWebhookEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Update a webhook endpoint",
        "description": "Requires scope `webhooks:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "webhooks:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The webhook endpoint's ID (UUID).",
              "example": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca"
            },
            "required": true,
            "name": "id",
            "in": "path"
          },
          {
            "schema": {
              "type": "string",
              "description": "Apply the change only if the resource `ETag` matches.",
              "example": "\"3\""
            },
            "required": false,
            "name": "If-Match",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateWebhookEndpointRequest"
              },
              "example": {
                "enabled": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The updated endpoint.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              },
              "ETag": {
                "$ref": "#/components/headers/ETag"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpoint"
                },
                "example": {
                  "object": "webhook_endpoint",
                  "id": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca",
                  "url": "https://fleet.example.com/webhooks/stage",
                  "description": "Dispatch",
                  "events": [
                    "reservation.checked_in",
                    "reservation.completed"
                  ],
                  "enabled": false,
                  "disabled_reason": null,
                  "disabled_at": null,
                  "previous_secret_expires_at": null,
                  "updated_at": "2026-11-01T15:04:05Z",
                  "created_at": "2026-11-01T15:04:05Z",
                  "livemode": false
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "$ref": "#/components/responses/Conflict"
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "$ref": "#/components/responses/Unprocessable"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      },
      "delete": {
        "operationId": "deleteWebhookEndpoint",
        "tags": [
          "Webhooks"
        ],
        "summary": "Delete a webhook endpoint",
        "description": "Requires scope `webhooks:write`.",
        "security": [
          {
            "ApiKeyAuth": [
              "webhooks:write"
            ]
          }
        ],
        "parameters": [
          {
            "schema": {
              "type": "string",
              "format": "uuid",
              "description": "The webhook endpoint's ID (UUID).",
              "example": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca"
            },
            "required": true,
            "name": "id",
            "in": "path"
          }
        ],
        "responses": {
          "200": {
            "description": "Deletion confirmation.",
            "headers": {
              "Request-Id": {
                "$ref": "#/components/headers/RequestId"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DeletedObject"
                },
                "example": {
                  "id": "7de472cc-f7ad-4013-b71f-a7f5901aa2ca",
                  "object": "webhook_endpoint",
                  "deleted": true
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          }
        }
      }
    }
  },
  "webhooks": {
    "reservation.confirmed": {
      "post": {
        "operationId": "webhook_reservation_confirmed",
        "tags": [
          "Webhooks"
        ],
        "summary": "reservation.confirmed",
        "description": "Sent to endpoints subscribed to `reservation.confirmed`. Verify the `Stage-Signature` header before trusting the payload. Respond with any 2xx within 10 seconds; failures are retried with exponential backoff (8 attempts over roughly 18 hours).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`",
              "example": "t=1793545445,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
            },
            "required": true,
            "name": "Stage-Signature",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    },
    "reservation.updated": {
      "post": {
        "operationId": "webhook_reservation_updated",
        "tags": [
          "Webhooks"
        ],
        "summary": "reservation.updated",
        "description": "Sent to endpoints subscribed to `reservation.updated`. Verify the `Stage-Signature` header before trusting the payload. Respond with any 2xx within 10 seconds; failures are retried with exponential backoff (8 attempts over roughly 18 hours).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`",
              "example": "t=1793545445,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
            },
            "required": true,
            "name": "Stage-Signature",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    },
    "reservation.checked_in": {
      "post": {
        "operationId": "webhook_reservation_checked_in",
        "tags": [
          "Webhooks"
        ],
        "summary": "reservation.checked_in",
        "description": "Sent to endpoints subscribed to `reservation.checked_in`. Verify the `Stage-Signature` header before trusting the payload. Respond with any 2xx within 10 seconds; failures are retried with exponential backoff (8 attempts over roughly 18 hours).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`",
              "example": "t=1793545445,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
            },
            "required": true,
            "name": "Stage-Signature",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    },
    "reservation.completed": {
      "post": {
        "operationId": "webhook_reservation_completed",
        "tags": [
          "Webhooks"
        ],
        "summary": "reservation.completed",
        "description": "Sent to endpoints subscribed to `reservation.completed`. Verify the `Stage-Signature` header before trusting the payload. Respond with any 2xx within 10 seconds; failures are retried with exponential backoff (8 attempts over roughly 18 hours).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`",
              "example": "t=1793545445,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
            },
            "required": true,
            "name": "Stage-Signature",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    },
    "reservation.cancelled": {
      "post": {
        "operationId": "webhook_reservation_cancelled",
        "tags": [
          "Webhooks"
        ],
        "summary": "reservation.cancelled",
        "description": "Sent to endpoints subscribed to `reservation.cancelled`. Verify the `Stage-Signature` header before trusting the payload. Respond with any 2xx within 10 seconds; failures are retried with exponential backoff (8 attempts over roughly 18 hours).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`",
              "example": "t=1793545445,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
            },
            "required": true,
            "name": "Stage-Signature",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    },
    "reservation.no_show": {
      "post": {
        "operationId": "webhook_reservation_no_show",
        "tags": [
          "Webhooks"
        ],
        "summary": "reservation.no_show",
        "description": "Sent to endpoints subscribed to `reservation.no_show`. Verify the `Stage-Signature` header before trusting the payload. Respond with any 2xx within 10 seconds; failures are retried with exponential backoff (8 attempts over roughly 18 hours).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`",
              "example": "t=1793545445,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
            },
            "required": true,
            "name": "Stage-Signature",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    },
    "reservation.expired": {
      "post": {
        "operationId": "webhook_reservation_expired",
        "tags": [
          "Webhooks"
        ],
        "summary": "reservation.expired",
        "description": "Sent to endpoints subscribed to `reservation.expired`. Verify the `Stage-Signature` header before trusting the payload. Respond with any 2xx within 10 seconds; failures are retried with exponential backoff (8 attempts over roughly 18 hours).",
        "parameters": [
          {
            "schema": {
              "type": "string",
              "description": "`t=<unix seconds>,v1=<hex HMAC-SHA256 of \"<t>.<raw body>\">`",
              "example": "t=1793545445,v1=5257a869e7ecebeda32affa62cdca3fa51cad7e77a0e56ff536d0ce8e108d8bd"
            },
            "required": true,
            "name": "Stage-Signature",
            "in": "header"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReservationWebhookEvent"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Acknowledged."
          }
        }
      }
    }
  }
}
