> 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 full documentation content, see https://docs.ocpplab.com/llms-full.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.ocpplab.com/_mcp/server.

# Proxy OCPP message

POST https://host.com/ocpp/commands/proxy-message
Content-Type: application/json

Send one outgoing charge-point message from the selected charger to the CSMS. Choose one snake_case `action`, the `ocpp_version`, and the action payload in the request body.

Reference: https://docs.ocpplab.com/api-reference/ocpplab-gateway-api/charger-operations/commands/proxy-message

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: OCPPLab SDK
  version: 1.0.0
paths:
  /ocpp/commands/proxy-message:
    post:
      operationId: proxy-message
      summary: Proxy OCPP message
      description: >-
        Send one outgoing charge-point message from the selected charger to the
        CSMS. Choose one snake_case `action`, the `ocpp_version`, and the action
        payload in the request body.
      tags:
        - subpackage_commands
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '202':
          description: Proxy message accepted for processing
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/QueuedCommandResponse'
        '400':
          description: Invalid request data
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '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 not found
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HttpErrorResponse'
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TargetedProxyMessageRequest'
servers:
  - url: https://host.com
components:
  schemas:
    ChargerCommandTarget:
      type: object
      properties:
        charger_id:
          type: string
          description: Target a single charger by deployment ID.
      required:
        - charger_id
      description: >-
        Single-charger target for command endpoints that do not support
        locations.
      title: ChargerCommandTarget
    ProxyMessageEventOcppVersion:
      type: string
      enum:
        - ocpp1.6
        - ocpp2.0.1
      title: ProxyMessageEventOcppVersion
    ProxyMessageEvent:
      type: object
      properties:
        action:
          type: string
        ocpp_version:
          $ref: '#/components/schemas/ProxyMessageEventOcppVersion'
        payload:
          type: object
          additionalProperties:
            description: Any type
          description: Action-specific request payload forwarded to the simulator.
      required:
        - action
        - ocpp_version
        - payload
      description: Command payload for proxy-message.
      title: ProxyMessageEvent
    TargetedProxyMessageRequest:
      type: object
      properties:
        target:
          $ref: '#/components/schemas/ChargerCommandTarget'
        event:
          $ref: '#/components/schemas/ProxyMessageEvent'
      required:
        - target
        - event
      description: Request for proxy-message command.
      title: TargetedProxyMessageRequest
    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
    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
    ValidationErrorLocItems:
      oneOf:
        - type: string
        - type: integer
      title: ValidationErrorLocItems
    ValidationErrorCtx:
      type: object
      properties: {}
      title: ValidationErrorCtx
    ValidationError:
      type: object
      properties:
        loc:
          type: array
          items:
            $ref: '#/components/schemas/ValidationErrorLocItems'
        msg:
          type: string
        type:
          type: string
        input:
          description: Any type
        ctx:
          $ref: '#/components/schemas/ValidationErrorCtx'
      required:
        - loc
        - msg
        - type
      title: ValidationError
    HTTPValidationError:
      type: object
      properties:
        detail:
          type: array
          items:
            $ref: '#/components/schemas/ValidationError'
      title: HTTPValidationError
  securitySchemes:
    HTTPBearer:
      type: http
      scheme: bearer

```

## SDK Code Examples

```python Outgoing OCPP message accepted and queued for the simulator
import requests

url = "https://host.com/ocpp/commands/proxy-message"

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

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

print(response.json())
```

```javascript Outgoing OCPP message accepted and queued for the simulator
const url = 'https://host.com/ocpp/commands/proxy-message';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: undefined
};

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

```go Outgoing OCPP message accepted and queued for the simulator
package main

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

func main() {

	url := "https://host.com/ocpp/commands/proxy-message"

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

	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 Outgoing OCPP message accepted and queued for the simulator
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/proxy-message")

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'

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

```java Outgoing OCPP message accepted and queued for the simulator
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/proxy-message")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php Outgoing OCPP message accepted and queued for the simulator
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/proxy-message', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Outgoing OCPP message accepted and queued for the simulator
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/proxy-message");
var request = new RestRequest(Method.POST);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift Outgoing OCPP message accepted and queued for the simulator
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]

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

