> ## 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 Current User Profile

> Who you are authenticated as. With an API key, this is the user who created the key. Returns the user (`id`, `full_name`, `email`), their company (`company_slug` and `company`), and `access`: your level per resource and the locations, fleets, analyses and forecasts your company's data covers. Use it to check a key works and to find the valid `location` and provider values for the other endpoints.

**Failure Modes:**
- **401**: Token or API key is missing, invalid, expired or revoked

**Required Auth Scopes:**
- Any valid token or API key (no scope needed)



## OpenAPI

````yaml /api-reference/openapi.json get /auth/me
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:
  /auth/me:
    get:
      tags:
        - API Keys
      summary: Get Current User Profile
      description: >-
        Who you are authenticated as. With an API key, this is the user who
        created the key. Returns the user (`id`, `full_name`, `email`), their
        company (`company_slug` and `company`), and `access`: your level per
        resource and the locations, fleets, analyses and forecasts your
        company's data covers. Use it to check a key works and to find the valid
        `location` and provider values for the other endpoints.


        **Failure Modes:**

        - **401**: Token or API key is missing, invalid, expired or revoked


        **Required Auth Scopes:**

        - Any valid token or API key (no scope needed)
      operationId: get_profile
      responses:
        '200':
          description: >-
            User profile retrieved successfully. Returns the complete public
            user information including company, case studies, and auth scopes.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MePublic'
        '401':
          description: >-
            Unauthorized. Token is missing, invalid, malformed, expired, or
            revoked. User must authenticate with a valid token.
        '403':
          description: >-
            Forbidden. The provided token does not contain sufficient
            authorization scopes to access this resource.
        '422':
          description: >-
            Unprocessable Entity. Request validation failed due to malformed
            data or invalid field types.
        '500':
          description: >-
            Internal Server Error. An unexpected exception occurred during user
            profile retrieval or database operations.
      security:
        - HTTPBearer: []
