curl --request POST \
--url https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"whitelist": "NEVER"
}
'import requests
url = "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate"
payload = { "whitelist": "NEVER" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({whitelist: 'NEVER'})
};
fetch('https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate', 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://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'whitelist' => 'NEVER'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate"
payload := strings.NewReader("{\n \"whitelist\": \"NEVER\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.post("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"whitelist\": \"NEVER\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"whitelist\": \"NEVER\"\n}"
response = http.request(request)
puts response.read_body{
"keyId": "0eb7732d-eb7a-418c",
"referenceId": "DE*8PS*AD21B1*3",
"contractId": "DE-8PS-C0AD21B13-Q",
"name": "My RFID key",
"validFrom": "2022-01-24T11:25:54.210Z",
"validTo": "2032-01-24T11:25:54.210Z",
"type": "card",
"enabled": true,
"whitelist": "NEVER",
"created": "2025-01-15T10:30:00Z",
"updated": "2025-01-15T10:30:00Z"
}{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}Activate a charging key
Activates a charging key for a specific user. The key must exist and be unassigned. Once activated, the key can be used to start charging sessions.
curl --request POST \
--url https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate \
--header 'Content-Type: application/json' \
--header 'X-API-Key: <api-key>' \
--data '
{
"whitelist": "NEVER"
}
'import requests
url = "https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate"
payload = { "whitelist": "NEVER" }
headers = {
"X-API-Key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-Key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({whitelist: 'NEVER'})
};
fetch('https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate', 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://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'whitelist' => 'NEVER'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-Key: <api-key>"
],
]);
$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://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate"
payload := strings.NewReader("{\n \"whitelist\": \"NEVER\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-Key", "<api-key>")
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.post("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate")
.header("X-API-Key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"whitelist\": \"NEVER\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{environment}.plugsurfing.com/drive/v1/users/{userId}/charging-keys/{referenceId}/activate")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-Key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"whitelist\": \"NEVER\"\n}"
response = http.request(request)
puts response.read_body{
"keyId": "0eb7732d-eb7a-418c",
"referenceId": "DE*8PS*AD21B1*3",
"contractId": "DE-8PS-C0AD21B13-Q",
"name": "My RFID key",
"validFrom": "2022-01-24T11:25:54.210Z",
"validTo": "2032-01-24T11:25:54.210Z",
"type": "card",
"enabled": true,
"whitelist": "NEVER",
"created": "2025-01-15T10:30:00Z",
"updated": "2025-01-15T10:30:00Z"
}{
"message": "Invalid request payload",
"details": [
"field X is required"
]
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}{
"message": "Resource not found"
}Authorizations
API key for authentication
Path Parameters
Human-readable identifier written on the rfid card or tag, visualNumber from the charging key reservation.
The unique identifier of the user who will own this charging key. Must be a valid user ID in your system.
Body
Optional request payload to activate a charging key.
Defines whether the CPO may allow a session for this charging key when it cannot get a response from the EMP, or must always rely on realtime authorization from the EMP. Possible values: ALLOWED_OFFLINE, NEVER.
ALLOWED_OFFLINE, NEVER "NEVER"
Response
OK
Represents a charging key assigned to a user account.
Identifier used for this charging key (uid in the case of a physical charging key)
"0eb7732d-eb7a-418c"
UTC timestamp when the charging key becomes valid.
"2022-01-24T11:25:54.210Z"
UTC timestamp when the charging key expires.
"2032-01-24T11:25:54.210Z"
Possible values include, but aren't limited to: 'tag', 'card', 'virtual', 'plug_and_charge'.
"card"
Indicates if the key can start a session or not
UTC timestamp when the charging key was created.
UTC timestamp when the charging key was last updated.
Visual number for RFID and virtual keys, Plug and Charge identifier (PCID )for plug_and_charge keys
"DE*8PS*AD21B1*3"
Identifier used in the context of roaming
"DE-8PS-C0AD21B13-Q"
Key name (usually set by end-users to name their keys when they have multiple ones).
"My RFID key"
Defines whether the CPO may allow a session for this charging key when it cannot get a response from the EMP, or must always rely on realtime authorization from the EMP. Possible values: ALLOWED_OFFLINE, NEVER.
ALLOWED_OFFLINE, NEVER "NEVER"