> ## Documentation Index
> Fetch the complete documentation index at: https://stage-docs.getswitch.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Station Capacity Alerts

> Retrieve real-time station capacity status and identify stations at or near full capacity where users cannot return vehicles. Returns lists of full-capacity stations, high-capacity stations (>90% full), current status of all stations, and a feasibility assessment.

Each station is reported at its most recent availability record of the last 24 hours.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: Insufficient permissions
- **404**: `no_data_binding` when the provider or location is not enabled for your company, or no data for that location and period
- **422**: Invalid query parameters
- **500**: Internal server error

**Required Auth Scopes:**
- `copilot:analytics`, and read access to live fleet data for your company



## OpenAPI

````yaml /api-reference/openapi.json get /copilot/station-based/{provider}/capacity_alerts
openapi: 3.1.0
info:
  title: SWITCH API
  version: '1.0'
  description: >-
    The SWITCH API gives mobility and logistics teams programmatic access to
    SWITCH forecasts, fleet operations, routing and analytics. Every request is
    authenticated with an API key sent as a bearer token.
servers:
  - url: https://stage-api.getswitch.io
    description: Stage
security: []
tags:
  - name: Forecast
    description: Demand forecasts per zone and time window.
  - name: Operations
    description: Fleet imbalance, rebalancing suggestions and generated tasks.
  - name: Routing
    description: Route optimisation for single and multiple fleets.
  - name: Routing Sessions
    description: Saved routing sessions, their routes and drivers.
  - name: Routing Operations
    description: Complete, undo and re-route the stops of a route.
  - name: Fleet Management
    description: Your depots, stations, drivers and cargo vehicles.
  - name: Integrations
    description: Vehicles, statuses and commands on your fleet platform.
  - name: Station Based Analytics
    description: Analytics for station-based (docked) services.
  - name: Zone Based Analytics
    description: Analytics for free-floating services, by zone.
  - name: Free Float Analytics
    description: Trip history for free-floating services.
  - name: Transit Analytics
    description: Punctuality and service delivery for public transit.
  - name: Live
    description: Real-time fleet, delivery and transit status.
  - name: Grids
    description: Spatial grids used by forecasts and analytics.
  - name: API Keys
    description: Create and manage the API keys you call this API with.