components:
  schemas:
    MePublic:
      properties:
        id:
          type: integer
          title: Id
          description: Unique identifier of the user.
        full_name:
          type: string
          title: Full Name
          description: Full name of the user.
        email:
          type: string
          title: Email
          description: Email address of the user.
        company_slug:
          type: string
          title: Company Slug
          description: Slug of the company the user belongs to.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Datetime when the user was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          title: Updated At
          description: Datetime when the user was last updated, if available.
        company:
          $ref: '#/components/schemas/CompanyPublic'
          description: Public information about the user's company.
        case_studies:
          items:
            $ref: '#/components/schemas/CaseStudyPublic'
          type: array
          title: Case Studies
          description: Always empty (legacy field).
        auth_scopes:
          items:
            $ref: '#/components/schemas/AuthScopePublic'
          type: array
          title: Auth Scopes
          description: Legacy authorization scopes, derived from the user's permissions.
        driver:
          $ref: '#/components/schemas/UserDriverPublic'
          description: Driver profile linked to this user, when present.
        access:
          $ref: '#/components/schemas/Access'
          description: >-
            What you can use: your level per resource (`resources`, e.g.
            `fleet.vehicles: use`), your company and plan (`company`), and the
            locations, fleets, analyses and forecasts your company's data covers
            (`data`). Absent only if it could not be resolved.
        is_internal:
          type: boolean
          title: Is Internal
          description: SWITCH staff or trial account (analytics flag).
          readOnly: true
      type: object
      required:
        - id
        - full_name
        - email
        - company_slug
        - created_at
        - company
        - case_studies
        - auth_scopes
        - is_internal
      title: MePublic
      description: The calling user, their company and what they may access.
      examples:
        - auth_scopes:
            - description: Read forecast data
              slug: forecast:read
            - description: Read access to upstream vehicles
              slug: integrations:vehicles:read
          case_studies: []
          company:
            case_studies: []
            created_at: '2026-03-01T09:00:00Z'
            name: Acme Mobility
            payer: acme-mobility
            plan: enterprise
            slug: acme-mobility
            users_count: 12
          company_slug: acme-mobility
          created_at: '2026-03-02T10:15:00Z'
          email: jane.doe@example.com
          full_name: Jane Doe
          id: 4211
          is_internal: false
          updated_at: '2026-11-20T08:30:00Z'
    CompanyPublic:
      properties:
        slug:
          type: string
          title: Slug
          description: Unique slug identifier for the company.
        name:
          type: string
          title: Name
          description: Name of the company.
        parent_company_slug:
          type:
            - string
            - 'null'
          title: Parent Company Slug
          description: Slug of the parent company, if this is a subsidiary.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Datetime when the company was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          title: Updated At
          description: Datetime when the company was last updated, if available.
        case_studies:
          items:
            $ref: '#/components/schemas/CaseStudyPublic'
          type: array
          title: Case Studies
          description: Always empty (legacy field).
        plan:
          type:
            - string
            - 'null'
          enum:
            - enterprise
            - pro
          title: Plan
          description: Billing plan of the company.
        payer:
          type:
            - string
            - 'null'
          title: Payer
          description: Slug of the company that pays for this company's usage.
        users_count:
          type:
            - integer
            - 'null'
          title: Users Count
          description: Active users of this company.
      type: object
      required:
        - slug
        - name
        - created_at
        - case_studies
      title: CompanyPublic
      description: |-
        Public schema for a company resource.

        Exposes company information and related case studies to API consumers.
    CaseStudyPublic:
      properties:
        slug:
          type: string
          title: Slug
          description: Unique slug identifier for the case study.
        title:
          type: string
          title: Title
          description: Title of the case study.
        description:
          type: string
          title: Description
          description: Description of the case study.
        company_slug:
          type: string
          title: Company Slug
          description: Slug of the company associated with the case study.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Datetime when the case study was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          title: Updated At
          description: Datetime when the case study was last updated, if available.
      type: object
      required:
        - slug
        - title
        - description
        - company_slug
        - created_at
      title: CaseStudyPublic
      description: >-
        Public schema for a case study resource.


        Exposes case study information to API consumers, omitting sensitive
        fields.
    AuthScopePublic:
      properties:
        slug:
          type: string
          title: Slug
          description: Unique slug identifier for the authorization scope.
        description:
          type: string
          title: Description
          description: Description of the authorization scope.
      type: object
      required:
        - slug
        - description
      title: AuthScopePublic
      description: >-
        Public schema for an authorization scope.


        Exposes information about an available authorization scope to API
        consumers.
    UserDriverPublic:
      properties:
        id:
          type: integer
          title: Id
          description: Unique identifier of the driver.
        user_id:
          type: integer
          title: User Id
          description: ID of the user linked to the driver.
        phone:
          type:
            - string
            - 'null'
          title: Phone
          description: Driver phone number, if available.
        license_number:
          type:
            - string
            - 'null'
          title: License Number
          description: Driver license number, if available.
        is_active:
          type: boolean
          title: Is Active
          description: Whether the driver is active.
        created_at:
          type: string
          format: date-time
          title: Created At
          description: Datetime when the driver was created.
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
          title: Updated At
          description: Datetime when the driver was last updated, if available.
      type: object
      required:
        - id
        - user_id
        - is_active
        - created_at
      title: UserDriverPublic
      description: Public summary of the driver profile linked to a user.
    Access:
      properties:
        schemaVersion:
          type: integer
          const: 2
          title: Schemaversion
          default: 2
        version:
          type: string
          title: Version
        company:
          $ref: '#/components/schemas/AccessCompanyView'
        resources:
          additionalProperties:
            $ref: '#/components/schemas/ResourceGrant'
          propertyNames:
            $ref: '#/components/schemas/Resource'
          type: object
          title: Resources
        data:
          $ref: '#/components/schemas/DataView'
        settings:
          $ref: '#/components/schemas/SettingsView'
      additionalProperties: false
      type: object
      required:
        - schemaVersion
        - version
        - company
        - resources
        - data
        - settings
      title: Access
      description: |-
        ``GET /auth/me`` -> ``access``. Never: secrets, secretRef, connection
        params (except the deliverart POS-id map as ``geolabels``), SQL filters,
        dataPrefix, forecast scenario, instructions.
    AccessCompanyView:
      properties:
        slug:
          type: string
          title: Slug
        chain:
          items:
            type: string
          type: array
          title: Chain
        dataOwner:
          type: string
          title: Dataowner
        payer:
          type: string
          title: Payer
        plan:
          type: string
          enum:
            - enterprise
            - pro
          title: Plan
        staff:
          type: boolean
          title: Staff
      additionalProperties: false
      type: object
      required:
        - slug
        - chain
        - dataOwner
        - payer
        - plan
        - staff
      title: AccessCompanyView
    ResourceGrant:
      properties:
        level:
          $ref: '#/components/schemas/Level'
        share:
          type: boolean
          title: Share
          default: false
        publish:
          type: boolean
          title: Publish
          default: false
      additionalProperties: false
      type: object
      required:
        - level
        - share
        - publish
      title: ResourceGrant
    DataView:
      properties:
        locations:
          additionalProperties:
            $ref: '#/components/schemas/Location'
          type: object
          title: Locations
        scope:
          $ref: '#/components/schemas/ScopeView'
        fleets:
          additionalProperties:
            $ref: '#/components/schemas/FleetView'
          type: object
          title: Fleets
        analyses:
          $ref: '#/components/schemas/AnalysesView'
        transit:
          $ref: '#/components/schemas/TransitView'
        forecast:
          $ref: '#/components/schemas/ForecastView'
        studies:
          $ref: '#/components/schemas/StudiesView'
      additionalProperties: false
      type: object
      required:
        - locations
        - scope
        - fleets
        - analyses
        - transit
        - forecast
        - studies
      title: DataView
    SettingsView:
      properties:
        timezone:
          type:
            - string
            - 'null'
          title: Timezone
        assistant:
          $ref: '#/components/schemas/AssistantView'
        forecast:
          $ref: '#/components/schemas/ForecastSettingsView'
        ops:
          $ref: '#/components/schemas/OpsSettingsView'
        transit:
          $ref: '#/components/schemas/CompanyTransitSettings'
        presentation:
          $ref: '#/components/schemas/PresentationView'
      additionalProperties: false
      type: object
      required:
        - timezone
        - assistant
        - forecast
        - ops
        - transit
        - presentation
      title: SettingsView
    Level:
      type: string
      enum:
        - none
        - read
        - use
        - manage
      title: Level
    Location:
      properties:
        label:
          type:
            - string
            - 'null'
          title: Label
          description: Display name.
        timezone:
          type:
            - string
            - 'null'
          title: Timezone
          description: Local time of the city (analytics windows, live).
        bounds:
          $ref: '#/components/schemas/Bounds'
          description: Bounding box (was MDS locationMappings).
        dataManagerCity:
          type:
            - string
            - 'null'
          title: Datamanagercity
          description: Data Manager city path for map layers.
      additionalProperties: false
      type: object
      title: Location
    ScopeView:
      properties:
        timeRange:
          $ref: '#/components/schemas/TimeRangeView'
      additionalProperties: false
      type: object
      required:
        - timeRange
      title: ScopeView
    FleetView:
      properties:
        connector:
          type: string
          enum:
            - atom
            - wunder_v1
            - wunder_v2
            - deliverart
            - demo
            - dummy
            - mds
            - waltti
          title: Connector
        locations:
          items:
            type: string
          type: array
          title: Locations
      additionalProperties: false
      type: object
      required:
        - connector
        - locations
      title: FleetView
    AnalysesView:
      properties:
        analytics:
          additionalProperties:
            $ref: '#/components/schemas/BindingView'
          type: object
          title: Analytics
        live:
          additionalProperties:
            $ref: '#/components/schemas/BindingView'
          type: object
          title: Live
      additionalProperties: false
      type: object
      required:
        - analytics
        - live
      title: AnalysesView
    TransitView:
      properties:
        locationId:
          type: string
          title: Locationid
        serviceProviderId:
          type: string
          title: Serviceproviderid
        walttiCitySlug:
          type:
            - string
            - 'null'
          title: Waltticityslug
      additionalProperties: false
      type: object
      required:
        - locationId
        - serviceProviderId
        - walttiCitySlug
      title: TransitView
    ForecastView:
      properties:
        grids:
          items:
            $ref: '#/components/schemas/Grid'
          type: array
          title: Grids
        types:
          additionalProperties:
            $ref: '#/components/schemas/ForecastTypeView'
          type: object
          title: Types
      additionalProperties: false
      type: object
      required:
        - grids
        - types
      title: ForecastView
    StudiesView:
      properties:
        prefix:
          type: string
          title: Prefix
        kinds:
          items:
            type: string
          type: array
          title: Kinds
        scenario:
          type:
            - string
            - 'null'
          title: Scenario
      additionalProperties: false
      type: object
      required:
        - prefix
        - kinds
        - scenario
      title: StudiesView
    AssistantView:
      properties:
        posture:
          type:
            - string
            - 'null'
          enum:
            - operational
            - market_intelligence
          title: Posture
      additionalProperties: false
      type: object
      required:
        - posture
      title: AssistantView
    ForecastSettingsView:
      properties:
        defaults:
          $ref: '#/components/schemas/ForecastDefaults'
      additionalProperties: false
      type: object
      required:
        - defaults
      title: ForecastSettingsView
    OpsSettingsView:
      properties:
        fleetModel:
          type:
            - string
            - 'null'
          enum:
            - station-based
            - free-floating
          title: Fleetmodel
        strategies:
          additionalProperties:
            additionalProperties:
              $ref: '#/components/schemas/Strategy'
            type: object
          type: object
          title: Strategies
      additionalProperties: false
      type: object
      required:
        - fleetModel
        - strategies
      title: OpsSettingsView
    CompanyTransitSettings:
      properties:
        timezone:
          type: string
          title: Timezone
          description: Transit timezone.
        onTimeWindowSeconds:
          prefixItems:
            - type: integer
            - type: integer
          type: array
          maxItems: 2
          minItems: 2
          title: Ontimewindowseconds
          description: Punctuality window [early, late] in seconds.
          default:
            - -60
            - 180
      additionalProperties: false
      type: object
      required:
        - timezone
      title: TransitSettings
    PresentationView:
      properties:
        analyses:
          additionalProperties:
            $ref: '#/components/schemas/PresentationEntry'
          type: object
          title: Analyses
      additionalProperties: false
      type: object
      required:
        - analyses
      title: PresentationView
    Bounds:
      properties:
        minLat:
          type: number
          title: Minlat
          description: South edge, WGS84 degrees.
        maxLat:
          type: number
          title: Maxlat
          description: North edge, WGS84 degrees.
        minLng:
          type: number
          title: Minlng
          description: West edge, WGS84 degrees.
        maxLng:
          type: number
          title: Maxlng
          description: East edge, WGS84 degrees.
      additionalProperties: false
      type: object
      required:
        - minLat
        - maxLat
        - minLng
        - maxLng
      title: Bounds
    TimeRangeView:
      properties:
        start:
          type:
            - string
            - 'null'
          format: date
          title: Start
        end:
          type:
            - string
            - 'null'
          format: date
          title: End
      additionalProperties: false
      type: object
      required:
        - start
        - end
      title: TimeRangeView
    BindingView:
      properties:
        locations:
          items:
            type: string
          type: array
          title: Locations
        connector:
          type:
            - string
            - 'null'
          title: Connector
        provider:
          type:
            - string
            - 'null'
          title: Provider
        geolabels:
          additionalProperties:
            type: string
          type:
            - object
            - 'null'
          title: Geolabels
        timezone:
          type:
            - string
            - 'null'
          title: Timezone
        fleet:
          type:
            - string
            - 'null'
          title: Fleet
      additionalProperties: false
      type: object
      required:
        - locations
        - connector
        - provider
        - geolabels
        - timezone
        - fleet
      title: BindingView
    Grid:
      properties:
        type:
          type: string
          minLength: 1
          title: Type
          description: Zoning type (custom-polygons, squares ...).
        tileSize:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
          title: Tilesize
          description: Tile size in metres; null for polygons.
      additionalProperties: false
      type: object
      required:
        - type
      title: Grid
    ForecastTypeView:
      properties:
        locations:
          items:
            type: string
          type: array
          title: Locations
        horizons:
          items:
            $ref: '#/components/schemas/Horizon'
          type: array
          title: Horizons
      additionalProperties: false
      type: object
      required:
        - locations
        - horizons
      title: ForecastTypeView
    ForecastDefaults:
      properties:
        granularityMinutes:
          type: integer
          exclusiveMinimum: 0
          title: Granularityminutes
          description: Step length in minutes.
        steps:
          type: integer
          exclusiveMinimum: 0
          title: Steps
          description: Number of steps.
        grid:
          $ref: '#/components/schemas/GridPreset'
          description: Grid of the preset.
      additionalProperties: false
      type: object
      required:
        - granularityMinutes
        - steps
        - grid
      title: ForecastDefaults
    Strategy:
      properties:
        enabled:
          type: boolean
          title: Enabled
          default: true
        zones:
          additionalProperties: true
          type:
            - object
            - 'null'
          title: Zones
        conditions:
          additionalProperties: true
          type:
            - object
            - 'null'
          title: Conditions
        sorting:
          items:
            additionalProperties: true
            type: object
          type:
            - array
            - 'null'
          title: Sorting
        params:
          additionalProperties: true
          type: object
          title: Params
      additionalProperties: false
      type: object
      required:
        - enabled
        - zones
        - conditions
        - sorting
        - params
      title: Strategy
      description: One rebalancing strategy after the merge patch (validated at resolve).
    PresentationEntry:
      properties:
        label:
          type:
            - string
            - 'null'
          title: Label
          description: Widget label.
        tags:
          items:
            type: string
          type:
            - array
            - 'null'
          title: Tags
          description: Widget chips.
      additionalProperties: false
      type: object
      title: PresentationEntry
    Horizon:
      properties:
        granularityMinutes:
          type: integer
          exclusiveMinimum: 0
          title: Granularityminutes
          description: Step length in minutes.
        steps:
          type: integer
          exclusiveMinimum: 0
          title: Steps
          description: Number of steps.
      additionalProperties: false
      type: object
      required:
        - granularityMinutes
        - steps
      title: Horizon
    GridPreset:
      properties:
        type:
          type: string
          minLength: 1
          title: Type
          description: Grid type.
        tileSize:
          type:
            - integer
            - 'null'
          exclusiveMinimum: 0
          title: Tilesize
          description: Tile size in metres; null for polygons.
      additionalProperties: false
      type: object
      required:
        - type
      title: GridPreset
  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.