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

# List OCPP + OCPI location templates

GET https://api.ocpplab.io/evcharger/templates/locations

Return ready-to-use request body templates for creating an OCPP charger location with OCPI roaming metadata. The public API validates query filters with Pydantic, then the service layer reads the local template gallery from config JSON.

Reference: https://docs.ocpplab.io/api-reference/evcharger/templates/list

## Authentication

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

## Request

### Query parameters

- `ocpp_version` (enum, optional, nullable) — Filter to templates for one OCPP version.
  - Allowed values: `ocpp1.6`, `ocpp2.0.1`
- `ocpi_version` (enum, optional, nullable) — Filter to templates for one OCPI version.
  - Allowed values: `2.1.1`, `2.2.1`
- `connector_type` (string, optional, nullable) — Filter to templates whose charger connector_type matches.
- `include_all` (boolean, optional, default: false) — When false, return the recommended four OCPP×OCPI templates. When true, return the extended gallery.

## Response

### 200

Location templates retrieved

- `count` (integer, required)
- `filters` (OcppTemplateFiltersResponse, required) — Filters echoed by the local template gallery.
- `templates` (list of OcppLocationTemplateResponse, required)

## Errors

### 400 Bad Request Error

Invalid template filter

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

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

### 500 Internal Server Error

Template gallery source failed

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

## Types

### OcppTemplateFiltersResponse

Filters echoed by the local template gallery.

- `ocpp_version` (string, optional, nullable)
- `ocpi_version` (string, optional, nullable)
- `connector_type` (string, optional, nullable)
- `include_all` (boolean, optional, default: false)

### OcppLocationTemplateResponse

One ready-to-POST OCPP + OCPI location template.

- `name` (string, required)
- `slug` (string, required)
- `description` (string, required)
- `cpo_name` (string, required)
- `cpo_slug` (string, required)
- `party_id` (string, required)
- `ocpp_version` (string, required)
- `ocpi_version` (string, required)
- `connector_type` (string, required)
- `body` (map from string to any, required) — Request body directly usable with the OCPP + OCPI create endpoint.

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

### ValidationErrorLocItems

### ValidationErrorCtx

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

## Examples

**Response**

```json
{
  "count": 1,
  "filters": {
    "ocpp_version": "ocpp1.6",
    "ocpi_version": "2.2.1",
    "connector_type": "IEC_62196_T2",
    "include_all": false
  },
  "templates": [
    {
      "name": "Type 2 AC city charger — TotalEnergies — OCPP 1.6 + OCPI 2.2.1",
      "slug": "ocpp-16-ocpi-221-totalenergies-type-2-ac-city-charger",
      "description": "Ready-to-use OCPP + OCPI create body.",
      "cpo_name": "TotalEnergies",
      "cpo_slug": "totalenergies",
      "party_id": "TEF",
      "ocpp_version": "ocpp1.6",
      "ocpi_version": "2.2.1",
      "connector_type": "IEC_62196_T2",
      "body": {
        "ocpp_version": "ocpp1.6",
        "ocpi_version": "2.2.1"
      }
    }
  ]
}
```

**SDK Code**

```python evcharger_templates_list_example
import requests

url = "https://api.ocpplab.io/evcharger/templates/locations"

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

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

print(response.json())
```

```javascript evcharger_templates_list_example
const url = 'https://api.ocpplab.io/evcharger/templates/locations';
const options = {method: 'GET', 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_templates_list_example
package main

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

func main() {

	url := "https://api.ocpplab.io/evcharger/templates/locations"

	req, _ := http.NewRequest("GET", 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_templates_list_example
require 'uri'
require 'net/http'

url = URI("https://api.ocpplab.io/evcharger/templates/locations")

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

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

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

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

HttpResponse<String> response = Unirest.get("https://api.ocpplab.io/evcharger/templates/locations")
  .header("Authorization", "Bearer <token>")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('GET', 'https://api.ocpplab.io/evcharger/templates/locations', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
  ],
]);

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

```csharp evcharger_templates_list_example
using RestSharp;

var client = new RestClient("https://api.ocpplab.io/evcharger/templates/locations");
var request = new RestRequest(Method.GET);
request.AddHeader("Authorization", "Bearer <token>");
IRestResponse response = client.Execute(request);
```

```swift evcharger_templates_list_example
import Foundation

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

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