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

# Stop, restart, or delete deployed charger runtimes

POST https://api.ocpplab.io/evcharger/deployment-runtime-ops
Content-Type: application/json

A single deployment_id runs synchronously and returns per-charger results. A location_id covers every charger in the location: it returns 202 at once and runs in the background, so follow it with ``GET /evcharger/deployment-runtime-ops/status`` (``client.evcharger.deployment_runtime_ops.status()``) until each charger reaches its target state. Background work is not durable across restarts.

Reference: https://docs.ocpplab.io/api-reference/evcharger/deployment-runtime-ops/operate

## Authentication

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

## Request

### Body (application/json)

This endpoint expects an OcppDeploymentRuntimeOpsRequest.

- `action` (enum, required) — Runtime operation to apply: stop, restart, or delete.
  - Allowed values: `stop`, `restart`, `delete`
- `deployment_id` (string, optional, nullable) — One deployment id to operate on. Mutually exclusive with location_id.
- `location_id` (string, optional, nullable) — Operate on every deployment in this location. Mutually exclusive with deployment_id.

## Response

### 202

Runtime operation accepted

- `evcharger_deployment_runtime_ops_operate_Response_202`

## Errors

### 401 Unauthorized Error

Missing or invalid Bearer token

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

### 422 Unprocessable Entity Error

Validation Error

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

## Types

### OcppDeploymentRuntimeOpsResponse

Aggregated response for one operational runtime request.

- `action` (enum, required) — Runtime operations accepted by the deployment runtime-ops endpoint.
  - Allowed values: `stop`, `restart`, `delete`
- `target_type` (enum, required)
  - Allowed values: `deployment`, `location`
- `accepted_count` (integer, required)
- `failed_count` (integer, required)
- `results` (list of DeploymentRuntimeOpsResult, required)
- `deployment_id` (string, optional, nullable)
- `location_id` (string, optional, nullable)

### AcceptedResponse

202 acknowledgment for work handed off to a background task. Long-running fan-outs (location create, location runtime ops) return this immediately; the actual work runs in the background and is not awaited.

- `detail` (string, required) — What was accepted and is running in the background.
- `status` (string, optional, default: accepted) — Always 'accepted'.

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

### DeploymentRuntimeOpsResult

Per-deployment runtime operation result.

- `deployment_id` (string, required)
- `status` (enum, required)
  - Allowed values: `accepted`, `failed`
- `response` (map from string to any, optional, nullable) — JSON payload returned by the cluster runtime adapter.
- `error` (string, optional, nullable)

### ValidationErrorLocItems

### ValidationErrorCtx

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

## Examples

### evcharger_deployment_runtime_ops_operate_example

**Response**

```json
{
  "action": "restart",
  "target_type": "location",
  "location_id": "4090477f-a416-4515-a302-97aa344a0a2a",
  "accepted_count": 2,
  "failed_count": 0,
  "results": [
    {
      "deployment_id": "dep-123",
      "status": "accepted",
      "response": {
        "action": "restart",
        "status": "PENDING"
      }
    }
  ]
}
```

**SDK Code**

```python evcharger_deployment_runtime_ops_operate_example
import requests

url = "https://api.ocpplab.io/evcharger/deployment-runtime-ops"

headers = {"Authorization": "Bearer <token>"}

response = requests.post(url, headers=headers)

print(response.json())
```

```javascript evcharger_deployment_runtime_ops_operate_example
const url = 'https://api.ocpplab.io/evcharger/deployment-runtime-ops';
const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};

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

```go evcharger_deployment_runtime_ops_operate_example
package main

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

func main() {

	url := "https://api.ocpplab.io/evcharger/deployment-runtime-ops"

	req, _ := http.NewRequest("POST", url, nil)

	req.Header.Add("Authorization", "Bearer <token>")

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

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

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

}
```

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

url = URI("https://api.ocpplab.io/evcharger/deployment-runtime-ops")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'

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

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

HttpResponse<String> response = Unirest.post("https://api.ocpplab.io/evcharger/deployment-runtime-ops")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ocpplab.io/evcharger/deployment-runtime-ops', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp evcharger_deployment_runtime_ops_operate_example
using RestSharp;

var client = new RestClient("https://api.ocpplab.io/evcharger/deployment-runtime-ops");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift evcharger_deployment_runtime_ops_operate_example
import Foundation

let headers = ["Authorization": "Bearer <token>"]

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ocpplab.io/evcharger/deployment-runtime-ops")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
request.allHTTPHeaderFields = headers

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()
```

### Restart one charger deployment

**Request**

```json
{
  "action": "restart",
  "deployment_id": "dep-123"
}
```

**Response**

