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

# Update location

PUT https://host.com/ocpp/locations/{location_id}
Content-Type: application/json

Partially update a location. Only supplied fields are modified.

Reference: https://docs.ocpplab.com/api-reference/ocpplab-gateway-api/core-resources/locations/update

## OpenAPI Specification

```yaml
openapi: 3.1.0
info:
  title: OCPPLab SDK
  version: 1.0.0
paths:
  /ocpp/locations/{location_id}:
    put:
      operationId: update
      summary: Update location
      description: Partially update a location. Only supplied fields are modified.
      tags:
        - subpackage_locations
      parameters:
        - name: location_id
          in: path
          description: Internal location identifier returned by the location CRUD API.
          required: true
          schema:
            type: string
        - name: Authorization
          in: header
          description: Bearer authentication
          required: true
          schema:
            type: string
      responses:
        '200':
          description: Location updated successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/LocationResponse'
        '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: Location 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/UpdateLocationRequest'
servers:
  - url: https://host.com
    description: Default
components:
  schemas:
    Coordinates:
      type: object
      properties:
        latitude:
          type: number
          format: double
          description: Latitude in decimal degrees.
        longitude:
          type: number
          format: double
          description: Longitude in decimal degrees.
      required:
        - latitude
        - longitude
      description: Normalized latitude/longitude pair accepted by the location API.
      title: Coordinates
    UpdateLocationRequest:
      type: object
      properties:
        slug:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        address:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        country:
          type:
            - string
            - 'null'
        coordinates:
          oneOf:
            - $ref: '#/components/schemas/Coordinates'
            - type: 'null'
        timezone:
          type:
            - string
            - 'null'
        owner_name:
          type:
            - string
            - 'null'
        public:
          type:
            - boolean
            - 'null'
        status:
          type:
            - string
            - 'null'
      description: Partial request body used to update one charging location.
      title: UpdateLocationRequest
    LocationResponseCoordinates:
      oneOf:
        - $ref: '#/components/schemas/Coordinates'
        - type: object
          additionalProperties:
            description: Any type
      title: LocationResponseCoordinates
    LocationResponse:
      type: object
      properties:
        id:
          type: string
        slug:
          type:
            - string
            - 'null'
        name:
          type:
            - string
            - 'null'
        address:
          type:
            - string
            - 'null'
        city:
          type:
            - string
            - 'null'
        country:
          type:
            - string
            - 'null'
        coordinates:
          oneOf:
            - $ref: '#/components/schemas/LocationResponseCoordinates'
            - type: 'null'
        timezone:
          type:
            - string
            - 'null'
        owner_name:
          type:
            - string
            - 'null'
        public:
          type:
            - boolean
            - 'null'
        status:
          type:
            - string
            - 'null'
        created_at:
          type:
            - string
            - 'null'
          format: date-time
        updated_at:
          type:
            - string
            - 'null'
          format: date-time
      required:
        - id
      description: Location payload returned by the CRUD endpoints.
      title: LocationResponse
    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

```

## Examples

### The updated location



**Request**

```json
undefined
```

**Response**

```json
{
  "id": "4090477f-a416-4515-a302-97aa344a0a2a",
  "slug": "paris-la-defense-hub-a1b2c3d4",
  "name": "La Defense Charging Hub - West",
  "address": "14 Rue de la Paix",
  "city": "Paris",
  "country": "FR",
  "coordinates": {
    "latitude": 48.8566,
    "longitude": 2.3522
  },
  "timezone": "Europe/Paris",
  "owner_name": "VINCI Autoroutes",
  "public": false,
  "status": "active",
  "created_at": "2026-04-02T09:15:00Z",
  "updated_at": "2026-04-03T11:30:00Z"
}
```

**SDK Code**

```python The updated location
import requests

url = "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a"

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

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

print(response.json())
```

```javascript The updated location
const url = 'https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a';
const options = {
  method: 'PUT',
  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 updated location
package main

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

func main() {

	url := "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a"

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

url = URI("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'

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

```java The updated location
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .asString();
```

```php The updated location
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a', [
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp The updated location
using RestSharp;

