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

# List Switches

> Get a list of Switches

export const permission_0 = 'switch:read'

<Info>Requires permission: **{permission_0}**</Info>

<Note>
  Read more about the [Switch](/docs/switch) data model.
</Note>


## OpenAPI

````yaml GET /v1/switch
openapi: 3.0.1
info:
  title: Variable API
  description: This is the Variable API
  version: 1.1.0
servers:
  - url: https://app.variable.global/api
security:
  - basicAuth: []
  - bearerAuth: []
  - oAuthNoScopes: []
paths:
  /v1/switch:
    get:
      summary: Get a list of Switches
      parameters:
        - $ref: '#/components/parameters/impacts'
      responses:
        '200':
          description: A list of Switches
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: array
                    items:
                      $ref: '#/components/schemas/Switch'
                required:
                  - data
        '401':
          description: ExpiredToken
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ExpiredTokenResponse'
      security:
        - bearerAuth: []
components:
  parameters:
    impacts:
      name: impacts
      in: query
      description: >-
        Which environmental impact indicators to include in the `impacts` field.
        Absent or empty returns only `GWP-fossil`. Pass `all` for every
        indicator, or a comma-separated list of canonical codes to filter
        (case-insensitive). `all` is only honored on its own — combining it with
        other codes (e.g. `all,gwp-fossil`) is treated as an unknown code. An
        unknown code returns `400`. See the [Impacts](/docs/impacts) concept and
        the full [indicator catalog](/docs/help/impact-indicators).
      required: false
      schema:
        type: string
        example: gwp-fossil,odp,ap
  schemas:
    Switch:
      allOf:
        - properties:
            uuid:
              $ref: '#/components/schemas/UUID'
        - $ref: '#/components/schemas/NewSwitch'
        - properties:
            image:
              type: string
              example: https://app.variable.global/uploads/image.jpg
            sources:
              type: array
              items:
                $ref: '#/components/schemas/IDAndName'
            footprint:
              deprecated: true
              description: >-
                Deprecated — use `impacts["GWP-fossil"]`. Kept for backwards
                compatibility.
              properties:
                CO2e:
                  properties:
                    productCarbonFootprint:
                      type: string
                      example: '1234.5678'
                    A1_A3:
                      type: string
                      example: '1234.5678'
            impacts:
              $ref: '#/components/schemas/Impacts'
        - $ref: '#/components/schemas/CreatedUpdated'
    ExpiredTokenResponse:
      type: object
      properties:
        message:
          type: string
          example: token expired
    UUID:
      type: string
      format: uuid
    NewSwitch:
      properties:
        syncId:
          $ref: '#/components/schemas/SyncId'
        name:
          type: string
          example: Switch Name
        unit:
          $ref: '#/components/schemas/UnitString'
    IDAndName:
      type: object
      properties:
        uuid:
          $ref: '#/components/schemas/UUID'
        name:
          type: string
          example: Name
    Impacts:
      type: object
      description: >-
        Environmental impact indicators keyed by canonical code (e.g.
        `GWP-fossil`, `ODP`, `AP`). Which indicators appear is controlled by the
        `impacts` query parameter — by default only `GWP-fossil` is returned.
      additionalProperties:
        $ref: '#/components/schemas/ApiImpact'
      example:
        GWP-fossil:
          unit: kgCO2e
          method: Mixed
          totalCarbonFootprint: '10'
          A1_A3: '10'
        ODP:
          unit: kgCFC11e
          method: EN15804+A2 - Core impact categories and indicators
          A1_A3: '0.0000012'
        AP:
          unit: molH+e
          method: EN15804+A2 - Core impact categories and indicators
          A1_A3: '2'
    CreatedUpdated:
      type: object
      properties:
        created:
          type: string
          description: ISO 8601 date
          example: '2021-01-01T00:00:00.000Z'
        updated:
          type: string
          description: ISO 8601 date
          example: '2021-01-31T23:59:59.000Z'
    SyncId:
      type: string
      description: >-
        An identifier to use when syncing data with other systems. [Read
        more](/docs/syncId)
      example: sync123
    UnitString:
      type: string
      example: kg
      description: >-
        The unit code (e.g. kg, lbs, etc.). All unit codes can be found in the
        [List Units](/api-reference/v1/unit/get) endpoint.
    ApiImpact:
      type: object
      description: >-
        One environmental impact indicator. `unit` and `method` describe the
        indicator; the remaining fields carry its values — both individual
        life-cycle stages (`A1`, `A2`, `A3`, …) and aggregated totals
        (`totalCarbonFootprint`, `A1_A3`, …). A value that is genuinely zero is
        the string `"0"`; a missing one is absent. `method` is `Mixed` when the
        total aggregates two or more components from different methods — common
        for the headline `GWP-fossil` total.
      properties:
        unit:
          type: string
          example: kgCO2e
        method:
          type: string
          example: EN15804+A2 - Core impact categories and indicators
      allOf:
        - $ref: '#/components/schemas/FootprintCO2eComputed'
        - $ref: '#/components/schemas/FootprintCO2e'
    FootprintCO2eComputed:
      properties:
        totalCarbonFootprint:
          type: string
          example: '1234.5678'
        productCarbonFootprint:
          type: string
          example: '1234.0'
        upstream:
          type: string
          example: '1230.0'
        direct:
          type: string
          example: '4.0'
        downstream:
          type: string
          example: '0.5678'
        A1_A3:
          type: string
          example: '1234.0'
    FootprintCO2e:
      type: object
      properties:
        A1:
          type: string
          example: '1200.0'
        A2:
          type: string
          example: '30.0'
        A3:
          type: string
          example: '4.0'
        A4:
          type: string
          example: '0.5'
        B1:
          type: string
          example: '0.06'
        B2:
          type: string
          example: '0.007'
        B3:
          type: string
          example: '0.0008'
        B4:
          type: string
          example: ''
        B5:
          type: string
          example: ''
        C1:
          type: string
          example: ''
        C2:
          type: string
          example: ''
        C3:
          type: string
          example: ''
        C4:
          type: string
          example: ''
        D:
          type: string
          example: ''
  securitySchemes:
    basicAuth:
      type: http
      scheme: basic
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    oAuthNoScopes:
      type: oauth2
      flows:
        clientCredentials:
          tokenUrl: /auth/token
          scopes: {}

````