```python BootNotification payload for OCPP 1.6
import requests

url = "https://host.com/ocpp/commands/proxy-message"

payload = {
    "target": { "charger_id": "dep-123" },
    "event": {
        "action": "boot_notification",
        "ocpp_version": "ocpp1.6",
        "payload": {
            "charge_point_vendor": "OCPPLAB",
            "charge_point_model": "SDK-DC-50"
        }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript BootNotification payload for OCPP 1.6
const url = 'https://host.com/ocpp/commands/proxy-message';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"target":{"charger_id":"dep-123"},"event":{"action":"boot_notification","ocpp_version":"ocpp1.6","payload":{"charge_point_vendor":"OCPPLAB","charge_point_model":"SDK-DC-50"}}}'
};

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

```go BootNotification payload for OCPP 1.6
package main

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

func main() {

	url := "https://host.com/ocpp/commands/proxy-message"

	payload := strings.NewReader("{\n  \"target\": {\n    \"charger_id\": \"dep-123\"\n  },\n  \"event\": {\n    \"action\": \"boot_notification\",\n    \"ocpp_version\": \"ocpp1.6\",\n    \"payload\": {\n      \"charge_point_vendor\": \"OCPPLAB\",\n      \"charge_point_model\": \"SDK-DC-50\"\n    }\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 BootNotification payload for OCPP 1.6
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/proxy-message")

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-123\"\n  },\n  \"event\": {\n    \"action\": \"boot_notification\",\n    \"ocpp_version\": \"ocpp1.6\",\n    \"payload\": {\n      \"charge_point_vendor\": \"OCPPLAB\",\n      \"charge_point_model\": \"SDK-DC-50\"\n    }\n  }\n}"

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

```java BootNotification payload for OCPP 1.6
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/proxy-message")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": {\n    \"charger_id\": \"dep-123\"\n  },\n  \"event\": {\n    \"action\": \"boot_notification\",\n    \"ocpp_version\": \"ocpp1.6\",\n    \"payload\": {\n      \"charge_point_vendor\": \"OCPPLAB\",\n      \"charge_point_model\": \"SDK-DC-50\"\n    }\n  }\n}")
  .asString();
```

```php BootNotification payload for OCPP 1.6
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/proxy-message', [
  'body' => '{
  "target": {
    "charger_id": "dep-123"
  },
  "event": {
    "action": "boot_notification",
    "ocpp_version": "ocpp1.6",
    "payload": {
      "charge_point_vendor": "OCPPLAB",
      "charge_point_model": "SDK-DC-50"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp BootNotification payload for OCPP 1.6
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/proxy-message");
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-123\"\n  },\n  \"event\": {\n    \"action\": \"boot_notification\",\n    \"ocpp_version\": \"ocpp1.6\",\n    \"payload\": {\n      \"charge_point_vendor\": \"OCPPLAB\",\n      \"charge_point_model\": \"SDK-DC-50\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift BootNotification payload for OCPP 1.6
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "target": ["charger_id": "dep-123"],
  "event": [
    "action": "boot_notification",
    "ocpp_version": "ocpp1.6",
    "payload": [
      "charge_point_vendor": "OCPPLAB",
      "charge_point_model": "SDK-DC-50"
    ]
  ]
] as [String : Any]

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

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

```python Authorize payload for OCPP 1.6
import requests

url = "https://host.com/ocpp/commands/proxy-message"

payload = {
    "target": { "charger_id": "dep-123" },
    "event": {
        "action": "authorize",
        "ocpp_version": "ocpp1.6",
        "payload": { "id_tag": "TAG-RFID-001" }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Authorize payload for OCPP 1.6
const url = 'https://host.com/ocpp/commands/proxy-message';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"target":{"charger_id":"dep-123"},"event":{"action":"authorize","ocpp_version":"ocpp1.6","payload":{"id_tag":"TAG-RFID-001"}}}'
};

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

```go Authorize payload for OCPP 1.6
package main

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

func main() {

	url := "https://host.com/ocpp/commands/proxy-message"

	payload := strings.NewReader("{\n  \"target\": {\n    \"charger_id\": \"dep-123\"\n  },\n  \"event\": {\n    \"action\": \"authorize\",\n    \"ocpp_version\": \"ocpp1.6\",\n    \"payload\": {\n      \"id_tag\": \"TAG-RFID-001\"\n    }\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 Authorize payload for OCPP 1.6
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/proxy-message")

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-123\"\n  },\n  \"event\": {\n    \"action\": \"authorize\",\n    \"ocpp_version\": \"ocpp1.6\",\n    \"payload\": {\n      \"id_tag\": \"TAG-RFID-001\"\n    }\n  }\n}"

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

```java Authorize payload for OCPP 1.6
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/proxy-message")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": {\n    \"charger_id\": \"dep-123\"\n  },\n  \"event\": {\n    \"action\": \"authorize\",\n    \"ocpp_version\": \"ocpp1.6\",\n    \"payload\": {\n      \"id_tag\": \"TAG-RFID-001\"\n    }\n  }\n}")
  .asString();
```

```php Authorize payload for OCPP 1.6
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/proxy-message', [
  'body' => '{
  "target": {
    "charger_id": "dep-123"
  },
  "event": {
    "action": "authorize",
    "ocpp_version": "ocpp1.6",
    "payload": {
      "id_tag": "TAG-RFID-001"
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Authorize payload for OCPP 1.6
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/proxy-message");
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-123\"\n  },\n  \"event\": {\n    \"action\": \"authorize\",\n    \"ocpp_version\": \"ocpp1.6\",\n    \"payload\": {\n      \"id_tag\": \"TAG-RFID-001\"\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Authorize payload for OCPP 1.6
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "target": ["charger_id": "dep-123"],
  "event": [
    "action": "authorize",
    "ocpp_version": "ocpp1.6",
    "payload": ["id_tag": "TAG-RFID-001"]
  ]
] as [String : Any]

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

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

```python Authorize payload for OCPP 2.0.1
import requests

url = "https://host.com/ocpp/commands/proxy-message"

payload = {
    "target": { "charger_id": "dep-123" },
    "event": {
        "action": "authorize",
        "ocpp_version": "ocpp2.0.1",
        "payload": { "id_token": {
                "idToken": "TAG-RFID-001",
                "type": "Central"
            } }
    }
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Authorize payload for OCPP 2.0.1
const url = 'https://host.com/ocpp/commands/proxy-message';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"target":{"charger_id":"dep-123"},"event":{"action":"authorize","ocpp_version":"ocpp2.0.1","payload":{"id_token":{"idToken":"TAG-RFID-001","type":"Central"}}}}'
};

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

```go Authorize payload for OCPP 2.0.1
package main

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

func main() {

	url := "https://host.com/ocpp/commands/proxy-message"

	payload := strings.NewReader("{\n  \"target\": {\n    \"charger_id\": \"dep-123\"\n  },\n  \"event\": {\n    \"action\": \"authorize\",\n    \"ocpp_version\": \"ocpp2.0.1\",\n    \"payload\": {\n      \"id_token\": {\n        \"idToken\": \"TAG-RFID-001\",\n        \"type\": \"Central\"\n      }\n    }\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 Authorize payload for OCPP 2.0.1
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/proxy-message")

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-123\"\n  },\n  \"event\": {\n    \"action\": \"authorize\",\n    \"ocpp_version\": \"ocpp2.0.1\",\n    \"payload\": {\n      \"id_token\": {\n        \"idToken\": \"TAG-RFID-001\",\n        \"type\": \"Central\"\n      }\n    }\n  }\n}"

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

```java Authorize payload for OCPP 2.0.1
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/proxy-message")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": {\n    \"charger_id\": \"dep-123\"\n  },\n  \"event\": {\n    \"action\": \"authorize\",\n    \"ocpp_version\": \"ocpp2.0.1\",\n    \"payload\": {\n      \"id_token\": {\n        \"idToken\": \"TAG-RFID-001\",\n        \"type\": \"Central\"\n      }\n    }\n  }\n}")
  .asString();
```

```php Authorize payload for OCPP 2.0.1
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/proxy-message', [
  'body' => '{
  "target": {
    "charger_id": "dep-123"
  },
  "event": {
    "action": "authorize",
    "ocpp_version": "ocpp2.0.1",
    "payload": {
      "id_token": {
        "idToken": "TAG-RFID-001",
        "type": "Central"
      }
    }
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Authorize payload for OCPP 2.0.1
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/proxy-message");
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-123\"\n  },\n  \"event\": {\n    \"action\": \"authorize\",\n    \"ocpp_version\": \"ocpp2.0.1\",\n    \"payload\": {\n      \"id_token\": {\n        \"idToken\": \"TAG-RFID-001\",\n        \"type\": \"Central\"\n      }\n    }\n  }\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Authorize payload for OCPP 2.0.1
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "target": ["charger_id": "dep-123"],
  "event": [
    "action": "authorize",
    "ocpp_version": "ocpp2.0.1",
    "payload": ["id_token": [
        "idToken": "TAG-RFID-001",
        "type": "Central"
      ]]
  ]
] as [String : Any]

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

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