> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.ocpplab.io/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ocpplab.io/_mcp/server.

# Update an EVSE

PATCH https://api.ocpplab.io/cpo/evses/{id}
Content-Type: application/json

Changes only the fields sent; send null to clear a field. Guard it with ``If-Match`` or ``expected_revision`` to avoid overwriting someone else's change.

Reference: https://docs.ocpplab.io/api-reference/cpo/evses/update

## Authentication

- `Authorization` header (bearer token, required) — Bearer authentication of the form `Bearer <token>`, where token is your auth token.

## Request

### Path parameters

- `id` (integer, required) — The EVSE's ``id``.

### Headers

- `If-Match` (string, optional, nullable) — Optional. The ``last_updated`` value you read; the write is refused with 412 if the object changed since.

### Body (application/json)

This endpoint expects an EvseUpdate.

- `expected_revision` (integer, optional, nullable)
- `evse_uid` (string, optional, nullable)
- `evse_id` (string, optional, nullable)
- `physical_reference` (string, optional, nullable)
- `location_id` (string, optional, nullable)
- `capabilities` (list of string, optional, nullable)
- `floor_level` (string, optional, nullable)
- `coordinates` (OcpiGeoLocation, optional, nullable)
- `directions` (list of CpoOcpiDisplayTextInput, optional, nullable)
- `parking_restrictions` (list of string, optional, nullable)
- `accepted_service_providers` (list of string, optional, nullable)
- `images` (list of OcpiImageInput, optional, nullable)

## Response

### 200

The object after the update.

- `id` (integer, required)
- `organization_id` (string, required)
- `charge_point_id` (string, required)
- `removed` (boolean, required)
- `origin` (CpoEvseOutOrigin, required)
- `last_updated` (datetime, required)
- `revision` (integer, required)
- `created_at` (datetime, required)
- `updated_at` (datetime, required)
- `evse_type_id` (integer, optional, nullable)
- `evse_id` (string, optional, nullable)
- `evse_uid` (string, optional, nullable)
- `physical_reference` (string, optional, nullable)
- `location_id` (string, optional, nullable)
- `location_db_id` (integer, optional, nullable)
- `status` (CpoEvseOutStatus, optional, nullable)
- `status_schedule` (list of OcpiStatusSchedule, optional, nullable)
- `capabilities` (list of string, optional, nullable)
- `floor_level` (string, optional, nullable)
- `coordinates` (OcpiGeoLocation, optional, nullable)
- `directions` (list of OcpiDisplayText, optional, nullable)
- `parking_restrictions` (list of string, optional, nullable)
- `parking` (list of OcpiEvseParking, optional, nullable)
- `accepted_service_providers` (list of string, optional, nullable)
- `images` (list of OcpiImage, optional, nullable)
- `role` (string, optional, nullable)
- `country_code` (string, optional, nullable)
- `party_id` (string, optional, nullable)
- `ocpi_version` (string, optional, nullable)
- `ocpp_version` (string, optional, nullable)
- `responded_at` (datetime, optional, nullable)

## Errors

### 400 Bad Request Error

If-Match is not a last_updated timestamp

- `detail` (string, required) — Human-readable error message returned by the API.

### 401 Unauthorized Error

Missing or invalid Bearer token

- `detail` (string, required) — Human-readable error message returned by the API.

### 404 Not Found Error

EVSE not found for your organization; or: Location not found for your organization

- `detail` (string, required) — Human-readable error message returned by the API.

### 409 Conflict Error

expected_revision is stale: the object changed since you read it

- `detail` (string, required) — Human-readable error message returned by the API.

### 412 Precondition Failed Error

If-Match no longer matches: the object changed since you read it

- `detail` (string, required) — Human-readable error message returned by the API.

### 422 Unprocessable Entity Error

The request does not match the schema

- `detail` (list of ValidationError, optional) — One entry per invalid field.

### 429 Too Many Requests Error

Gateway rate limit reached; retry after the given seconds

- `detail` (string, required) — Human-readable error message returned by the API.

### 502 Bad Gateway Error

Gateway unreachable, failing, or misconfigured

- `detail` (string, required) — Human-readable error message returned by the API.

### 504 Gateway Timeout Error

Gateway timed out

- `detail` (string, required) — Human-readable error message returned by the API.

## Types

### OcpiGeoLocation

- `latitude` (string, required)
- `longitude` (string, required)

### CpoOcpiDisplayTextInput

- `language` (string, required)
- `text` (string, required)

### OcpiImageInput

- `url` (string, required)
- `category` (string, required)
- `type` (string, required)
- `thumbnail` (string, optional, nullable)
- `width` (integer, optional, nullable)
- `height` (integer, optional, nullable)

### CpoEvseOutOrigin

### CpoEvseOutStatus

### OcpiStatusSchedule

- `period_begin` (datetime, required)
- `status` (string, required)
- `period_end` (datetime, optional, nullable)

### OcpiDisplayText

- `language` (string, required)
- `text` (string, required)

### OcpiEvseParking

- `parking_id` (string, required)
- `evse_position` (string, optional, nullable)

