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

# Clear local authorization list

POST https://host.com/ocpp/commands/clear-local-auth-list
Content-Type: application/json

Send a local authorization list clear command to the selected charger. All entries are removed and the list version resets to 0.

Reference: https://docs.ocpplab.com/api-reference/ocpplab-gateway-api/charger-operations/commands/clear-local-list

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: OCPPLab SDK
  version: 1.0.0
paths:
  /ocpp/commands/clear-local-auth-list:
    post:
      operationId: clear-local-list
      summary: Clear local authorization list
      description: >-
        Send a local authorization list clear command to the selected charger.
        All entries are removed and the list version resets to 0.
      tags:
        - subpackage_commands
      parameters:
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Local auth list cleared
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocalListMutationResponse'
        '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/TargetedLocalListMutationRequest'
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
    EmptyEvent:
      type: object
      properties: {}
      description: Empty event payload for commands that only need a target.
      title: EmptyEvent
    TargetedLocalListMutationRequest:
      type: object
      properties:
        target:
          $ref: '#/components/schemas/ChargerCommandTarget'
        event:
          $ref: '#/components/schemas/EmptyEvent'
      required:
        - target
        - event
      description: Request for local authorization list deletion command.
      title: TargetedLocalListMutationRequest
    LocalListMutationResponse:
      type: object
      properties:
        status:
          type:
            - string
            - 'null'
        list_version:
          type:
            - integer
            - 'null'
        entries_received:
          type:
            - integer
            - 'null'
        msg:
          type:
            - string
            - 'null'
        entries_deleted:
          type:
            - integer
            - 'null'
      description: Response body returned by local-auth mutation endpoints.
      title: LocalListMutationResponse
    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 The charger removed all local authorization entries
import requests

url = "https://host.com/ocpp/commands/clear-local-auth-list"

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

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

print(response.json())
```

```javascript The charger removed all local authorization entries
const url = 'https://host.com/ocpp/commands/clear-local-auth-list';
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 The charger removed all local authorization entries
package main

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

func main() {

	url := "https://host.com/ocpp/commands/clear-local-auth-list"

	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 The charger removed all local authorization entries
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/clear-local-auth-list")

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 The charger removed all local authorization entries
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

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

```php The charger removed all local authorization entries
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

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

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

```csharp The charger removed all local authorization entries
using RestSharp;

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

```swift The charger removed all local authorization entries
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpp/commands/clear-local-auth-list")! 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 Clear the local authorization list on one charger
import requests

url = "https://host.com/ocpp/commands/clear-local-auth-list"

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

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

print(response.json())
```

```javascript Clear the local authorization list on one charger
const url = 'https://host.com/ocpp/commands/clear-local-auth-list';
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"target":{"charger_id":"dep-123"}}'
};

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

```go Clear the local authorization list on one charger
package main

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

func main() {

	url := "https://host.com/ocpp/commands/clear-local-auth-list"

	payload := strings.NewReader("{\n  \"target\": {\n    \"charger_id\": \"dep-123\"\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 Clear the local authorization list on one charger
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/commands/clear-local-auth-list")

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}"

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

```java Clear the local authorization list on one charger
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.post("https://host.com/ocpp/commands/clear-local-auth-list")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"target\": {\n    \"charger_id\": \"dep-123\"\n  }\n}")
  .asString();
```

```php Clear the local authorization list on one charger
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'https://host.com/ocpp/commands/clear-local-auth-list', [
  'body' => '{
  "target": {
    "charger_id": "dep-123"
  }
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Clear the local authorization list on one charger
using RestSharp;

var client = new RestClient("https://host.com/ocpp/commands/clear-local-auth-list");
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}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Clear the local authorization list on one charger
import Foundation

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

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

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