> ## 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 an EVSE

> Sets the EVSE's limit, in amps per phase (`current_a`) or in watts over all phases (`power_w`),
or removes it with `null`. Load balancing keeps the EVSE below it from its next run, within a
second, whether the charger is in a group or not; this call sends nothing to the charger. What
load balancing gives the EVSE now is `allocation` in the charger's live state.

The limit cannot exceed the charger's maximum current (its overcurrent protection), when one is
set; in watts that is the maximum at 230 V on three phases, either way. A negative `power_w`
discharges the vehicle, on a charger that can. Setting the limit it has already changes
nothing, so a request can be repeated safely.

Needs `basic` access to the charger: with `view` it is a 403. A charger you do not reach, or
your token's reach leaves out, is a 404, and so is an EVSE the charger does not have. When load
balancing cannot be told, the answer is a 503 and nothing changed: try again in a moment.



## OpenAPI

````yaml api-reference/v4/v4.openapi.json PATCH /chargers/{charger}/evses/{evse}
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}/evses/{evse}:
    patch:
      tags:
        - chargers
      summary: Change an EVSE
      description: >-
        Sets the EVSE's limit, in amps per phase (`current_a`) or in watts over
        all phases (`power_w`),

        or removes it with `null`. Load balancing keeps the EVSE below it from
        its next run, within a

        second, whether the charger is in a group or not; this call sends
        nothing to the charger. What

        load balancing gives the EVSE now is `allocation` in the charger's live
        state.


        The limit cannot exceed the charger's maximum current (its overcurrent
        protection), when one is

        set; in watts that is the maximum at 230 V on three phases, either way.
        A negative `power_w`

        discharges the vehicle, on a charger that can. Setting the limit it has
        already changes

        nothing, so a request can be repeated safely.


        Needs `basic` access to the charger: with `view` it is a 403. A charger
        you do not reach, or

        your token's reach leaves out, is a 404, and so is an EVSE the charger
        does not have. When load

        balancing cannot be told, the answer is a 503 and nothing changed: try
        again in a moment.
      operationId: update_evse
      parameters:
        - name: charger
          in: path
          description: The charger's id
          required: true
          schema:
            type: string
            format: uuid
        - name: evse
          in: path
          description: The EVSE's number on the charger, as in its `evses`
          required: true
          schema:
            type: integer
            format: int32
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UpdateEvse'
        required: true
      responses:
        '200':
          description: The EVSE, as the charger shows it
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Evse'
        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:control
components:
  schemas:
    UpdateEvse:
      type: object
      description: What to change on an EVSE. Send only what you change.
      properties:
        limit:
          oneOf:
            - $ref: '#/components/schemas/SetEvseLimit'
              description: >-
                The limit load balancing keeps the EVSE below: in amps per phase
                or in watts, or null to

                remove it. Left out, the limit stays as it is.
            - type: 'null'
      additionalProperties: false
    Evse:
      type: object
      description: 'An EVSE: the part of a charger that charges one vehicle at a time.'
      required:
        - id
        - connectors
      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'
        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.
    Problem:
      type: object
      description: An error response body (RFC 9457).
      required:
        - type
        - title
        - status
        - code
      properties:
        code:
          type: string
          description: 'The kind of problem, for code to act on: the last part of `type`.'
        detail:
          type: string
          description: >-
            What went wrong with this request, when there is more to say than
            the title.
        errors:
          type: array
          items:
            $ref: '#/components/schemas/FieldError'
          description: 'With `validation-failed`: the fields that broke a rule.'
        status:
          type: integer
          format: int32
          description: The HTTP status code.
          minimum: 0
        title:
          type: string
          description: A short summary of the kind of problem.
        type:
          type: string
          description: The page that explains this kind of problem.
    SetEvseLimit:
      type: object
      description: 'A limit for an EVSE: `current_a` or `power_w`, one of the two.'
      properties:
        current_a:
          oneOf:
            - $ref: '#/components/schemas/LimitCurrent'
              description: The limit in amps per phase. Null when it is set in watts.
            - type: 'null'
        power_w:
          oneOf:
            - $ref: '#/components/schemas/LimitPower'
              description: >-
                The limit in watts, over all phases. Null when it is set in
                amps.
            - type: 'null'
      additionalProperties: false
    Connector:
      type: object
      description: 'A connector: a plug of an EVSE.'
      required:
        - id
      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.
        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'
    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
      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.
    EvseLimit:
      type: object
      description: >-
        The limit set for an EVSE, in amps or in watts. Load balancing keeps the
        EVSE below it.
      properties:
        current_a:
          type:
            - integer
            - 'null'
          format: int32
          description: The limit in amps per phase; null when it is set in watts.
        power_w:
          type:
            - integer
            - 'null'
          format: int32
          description: >-
            The limit in watts; null when it is set in amps. Negative discharges
            the vehicle.
        set_by:
          oneOf:
            - $ref: '#/components/schemas/LimitSetBy'
              description: Who set it; null when it is not known.
            - type: 'null'
    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
    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.
    LimitCurrent:
      type: integer
      description: >-
        A limit in whole amps per phase: 0 pauses charging. Not above the
        charger's maximum current, when one is set.
      maximum: 1000
      minimum: 0
    LimitPower:
      type: integer
      description: >-
        A limit in whole watts, over all phases. Negative discharges the
        vehicle, on a charger that can. Either way not above the charger's
        maximum current at 230 V on three phases, when one is set.
      maximum: 1000000
      minimum: -1000000
    ConnectorFormat:
      type: string
      description: >-
        Whether a connector is a socket the vehicle's cable goes in, or a cable
        fixed to the

        charger.
      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
    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
    LimitSetBy:
      type: string
      description: Who set a limit.
      enum:
        - api
        - user
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: >-
        An access token from `accounts.plugchoice.com`, for a personal API
        token, a person signed in through an app, or an OAuth client.

````

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