```json
{
  "action": "restart",
  "target_type": "location",
  "location_id": "4090477f-a416-4515-a302-97aa344a0a2a",
  "accepted_count": 2,
  "failed_count": 0,
  "results": [
    {
      "deployment_id": "dep-123",
      "status": "accepted",
      "response": {
        "action": "restart",
        "status": "PENDING"
      }
    }
  ]
}
```

**SDK Code**

```python Restart one charger deployment
import requests

url = "https://api.ocpplab.io/evcharger/deployment-runtime-ops"

payload = {
    "action": "restart",
    "deployment_id": "dep-123"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Restart one charger deployment
const url = 'https://api.ocpplab.io/evcharger/deployment-runtime-ops';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"action":"restart","deployment_id":"dep-123"}'
};

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

```go Restart one charger deployment
package main

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

func main() {

	url := "https://api.ocpplab.io/evcharger/deployment-runtime-ops"

	payload := strings.NewReader("{\n  \"action\": \"restart\",\n  \"deployment_id\": \"dep-123\"\n}")

	req, _ := http.NewRequest("POST", 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(res)
	fmt.Println(string(body))

}
```

```ruby Restart one charger deployment
require 'uri'
require 'net/http'

url = URI("https://api.ocpplab.io/evcharger/deployment-runtime-ops")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"restart\",\n  \"deployment_id\": \"dep-123\"\n}"

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

```java Restart one charger deployment
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.ocpplab.io/evcharger/deployment-runtime-ops")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"restart\",\n  \"deployment_id\": \"dep-123\"\n}")
  .asString();
```

```php Restart one charger deployment
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ocpplab.io/evcharger/deployment-runtime-ops', [
  'body' => '{
  "action": "restart",
  "deployment_id": "dep-123"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Restart one charger deployment
using RestSharp;

var client = new RestClient("https://api.ocpplab.io/evcharger/deployment-runtime-ops");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"restart\",\n  \"deployment_id\": \"dep-123\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Restart one charger deployment
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": "restart",
  "deployment_id": "dep-123"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ocpplab.io/evcharger/deployment-runtime-ops")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```

### Stop every charger in a location

**Request**

```json
{
  "action": "stop",
  "location_id": "4090477f-a416-4515-a302-97aa344a0a2a"
}
```

**Response**

```json
{
  "action": "restart",
  "target_type": "location",
  "location_id": "4090477f-a416-4515-a302-97aa344a0a2a",
  "accepted_count": 2,
  "failed_count": 0,
  "results": [
    {
      "deployment_id": "dep-123",
      "status": "accepted",
      "response": {
        "action": "restart",
        "status": "PENDING"
      }
    }
  ]
}
```

**SDK Code**

```python Stop every charger in a location
import requests

url = "https://api.ocpplab.io/evcharger/deployment-runtime-ops"

payload = {
    "action": "stop",
    "location_id": "4090477f-a416-4515-a302-97aa344a0a2a"
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Stop every charger in a location
const url = 'https://api.ocpplab.io/evcharger/deployment-runtime-ops';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"action":"stop","location_id":"4090477f-a416-4515-a302-97aa344a0a2a"}'
};

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

```go Stop every charger in a location
package main

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

func main() {

	url := "https://api.ocpplab.io/evcharger/deployment-runtime-ops"

	payload := strings.NewReader("{\n  \"action\": \"stop\",\n  \"location_id\": \"4090477f-a416-4515-a302-97aa344a0a2a\"\n}")

	req, _ := http.NewRequest("POST", 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(res)
	fmt.Println(string(body))

}
```

```ruby Stop every charger in a location
require 'uri'
require 'net/http'

url = URI("https://api.ocpplab.io/evcharger/deployment-runtime-ops")

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

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"action\": \"stop\",\n  \"location_id\": \"4090477f-a416-4515-a302-97aa344a0a2a\"\n}"

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

```java Stop every charger in a location
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://api.ocpplab.io/evcharger/deployment-runtime-ops")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"action\": \"stop\",\n  \"location_id\": \"4090477f-a416-4515-a302-97aa344a0a2a\"\n}")
  .asString();
```

```php Stop every charger in a location
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://api.ocpplab.io/evcharger/deployment-runtime-ops', [
  'body' => '{
  "action": "stop",
  "location_id": "4090477f-a416-4515-a302-97aa344a0a2a"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Stop every charger in a location
using RestSharp;

var client = new RestClient("https://api.ocpplab.io/evcharger/deployment-runtime-ops");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"action\": \"stop\",\n  \"location_id\": \"4090477f-a416-4515-a302-97aa344a0a2a\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Stop every charger in a location
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "action": "stop",
  "location_id": "4090477f-a416-4515-a302-97aa344a0a2a"
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://api.ocpplab.io/evcharger/deployment-runtime-ops")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"
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()
```