var client = new RestClient("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
IRestResponse response = client.Execute(request);
```

```swift The updated location
import Foundation

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Rename and change visibility



**Request**

```json
{
  "name": "La Defense Charging Hub - West",
  "timezone": "Europe/Paris",
  "public": false
}
```

**Response**

```json
{
  "id": "4090477f-a416-4515-a302-97aa344a0a2a",
  "slug": "paris-la-defense-hub-a1b2c3d4",
  "name": "La Defense Charging Hub - West",
  "address": "14 Rue de la Paix",
  "city": "Paris",
  "country": "FR",
  "coordinates": {
    "latitude": 48.8566,
    "longitude": 2.3522
  },
  "timezone": "Europe/Paris",
  "owner_name": "VINCI Autoroutes",
  "public": false,
  "status": "active",
  "created_at": "2026-04-02T09:15:00Z",
  "updated_at": "2026-04-03T11:30:00Z"
}
```

**SDK Code**

```python Rename and change visibility
import requests

url = "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a"

payload = {
    "name": "La Defense Charging Hub - West",
    "timezone": "Europe/Paris",
    "public": False
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

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

print(response.json())
```

```javascript Rename and change visibility
const url = 'https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"name":"La Defense Charging Hub - West","timezone":"Europe/Paris","public":false}'
};

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

```go Rename and change visibility
package main

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

func main() {

	url := "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a"

	payload := strings.NewReader("{\n  \"name\": \"La Defense Charging Hub - West\",\n  \"timezone\": \"Europe/Paris\",\n  \"public\": false\n}")

	req, _ := http.NewRequest("PUT", 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 Rename and change visibility
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"name\": \"La Defense Charging Hub - West\",\n  \"timezone\": \"Europe/Paris\",\n  \"public\": false\n}"

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

```java Rename and change visibility
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"name\": \"La Defense Charging Hub - West\",\n  \"timezone\": \"Europe/Paris\",\n  \"public\": false\n}")
  .asString();
```

```php Rename and change visibility
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a', [
  'body' => '{
  "name": "La Defense Charging Hub - West",
  "timezone": "Europe/Paris",
  "public": false
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Rename and change visibility
using RestSharp;

var client = new RestClient("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"name\": \"La Defense Charging Hub - West\",\n  \"timezone\": \"Europe/Paris\",\n  \"public\": false\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Rename and change visibility
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = [
  "name": "La Defense Charging Hub - West",
  "timezone": "Europe/Paris",
  "public": false
] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```

### Update operational status only



**Request**

```json
{
  "status": "maintenance"
}
```

**Response**

```json
{
  "id": "4090477f-a416-4515-a302-97aa344a0a2a",
  "slug": "paris-la-defense-hub-a1b2c3d4",
  "name": "La Defense Charging Hub - West",
  "address": "14 Rue de la Paix",
  "city": "Paris",
  "country": "FR",
  "coordinates": {
    "latitude": 48.8566,
    "longitude": 2.3522
  },
  "timezone": "Europe/Paris",
  "owner_name": "VINCI Autoroutes",
  "public": false,
  "status": "active",
  "created_at": "2026-04-02T09:15:00Z",
  "updated_at": "2026-04-03T11:30:00Z"
}
```

**SDK Code**

```python Update operational status only
import requests

url = "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a"

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

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

print(response.json())
```

```javascript Update operational status only
const url = 'https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a';
const options = {
  method: 'PUT',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: '{"status":"maintenance"}'
};

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

```go Update operational status only
package main

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

func main() {

	url := "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a"

	payload := strings.NewReader("{\n  \"status\": \"maintenance\"\n}")

	req, _ := http.NewRequest("PUT", 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 Update operational status only
require 'uri'
require 'net/http'

url = URI("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")

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

request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"status\": \"maintenance\"\n}"

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

```java Update operational status only
import com.mashape.unirest.http.HttpResponse;
import com.mashape.unirest.http.Unirest;

HttpResponse<String> response = Unirest.put("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"status\": \"maintenance\"\n}")
  .asString();
```

```php Update operational status only
<?php
require_once('vendor/autoload.php');

$client = new \GuzzleHttp\Client();

$response = $client->request('PUT', 'https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a', [
  'body' => '{
  "status": "maintenance"
}',
  'headers' => [
    'Authorization' => 'Bearer <token>',
    'Content-Type' => 'application/json',
  ],
]);

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

```csharp Update operational status only
using RestSharp;

var client = new RestClient("https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a");
var request = new RestRequest(Method.PUT);
request.AddHeader("Authorization", "Bearer <token>");
request.AddHeader("Content-Type", "application/json");
request.AddParameter("application/json", "{\n  \"status\": \"maintenance\"\n}", ParameterType.RequestBody);
IRestResponse response = client.Execute(request);
```

```swift Update operational status only
import Foundation

let headers = [
  "Authorization": "Bearer <token>",
  "Content-Type": "application/json"
]
let parameters = ["status": "maintenance"] as [String : Any]

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

let request = NSMutableURLRequest(url: NSURL(string: "https://host.com/ocpp/locations/4090477f-a416-4515-a302-97aa344a0a2a")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "PUT"
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()
```