> ## 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.

# Update Station

> Update a station. Only the fields you send change; send `latitude` and `longitude` together to move it, and `polygon: null` to remove its area.

**Failure Modes:**
- **401**: Token is missing or invalid
- **403**: Insufficient permissions, or you cannot manage the station's company or the new `company_slug`
- **404**: No station with this ID
- **422**: Invalid request body

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



## OpenAPI

````yaml /api-reference/openapi.json put /operations/stations/{station_id}
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/{station_id}:
    put:
      tags:
        - Fleet Management
      summary: Update Station
      description: >-
        Update a station. Only the fields you send change; send `latitude` and
        `longitude` together to move it, and `polygon: null` to remove its area.


        **Failure Modes:**

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

        - **403**: Insufficient permissions, or you cannot manage the station's
        company or the new `company_slug`

        - **404**: No station with this ID

        - **422**: Invalid request body


        **Required Auth Scopes:**

        - `stations:manage`
      operationId: update_station
      parameters:
        - name: station_id
          in: path
          required: true
          schema:
            type: integer
            description: ID of the station.
            title: Station Id
          description: ID of the station.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/StationUpdate'
      responses:
        '200':
          description: >-
            Station updated successfully. Returns the updated 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 update stations.
        '404':
          description: Not Found. No station exists with the specified ID in the system.
        '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:
    StationUpdate:
      properties:
        name:
          type:
            - string
            - 'null'
          title: Name
          description: Updated name.
          examples:
            - Duomo
        address:
          type:
            - string
            - 'null'
          title: Address
          description: Updated address.
          examples:
            - Piazza del Duomo, 20122 Milano MI
        max_capacity:
          type:
            - integer
            - 'null'
          title: Max Capacity
          description: Updated max capacity.
          examples:
            - 20
        latitude:
          type:
            - number
            - 'null'
          title: Latitude
          description: New latitude; applied only together with `longitude`.
          examples:
            - 45.4642
        longitude:
          type:
            - number
            - 'null'
          title: Longitude
          description: New longitude; applied only together with `latitude`.
          examples:
            - 9.19
        polygon:
          items:
            items:
              type: number
            type: array
          type:
            - array
            - 'null'
          title: Polygon
          description: New station area (closed ring of `[longitude, latitude]`).
          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
            - 'null'
          title: Company Slug
          description: Move the station to another company you can manage.
          examples:
            - acme-mobility
      type: object
      title: StationUpdate
      description: |-
        Schema for partially updating a station.

        Only provided fields are applied; omitted fields remain unchanged.
        Latitude and longitude are only applied when both are sent; send
        `polygon: null` to remove the boundary.
      examples:
        - max_capacity: 24
    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.