### OcpiImage

- `url` (string, required)
- `category` (string, required)
- `type` (string, required)
- `thumbnail` (string, optional, nullable)
- `width` (integer, optional, nullable)
- `height` (integer, optional, nullable)

### ValidationError

Why one field is invalid.

- `loc` (list of ValidationErrorLocItems, required) — Where the field is: ``body`` / ``query`` / ``path`` / ``header``, then its name.
- `msg` (string, required) — What is wrong, in English.
- `type` (string, required) — Machine-readable error code, e.g. ``missing``.
- `input` (any, optional) — The value that was sent.
- `ctx` (ValidationErrorCtx, optional) — Details of the rule that failed, e.g. `{"le": 200}`.

### ValidationErrorLocItems

### ValidationErrorCtx

Details of the rule that failed, e.g. `{"le": 200}`.

## Examples

**Request**

```json
{
  "expected_revision": 1,
  "floor_level": "-1"
}
```

**Response**

```json
{
  "id": 101,
  "organization_id": "550e8400-e29b-41d4-a716-446655440000",
  "charge_point_id": "CP-AMS-001",
  "removed": false,
  "origin": "LOCAL",
  "last_updated": "2026-09-30T10:00:00Z",
  "revision": 2,
  "created_at": "2026-09-01T09:00:00Z",
  "updated_at": "2026-09-30T10:00:00Z",
  "evse_type_id": 1,
  "evse_id": "NL*OCP*E1001*1",
  "evse_uid": "NL*OCP*E1001*1",
  "location_id": "LOC-AMS-01",
  "location_db_id": 12,
  "status": "AVAILABLE",
  "capabilities": [
    "RFID_READER",
    "REMOTE_START_STOP_CAPABLE"
  ],
  "floor_level": "-1",
  "role": "CPO",
  "country_code": "NL",
  "party_id": "OCP",
  "ocpi_version": "2.2.1",
  "ocpp_version": "ocpp2.0.1"
}
```

**SDK Code**

```python
import requests

url = "https://api.ocpplab.io/cpo/evses/101"

payload = {
    "expected_revision": 1,
    "floor_level": "-1"
}
headers = {
    "If-Match": "2026-09-30T10:00:00Z",
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.patch(url, json=payload, headers=headers)

print(response.json())
```

```javascript
const url = 'https://api.ocpplab.io/cpo/evses/101';
const options = {
  method: 'PATCH',
  headers: {
    'If-Match': '2026-09-30T10:00:00Z',
    Authorization: 'Bearer <token>',
    'Content-Type': 'application/json'
  },
  body: '{"expected_revision":1,"floor_level":"-1"}'
};

try {
  const response = await fetch(url, options);
  const data = await response.json();
  console.log(data);
} catch (error) {
  console.error(error);
}
```

```go
package main

import (
	"fmt"
	"strings"
	"net/http"
	"io"
)

func main() {

	url := "https://api.ocpplab.io/cpo/evses/101"

	payload := strings.NewReader("{\n  \"expected_revision\": 1,\n  \"floor_level\": \"-1\"\n}")

	req, _ := http.NewRequest("PATCH", url, payload)

	req.Header.Add("If-Match", "2026-09-30T10:00:00Z")
	req.Header.Add("Authorization", "Bearer <token>")
	req.Header.Add("Content-Type", "application/json")

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("https://api.ocpplab.io/cpo/evses/101")

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Patch.new(url)
request["If-Match"] = '2026-09-30T10:00:00Z'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"expected_revision\": 1,\n  \"floor_level\": \"-1\"\n}"

response = http.request(request)
puts response.read_body
```

```java
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.patch("https://api.ocpplab.io/cpo/evses/101")
  .header("If-Match", "2026-09-30T10:00:00Z")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"expected_revision\": 1,\n  \"floor_level\": \"-1\"\n}")
  .asString();
```

```php
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PATCH', 'https://api.ocpplab.io/cpo/evses/101', [
  'body' => '{
  "expected_revision": 1,
  "floor_level": "-1"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
    'If-Match' => '2026-09-30T10:00:00Z',
  ],
]);

echo $response->getBody();
```

```csharp
using RestSharp;

var client = new RestClient("https://api.ocpplab.io/cpo/evses/101");
var request = new RestRequest(Method.PATCH);
request.AddHeader("If-Match", "2026-09-30T10:00:00Z");
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"expected_revision\": 1,\n  \"floor_level\": \"-1\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = [
  "If-Match": "2026-09-30T10:00:00Z",
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "expected_revision": 1,
  "floor_level": "-1"
] as [String : Any]

let postData = JSONSerialization.data(withJSONObject: parameters, options: [])

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ocpplab.io/cpo/evses/101")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PATCH"
request.allHTTPHeaderFields = headers
request.httpBody = postData as Data

let session = URLSession.shared
let dataTask = session.dataTask(with: request as URLRequest, completionHandler: { (data, response, error) -> Void in
  if (error != nil) {
    print(error as Any)
  } else {
    let httpResponse = response as? HTTPURLResponse
    print(httpResponse)
  }
})

dataTask.resume()
```