> ## 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 charger's live state

> What each of the charger's EVSEs is doing now: its status, what it measures, the session
running on it, its limit and what load balancing gives it. A charger you do not reach, or your
token's reach leaves out, is a 404. When the live state cannot be read the answer is a 503,
never an older state: try again in a moment.

Reading it keeps the charger watched for 30 seconds, the one thing this read changes: while it
charges outside load balancing, the charger then sends its meter values every 60 seconds
instead of every 500. Poll within 30 seconds to keep it so.



## OpenAPI

````yaml api-reference/v4/v4.openapi.json GET /chargers/{charger}/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:
  /chargers/{charger}/live:
    get:
      tags:
        - chargers
      summary: A charger's live state
      description: >-
        What each of the charger's EVSEs is doing now: its status, what it
        measures, the session

        running on it, its limit and what load balancing gives it. A charger you
        do not reach, or your

        token's reach leaves out, is a 404. When the live state cannot be read
        the answer is a 503,

        never an older state: try again in a moment.


        Reading it keeps the charger watched for 30 seconds, the one thing this
        read changes: while it

        charges outside load balancing, the charger then sends its meter values
        every 60 seconds

        instead of every 500. Poll within 30 seconds to keep it so.
      operationId: show_charger_live
      parameters:
        - name: charger
          in: path
          description: The charger's id
          required: true
          schema:
            type: string
            format: uuid
      responses:
        '200':
          description: The charger's live state
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ChargerLive'
        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:
            - chargers:read
components:
  schemas:
    ChargerLive:
      type: object
      description: 'A charger''s live state: what each of its EVSEs is doing now.'
      required:
        - charger_id
        - connection
        - evses
      properties:
        charger_id:
          type: string
          format: uuid
          description: The charger's id.
        connection:
          $ref: '#/components/schemas/Connection'
        evses:
          type: array
          items:
            $ref: '#/components/schemas/EvseLive'
          description: Its EVSEs, by number, as the charger lists them.
    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.
    Connection:
      type: object
      description: Whether the charger is connected to Plugchoice.
      required:
        - status
      properties:
        last_seen_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            The last time Plugchoice recorded hearing from it: a connection, a
            heartbeat or the loss

            of its connection. While `online` it is connected now. Null when it
            never connected.
        status:
          $ref: '#/components/schemas/ConnectionStatus'
    EvseLive:
      type: object
      description: What an EVSE is doing now.
      required:
        - id
      properties:
        allocation:
          oneOf:
            - $ref: '#/components/schemas/Allocation'
              description: >-
                What load balancing gives the EVSE now; null when the EVSE is
                not load balanced.
            - type: 'null'
        id:
          type: integer
          format: int32
          description: The EVSE's number on the charger, as in the charger's `evses`.
        limit:
          oneOf:
            - $ref: '#/components/schemas/EvseLimit'
              description: >-
                The limit a person or an integration set for the EVSE; null when
                there is none.
            - type: 'null'
        measurements:
          oneOf:
            - $ref: '#/components/schemas/Measurements'
              description: >-
                What the EVSE last measured; null when it never reported a
                measurement. Without a session

                (any status but `charging`, `suspended_ev`, `suspended_evse` and
                `occupied`) it draws

                nothing: `power_w` and each phase's current are 0.
            - type: 'null'
        status:
          oneOf:
            - $ref: '#/components/schemas/EvseStatus'
              description: >-
                What the EVSE is doing, as its charger last reported it; null
                when the charger reported

                a status this API does not know.
            - type: 'null'
        status_changed_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the charger reported that status; null when it is not known.
        transaction:
          oneOf:
            - $ref: '#/components/schemas/RunningTransaction'
              description: >-
                The session running on the EVSE; null when none runs, and below
                basic access to the

                charger (a charger shared with one of your teams' apps shows no
                sessions).
            - 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.
    ConnectionStatus:
      type: string
      description: >-
        Whether the charger is connected now. Accept values you do not know:
        more may come.
      enum:
        - online
        - offline
        - never_seen
    Allocation:
      type: object
      description: What the load balancer gives the EVSE now.
      required:
        - current_a
      properties:
        allocated_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the load balancer decided it.
        current_a:
          $ref: '#/components/schemas/PerPhase'
          description: >-
            Current per grid phase in A; `null` for a phase the EVSE does not
            use.
    EvseLimit:
      type: object
      description: >-
        The limit set for an EVSE, in amps or in watts. Load balancing keeps the
        EVSE below it.
      properties:
        current_a:
          type:
            - integer
            - 'null'
          format: int32
          description: The limit in amps per phase; null when it is set in watts.
        power_w:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The limit in watts; null when it is set in amps. Negative discharges
            the vehicle.
        set_by:
          oneOf:
            - $ref: '#/components/schemas/LimitSetBy'
              description: Who set it; null when it is not known.
            - type: 'null'
    Measurements:
      type: object
      description: What the EVSE last measured.
      properties:
        current_a:
          oneOf:
            - $ref: '#/components/schemas/PerPhase'
              description: >-
                Current per grid phase in A; `null` for a phase the EVSE does
                not use or report.
            - type: 'null'
        energy_register_wh:
          type:
            - number
            - 'null'
          format: double
          description: The meter's energy register in Wh.
        measured_at:
          type:
            - string
            - 'null'
          format: date-time
          description: When the charger measured these, by its own clock.
        power_w:
          type:
            - number
            - 'null'
          format: double
          description: >-
            Active power in W. 0 when the EVSE has no session; `null` when the
            charger reports

            neither power nor current.
        soc_percent:
          type:
            - number
            - 'null'
          format: double
          description: >-
            The car's battery level, when the car reports it (DC, or AC with ISO
            15118).
        voltage_v:
          oneOf:
            - $ref: '#/components/schemas/PerPhase'
              description: Voltage per grid phase in V.
            - type: 'null'
    EvseStatus:
      type: string
      description: >-
        What an EVSE is doing, as its charger reports it. OCPP 1.6 chargers
        report all but

        `occupied`; OCPP 2.x chargers report `available`, `occupied`,
        `reserved`, `unavailable` and

        `faulted`. Accept values you do not know: more may come.
      enum:
        - available
        - preparing
        - charging
        - suspended_ev
        - suspended_evse
        - finishing
        - occupied
        - reserved
        - unavailable
        - faulted
    RunningTransaction:
      type: object
      description: The session running on an EVSE, as far as it has come.
      required:
        - id
        - started_at
      properties:
        energy_wh:
          type:
            - integer
            - 'null'
          format: int64
          description: >-
            The energy charged since it started, in Wh: the meter's register now
            minus at the start.

            Null when either is not known.
        id:
          type: string
          format: uuid
          description: The transaction's id.
        started_at:
          type: string
          format: date-time
          description: When it started, by the charger's clock.
    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.
      properties:
        l1:
          type:
            - number
            - 'null'
          format: double
        l2:
          type:
            - number
            - 'null'
          format: double
        l3:
          type:
            - number
            - 'null'
          format: double
    LimitSetBy:
      type: string
      description: Who set a limit.
      enum:
        - api
        - user
  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.