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

# WebSocket

> One connection: JSON text messages, each `{"type", "id", "data"}`. Nothing goes in the URL.



## AsyncAPI

````yaml api-reference/v4/v4.asyncapi.json websocket
id: websocket
title: WebSocket
description: >-
  One connection: JSON text messages, each `{"type", "id", "data"}`. Nothing
  goes in the URL.
servers:
  - id: production
    protocol: wss
    host: api.plugchoice.com
    bindings: []
    variables: []
address: /v4/websocket
parameters: []
bindings: []
operations:
  - &ref_17
    id: authenticate
    title: Authenticate
    description: >-
      The token: the first message, within 10 seconds of `hello`, and later a
      fresh token on the open connection.
    type: receive
    messages:
      - &ref_22
        id: authenticate
        contentType: application/json
        payload:
          - name: Authenticate
            description: >-
              The token: the first message, within 10 seconds of `hello`, and
              later a fresh token on the open connection.
            type: object
            properties:
              - name: data
                type: object
                description: >-
                  The data of `authenticate`: the first message, and a renewal
                  of the token later.
                required: true
                properties:
                  - name: token
                    type: string
                    description: >-
                      An access token from `accounts.plugchoice.com`, as an HTTP
                      request sends it in

                      `Authorization: Bearer …`.
                    required: true
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: false
              - name: type
                type: string
                description: authenticate
                required: true
        headers: []
        jsonPayloadSchema:
          additionalProperties: false
          properties:
            data:
              additionalProperties: false
              description: >-
                The data of `authenticate`: the first message, and a renewal of
                the token later.
              properties:
                token:
                  description: >-
                    An access token from `accounts.plugchoice.com`, as an HTTP
                    request sends it in

                    `Authorization: Bearer …`.
                  type: string
                  x-parser-schema-id: <anonymous-schema-2>
              required:
                - token
              type: object
              x-parser-schema-id: Authenticate
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-3>
            type:
              const: authenticate
              type: string
              x-parser-schema-id: <anonymous-schema-4>
          required:
            - type
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-1>
        title: Authenticate
        description: >-
          The token: the first message, within 10 seconds of `hello`, and later
          a fresh token on the open connection.
        example: |-
          {
            "data": {
              "token": "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIn0.eyJleHAiOjE3OTU1MTU2MDB9.c2lnbmF0dXJl"
            },
            "id": "1",
            "type": "authenticate"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: authenticate
    bindings: []
    extensions: &ref_0
      - id: x-parser-unique-object-id
        value: websocket
  - &ref_18
    id: ping
    title: Ping
    description: 'Asks whether the connection works: `pong` comes back with the same `data`.'
    type: receive
    messages:
      - &ref_23
        id: ping
        contentType: application/json
        payload:
          - name: Ping
            description: >-
              Asks whether the connection works: `pong` comes back with the same
              `data`.
            type: object
            properties:
              - name: description
                type: string
                description: Anything; it comes back in the `pong`.
                required: false
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: false
              - name: type
                type: string
                description: ping
                required: true
        headers: []
        jsonPayloadSchema:
          additionalProperties: false
          properties:
            data:
              description: Anything; it comes back in the `pong`.
              x-parser-schema-id: <anonymous-schema-67>
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-68>
            type:
              const: ping
              type: string
              x-parser-schema-id: <anonymous-schema-69>
          required:
            - type
          type: object
          x-parser-schema-id: <anonymous-schema-66>
        title: Ping
        description: >-
          Asks whether the connection works: `pong` comes back with the same
          `data`.
        example: |-
          {
            "data": 42,
            "id": "p1",
            "type": "ping"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: ping
    bindings: []
    extensions: *ref_0
  - &ref_21
    id: send
    title: Send
    description: Everything the server sends.
    type: send
    messages:
      - &ref_26
        id: hello
        contentType: application/json
        payload:
          - name: Hello
            description: The first message, right after the upgrade.
            type: object
            properties:
              - name: data
                type: object
                description: The first message, right after the upgrade.
                required: true
                properties:
                  - name: authenticate_within_s
                    type: integer
                    description: >-
                      Send `authenticate` within this many seconds, or the
                      connection closes with 4001.
                    required: true
                  - name: connection_id
                    type: string
                    description: >-
                      This connection's id: it is in the server's logs, so give
                      it when you ask for support.
                    required: true
                  - name: heartbeat_interval_s
                    type: integer
                    description: >-
                      The server sends a `heartbeat` after this many seconds
                      without another message. Nothing

                      from the server for 60 seconds means the connection is
                      gone: close it and connect again.
                    required: true
              - name: type
                type: string
                description: hello
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: The first message, right after the upgrade.
              properties:
                authenticate_within_s:
                  description: >-
                    Send `authenticate` within this many seconds, or the
                    connection closes with 4001.
                  format: int64
                  minimum: 0
                  type: integer
                  x-parser-schema-id: <anonymous-schema-25>
                connection_id:
                  description: >-
                    This connection's id: it is in the server's logs, so give it
                    when you ask for support.
                  format: uuid
                  type: string
                  x-parser-schema-id: <anonymous-schema-26>
                heartbeat_interval_s:
                  description: >-
                    The server sends a `heartbeat` after this many seconds
                    without another message. Nothing

                    from the server for 60 seconds means the connection is gone:
                    close it and connect again.
                  format: int64
                  minimum: 0
                  type: integer
                  x-parser-schema-id: <anonymous-schema-27>
              required:
                - connection_id
                - heartbeat_interval_s
                - authenticate_within_s
              type: object
              x-parser-schema-id: Hello
            type:
              const: hello
              type: string
              x-parser-schema-id: <anonymous-schema-28>
          required:
            - type
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-24>
        title: Hello
        description: The first message, right after the upgrade.
        example: |-
          {
            "data": {
              "authenticate_within_s": 10,
              "connection_id": "6f1c2d3e-8a4b-4c5d-9e6f-7a8b9c0d1e2f",
              "heartbeat_interval_s": 25
            },
            "type": "hello"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: hello
      - &ref_27
        id: authenticated
        contentType: application/json
        payload:
          - name: Authenticated
            description: 'The token counts: until when, and with which scopes.'
            type: object
            properties:
              - name: data
                type: object
                description: >-
                  The token counts: the answer to `authenticate`, the first one
                  and each renewal.
                required: true
                properties:
                  - name: expires_at
                    type: string
                    description: >-
                      When the connection's authentication ends: the token's
                      expiry, or a personal token's own

                      end when that is earlier. Send a fresh token with
                      `authenticate` before then; without one

                      the connection closes with 4100.
                    required: true
                  - name: scopes
                    type: array
                    description: The API's scopes the token holds.
                    required: true
                    properties:
                      - name: item
                        type: string
                        description: >-
                          A scope: what a token may be used for, as
                          `resource:action`.
                        enumValues:
                          - chargers:read
                          - chargers:control
                          - chargers:write
                          - transactions:read
                          - transactions:write
                          - locations:read
                          - locations:write
                          - meters:read
                          - teams:read
                          - teams:write
                          - webhooks:read
                          - webhooks:write
                          - billing:read
                          - billing:write
                        required: false
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: false
              - name: type
                type: string
                description: authenticated
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: >-
                The token counts: the answer to `authenticate`, the first one
                and each renewal.
              properties:
                expires_at:
                  description: >-
                    When the connection's authentication ends: the token's
                    expiry, or a personal token's own

                    end when that is earlier. Send a fresh token with
                    `authenticate` before then; without one

                    the connection closes with 4100.
                  format: date-time
                  type: string
                  x-parser-schema-id: <anonymous-schema-6>
                scopes:
                  description: The API's scopes the token holds.
                  items:
                    description: >-
                      A scope: what a token may be used for, as
                      `resource:action`.
                    enum:
                      - chargers:read
                      - chargers:control
                      - chargers:write
                      - transactions:read
                      - transactions:write
                      - locations:read
                      - locations:write
                      - meters:read
                      - teams:read
                      - teams:write
                      - webhooks:read
                      - webhooks:write
                      - billing:read
                      - billing:write
                    type: string
                    x-parser-schema-id: Scope
                  type: array
                  x-parser-schema-id: <anonymous-schema-7>
              required:
                - expires_at
                - scopes
              type: object
              x-parser-schema-id: Authenticated
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-8>
            type:
              const: authenticated
              type: string
              x-parser-schema-id: <anonymous-schema-9>
          required:
            - type
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-5>
        title: Authenticated
        description: 'The token counts: until when, and with which scopes.'
        example: |-
          {
            "data": {
              "expires_at": "2026-11-24T10:20:00Z",
              "scopes": [
                "chargers:read",
                "chargers:control"
              ]
            },
            "id": "1",
            "type": "authenticated"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: authenticated
      - &ref_28
        id: subscribed
        contentType: application/json
        payload:
          - name: Subscribed
            description: >-
              The subscription is made; its state now follows, a message per
              resource.
            type: object
            properties:
              - name: data
                type: object
                description: >-
                  The subscription is made: its first messages, the state now,
                  follow.
                required: true
                properties:
                  - name: count
                    type: integer
                    description: How many chargers it follows now.
                    required: true
                  - name: topic
                    type: string
                    description: >-
                      A topic a client can subscribe to: the path of the list it
                      follows, under `/v4`. Accept

                      topics you do not know: more come.
                    enumValues:
                      - chargers/live
                    required: true
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: true
              - name: type
                type: string
                description: subscribed
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: >-
                The subscription is made: its first messages, the state now,
                follow.
              properties:
                count:
                  description: How many chargers it follows now.
                  minimum: 0
                  type: integer
                  x-parser-schema-id: <anonymous-schema-91>
                topic:
                  description: >-
                    A topic a client can subscribe to: the path of the list it
                    follows, under `/v4`. Accept

                    topics you do not know: more come.
                  enum:
                    - chargers/live
                  type: string
                  x-parser-schema-id: Topic
              required:
                - topic
                - count
              type: object
              x-parser-schema-id: Subscribed
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-92>
            type:
              const: subscribed
              type: string
              x-parser-schema-id: <anonymous-schema-93>
          required:
            - type
            - id
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-90>
        title: Subscribed
        description: >-
          The subscription is made; its state now follows, a message per
          resource.
        example: |-
          {
            "data": {
              "count": 2,
              "topic": "chargers/live"
            },
            "id": "garage",
            "type": "subscribed"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribed
      - &ref_29
        id: unsubscribed
        contentType: application/json
        payload:
          - name: Unsubscribed
            description: The subscription ended, asked for or not; nothing of it follows.
            type: object
            properties:
              - name: data
                type: object
                description: 'The subscription ended: nothing of it follows.'
                required: true
                properties:
                  - name: reason
                    type: string
                    description: >-
                      Why a subscription ended. Accept reasons you do not know:
                      more may come.
                    enumValues:
                      - requested
                      - insufficient_scope
                      - not_found
                      - too_broad
                    required: true
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: true
              - name: type
                type: string
                description: unsubscribed
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: 'The subscription ended: nothing of it follows.'
              properties:
                reason:
                  description: >-
                    Why a subscription ended. Accept reasons you do not know:
                    more may come.
                  enum:
                    - requested
                    - insufficient_scope
                    - not_found
                    - too_broad
                  type: string
                  x-parser-schema-id: UnsubscribeReason
              required:
                - reason
              type: object
              x-parser-schema-id: Unsubscribed
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-101>
            type:
              const: unsubscribed
              type: string
              x-parser-schema-id: <anonymous-schema-102>
          required:
            - type
            - id
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-100>
        title: Unsubscribed
        description: The subscription ended, asked for or not; nothing of it follows.
        example: |-
          {
            "data": {
              "reason": "requested"
            },
            "id": "garage",
            "type": "unsubscribed"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: unsubscribed
      - &ref_30
        id: live
        contentType: application/json
        payload:
          - name: Live state
            description: >-
              A charger's live state, as `GET /v4/chargers/{charger}/live`
              answers it: first the state now, then after each change, at most
              one per charger a second.
            type: object
            properties:
              - name: data
                type: object
                description: 'A charger''s live state: what each of its EVSEs is doing now.'
                required: true
                properties:
                  - name: charger_id
                    type: string
                    description: The charger's id.
                    required: true
                  - name: connection
                    type: object
                    description: Whether the charger is connected to Plugchoice.
                    required: true
                    properties:
                      - name: last_seen_at
                        type: &ref_4
                          - string
                          - 'null'
                        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.
                        required: false
                      - name: status
                        type: string
                        description: >-
                          Whether the charger is connected now. Accept values
                          you do not know: more may come.
                        enumValues:
                          - online
                          - offline
                          - never_seen
                        required: true
                  - name: evses
                    type: array
                    description: Its EVSEs, by number, as the charger lists them.
                    required: true
                    properties:
                      - name: allocation
                        type: object
                        required: false
                        properties:
                          - name: allocated_at
                            type: &ref_5
                              - string
                              - 'null'
                            description: When the load balancer decided it.
                            required: false
                          - name: current_a
                            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: true
                            properties:
                              - name: l1
                                type: &ref_1
                                  - number
                                  - 'null'
                                required: false
                              - name: l2
                                type: &ref_2
                                  - number
                                  - 'null'
                                required: false
                              - name: l3
                                type: &ref_3
                                  - number
                                  - 'null'
                                required: false
                      - name: id
                        type: integer
                        description: >-
                          The EVSE's number on the charger, as in the charger's
                          `evses`.
                        required: true
                      - name: limit
                        type: object
                        required: false
                        properties:
                          - name: current_a
                            type: &ref_6
                              - integer
                              - 'null'
                            description: >-
                              The limit in amps per phase; null when it is set
                              in watts.
                            required: false
                          - name: power_w
                            type: &ref_7
                              - integer
                              - 'null'
                            description: >-
                              The limit in watts; null when it is set in amps.
                              Negative discharges the vehicle.
                            required: false
                          - name: set_by
                            type: string
                            required: false
                      - name: measurements
                        type: object
                        required: false
                        properties:
                          - name: current_a
                            type: object
                            required: false
                            properties:
                              - name: l1
                                type: *ref_1
                                required: false
                              - name: l2
                                type: *ref_2
                                required: false
                              - name: l3
                                type: *ref_3
                                required: false
                          - name: energy_register_wh
                            type: &ref_9
                              - number
                              - 'null'
                            description: The meter's energy register in Wh.
                            required: false
                          - name: measured_at
                            type: &ref_10
                              - string
                              - 'null'
                            description: When the charger measured these, by its own clock.
                            required: false
                          - name: power_w
                            type: &ref_11
                              - number
                              - 'null'
                            description: >-
                              Active power in W. 0 when the EVSE has no session;
                              `null` when the charger reports

                              neither power nor current.
                            required: false
                          - name: soc_percent
                            type: &ref_12
                              - number
                              - 'null'
                            description: >-
                              The car's battery level, when the car reports it
                              (DC, or AC with ISO 15118).
                            required: false
                          - name: voltage_v
                            type: object
                            required: false
                            properties:
                              - name: l1
                                type: *ref_1
                                required: false
                              - name: l2
                                type: *ref_2
                                required: false
                              - name: l3
                                type: *ref_3
                                required: false
                      - name: status
                        type: string
                        required: false
                      - name: status_changed_at
                        type: &ref_13
                          - string
                          - 'null'
                        description: >-
                          When the charger reported that status; null when it is
                          not known.
                        required: false
                      - name: transaction
                        type: object
                        required: false
                        properties:
                          - name: energy_wh
                            type: &ref_14
                              - integer
                              - 'null'
                            description: >-
                              The energy charged since it started, in Wh: the
                              meter's register now minus at the start.

                              Null when either is not known.
                            required: false
                          - name: id
                            type: string
                            description: The transaction's id.
                            required: true
                          - name: started_at
                            type: string
                            description: When it started, by the charger's clock.
                            required: true
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: true
              - name: type
                type: string
                description: live
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: 'A charger''s live state: what each of its EVSEs is doing now.'
              properties:
                charger_id:
                  description: The charger's id.
                  format: uuid
                  type: string
                  x-parser-schema-id: <anonymous-schema-30>
                connection:
                  description: Whether the charger is connected to Plugchoice.
                  properties:
                    last_seen_at:
                      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.
                      format: date-time
                      type: *ref_4
                      x-parser-schema-id: <anonymous-schema-31>
                    status:
                      description: >-
                        Whether the charger is connected now. Accept values you
                        do not know: more may come.
                      enum:
                        - online
                        - offline
                        - never_seen
                      type: string
                      x-parser-schema-id: ConnectionStatus
                  required:
                    - status
                  type: object
                  x-parser-schema-id: Connection
                evses:
                  description: Its EVSEs, by number, as the charger lists them.
                  items:
                    description: What an EVSE is doing now.
                    properties:
                      allocation:
                        oneOf:
                          - description: What the load balancer gives the EVSE now.
                            properties:
                              allocated_at:
                                description: When the load balancer decided it.
                                format: date-time
                                type: *ref_5
                                x-parser-schema-id: <anonymous-schema-34>
                              current_a: &ref_8
                                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:
                                    format: double
                                    type: *ref_1
                                    x-parser-schema-id: <anonymous-schema-35>
                                  l2:
                                    format: double
                                    type: *ref_2
                                    x-parser-schema-id: <anonymous-schema-36>
                                  l3:
                                    format: double
                                    type: *ref_3
                                    x-parser-schema-id: <anonymous-schema-37>
                                type: object
                                x-parser-schema-id: PerPhase
                            required:
                              - current_a
                            type: object
                            x-parser-schema-id: Allocation
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-38>
                        x-parser-schema-id: <anonymous-schema-33>
                      id:
                        description: >-
                          The EVSE's number on the charger, as in the charger's
                          `evses`.
                        format: int32
                        type: integer
                        x-parser-schema-id: <anonymous-schema-39>
                      limit:
                        oneOf:
                          - description: >-
                              The limit set for an EVSE, in amps or in watts.
                              Load balancing keeps the EVSE below it.
                            properties:
                              current_a:
                                description: >-
                                  The limit in amps per phase; null when it is
                                  set in watts.
                                format: int32
                                type: *ref_6
                                x-parser-schema-id: <anonymous-schema-41>
                              power_w:
                                description: >-
                                  The limit in watts; null when it is set in
                                  amps. Negative discharges the vehicle.
                                format: int32
                                type: *ref_7
                                x-parser-schema-id: <anonymous-schema-42>
                              set_by:
                                oneOf:
                                  - description: Who set a limit.
                                    enum:
                                      - api
                                      - user
                                    type: string
                                    x-parser-schema-id: LimitSetBy
                                  - type: 'null'
                                    x-parser-schema-id: <anonymous-schema-44>
                                x-parser-schema-id: <anonymous-schema-43>
                            type: object
                            x-parser-schema-id: EvseLimit
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-45>
                        x-parser-schema-id: <anonymous-schema-40>
                      measurements:
                        oneOf:
                          - description: What the EVSE last measured.
                            properties:
                              current_a:
                                oneOf:
                                  - *ref_8
                                  - type: 'null'
                                    x-parser-schema-id: <anonymous-schema-48>
                                x-parser-schema-id: <anonymous-schema-47>
                              energy_register_wh:
                                description: The meter's energy register in Wh.
                                format: double
                                type: *ref_9
                                x-parser-schema-id: <anonymous-schema-49>
                              measured_at:
                                description: >-
                                  When the charger measured these, by its own
                                  clock.
                                format: date-time
                                type: *ref_10
                                x-parser-schema-id: <anonymous-schema-50>
                              power_w:
                                description: >-
                                  Active power in W. 0 when the EVSE has no
                                  session; `null` when the charger reports

                                  neither power nor current.
                                format: double
                                type: *ref_11
                                x-parser-schema-id: <anonymous-schema-51>
                              soc_percent:
                                description: >-
                                  The car's battery level, when the car reports
                                  it (DC, or AC with ISO 15118).
                                format: double
                                type: *ref_12
                                x-parser-schema-id: <anonymous-schema-52>
                              voltage_v:
                                oneOf:
                                  - *ref_8
                                  - type: 'null'
                                    x-parser-schema-id: <anonymous-schema-54>
                                x-parser-schema-id: <anonymous-schema-53>
                            type: object
                            x-parser-schema-id: Measurements
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-55>
                        x-parser-schema-id: <anonymous-schema-46>
                      status:
                        oneOf:
                          - 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
                            type: string
                            x-parser-schema-id: EvseStatus
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-57>
                        x-parser-schema-id: <anonymous-schema-56>
                      status_changed_at:
                        description: >-
                          When the charger reported that status; null when it is
                          not known.
                        format: date-time
                        type: *ref_13
                        x-parser-schema-id: <anonymous-schema-58>
                      transaction:
                        oneOf:
                          - description: >-
                              The session running on an EVSE, as far as it has
                              come.
                            properties:
                              energy_wh:
                                description: >-
                                  The energy charged since it started, in Wh:
                                  the meter's register now minus at the start.

                                  Null when either is not known.
                                format: int64
                                type: *ref_14
                                x-parser-schema-id: <anonymous-schema-60>
                              id:
                                description: The transaction's id.
                                format: uuid
                                type: string
                                x-parser-schema-id: <anonymous-schema-61>
                              started_at:
                                description: When it started, by the charger's clock.
                                format: date-time
                                type: string
                                x-parser-schema-id: <anonymous-schema-62>
                            required:
                              - id
                              - started_at
                            type: object
                            x-parser-schema-id: RunningTransaction
                          - type: 'null'
                            x-parser-schema-id: <anonymous-schema-63>
                        x-parser-schema-id: <anonymous-schema-59>
                    required:
                      - id
                    type: object
                    x-parser-schema-id: EvseLive
                  type: array
                  x-parser-schema-id: <anonymous-schema-32>
              required:
                - charger_id
                - connection
                - evses
              type: object
              x-parser-schema-id: ChargerLive
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-64>
            type:
              const: live
              type: string
              x-parser-schema-id: <anonymous-schema-65>
          required:
            - type
            - id
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-29>
        title: Live state
        description: >-
          A charger's live state, as `GET /v4/chargers/{charger}/live` answers
          it: first the state now, then after each change, at most one per
          charger a second.
        example: |-
          {
            "data": {
              "charger_id": "0f8d4c1e-7b5e-4a5e-9a51-3c1f0e8b2d47",
              "connection": {
                "last_seen_at": "2026-11-24T09:00:00Z",
                "status": "online"
              },
              "evses": [
                {
                  "allocation": null,
                  "id": 1,
                  "limit": {
                    "current_a": 16,
                    "power_w": null,
                    "set_by": "api"
                  },
                  "measurements": {
                    "current_a": {
                      "l1": 16,
                      "l2": 16.1,
                      "l3": 15.9
                    },
                    "energy_register_wh": 1523400,
                    "measured_at": "2026-11-24T10:15:30Z",
                    "power_w": 11040,
                    "soc_percent": null,
                    "voltage_v": null
                  },
                  "status": "charging",
                  "status_changed_at": "2026-11-24T09:30:00Z",
                  "transaction": {
                    "energy_wh": 5300,
                    "id": "8d3c2a90-51f7-4c1e-b7d2-6f0e9a4c3b18",
                    "started_at": "2026-11-24T09:30:00Z"
                  }
                }
              ]
            },
            "id": "garage",
            "type": "live"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: live
      - &ref_31
        id: removed
        contentType: application/json
        payload:
          - name: Removed
            description: 'A charger left the subscription: it sends nothing more here.'
            type: object
            properties:
              - name: data
                type: object
                description: >-
                  A charger left the subscription: it left the location or the
                  team it follows, and sends

                  nothing more here.
                required: true
                properties:
                  - name: charger_id
                    type: string
                    description: The charger's id.
                    required: true
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: true
              - name: type
                type: string
                description: removed
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: >-
                A charger left the subscription: it left the location or the
                team it follows, and sends

                nothing more here.
              properties:
                charger_id:
                  description: The charger's id.
                  format: uuid
                  type: string
                  x-parser-schema-id: <anonymous-schema-78>
              required:
                - charger_id
              type: object
              x-parser-schema-id: Removed
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-79>
            type:
              const: removed
              type: string
              x-parser-schema-id: <anonymous-schema-80>
          required:
            - type
            - id
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-77>
        title: Removed
        description: 'A charger left the subscription: it sends nothing more here.'
        example: |-
          {
            "data": {
              "charger_id": "3b7e9a15-c2d4-4f86-8a0e-91d5f6c7b204"
            },
            "id": "garage",
            "type": "removed"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: removed
      - &ref_32
        id: pong
        contentType: application/json
        payload:
          - name: Pong
            description: The answer to `ping`, with its `data`.
            type: object
            properties:
              - name: description
                type: string
                description: What the `ping` sent.
                required: false
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: false
              - name: type
                type: string
                description: pong
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: What the `ping` sent.
              x-parser-schema-id: <anonymous-schema-71>
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-72>
            type:
              const: pong
              type: string
              x-parser-schema-id: <anonymous-schema-73>
          required:
            - type
          type: object
          x-parser-schema-id: <anonymous-schema-70>
        title: Pong
        description: The answer to `ping`, with its `data`.
        example: |-
          {
            "data": 42,
            "id": "p1",
            "type": "pong"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: pong
      - &ref_33
        id: heartbeat
        contentType: application/json
        payload:
          - name: Heartbeat
            description: 'After 25 seconds without another message: the connection lives.'
            type: object
            properties:
              - name: type
                type: string
                description: heartbeat
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            type:
              const: heartbeat
              type: string
              x-parser-schema-id: <anonymous-schema-23>
          required:
            - type
          type: object
          x-parser-schema-id: <anonymous-schema-22>
        title: Heartbeat
        description: 'After 25 seconds without another message: the connection lives.'
        example: |-
          {
            "type": "heartbeat"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: heartbeat
      - &ref_34
        id: token_expiring
        contentType: application/json
        payload:
          - name: Token expiring
            description: >-
              The authentication ends in 60 seconds: send a fresh token with
              `authenticate`.
            type: object
            properties:
              - name: data
                type: object
                description: >-
                  The connection's authentication ends in 60 seconds: send a
                  fresh token with `authenticate`.
                required: true
                properties:
                  - name: expires_at
                    type: string
                    description: When it ends, as `authenticated` said.
                    required: true
              - name: type
                type: string
                description: token_expiring
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: >-
                The connection's authentication ends in 60 seconds: send a fresh
                token with `authenticate`.
              properties:
                expires_at:
                  description: When it ends, as `authenticated` said.
                  format: date-time
                  type: string
                  x-parser-schema-id: <anonymous-schema-95>
              required:
                - expires_at
              type: object
              x-parser-schema-id: TokenExpiring
            type:
              const: token_expiring
              type: string
              x-parser-schema-id: <anonymous-schema-96>
          required:
            - type
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-94>
        title: Token expiring
        description: >-
          The authentication ends in 60 seconds: send a fresh token with
          `authenticate`.
        example: |-
          {
            "data": {
              "expires_at": "2026-11-24T10:20:00Z"
            },
            "type": "token_expiring"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: token_expiring
      - &ref_35
        id: reconnect
        contentType: application/json
        payload:
          - name: Reconnect
            description: >-
              The server closes this connection soon: open a new one first, then
              close this one.
            type: object
            properties:
              - name: data
                type: object
                description: >-
                  The server closes this connection soon: open a new one,
                  authenticate and subscribe, then close

                  this one with 1000. Until it closes, this one keeps working.
                required: true
                properties:
                  - name: close_in_s
                    type: integer
                    description: >-
                      The server closes this connection after this many seconds
                      (4200 or 4201).
                    required: true
                  - name: reason
                    type: string
                    description: >-
                      Why the server asks for a new connection. Accept reasons
                      you do not know: more may come.
                    enumValues:
                      - server_stopping
                      - max_age
                    required: true
              - name: type
                type: string
                description: reconnect
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: >-
                The server closes this connection soon: open a new one,
                authenticate and subscribe, then close

                this one with 1000. Until it closes, this one keeps working.
              properties:
                close_in_s:
                  description: >-
                    The server closes this connection after this many seconds
                    (4200 or 4201).
                  format: int64
                  minimum: 0
                  type: integer
                  x-parser-schema-id: <anonymous-schema-75>
                reason:
                  description: >-
                    Why the server asks for a new connection. Accept reasons you
                    do not know: more may come.
                  enum:
                    - server_stopping
                    - max_age
                  type: string
                  x-parser-schema-id: ReconnectReason
              required:
                - reason
                - close_in_s
              type: object
              x-parser-schema-id: Reconnect
            type:
              const: reconnect
              type: string
              x-parser-schema-id: <anonymous-schema-76>
          required:
            - type
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-74>
        title: Reconnect
        description: >-
          The server closes this connection soon: open a new one first, then
          close this one.
        example: |-
          {
            "data": {
              "close_in_s": 10,
              "reason": "server_stopping"
            },
            "type": "reconnect"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: reconnect
      - &ref_36
        id: error
        contentType: application/json
        payload:
          - name: Error
            description: >-
              A request failed, as the HTTP API's problems: `code` says why. The
              connection stays open.
            type: object
            properties:
              - name: data
                type: object
                description: An error response body (RFC 9457).
                required: true
                properties:
                  - name: code
                    type: string
                    description: >-
                      The kind of problem, for code to act on: the last part of
                      `type`.
                    required: true
                  - name: detail
                    type: string
                    description: >-
                      What went wrong with this request, when there is more to
                      say than the title.
                    required: false
                  - name: errors
                    type: array
                    description: 'With `validation-failed`: the fields that broke a rule.'
                    required: false
                    properties:
                      - name: 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).
                        required: true
                      - name: field
                        type: string
                        description: >-
                          Where the field is in the request, such as `name` or
                          `connectors[0].max_current`.
                        required: true
                      - name: message
                        type: string
                        description: What is wrong, in English.
                        required: true
                  - name: status
                    type: integer
                    description: The HTTP status code.
                    required: true
                  - name: title
                    type: string
                    description: A short summary of the kind of problem.
                    required: true
                  - name: type
                    type: string
                    description: The page that explains this kind of problem.
                    required: true
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: false
              - name: type
                type: string
                description: error
                required: true
        headers: []
        jsonPayloadSchema:
          properties:
            data:
              description: An error response body (RFC 9457).
              properties:
                code:
                  description: >-
                    The kind of problem, for code to act on: the last part of
                    `type`.
                  type: string
                  x-parser-schema-id: <anonymous-schema-11>
                detail:
                  description: >-
                    What went wrong with this request, when there is more to say
                    than the title.
                  type: string
                  x-parser-schema-id: <anonymous-schema-12>
                errors:
                  description: 'With `validation-failed`: the fields that broke a rule.'
                  items:
                    description: One field that broke a rule.
                    properties:
                      code:
                        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).
                        type: string
                        x-parser-schema-id: <anonymous-schema-14>
                      field:
                        description: >-
                          Where the field is in the request, such as `name` or
                          `connectors[0].max_current`.
                        type: string
                        x-parser-schema-id: <anonymous-schema-15>
                      message:
                        description: What is wrong, in English.
                        type: string
                        x-parser-schema-id: <anonymous-schema-16>
                    required:
                      - field
                      - code
                      - message
                    type: object
                    x-parser-schema-id: FieldError
                  type: array
                  x-parser-schema-id: <anonymous-schema-13>
                status:
                  description: The HTTP status code.
                  format: int32
                  minimum: 0
                  type: integer
                  x-parser-schema-id: <anonymous-schema-17>
                title:
                  description: A short summary of the kind of problem.
                  type: string
                  x-parser-schema-id: <anonymous-schema-18>
                type:
                  description: The page that explains this kind of problem.
                  type: string
                  x-parser-schema-id: <anonymous-schema-19>
              required:
                - type
                - title
                - status
                - code
              type: object
              x-parser-schema-id: Problem
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-20>
            type:
              const: error
              type: string
              x-parser-schema-id: <anonymous-schema-21>
          required:
            - type
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-10>
        title: Error
        description: >-
          A request failed, as the HTTP API's problems: `code` says why. The
          connection stays open.
        example: |-
          {
            "data": {
              "code": "not-found",
              "status": 404,
              "title": "Not found",
              "type": "https://developer.plugchoice.com/api/errors/not-found"
            },
            "id": "garage",
            "type": "error"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: error
    bindings: []
    extensions: *ref_0
  - &ref_19
    id: subscribe
    title: Subscribe
    description: >-
      Follows what a list of the HTTP API answers, with its filters, scope and
      access: the state now, then each change.
    type: receive
    messages:
      - &ref_24
        id: subscribe
        contentType: application/json
        payload:
          - name: Subscribe
            description: >-
              Follows what a list of the HTTP API answers, with its filters,
              scope and access: the state now, then each change.
            type: object
            properties:
              - name: data
                type: object
                description: >-
                  The data of `subscribe`: a topic, and the filter that says
                  which of its resources to follow.

                  The topic is the path of the list it follows, under `/v4`; the
                  filter takes that list's

                  parameters that say where.
                required: true
                properties:
                  - name: filter
                    type: object
                    description: >-
                      Which chargers a `chargers/live` subscription follows: the
                      filters of `GET /v4/chargers/live`

                      that say where. They narrow each other, as the list's do.
                    required: false
                    properties:
                      - name: charger_id
                        type: array
                        description: Only these chargers, at most 100.
                        required: false
                        properties:
                          - name: item
                            type: string
                            required: false
                      - name: location_id
                        type: &ref_15
                          - string
                          - 'null'
                        description: Only the chargers at this location.
                        required: false
                      - name: team_id
                        type: &ref_16
                          - string
                          - 'null'
                        description: 'Only the chargers this team reaches: one of yours.'
                        required: false
                  - name: topic
                    type: string
                    enumValues:
                      - chargers/live
                    required: true
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: true
              - name: type
                type: string
                description: subscribe
                required: true
        headers: []
        jsonPayloadSchema:
          additionalProperties: false
          properties:
            data:
              description: >-
                The data of `subscribe`: a topic, and the filter that says which
                of its resources to follow.

                The topic is the path of the list it follows, under `/v4`; the
                filter takes that list's

                parameters that say where.
              oneOf:
                - additionalProperties: false
                  description: >-
                    The live state of chargers, as `GET /v4/chargers/live` lists
                    them, with the scope

                    `chargers:read`: a `live` message per charger with its state
                    now, then one per change, at

                    most one per charger a second; `removed` for a charger that
                    leaves a location's or a team's

                    subscription. Chargers named with `charger_id` stay watched
                    while the subscription is open

                    (their meter values come every 60 seconds while they
                    charge); a subscription of a location

                    or a team keeps none watched.
                  properties:
                    filter:
                      additionalProperties: false
                      description: >-
                        Which chargers a `chargers/live` subscription follows:
                        the filters of `GET /v4/chargers/live`

                        that say where. They narrow each other, as the list's
                        do.
                      properties:
                        charger_id:
                          description: Only these chargers, at most 100.
                          items:
                            format: uuid
                            type: string
                            x-parser-schema-id: <anonymous-schema-84>
                          maxItems: 100
                          type: array
                          x-parser-schema-id: <anonymous-schema-83>
                        location_id:
                          description: Only the chargers at this location.
                          format: uuid
                          type: *ref_15
                          x-parser-schema-id: <anonymous-schema-85>
                        team_id:
                          description: 'Only the chargers this team reaches: one of yours.'
                          format: uuid
                          type: *ref_16
                          x-parser-schema-id: <anonymous-schema-86>
                      type: object
                      x-parser-schema-id: ChargersLiveFilter
                    topic:
                      enum:
                        - chargers/live
                      type: string
                      x-parser-schema-id: <anonymous-schema-87>
                  required:
                    - topic
                  type: object
                  x-parser-schema-id: <anonymous-schema-82>
              x-parser-schema-id: Subscribe
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-88>
            type:
              const: subscribe
              type: string
              x-parser-schema-id: <anonymous-schema-89>
          required:
            - type
            - id
            - data
          type: object
          x-parser-schema-id: <anonymous-schema-81>
        title: Subscribe
        description: >-
          Follows what a list of the HTTP API answers, with its filters, scope
          and access: the state now, then each change.
        example: |-
          {
            "data": {
              "filter": {
                "location_id": "5620bf8d-88e0-4d6f-9153-4a3b97e5ae30"
              },
              "topic": "chargers/live"
            },
            "id": "garage",
            "type": "subscribe"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: subscribe
    bindings: []
    extensions: *ref_0
  - &ref_20
    id: unsubscribe
    title: Unsubscribe
    description: Ends the subscription its `id` names.
    type: receive
    messages:
      - &ref_25
        id: unsubscribe
        contentType: application/json
        payload:
          - name: Unsubscribe
            description: Ends the subscription its `id` names.
            type: object
            properties:
              - name: id
                type: string
                description: >-
                  The client's id for a request: its answer, and every message
                  of a subscription, carry it.
                required: true
              - name: type
                type: string
                description: unsubscribe
                required: true
        headers: []
        jsonPayloadSchema:
          additionalProperties: false
          properties:
            id:
              description: >-
                The client's id for a request: its answer, and every message of
                a subscription, carry it.
              maxLength: 64
              minLength: 1
              type: string
              x-parser-schema-id: <anonymous-schema-98>
            type:
              const: unsubscribe
              type: string
              x-parser-schema-id: <anonymous-schema-99>
          required:
            - type
            - id
          type: object
          x-parser-schema-id: <anonymous-schema-97>
        title: Unsubscribe
        description: Ends the subscription its `id` names.
        example: |-
          {
            "id": "garage",
            "type": "unsubscribe"
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: unsubscribe
    bindings: []
    extensions: *ref_0
sendOperations:
  - *ref_17
  - *ref_18
  - *ref_19
  - *ref_20
receiveOperations:
  - *ref_21
sendMessages:
  - *ref_22
  - *ref_23
  - *ref_24
  - *ref_25
receiveMessages:
  - *ref_26
  - *ref_27
  - *ref_28
  - *ref_29
  - *ref_30
  - *ref_31
  - *ref_32
  - *ref_33
  - *ref_34
  - *ref_35
  - *ref_36
extensions:
  - id: x-parser-unique-object-id
    value: websocket
securitySchemes: []

````

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