Skip to main content
PUT
/
api
/
partners
/
v2.0
/
org
/
{org_id}
/
users
/
{user_id}
/
charging-config
Update the user's charging configuration
curl --request PUT \
  --url https://api.example.com/api/partners/v2.0/org/{org_id}/users/{user_id}/charging-config \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "hems_min_export_to_start_w": 25000,
  "hems_max_import_before_stopping_w": 25000
}
'
import requests

url = "https://api.example.com/api/partners/v2.0/org/{org_id}/users/{user_id}/charging-config"

payload = {
"hems_min_export_to_start_w": 25000,
"hems_max_import_before_stopping_w": 25000
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({hems_min_export_to_start_w: 25000, hems_max_import_before_stopping_w: 25000})
};

fetch('https://api.example.com/api/partners/v2.0/org/{org_id}/users/{user_id}/charging-config', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));
<?php

$curl = curl_init();

curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/partners/v2.0/org/{org_id}/users/{user_id}/charging-config",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'hems_min_export_to_start_w' => 25000,
'hems_max_import_before_stopping_w' => 25000
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);

$response = curl_exec($curl);
$err = curl_error($curl);

curl_close($curl);

if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}
package main

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

func main() {

url := "https://api.example.com/api/partners/v2.0/org/{org_id}/users/{user_id}/charging-config"

payload := strings.NewReader("{\n \"hems_min_export_to_start_w\": 25000,\n \"hems_max_import_before_stopping_w\": 25000\n}")

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

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(string(body))

}
HttpResponse<String> response = Unirest.put("https://api.example.com/api/partners/v2.0/org/{org_id}/users/{user_id}/charging-config")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"hems_min_export_to_start_w\": 25000,\n \"hems_max_import_before_stopping_w\": 25000\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.example.com/api/partners/v2.0/org/{org_id}/users/{user_id}/charging-config")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"hems_min_export_to_start_w\": 25000,\n \"hems_max_import_before_stopping_w\": 25000\n}"

response = http.request(request)
puts response.read_body
{
  "mode_conflict": true,
  "config_divergence": true,
  "devices": [
    {
      "device_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
      "device_type": "<string>",
      "is_primary_actuator": true
    }
  ],
  "available_modes": [
    {
      "available": true,
      "reasons": []
    }
  ],
  "hems_eligible": true,
  "hems_ineligible_reasons": [],
  "thresholds": {
    "hems_min_export_to_start_w": 123,
    "hems_max_import_before_stopping_w": 123,
    "min_band_w": 123
  },
  "health_warning": {
    "since": "2023-11-07T05:31:56Z"
  },
  "status": {
    "charge_power_w": 123,
    "solar_kwh_today": 123,
    "as_of": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

The access token received from the authorization server in the OAuth 2.0 flow.

Path Parameters

org_id
string<uuid>
required

The organization ID of the user's organization

user_id
string<uuid>
required

The user whose charging configuration to update

Body

application/json

All fields optional — omitted fields are left unchanged. The mode must be in available_modes (none always is); thresholds must satisfy every device's hysteresis-band minimum (min_band_w on GET).

smart_charging_mode
enum<string> | null

User-facing charging mode on the partner-API wire — the projection of the DesiredSteering subset {NO_STEERING, DAY_AHEAD, HEMS, DAY_AHEAD_HEMS}.

Only the Day-Ahead + HEMS nibbles are user-selectable here; Intraday and Curtailment are folded into the same projection (a Day-Ahead+Intraday device still reads spot). Use to_desired_steering / wire_mode_from_desired to cross the boundary — never compare a DesiredSteering against one of these directly.

Available options:
none,
spot,
hems,
hems_and_spot
hems_min_export_to_start_w
integer | null
Required range: 0 <= x <= 50000
hems_max_import_before_stopping_w
integer | null
Required range: 0 <= x <= 50000

Response

200 - application/json

OK

smart_charging_mode
enum<string>
required

User-facing charging mode on the partner-API wire — the projection of the DesiredSteering subset {NO_STEERING, DAY_AHEAD, HEMS, DAY_AHEAD_HEMS}.

Only the Day-Ahead + HEMS nibbles are user-selectable here; Intraday and Curtailment are folded into the same projection (a Day-Ahead+Intraday device still reads spot). Use to_desired_steering / wire_mode_from_desired to cross the boundary — never compare a DesiredSteering against one of these directly.

Available options:
none,
spot,
hems,
hems_and_spot
mode_conflict
boolean
required
config_divergence
boolean
required
devices
DeviceModeOutput · object[]
required
available_modes
ModeAvailabilityOutput · object[]
required
hems_eligible
boolean
required
hems_ineligible_reasons
enum<string>[]
required

Why a mode is unavailable (or HEMS ineligible). Stable wire codes the frontend maps to unlock hints — e.g. a locked HEMS row rendering "Connect an inverter".

Available options:
no_ev,
no_battery_capacity,
no_actuator,
wallbox_not_modulating,
no_inverter,
inverter_no_export_data
thresholds
ThresholdsOutput · object | null
required
health_warning
HealthWarningOutput · object | null
required
status
SmartChargingStatusOutput · object
required