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

# List a location's groups

> The fuse tree of a location you reach with basic access or more: each group with its fuse,
its settings for load balancing, its meter and its chargers, and the groups behind it. A
location you do not reach is a 404; one you only view (shared with your app) is a 403.



## OpenAPI

````yaml api-reference/v4/v4.openapi.json GET /locations/{location}/groups
openapi: 3.1.0
info:
  title: Plugchoice API
  description: >-
    Every request sends an access token as `Authorization: Bearer …`, unless an
    operation says otherwise.


    Errors are problems (RFC 9457, `application/problem+json`): `code` says what
    went wrong, and a failed validation lists the fields in `errors`.


    A list answers one page: `{"data": [...], "next_cursor": ...,
    "previous_cursor": ...}`. Pass a cursor back as `cursor` to get that page,
    and `limit` (1 to 100, default 25) for its size.


    Within v4, changes only add: new operations, new optional parameters, new
    fields and new enum values. Ignore fields you do not know, and accept enum
    values you do not know. Requests that send a field the operation does not
    know are refused, so a typo does not pass unnoticed.
  version: '4'
servers:
  - url: https://api.plugchoice.com/v4
security:
  - bearer: []
paths:
  /locations/{location}/groups:
    get:
      tags:
        - locations
      summary: A location's groups
      description: >-
        The fuse tree of a location you reach with basic access or more: each
        group with its fuse,

        its settings for load balancing, its meter and its chargers, and the
        groups behind it. A

        location you do not reach is a 404; one you only view (shared with your
        app) is a 403.
      operationId: list_location_groups
      parameters:
        - name: location
          in: path
          description: The location's id
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The location's groups
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/GroupTree'
        default:
          description: >-
            A problem (RFC 9457). `code` says which; the field errors come with
            `validation-failed`.
          content:
            application/problem+json:
              schema:
                $ref: '#/components/schemas/Problem'
      security:
        - bearer:
            - locations:read
components:
  schemas:
    GroupTree:
      type: object
      description: A location's groups, from its main fuse down.
      required:
        - data
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Group'
          description: 'The groups at the top: in most locations one, the main fuse.'
    Problem:
      type: object
      description: An error response body (RFC 9457).
      required:
        - type
        - title
        - status
        - code
      properties:
        code:
          type: string
          description: 'The kind of problem, for code to act on: the last part of `type`.'
        detail:
          type: string
          description: >-
            What went wrong with this request, when there is more to say than
            the title.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
          description: 'With `validation-failed`: the fields that broke a rule.'
        status:
          type: integer
          format: int32
          description: The HTTP status code.
          minimum: 0
        title:
          type: string
          description: A short summary of the kind of problem.
        type:
          type: string
          description: The page that explains this kind of problem.
    Group:
      type: object
      description: >-
        A group: a fuse, with the chargers behind it and the groups behind
        those. Load balancing keeps

        what flows through the group under its fuse.
      required:
        - id
        - fuse_a
        - solar
        - peak_shaving
        - charger_ids
        - groups
      properties:
        charger_ids:
          type: array
          items:
            type: string
            format: uuid
          description: The chargers in the group, in the group's order.
        fuse_a:
          type: integer
          format: int32
          description: >-
            The fuse: the most current that may flow through the group, per
            phase, in amps.
        groups:
          type: array
          items:
            $ref: '#/components/schemas/Group'
          description: The groups behind this one, each with a fuse of its own.
        id:
          type: string
          format: uuid
          description: The group's id.
        meter_id:
          type:
            - string
            - 'null'
          format: uuid
          description: >-
            The meter that measures what flows through the group, so load
            balancing counts what else

            is behind the fuse; null when it has none.
        method:
          oneOf:
            - $ref: '#/components/schemas/ChargingMethod'
              description: >-
                How the group's chargers charge; null when this API does not
                know the method.
            - type: 'null'
        name:
          type:
            - string
            - 'null'
          description: Its name; null when it has none.
        net_type:
          oneOf:
            - $ref: '#/components/schemas/NetType'
              description: The grid's earthing system; null when it is not set.
            - type: 'null'
        peak_shaving:
          $ref: '#/components/schemas/PeakShaving'
        solar:
          $ref: '#/components/schemas/Solar'
    FieldError:
      type: object
      description: One field that broke a rule.
      required:
        - field
        - code
        - message
      properties:
        code:
          type: string
          description: >-
            The rule it broke, for code to act on: `missing-field`,
            `unknown-field`, `invalid-type`,

            `invalid`, or `taken` (a value that must be unique, such as a card's
            id at a location,

            and is not).
        field:
          type: string
          description: >-
            Where the field is in the request, such as `name` or
            `connectors[0].max_current`.
        message:
          type: string
          description: What is wrong, in English.
    ChargingMethod:
      type: string
      description: >-
        How a group's chargers charge. Accept values you do not know: more may
        come.
      enum:
        - fast
        - solar
    NetType:
      type: string
      description: >-
        The earthing system of a grid connection (IEC 60364). Accept values you
        do not know: more

        may come.
      enum:
        - tn
        - tt
        - it
    PeakShaving:
      type: object
      description: >-
        Keeping what the group takes from the grid under a limit: the peak a
        capacity tariff bills.

        It needs the group's meter.
      required:
        - enabled
        - max_current_a
      properties:
        enabled:
          type: boolean
        max_current_a:
          type: integer
          format: int32
          description: >-
            The limit, in amps summed over the phases (at 230 V, each amp is 230
            W).
        mode:
          oneOf:
            - $ref: '#/components/schemas/PeakShavingMode'
              description: When the limit holds; null when this API does not know the mode.
            - type: 'null'
    Solar:
      type: object
      description: Charging on the surplus of solar panels, while `method` is `solar`.
      required:
        - always_charge
        - minimum_current_a
        - grid_current_a
      properties:
        always_charge:
          type: boolean
          description: >-
            Whether vehicles keep charging at `minimum_current_a` when there is
            too little surplus;

            without it they charge on the surplus alone.
        grid_current_a:
          type: integer
          format: int32
          description: >-
            The current the group may take from the grid to keep vehicles at
            their minimum when the

            surplus falls short, in amps, summed over the phases.
        minimum_current_a:
          type: integer
          format: int32
          description: >-
            The current each EVSE keeps charging at, per phase, in amps, while
            `always_charge` is on.
    PeakShavingMode:
      type: string
      description: >-
        When a peak shaving limit holds. Accept values you do not know: more may
        come.
      enum:
        - instant
        - quarter_hour
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        An access token from `accounts.plugchoice.com`, for a personal API
        token, a person signed in through an app, or an OAuth client.

````

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