> This page is for Firmware, version 4.0 (default).
> For other versions, use one of these documentation indexes:
> - 4.0 (default): https://docs.ouster.com/sensor-docs/firmware/4.0/llms.txt
> - 3.2: https://docs.ouster.com/sensor-docs/firmware/3.2/llms.txt

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

# Apply staged configuration to active

POST http://os-992244000006.local/api/v1/zone_monitor/apply

Cancel's any existing rendering operations and applies the staged zone set. If the staged set is empty,
the active zone set will be removed upon reinitialization. If necessary zones will be rendered. Rendering
is performed asynchronously and rendering time depends on the complexity of the zone set. Clients may query
the Zone Monitor status endpoint (GET /api/v1/zone\_monitor/status) to check rendering progress.

**To delete all zones** (return to zone-free state):

1. Ensuring the staged configuration does not enable Zone Monitor output:
   * Set `udp_profile_lidar` to a profile other than ZONE16 (e.g., RNG19\_RFL8\_SIG16\_NIR16\_DUAL)
   * Set `udp_dest_zm` to "" AND/OR set `udp_port_zm` to 0
2. DELETE /api/v1/zone\_monitor/staged (clears the staged configuration)
3. POST /api/v1/zone\_monitor/apply (applies empty staged, deleting active zones)

The apply endpoint will return the empty zone set hash and Zone Monitor will be disabled after reinitialization.

**Note**: Empty zone sets (zones: ) cannot be uploaded via ZIP. Deletion requires the three-step process above.

**Important**: Zone Monitor must be disabled (in the staged configuration) before deleting zones.
Attempting to delete zones while Zone Monitor is enabled will result in a 400 error with a descriptive
message explaining the requirement.

Reference: https://docs.ouster.com/sensor-docs/firmware/api-reference/ouster-http-api/zone-monitor/apply-staged-configuration-to-active

## Response

### 200

Configuration accepted for application. Returns the hash of the applied configuration. For empty staged sets (zone deletion), returns the empty zone set hash.

- `hash` (string, optional) — Returns the SHA256 hash of the zone file/set as a 64 character hex string.

## Errors

### 400 Bad Request Error

Invalid configuration (e.g., empty zones, schema violation, incompatible lidar mode). This error is also returned when attempting to delete zones while Zone Monitor is enabled. To delete zones, first ensure the staged configuration disables Zone Monitor output (udp_profile_lidar must not be ZONE16, and udp_dest_zm must be cleared or udp_port_zm set to 0).

- `any`

### 404 Not Found Error

Staged/Pending set not found, is Zone Monitor enabled and staged set created?

- `any`

## Examples

**Response**

```json
{
  "hash": "3f786850e387550fdab836ed7e6dc881de23001b5f8a1a2b4c3d5e6f7a8b9c0d"
}
```

**SDK Code**

```python
import requests

url = "http://os-992244000006.local/api/v1/zone_monitor/apply"

response = requests.post(url)

print(response.json())
```

```javascript
const url = 'http://os-992244000006.local/api/v1/zone_monitor/apply';
const options = {method: 'POST'};

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

```go
package main

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

func main() {

	url := "http://os-992244000006.local/api/v1/zone_monitor/apply"

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

	res, _ := http.DefaultClient.Do(req)

	defer res.Body.Close()
	body, _ := io.ReadAll(res.Body)

	fmt.Println(res)
	fmt.Println(string(body))

}
```

```ruby
require 'uri'
require 'net/http'

url = URI("http://os-992244000006.local/api/v1/zone_monitor/apply")

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

request = Net::HTTP::Post.new(url)

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

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

HttpResponse<String> response = Unirest.post("http://os-992244000006.local/api/v1/zone_monitor/apply")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://os-992244000006.local/api/v1/zone_monitor/apply');

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

```csharp
using RestSharp;

var client = new RestClient("http://os-992244000006.local/api/v1/zone_monitor/apply");
var request = new RestRequest(Method.POST);
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let request = NSMutableURLRequest(url: NSURL(string: "http://os-992244000006.local/api/v1/zone_monitor/apply")! as URL,
                                        cachePolicy: .useProtocolCachePolicy,
                                    timeoutInterval: 10.0)
request.httpMethod = "POST"

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()
```