paths:
  /copilot/station-based/{provider}/capacity_alerts:
    get:
      tags:
        - Station Based Analytics
      summary: Get Station Capacity Alerts
      description: >-
        Retrieve real-time station capacity status and identify stations at or
        near full capacity where users cannot return vehicles. Returns lists of
        full-capacity stations, high-capacity stations (>90% full), current
        status of all stations, and a feasibility assessment.


        Each station is reported at its most recent availability record of the
        last 24 hours.


        **Failure Modes:**

        - **401**: Token is missing or invalid

        - **403**: Insufficient permissions

        - **404**: `no_data_binding` when the provider or location is not
        enabled for your company, or no data for that location and period

        - **422**: Invalid query parameters

        - **500**: Internal server error


        **Required Auth Scopes:**

        - `copilot:analytics`, and read access to live fleet data for your
        company
      operationId: get_capacity_alerts
      parameters:
        - name: provider
          in: path
          required: true
          schema:
            type: string
            description: >-
              Identifier of the mobility provider whose data you analyse, e.g.
              `acme-bikes`. It must be the provider of a data source enabled for
              your company's station-based analytics; any other value is refused
              with 404 `no_data_binding` (`kind: source`). Your SWITCH contact
              tells you the provider identifiers and locations enabled for your
              company.
            title: Provider
          description: >-
            Identifier of the mobility provider whose data you analyse, e.g.
            `acme-bikes`. It must be the provider of a data source enabled for
            your company's station-based analytics; any other value is refused
            with 404 `no_data_binding` (`kind: source`). Your SWITCH contact
            tells you the provider identifiers and locations enabled for your
            company.
        - name: geolabel
          in: query
          required: true
          schema:
            type: string
            description: >-
              Location whose stations to check, e.g. `milan`: one of the
              locations (or their geolabels) enabled for your company with this
              provider. Any other value is refused with 404 `no_data_binding`
              (`kind: location`).
            title: Geolabel
          description: >-
            Location whose stations to check, e.g. `milan`: one of the locations
            (or their geolabels) enabled for your company with this provider.
            Any other value is refused with 404 `no_data_binding` (`kind:
            location`).
      responses:
        '200':
          description: >-
            Capacity alert data retrieved. Returns full-capacity stations,
            high-capacity stations, all station statuses, and a feasibility
            assessment.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CapacityAlertsResponse'
        '401':
          description: Unauthorized. Token is missing or invalid.
        '403':
          description: Forbidden. Insufficient permissions.
        '422':
          description: Unprocessable Entity. Validation failed.
        '500':
          description: Internal Server Error.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    CapacityAlertsResponse:
      properties:
        full_capacity_stations:
          items:
            $ref: '#/components/schemas/StationCapacityStatus'
          type: array
          title: Full Capacity Stations
          description: >-
            Stations that are completely full (no available docks for bike
            returns)
          examples:
            - []
        high_capacity_stations:
          items:
            $ref: '#/components/schemas/StationCapacityStatus'
          type: array
          title: High Capacity Stations
          description: Stations with high capacity utilization (>90% full)
          examples:
            - []
        all_stations_status:
          items:
            $ref: '#/components/schemas/StationCapacityStatus'
          type: array
          title: All Stations Status
          description: Current status of all stations in the specified area
          examples:
            - []
        feasibility:
          type: string
          title: Feasibility
          description: Analysis feasibility status indicating if the query was successful
          examples:
            - feasible
            - not-feasible
        message:
          type: string
          title: Message
          description: >-
            Human-readable message describing the analysis results and data
            timeframe
          examples:
            - >-
              Real-time alerting system for stations at capacity where users
              cannot return bikes. Data from last 3 hours.
      type: object
      required:
        - full_capacity_stations
        - high_capacity_stations
        - all_stations_status
        - feasibility
        - message
      title: CapacityAlertsResponse
      description: Capacity alerts analysis response with real-time station status.
      examples:
        - all_stations_status:
            - available_bikes: 24
              available_docks: 0
              available_ebikes: 7
              capacity: 24
              capacity_stress: 1
              ebike_ratio: 0.29
              geolabel: milan
              is_full: true
              provider: acme-bikes
              station_id: 101
              station_latitude: 45.4642
              station_longitude: 9.19
              station_name: Duomo
              timestamp: '2026-11-29T08:55:00Z'
              total_vehicles_available: 24
            - available_bikes: 4
              available_docks: 26
              available_ebikes: 1
              capacity: 30
              capacity_stress: 0.13
              ebike_ratio: 0.25
              geolabel: milan
              is_full: false
              provider: acme-bikes
              station_id: 245
              station_latitude: 45.4859
              station_longitude: 9.2045
              station_name: Stazione Centrale
              timestamp: '2026-11-29T08:56:00Z'
              total_vehicles_available: 4
          feasibility: feasible
          full_capacity_stations:
            - available_bikes: 24
              available_docks: 0
              available_ebikes: 7
              capacity: 24
              capacity_stress: 1
              ebike_ratio: 0.29
              geolabel: milan
              is_full: true
              provider: acme-bikes
              station_id: 101
              station_latitude: 45.4642
              station_longitude: 9.19
              station_name: Duomo
              timestamp: '2026-11-29T08:55:00Z'
              total_vehicles_available: 24
          high_capacity_stations:
            - available_bikes: 19
              available_docks: 1
              available_ebikes: 8
              capacity: 20
              capacity_stress: 0.95
              ebike_ratio: 0.42
              geolabel: milan
              is_full: false
              provider: acme-bikes
              station_id: 318
              station_latitude: 45.4532
              station_longitude: 9.176
              station_name: Darsena
              timestamp: '2026-11-29T08:54:00Z'
              total_vehicles_available: 19
          message: >-
            Real-time alerting system for stations at capacity where users
            cannot return bikes. Data from last 24 hours. Snapshot semantics:
            one record per station (latest within window).
    StationCapacityStatus:
      properties:
        station_id:
          anyOf:
            - type: integer
            - type: string
          title: Station Id
          description: Unique identifier for the bike sharing station
          examples:
            - 123
            - station_456
            - ST_789
        station_name:
          type: string
          minLength: 1
          title: Station Name
          description: Human-readable name of the station
          examples:
            - Central Station
            - Park Avenue
            - Main Square
        station_latitude:
          type: number
          maximum: 90
          minimum: -90
          title: Station Latitude
          description: Station latitude in decimal degrees
          examples:
            - 45.464664
            - 40.7128
            - 51.5074
        station_longitude:
          type: number
          maximum: 180
          minimum: -180
          title: Station Longitude
          description: Station longitude in decimal degrees
          examples:
            - 9.18854
            - -74.006
            - -0.1278
        timestamp:
          type: string
          format: date-time
          title: Timestamp
          description: Timestamp of the latest data record for this station
          examples:
            - '2024-10-04T14:30:00Z'
        total_vehicles_available:
          type: integer
          minimum: 0
          title: Total Vehicles Available
          description: Total number of vehicles (bikes + e-bikes) available at the station
          examples:
            - 0
            - 5
            - 12
        available_ebikes:
          type: integer
          minimum: 0
          title: Available Ebikes
          description: Number of e-bikes available at the station
          examples:
            - 0
            - 2
            - 8
        available_bikes:
          type: integer
          minimum: 0
          title: Available Bikes
          description: Total number of bikes available (including e-bikes)
          examples:
            - 0
            - 5
            - 12
        available_docks:
          type: integer
          minimum: 0
          title: Available Docks
          description: Number of available docking stations where bikes can be returned
          examples:
            - 0
            - 3
            - 15
        capacity:
          type: integer
          exclusiveMinimum: 0
          title: Capacity
          description: Total capacity (docks) of this station
          examples:
            - 20
            - 30
            - 40
        provider:
          type: string
          minLength: 1
          title: Provider
          description: Bike sharing provider identifier
          examples:
            - acme-bikes
        geolabel:
          type: string
          minLength: 1
          title: Geolabel
          description: Geographic label for this station
          examples:
            - milan
            - rome
            - paris
        is_full:
          type: boolean
          title: Is Full
          description: Whether the station is at full capacity (no available docks)
          examples:
            - true
            - false
        capacity_stress:
          type: number
          maximum: 1
          minimum: 0
          title: Capacity Stress
          description: Capacity utilization ratio (0-1, where 1 means completely full)
          examples:
            - 0
            - 0.85
            - 1
        ebike_ratio:
          type: number
          maximum: 1
          minimum: 0
          title: Ebike Ratio
          description: Proportion of available vehicles that are e-bikes (0-1)
          examples:
            - 0
            - 0.35
            - 0.67
      type: object
      required:
        - station_id
        - station_name
        - station_latitude
        - station_longitude
        - timestamp
        - total_vehicles_available
        - available_ebikes
        - available_bikes
        - available_docks
        - capacity
        - provider
        - geolabel
        - is_full
        - capacity_stress
        - ebike_ratio
      title: StationCapacityStatus
      description: >-
        Station capacity status with real-time availability and capacity
        metrics.
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer
      description: >-
        An API key, sent as `Authorization: Bearer <key>`. Create one in the
        SWITCH Copilot under **Settings → API keys** (needs the API keys
        permission in your company), or with `POST /auth/api-keys`. The key is
        shown once, at creation.

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.