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

# Change a charger

> Changes the fields sent. `reference` is your team's own name for the charger: the team you
reach it through with the highest access (the oldest of them on a tie), whose reference the
charger shows; other teams keep theirs. Setting what it already has changes nothing.

Needs `basic` access to the charger: with `view` (a charger shared with one of your team's
apps) it is a 403. A charger you do not reach, or your token's reach leaves out, is a 404.



## OpenAPI

````yaml api-reference/v4/v4.openapi.json PATCH /chargers/{charger}
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}:
    patch:
      tags:
        - chargers
      summary: Change a charger
      description: >-
        Changes the fields sent. `reference` is your team's own name for the
        charger: the team you

        reach it through with the highest access (the oldest of them on a tie),
        whose reference the

        charger shows; other teams keep theirs. Setting what it already has
        changes nothing.


        Needs `basic` access to the charger: with `view` (a charger shared with
        one of your team's

        apps) it is a 403. A charger you do not reach, or your token's reach
        leaves out, is a 404.
      operationId: update_charger
      parameters:
        - name: charger
          in: path
          description: The charger's id
          required: true
          schema:
            type: string
            format: uuid
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateCharger'
        required: true
      responses:
        '200':
          description: The charger, changed
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Charger'
        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:write
components:
  schemas:
    UpdateCharger:
      type: object
      description: 'What to change of a charger: only the fields sent change.'
      properties:
        reference:
          oneOf:
            - $ref: '#/components/schemas/Reference'
              description: >-
                Your team's own name for the charger, or null to remove it. Left
                out, it stays as it is.
            - type: 'null'
      additionalProperties: false
    Charger:
      type: object
      description: A charger.
      required:
        - id
        - identity
        - connection
        - blocked
        - licence
        - access
        - evses
        - created_at
        - updated_at
        - error
        - firmware_version
        - history_starts_at
        - location
        - max_current_a
        - model
        - ocpp_version
        - pincode
        - reference
        - serial_number
        - setup_status
      properties:
        access:
          $ref: '#/components/schemas/Access'
        blocked:
          type: boolean
          description: >-
            Whether Plugchoice blocked the charger: a stop Plugchoice puts on a
            charger, which only

            Plugchoice lifts.
        connection:
          $ref: '#/components/schemas/Connection'
        created_at:
          type: string
          format: date-time
        error:
          oneOf:
            - $ref: '#/components/schemas/EvseError'
              description: >-
                The fault the charger reports for itself rather than for one
                EVSE (OCPP 1.6's connector

                0); null when it reports none.
            - type: 'null'
        evses:
          type: array
          items:
            $ref: '#/components/schemas/Evse'
          description: Its EVSEs, by number. Empty until the charger reports one.
        firmware_version:
          type:
            - string
            - 'null'
          description: The firmware version it reported last; null until it reports one.
        history_starts_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When the charger's history starts for you: it changed hands then,
            and its transactions and

            logs from before are hidden from you, but for transactions at its
            location now under the

            team that holds that location now. Null when you see all of it.
        id:
          type: string
          format: uuid
          description: The charger's id.
        identity:
          type: string
          description: 'The name it connects with: its OCPP charge point identity.'
        licence:
          $ref: '#/components/schemas/Licence'
        location:
          oneOf:
            - $ref: '#/components/schemas/LocationReference'
              description: Where it is; null when it is at no location.
            - type: 'null'
        max_current_a:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The most current the charger may draw, per phase, as installed: its
            overcurrent

            protection. An EVSE's limit cannot exceed it. Null when it is not
            set.
        model:
          oneOf:
            - $ref: '#/components/schemas/ChargerModel'
              description: The model it reported; null until it reports one.
            - type: 'null'
        ocpp_version:
          oneOf:
            - $ref: '#/components/schemas/OcppVersion'
              description: The OCPP version it speaks; null when it never connected.
            - type: 'null'
        pincode:
          type:
            - string
            - 'null'
          description: >-
            The code printed on the charger, which proves a person has it in
            hand when they add it to

            an account. Null below `basic` access.
        reference:
          type:
            - string
            - 'null'
          description: >-
            A team's own name for the charger, such as `Garage`: each team gives
            its own. With

            `team_id` a list shows that team's; otherwise it is the reference of
            the team you reach

            the charger through with the highest access (the oldest of them on a
            tie), which

            `update_charger` changes. Null when that team gave none.
        serial_number:
          type:
            - string
            - 'null'
          description: The serial number it reported; null when it did not.
        setup_status:
          oneOf:
            - $ref: '#/components/schemas/SetupStatus'
              description: Where the charger's setup is; null when it is not known.
            - type: 'null'
        updated_at:
          type: string
          format: date-time
          description: When the charger or one of its EVSEs last changed.
    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`.
    Reference:
      type: string
      description: >-
        A team's own name for a charger: 1 to 255 characters, with spaces around
        it removed.
      maxLength: 255
      minLength: 1
    Access:
      type: string
      description: >-
        The caller's access to a charger or a location: the highest any of their
        teams has, within

        the token's reach. Each level grants everything below it. Accept levels
        you do not know: more

        may come.
      enum:
        - view
        - basic
        - sensitive
        - full
    Connection:
      type: object
      description: Whether the charger is connected to Plugchoice.
      required:
        - status
        - connected_at
        - disconnected_at
        - last_seen_at
      properties:
        connected_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When it last connected: while `online`, when its connection now
            started. Null when it

            never connected.
        disconnected_at:
          type:
            - string
            - 'null'
          format: date-time
          description: >-
            When it last lost its connection: while `offline`, since when it is
            away. Null when it

            never lost one.
        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'
    EvseError:
      type: object
      description: >-
        A fault an OCPP 1.6 charger reports with a status. OCPP 2.x chargers
        report faults as events

        instead, so their EVSEs show none here.
      required:
        - code
        - info
        - vendor_code
        - vendor_id
      properties:
        code:
          $ref: '#/components/schemas/EvseErrorCode'
        info:
          type:
            - string
            - 'null'
          description: Free text the charger added; null when it added none.
        vendor_code:
          type:
            - string
            - 'null'
          description: The vendor's own error code; null when the charger sent none.
        vendor_id:
          type:
            - string
            - 'null'
          description: >-
            The vendor whose code `vendor_code` is; null when the charger sent
            none.
    Evse:
      type: object
      description: 'An EVSE: the part of a charger that charges one vehicle at a time.'
      required:
        - id
        - connectors
        - error
        - limit
        - min_current_a
        - phase_rotation
        - status
        - status_changed_at
      properties:
        connectors:
          type: array
          items:
            $ref: '#/components/schemas/Connector'
          description: Its connectors, by number.
        error:
          oneOf:
            - $ref: '#/components/schemas/EvseError'
              description: >-
                The fault the charger reports for the EVSE; null when it reports
                none.
            - type: 'null'
        id:
          type: integer
          format: int32
          description: >-
            The EVSE's number on the charger, from 1. On an OCPP 1.6 charger it
            is the connector's

            number.
        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'
        min_current_a:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The lowest current per phase the EVSE is set up to charge with, as
            installed. 0 when no

            minimum is set; null when the charger reported no connector for the
            EVSE.
        phase_rotation:
          oneOf:
            - $ref: '#/components/schemas/PhaseRotation'
              description: >-
                The order in which the EVSE is wired to the grid's phases, as
                installed; null when it is

                not known.
            - 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.
    Licence:
      type: object
      description: >-
        What the charger's licences allow it. Read only: licences are bought and
        managed elsewhere.
      required:
        - smart
        - load_balancing_allowed
      properties:
        load_balancing_allowed:
          type: boolean
          description: >-
            Whether the charger may join load balancing: with Smart, or included
            with the charger

            (chargers added before load balancing became part of Smart, and
            every Volt Time One).
        smart:
          type: boolean
          description: >-
            Whether the charger has Smart: a Smart licence that has not expired,
            or a partner that

            includes it. Smart charging and solar charging at a location need it
            on every charger

            there.
    LocationReference:
      type: object
      description: A location, as a charger names it.
      required:
        - id
        - name
      properties:
        id:
          type: string
          format: uuid
          description: The location's id.
        name:
          type:
            - string
            - 'null'
          description: Its name; null when it has none.
    ChargerModel:
      type: object
      description: A charger's model, as the charger reports it when it starts.
      required:
        - vendor
        - name
      properties:
        name:
          type: string
        vendor:
          type: string
    OcppVersion:
      type: string
      description: >-
        The OCPP version a charger speaks. Accept versions you do not know: more
        may come.
      enum:
        - '1.6'
        - 2.0.1
        - '2.1'
    SetupStatus:
      type: string
      description: >-
        Where a charger's setup is, from core's `setup_pending` and
        `setup_completed`. Accept values

        you do not know: more may come.
      enum:
        - pending
        - completed
    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
    EvseErrorCode:
      type: string
      description: 'An OCPP 1.6 error code. Accept values you do not know: more may come.'
      enum:
        - connector_lock_failure
        - ev_communication_error
        - ground_failure
        - high_temperature
        - internal_error
        - local_list_conflict
        - other_error
        - over_current_failure
        - over_voltage
        - power_meter_failure
        - power_switch_failure
        - reader_failure
        - reset_failure
        - under_voltage
        - weak_signal
    Connector:
      type: object
      description: 'A connector: a plug of an EVSE.'
      required:
        - id
        - format
        - max_current_a
        - max_voltage_v
        - power_type
        - standard
      properties:
        format:
          oneOf:
            - $ref: '#/components/schemas/ConnectorFormat'
              description: >-
                Whether it is a socket or a fixed cable; null when it is not
                known.
            - type: 'null'
        id:
          type: integer
          format: int32
          description: The connector's number on its EVSE, from 1.
        max_current_a:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The most current it may deliver, per phase, as installed; null when
            it is not known.
        max_voltage_v:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The highest voltage it delivers, as installed; null when it is not
            known.
        power_type:
          oneOf:
            - $ref: '#/components/schemas/PowerType'
              description: Its power supply; null when it is not known.
            - type: 'null'
        standard:
          oneOf:
            - $ref: '#/components/schemas/ConnectorStandard'
              description: Its plug; null when it is not known.
            - type: 'null'
    EvseLimit:
      type: object
      description: >-
        The limit set for an EVSE, in amps or in watts. Load balancing keeps the
        EVSE below it.
      required:
        - current_a
        - power_w
        - set_by
      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'
    PhaseRotation:
      type: string
      description: >-
        How an EVSE is wired to the grid's phases, as OCPP's
        `ConnectorPhaseRotation` names it

        (in lowercase): the EVSE's phases R, S and T in the order they meet the
        grid's L1, L2 and

        L3, so `rst` is the standard wiring. Accept values you do not know: more
        may come.
      enum:
        - rst
        - rts
        - srt
        - str
        - trs
        - tsr
    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
    ConnectorFormat:
      type: string
      description: >-
        Whether a connector is a socket the vehicle's cable goes in, or a cable
        fixed to the

        charger. Accept values you do not know: more may come.
      enum:
        - socket
        - cable
    PowerType:
      type: string
      description: >-
        A connector's power supply. Accept values you do not know: more may
        come.
      enum:
        - ac_1_phase
        - ac_2_phase
        - ac_2_phase_split
        - ac_3_phase
        - dc
    ConnectorStandard:
      type: string
      description: >-
        A connector's plug, as OCPI names them. Accept values you do not know:
        more may come.
      enum:
        - chademo
        - type_1
        - type_2
        - ccs_2
        - type_3a
        - type_3c
        - tesla_s
    LimitSetBy:
      type: string
      description: 'Who set a limit. Accept values you do not know: more may come.'
      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.