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

# Unplug connector

POST https://host.com/ocpp/commands/unplug-connector
Content-Type: application/json

Simulate physical cable unplug on the specified connector. The charger returns to `Available` once the cable is removed. Targets a single charger, selected chargers in a location, or all chargers in a location.

Reference: https://docs.ocpplab.com/api-reference/ocpplab-gateway-api/charger-operations/commands/unplug-connector

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: OCPPLab SDK
  version: 1.0.0
paths:
  /ocpp/commands/unplug-connector:
    post:
      operationId: unplug-connector
      summary: Unplug connector
      description: >-
        Simulate physical cable unplug on the specified connector. The charger
        returns to `Available` once the cable is removed. Targets a single
        charger, selected chargers in a location, or all chargers in a location.
      tags:
        - subpackage_commands
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Command accepted and queued for the target charger(s)
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationCommandResponse'
        '401':
          description: Missing or invalid bearer token
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '403':
          description: Insufficient permissions or missing required claims
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '404':
          description: Charger or location not found
          content:
            application/json:
              schema:
                description: Any type
        '422':
          description: Invalid target — provide either charger_id or location_id, not both
          content:
            application/json:
              schema:
                description: Any type
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                description: Any type
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/UnifiedConnectorRequest'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    CommandTarget:
      type: object
      properties:
        charger_id:
          type:
            - string
            - 'null'
          description: Target a single charger by deployment ID.
        location_id:
          type:
            - string
            - 'null'
          description: Target all or selected chargers in a location.
        charger_ids:
          type:
            - array
            - 'null'
          items:
            type: string
          description: >-
            Subset of chargers within the location. Null = all chargers. Only
            valid with location_id.
      description: >-
        Target for a unified command.


        Provide exactly one of ``charger_id`` or ``location_id``.

        ``charger_ids`` is an optional subset filter — only valid with
        ``location_id``.


        Examples::

            {"charger_id": "dep-123"}
            {"location_id": "loc-456"}
            {"location_id": "loc-456", "charger_ids": ["dep-1", "dep-2"]}
      title: CommandTarget
    ConnectorCommandEvent:
      type: object
      properties:
        evse_id:
          type: integer
          default: 1
        connector_id:
          type: integer
          default: 1
      description: Command payload for connector-scoped actions.
      title: ConnectorCommandEvent
    UnifiedConnectorRequest:
      type: object
      properties:
        target:
          $ref: '#/components/schemas/CommandTarget'
        event:
          $ref: '#/components/schemas/ConnectorCommandEvent'
      required:
        - target
        - event
      description: Request for plug / unplug / unlock / EV-energy commands.
      title: UnifiedConnectorRequest
    QueuedCommandResponse:
      type: object
      properties:
        id:
          type: string
        event_type:
          type: string
        ocpp_version:
          type: string
        payload:
          type: object
          additionalProperties:
            description: Any type
          description: Command payload sent to the simulator queue.
      required:
        - id
        - event_type
        - ocpp_version
        - payload
      description: Queued command payload returned by simulator action endpoints.
      title: QueuedCommandResponse
    LocationQueuedCommandResult:
      type: object
      properties:
        charger_id:
          type: string
        identity:
          type: string
        command:
          $ref: '#/components/schemas/QueuedCommandResponse'
      required:
        - charger_id
        - identity
        - command
      description: One queued command result item for a location-scoped command request.
      title: LocationQueuedCommandResult
    LocationCommandFailure:
      type: object
      properties:
        identity:
          type:
            - string
            - 'null'
        error:
          type: string
      required:
        - error
      description: Failed charger result returned by location command endpoints.
      title: LocationCommandFailure
    LocationCommandResponse:
      type: object
      properties:
        targeted_count:
          type: integer
        queued_count:
          type: integer
        failed_count:
          type: integer
        results:
          type: array
          items:
            $ref: '#/components/schemas/LocationQueuedCommandResult'
        failed:
          type: array
          items:
            $ref: '#/components/schemas/LocationCommandFailure'
      required:
        - targeted_count
        - queued_count
        - failed_count
        - results
        - failed
      description: Response body returned by location-scoped charger command endpoints.
      title: LocationCommandResponse
    HttpErrorResponse:
      type: object
      properties:
        detail:
          type: string
          description: Human-readable error message returned by the API.
      required:
        - detail
      description: Standard HTTP error payload returned by the API.
      title: HttpErrorResponse
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

