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

# Create Station

> Add a docking station, with its capacity and optionally its area as a polygon.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: Insufficient permissions, or `company_slug` is a company you cannot manage
- **422**: Invalid request body, e.g. a polygon that is not closed or has fewer than 4 points

**Required Auth Scopes:**
- `stations:manage`



## OpenAPI

````yaml /api-reference/openapi.json post /operations/stations
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://api.getswitch.io
    description: Production
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:
  /operations/stations:
    post:
      tags:
        - Fleet Management
      summary: Create Station
      description: >-
        Add a docking station, with its capacity and optionally its area as a
        polygon.


        **Failure Modes:**

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

        - **403**: Insufficient permissions, or `company_slug` is a company you
        cannot manage

        - **422**: Invalid request body, e.g. a polygon that is not closed or
        has fewer than 4 points


        **Required Auth Scopes:**

        - `stations:manage`
      operationId: create_station
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StationCreate'
      responses:
        '201':
          description: >-
            Station created successfully. Returns the complete station profile
            including coordinates, capacity, optional polygon boundary, and
            company ownership.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/StationPublic'
        '401':
          description: >-
            Unauthorized. Token is missing, invalid, malformed, expired, or
            revoked.
        '403':
          description: >-
            Forbidden. The authenticated user does not have sufficient
            permissions to create stations.
        '422':
          description: >-
            Unprocessable Entity. Request validation failed due to malformed
            data, missing required fields, or invalid field types.
        '500':
          description: Internal Server Error.
      security:
        - HTTPBearer: []
        - HTTPBearer: []
components:
  schemas:
    StationCreate:
      properties:
        name:
          type: string
          title: Name
          description: Station name.
          examples:
            - Duomo
        address:
          type: string
          title: Address
          description: Full address.
          examples:
            - Piazza del Duomo, 20122 Milano MI
        max_capacity:
          type: integer
          title: Max Capacity
          description: Maximum number of vehicles the station holds.
          examples:
            - 20
        latitude:
          type: number
          title: Latitude
          description: Latitude (WGS84).
          examples:
            - 45.4642
        longitude:
          type: number
          title: Longitude
          description: Longitude (WGS84).
          examples:
            - 9.19
        polygon:
          items:
            items:
              type: number
            type: array
          type:
            - array
            - 'null'
          title: Polygon
          description: >-
            Optional station area as a closed ring of `[longitude, latitude]`
            pairs: at least 4 points, the last equal to the first.
          examples:
            - - - 9.1893
                - 45.4638
              - - 9.1907
                - 45.4638
              - - 9.1907
                - 45.4647
              - - 9.1893
                - 45.4647
              - - 9.1893
                - 45.4638
        company_slug:
          type: string
          title: Company Slug
          description: Owning company slug.
          examples:
            - acme-mobility
      type: object
      required:
        - name
        - address
        - max_capacity
        - latitude
        - longitude
        - company_slug
      title: StationCreate
      description: |-
        Schema for creating a new station.

        All required fields must be provided including name, address,
        capacity, and WGS84 coordinates. An optional polygon boundary can
        define the station's geographic area.
      examples:
        - address: Piazza del Duomo, 20122 Milano MI
          company_slug: acme-mobility
          latitude: 45.4642
          longitude: 9.19
          max_capacity: 20
          name: Duomo
          polygon:
            - - 9.1893
              - 45.4638
            - - 9.1907
              - 45.4638
            - - 9.1907
              - 45.4647
            - - 9.1893
              - 45.4647
            - - 9.1893
              - 45.4638
    StationPublic:
      properties:
        id:
          type: integer
          title: Id
          description: Unique ID.
          examples:
            - 1
        name:
          type: string
          title: Name
          description: Station name.
          examples:
            - Duomo
        address:
          type: string
          title: Address
          description: Full address.
          examples:
            - Piazza del Duomo, 20122 Milano MI
        max_capacity:
          type: integer
          title: Max Capacity
          description: Maximum number of vehicles the station holds.
          examples:
            - 20
        latitude:
          type: number
          title: Latitude
          description: Latitude.
          examples:
            - 45.4642
        longitude:
          type: number
          title: Longitude
          description: Longitude.
          examples:
            - 9.19
        polygon:
          items:
            items:
              type: number
            type: array
          type:
            - array
            - 'null'
          title: Polygon
          description: >-
            Station area as a closed ring of `[longitude, latitude]` pairs;
            absent when the station has none.
          examples:
            - - - 9.1893
                - 45.4638
              - - 9.1907
                - 45.4638
              - - 9.1907
                - 45.4647
              - - 9.1893
                - 45.4647
              - - 9.1893
                - 45.4638
        company_slug:
          type: string
          title: Company Slug
          description: Owning company slug.
          examples:
            - acme-mobility
        company_name:
          type: string
          title: Company Name
          description: Owning company display name.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Datetime when the record was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          title: Updated At
          description: Datetime when the record was last updated, if ever.
      type: object
      required:
        - id
        - name
        - address
        - max_capacity
        - latitude
        - longitude
        - company_slug
        - company_name
        - created_at
      title: StationPublic
      description: |-
        Public schema for a station resource.

        Exposes station details to API consumers, including coordinates,
        capacity, optional polygon boundary, and company ownership.
      examples:
        - address: Piazza del Duomo, 20122 Milano MI
          company_name: Acme Mobility
          company_slug: acme-mobility
          created_at: '2026-09-18T10:05:00Z'
          id: 21
          latitude: 45.4642
          longitude: 9.19
          max_capacity: 20
          name: Duomo
          polygon:
            - - 9.1893
              - 45.4638
            - - 9.1907
              - 45.4638
            - - 9.1907
              - 45.4647
            - - 9.1893
              - 45.4647
            - - 9.1893
              - 45.4638
          updated_at: '2026-11-03T08:31:00Z'
  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.