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

# Get a location's live state

> What flows through each load balancing group of a location you reach with basic access or
more: what its chargers ask for, what load balancing gives them, what it has to give, and its
meter's reading. A location you do not reach is a 404; one you only view (shared with your app)
is a 403. The meter's reading needs `meters:read` as well. When the live state cannot be read
the answer is a 503, never an older state: try again in a moment.



## OpenAPI

````yaml api-reference/v4/v4.openapi.json GET /locations/{location}/live
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}/live:
    get:
      tags:
        - locations
      summary: A location's live state
      description: >-
        What flows through each load balancing group of a location you reach
        with basic access or

        more: what its chargers ask for, what load balancing gives them, what it
        has to give, and its

        meter's reading. A location you do not reach is a 404; one you only view
        (shared with your app)

        is a 403. The meter's reading needs `meters:read` as well. When the live
        state cannot be read

        the answer is a 503, never an older state: try again in a moment.
      operationId: show_location_live
      parameters:
        - name: location
          in: path
          description: The location's id
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The location's live state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationLive'
        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:
    LocationLive:
      type: object
      description: What flows through a location's load balancing groups now.
      required:
        - location_id
        - groups
      properties:
        groups:
          type: array
          items:
            $ref: '#/components/schemas/GroupLive'
          description: >-
            Its groups, as `GET /v4/locations/{location}/groups` has them, in
            one list: each group

            before the groups behind it. Empty when its power is not managed.
        location_id:
          type: string
          format: uuid
          description: The location's id.
    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, such as
            `validation_failed`. Treat a code you do

            not know by the status.
        detail:
          type: string
          description: >-
            What went wrong with this request, when there is more to say than
            the title; left out

            when there is not.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
          description: >-
            With `validation_failed`: the fields that broke a rule; left out
            when there are none.
        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: its `code` with
            hyphens, as

            `https://developer.plugchoice.com/api/errors/validation-failed`.
    GroupLive:
      type: object
      description: >-
        What flows through a group now. A charger's own share is in its live
        state

        (`GET /v4/chargers/live?location_id=…`).
      required:
        - id
        - fuse_a
        - allocated_a
        - available_a
        - measured_at
        - meter
        - requested_a
      properties:
        allocated_a:
          oneOf:
            - $ref: '#/components/schemas/PerPhase'
              description: >-
                What load balancing gives the chargers behind the group, per
                grid phase, in A. Null while

                it does not run the group.
            - type: 'null'
        available_a:
          oneOf:
            - $ref: '#/components/schemas/PerPhase'
              description: >-
                What load balancing has to give the chargers behind the group,
                per grid phase, in A: the

                fuse less what else the group's meter measures behind it, and
                within solar and peak

                shaving. Null while it does not run the group.
            - type: 'null'
        fuse_a:
          type: integer
          format: int32
          description: >-
            The group's fuse: the most current that may flow through it, per
            phase, in amps.
        id:
          type: string
          format: uuid
          description: The group's id.
        measured_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When load balancing worked these figures out, at its last run of the
            group. Null while it

            does not run the group, and when the OCPP service wrote no time with
            them.
        meter:
          oneOf:
            - $ref: '#/components/schemas/MeterReading'
              description: >-
                What the group's meter measured last. Null when the group has no
                meter, the meter has no

                reading, your token lacks `meters:read`, or the meter belongs to
                a team that is not at

                this location and not yours.
            - type: 'null'
        requested_a:
          oneOf:
            - $ref: '#/components/schemas/PerPhase'
              description: >-
                What the chargers behind the group ask for, per grid phase, in
                A: the most each could

                take. Null while load balancing does not run the group.
            - type: 'null'
    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.
    PerPhase:
      type: object
      description: >-
        A value per grid phase: the phases the grid's L1, L2 and L3 are, after
        the EVSE's phase

        rotation. `null` for a phase that is not there.
      required:
        - l1
        - l2
        - l3
      properties:
        l1:
          type:
            - number
            - 'null'
          format: double
        l2:
          type:
            - number
            - 'null'
          format: double
        l3:
          type:
            - number
            - 'null'
          format: double
    MeterReading:
      type: object
      description: What a meter measured last.
      required:
        - current_a
        - voltage_v
        - measured_at
        - power_w
      properties:
        current_a:
          $ref: '#/components/schemas/PerPhase'
          description: >-
            Current per grid phase in A, positive while taking from the grid and
            negative while

            feeding into it; null for a phase the meter does not measure.
        measured_at:
          type: string
          format: date-time
          description: >-
            When the meter measured it. A meter that stops sending keeps its
            last reading and its time.
        power_w:
          type:
            - number
            - 'null'
          format: double
          description: >-
            Active power through the meter in W, positive while the location
            takes power from the grid

            and negative while it feeds power into it: each measured phase's
            current times its voltage

            (230 V where the meter reports none), added up. Null when the meter
            measures no phase.
        voltage_v:
          $ref: '#/components/schemas/PerPhase'
          description: >-
            Voltage per grid phase in V, as the meter reports it; null for a
            phase it reports none for

            (`power_w` then counts 230 V there).
  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.