```

## Examples

### Unplug queued for one targeted charger



**Request**

```json
{
  "target": {
    "charger_id": "dep-789"
  },
  "event": {
    "evse_id": 2,
    "connector_id": 1
  }
}
```

**Response**

```json
{
  "targeted_count": 1,
  "queued_count": 1,
  "failed_count": 0,
  "results": [
    {
      "charger_id": "dep-789",
      "identity": "CP-CHARGER-789",
      "command": {
        "id": "f7e8d9c0b1a2",
        "event_type": "unplug",
        "ocpp_version": "ocpp1.6",
        "payload": {
          "evse_id": 2,
          "connector_id": 1
        }
      }
    }
  ],
  "failed": []
}
```

**SDK Code**

```python Unplug queued for one targeted charger
import requests

url = "https://host.com/ocpp/commands/unplug-connector"

payload = {
    "target": { "charger_id": "dep-789" },
    "event": {
        "evse_id": 2,
        "connector_id": 1
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Unplug queued for one targeted charger
const url = 'https://host.com/ocpp/commands/unplug-connector';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"target":{"charger_id":"dep-789"},"event":{"evse_id":2,"connector_id":1}}'
};

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

```go Unplug queued for one targeted charger
package main

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

func main() {

	url := "https://host.com/ocpp/commands/unplug-connector"

	payload := strings.NewReader("{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\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 Unplug queued for one targeted charger
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/unplug-connector")

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  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}"

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

```java Unplug queued for one targeted charger
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/unplug-connector")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}")
  .asString();
