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

# Upload zone configuration from a ZIP file

POST http://os-992244000006.local/api/v1/zone_monitor/staged/zip
Content-Type: application/octet-stream

Upload a ZIP file containing zone configuration (metadata.json,
STL files, and/or ZRB files). The ZIP file must contain a metadata.json
file and zone files named as '0.stl'/'0.zrb' through '127.stl'/'127.zrb'.

When the `apply` query parameter is true, the configuration is applied asynchronously
after upload. Clients should poll the status endpoint to verify completion.


Reference: https://docs.ouster.com/sensor-docs/firmware/api-reference/ouster-http-api/zone-monitor/upload-zone-configuration-from-a-zip-file

## Request

### Query parameters

- `apply` (boolean, optional, default: false) — When true, applies configuration after uploading (asynchronous operation)

### Body (application/octet-stream)

This endpoint expects binary data of type application/octet-stream.

- Binary request body.

## Response

### 204

Zone configuration successfully uploaded

## Errors

### 400 Bad Request Error

Invalid ZIP file or configuration

- `any`

### 404 Not Found Error

Zone set not found

- `any`

## Examples

**SDK Code**

```python
import requests

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

headers = {"Content-Type": "application/octet-stream"}

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

print(response.json())
```

```javascript
const url = 'http://os-992244000006.local/api/v1/zone_monitor/staged/zip';
const options = {method: 'POST', headers: {'Content-Type': 'application/octet-stream'}};

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/staged/zip"

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

	req.Header.Add("Content-Type", "application/octet-stream")

	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/staged/zip")

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

request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/octet-stream'

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/staged/zip")
  .header("Content-Type", "application/octet-stream")
  .asString();
```

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

$client = new \GuzzleHttp\Client();

$response = $client->request('POST', 'http://os-992244000006.local/api/v1/zone_monitor/staged/zip', [
  'headers' => [
    'Content-Type' => 'application/octet-stream',
  ],
]);

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

```csharp
using RestSharp;

var client = new RestClient("http://os-992244000006.local/api/v1/zone_monitor/staged/zip");
var request = new RestRequest(Method.POST);
request.AddHeader("Content-Type", "application/octet-stream");
IRestResponse response = client.Execute(request);
```

```swift
import Foundation

let headers = ["Content-Type": "application/octet-stream"]

let request = NSMutableURLRequest(url: NSURL(string: "http://os-992244000006.local/api/v1/zone_monitor/staged/zip")! 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()
```