```

```php Unplug queued for one targeted charger
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/unplug-connector', [
  'body' => '{
  "target": {
    "charger_id": "dep-789"
  },
  "event": {
    "evse_id": 2,
    "connector_id": 1
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Unplug queued for one targeted charger
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/unplug-connector");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Unplug queued for one targeted charger
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "target": ["charger_id": "dep-789"],
  "event": [
    "evse_id": 2,
    "connector_id": 1
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpp/commands/unplug-connector")! 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()
```

### Unplug connector — single charger



**Request**

```json
{
  "target": {
    "charger_id": "dep-789"
  },
  "event": {
    "evse_id": 2,
    "connector_id": 1
  }
}
```

**Response**

```json
{
  "targeted_count": 1,
  "queued_count": 1,
  "failed_count": 0,
  "results": [
    {
      "charger_id": "dep-789",
      "identity": "CP-CHARGER-789",
      "command": {
        "id": "f7e8d9c0b1a2",
        "event_type": "unplug",
        "ocpp_version": "ocpp1.6",
        "payload": {
          "evse_id": 2,
          "connector_id": 1
        }
      }
    }
  ],
  "failed": []
}
```

**SDK Code**

```python Unplug connector — single charger
import requests

url = "https://host.com/ocpp/commands/unplug-connector"

payload = {
    "target": { "charger_id": "dep-789" },
    "event": {
        "evse_id": 2,
        "connector_id": 1
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Unplug connector — single charger
const url = 'https://host.com/ocpp/commands/unplug-connector';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"target":{"charger_id":"dep-789"},"event":{"evse_id":2,"connector_id":1}}'
};

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

```go Unplug connector — single charger
package main

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

func main() {

	url := "https://host.com/ocpp/commands/unplug-connector"

	payload := strings.NewReader("{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\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 Unplug connector — single charger
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/unplug-connector")

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  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}"

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

```java Unplug connector — single charger
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/unplug-connector")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}")
  .asString();
```

```php Unplug connector — single charger
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/unplug-connector', [
  'body' => '{
  "target": {
    "charger_id": "dep-789"
  },
  "event": {
    "evse_id": 2,
    "connector_id": 1
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Unplug connector — single charger
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/unplug-connector");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Unplug connector — single charger
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "target": ["charger_id": "dep-789"],
  "event": [
    "evse_id": 2,
    "connector_id": 1
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpp/commands/unplug-connector")! 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()
```

### Unplug connector — all chargers in a location



**Request**

```json
{
  "target": {
    "charger_id": "dep-789"
  },
  "event": {
    "evse_id": 2,
    "connector_id": 1
  }
}
```

**Response**

```json
{
  "targeted_count": 1,
  "queued_count": 1,
  "failed_count": 0,
  "results": [
    {
      "charger_id": "dep-789",
      "identity": "CP-CHARGER-789",
      "command": {
        "id": "f7e8d9c0b1a2",
        "event_type": "unplug",
        "ocpp_version": "ocpp1.6",
        "payload": {
          "evse_id": 2,
          "connector_id": 1
        }
      }
    }
  ],
  "failed": []
}
```

**SDK Code**

```python Unplug connector — all chargers in a location
import requests

url = "https://host.com/ocpp/commands/unplug-connector"

payload = {
    "target": { "charger_id": "dep-789" },
    "event": {
        "evse_id": 2,
        "connector_id": 1
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Unplug connector — all chargers in a location
const url = 'https://host.com/ocpp/commands/unplug-connector';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"target":{"charger_id":"dep-789"},"event":{"evse_id":2,"connector_id":1}}'
};

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

```go Unplug connector — all chargers in a location
package main

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

func main() {

	url := "https://host.com/ocpp/commands/unplug-connector"

	payload := strings.NewReader("{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\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 Unplug connector — all chargers in a location
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/unplug-connector")

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  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}"

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

```java Unplug connector — all chargers in a location
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/unplug-connector")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}")
  .asString();
```

```php Unplug connector — all chargers in a location
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/unplug-connector', [
  'body' => '{
  "target": {
    "charger_id": "dep-789"
  },
  "event": {
    "evse_id": 2,
    "connector_id": 1
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Unplug connector — all chargers in a location
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/unplug-connector");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Unplug connector — all chargers in a location
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "target": ["charger_id": "dep-789"],
  "event": [
    "evse_id": 2,
    "connector_id": 1
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpp/commands/unplug-connector")! 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()
```

### Unplug connector — selected chargers in a location



**Request**

```json
{
  "target": {
    "charger_id": "dep-789"
  },
  "event": {
    "evse_id": 2,
    "connector_id": 1
  }
}
```

**Response**

```json
{
  "targeted_count": 1,
  "queued_count": 1,
  "failed_count": 0,
  "results": [
    {
      "charger_id": "dep-789",
      "identity": "CP-CHARGER-789",
      "command": {
        "id": "f7e8d9c0b1a2",
        "event_type": "unplug",
        "ocpp_version": "ocpp1.6",
        "payload": {
          "evse_id": 2,
          "connector_id": 1
        }
      }
    }
  ],
  "failed": []
}
```

**SDK Code**

```python Unplug connector — selected chargers in a location
import requests

url = "https://host.com/ocpp/commands/unplug-connector"

payload = {
    "target": { "charger_id": "dep-789" },
    "event": {
        "evse_id": 2,
        "connector_id": 1
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Unplug connector — selected chargers in a location
const url = 'https://host.com/ocpp/commands/unplug-connector';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"target":{"charger_id":"dep-789"},"event":{"evse_id":2,"connector_id":1}}'
};

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

```go Unplug connector — selected chargers in a location
package main

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

func main() {

	url := "https://host.com/ocpp/commands/unplug-connector"

	payload := strings.NewReader("{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\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 Unplug connector — selected chargers in a location
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/unplug-connector")

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  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}"

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

```java Unplug connector — selected chargers in a location
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/unplug-connector")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}")
  .asString();
```

```php Unplug connector — selected chargers in a location
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/unplug-connector', [
  'body' => '{
  "target": {
    "charger_id": "dep-789"
  },
  "event": {
    "evse_id": 2,
    "connector_id": 1
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Unplug connector — selected chargers in a location
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/unplug-connector");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"target\": {\n    \"charger_id\": \"dep-789\"\n  },\n  \"event\": {\n    \"evse_id\": 2,\n    \"connector_id\": 1\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Unplug connector — selected chargers in a location
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "target": ["charger_id": "dep-789"],
  "event": [
    "evse_id": 2,
    "connector_id": 1
  ]
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpp/commands/unplug-connector")! 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()
```