h-cam B1280 Camera API
Quick Start
Confirm the product and firmware identity, start continuous acquisition, then fetch a JPEG:
curl http://CAMERA_IP/api/v1/info
curl -X POST http://CAMERA_IP/api/v1/camera/acquisition/continuous/start
curl -o frame.jpg http://CAMERA_IP/api/v1/frames/latestThe API root at /api/v1 is the canonical route-discovery document. The
canonical camera-state read is GET /api/v1/camera.
Endpoint Index
Service
| Method | Path | Success | Use |
|---|---|---|---|
GET | /api/v1 | 200 application/json | Returns API version 1.0 and the closed link map for public HTTP resources. |
GET | /api/v1/info | 200 application/json | Returns product, firmware Git SHA, chip, network identity, and feature flags. |
GET | /api/v1/health | 200 application/json | Returns overall health, warnings, faults, uptime, and heap telemetry. |
GET | /api/v1/time | 200 application/json | Returns compact monotonic time plus coherent PTP quality and scheduling readiness. |
GET | /api/v1/system | 200 application/json | Returns boot identity, reset reason, uptime, and silicon temperature. |
POST | /api/v1/system/reboot | 200 application/json | Schedules a reboot after an optional bounded delay. |
GET | / | 200 text/html | Serves the built-in browser control and status document. |
Network
| Method | Path | Success | Use |
|---|---|---|---|
GET | /api/v1/network | 200 application/json | Returns the active network state, last confirmed persistent configuration, any pending change, mDNS state, recovery state, and discovery settings. |
PATCH | /api/v1/network | 200 application/json / 200 application/json / 202 application/json | Validates or applies DHCP or static IPv4 configuration, optionally staging a confirmable address change. |
POST | /api/v1/network/confirm | 200 application/json | Confirms a staged network configuration using its config_id. |
POST | /api/v1/network/rollback | 202 application/json / 200 application/json | Rolls back a staged network configuration using its config_id. |
UDP | udp:discovery | 200 application/json | Discovers cameras with the canonical JSON broadcast exchange on UDP port 39590. |
Camera
| Method | Path | Success | Use |
|---|---|---|---|
GET | /api/v1/camera | 200 application/json | Returns the canonical grouped camera state: acquisition, pipeline timing, latest frame, output, and frame-buffer counts. |
GET | /api/v1/camera/capabilities | 200 application/json | Returns the installed AR0144 sensor descriptor and immutable pipeline, timing, preview, trigger, network, and feature capabilities. |
GET | /api/v1/camera/config | 200 application/json | Returns current sensor-backed configuration and timing readback. |
PATCH | /api/v1/camera/config | 200 application/json | Applies mutable pipeline, sensor timing/control, JPEG, and ISP configuration fields. |
GET | /api/v1/camera/acquisition | 200 application/json | Returns acquisition mode and retained-frame buffer state. |
POST | /api/v1/camera/acquisition/continuous/start | 200 application/json | Starts continuous free-run acquisition. |
POST | /api/v1/camera/acquisition/triggered/start | 200 application/json | Starts software-trigger-ready acquisition. |
POST | /api/v1/camera/acquisition/stop | 200 application/json | Stops acquisition. |
POST | /api/v1/camera/acquisition/flush | 200 application/json | Flushes retained JPEG frames. |
Trigger
| Method | Path | Success | Use |
|---|---|---|---|
GET | /api/v1/camera/trigger | 200 application/json | Returns software-trigger readiness, compact PTP quality, output state, visible trigger slots, and the earliest admission times. |
POST | /api/v1/camera/trigger/schedule | 200 application/json | Schedules a monotonic or PTP software-trigger output and can optionally wait for its associated frame. |
POST | /api/v1/camera/trigger/cancel | 200 application/json | Cancels a retained future scheduled trigger using its required trigger_id. |
Frames and Streams
| Method | Path | Success | Use |
|---|---|---|---|
GET | /api/v1/frames/latest/meta | 200 application/json | Returns common metadata for the latest retained frame. |
GET | /api/v1/frames/latest | 200 image/jpeg | Returns the latest retained JPEG with retained timing headers. |
GET | /api/v1/frames/next | 200 image/jpeg | Waits for and returns the next retained JPEG after a required boot-scoped frame cursor. |
GET | /api/v1/frames/{frame_id}/meta | 200 application/json | Returns common metadata for a retained frame by public frame ID. |
GET | /api/v1/frames/{frame_id} | 200 image/jpeg | Returns a retained JPEG by public frame ID. |
GET | /api/v1/preview.mjpg | 307 application/json | Validates preview query parameters and redirects to the direct MJPEG server. |
GET | /api/v1/events | 200 text/event-stream | Streams retained system, frame, and terminal error events using SSE. |
GET | /stream.mjpg | 200 multipart/x-mixed-replace | Streams multipart MJPEG directly from TCP port 81. |
Metrics
| Method | Path | Success | Use |
|---|---|---|---|
GET | /api/v1/metrics | 200 application/json | Returns grouped camera, preview, trigger, and system telemetry. |
Debug Diagnostics
| Method | Path | Success | Use |
|---|---|---|---|
GET | /debug/runtime | 200 application/json | Returns internal task, resource, service, lifecycle, and coherent PTP diagnostics. |
GET | /debug/time | 200 application/json | Returns the complete coherent PTP diagnostic projection used by qualification tools. |
GET | /debug/camera/sensor | 200 application/json | Returns camera-task sensor registers, AR0144 diagnostics, sensor-read timing, and raw-slot ownership. |
Endpoints
Each endpoint section lists its accepted query string, request body, response statuses, success schemas, examples, and endpoint-specific behavior.
Service
GET /api/v1
Returns API version 1.0 and the closed link map for public HTTP resources.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | discovery.api_root |
400 | bad_request | application/json | common.product_error |
Success Response Schemas
200 success response: discovery.api_root
Example
Request
curl 'http://CAMERA_IP/api/v1'Response
{
"api_version": "1.0",
"links": {
"info": "/api/v1/info",
"health": "/api/v1/health",
"network": "/api/v1/network",
"time": "/api/v1/time",
"system": "/api/v1/system",
"camera": "/api/v1/camera",
...GET /api/v1/info
Returns product, firmware Git SHA, chip, network identity, and feature flags.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | discovery.info |
400 | bad_request | application/json | common.product_error |
Success Response Schemas
200 success response: discovery.info
Example
Request
curl 'http://CAMERA_IP/api/v1/info'Response
{
"model": "esp32-p4-ar0144-camera",
"api_version": "1.0",
"firmware": {
"name": "esp32_p4_ar0144_camera",
"idf_version": "v5.5.4",
"git_sha": "744a7161b3d9626f11475fc40408620ca6b85fc3-dirty",
"build_time": "Aug 4 2026 16:06:26"
},
...GET /api/v1/health
Returns overall health, warnings, faults, uptime, and heap telemetry.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | discovery.health |
400 | bad_request | application/json | common.product_error |
Success Response Schemas
200 success response: discovery.health
Example
Request
curl 'http://CAMERA_IP/api/v1/health'Response
{
"state": "ok",
"uptime_ms": 21451,
"faults": [],
"warnings": [],
"heap": {
"internal_free_bytes": 147591,
"internal_min_free_bytes": 139023,
"psram_free_bytes": 13067500,
...GET /api/v1/time
Returns compact monotonic time plus coherent PTP quality and scheduling readiness.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | discovery.time |
400 | bad_request | application/json | common.product_error |
503 | time_unavailable | application/json | common.product_error |
Success Response Schemas
200 success response: discovery.time
Example
Request
curl 'http://CAMERA_IP/api/v1/time'Response
{
"boot_id": "00000000-0000-4000-8000-000000000002",
"mono_ns": "1700000000000000000",
"ptp": {
"ns": "1700000000000000000",
"state": "acquiring",
"epoch": null,
"generation": 1,
"grandmaster_id": "grandmaster-1",
...GET /api/v1/system
Returns boot identity, reset reason, uptime, and silicon temperature.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | system.response |
400 | bad_request | application/json | common.product_error |
Success Response Schemas
200 success response: system.response
Example
Request
curl 'http://CAMERA_IP/api/v1/system'Response
{
"uptime_s": 52,
"boot_id": "00000000-0000-4000-8000-000000000002",
"reset_reason": "software",
"temperature_c": 36.2
}POST /api/v1/system/reboot
Schedules a reboot after an optional bounded delay.
Query String
No query string is accepted.
Request Body
Body schema: system.reboot.request
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | system.reboot.response |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
Success Response Schemas
200 success response: system.reboot.response
Example
Request
curl -X POST -H 'Content-Type: application/json' --data '{"delay_ms":250}' 'http://CAMERA_IP/api/v1/system/reboot'Response
{
"ok": true,
"rebooting": true,
"delay_ms": 250
}GET /
Serves the built-in browser control and status document.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | text/html | web.root_html_response |
Success Response Schemas
200 success response: web.root_html_response
Example
Request
curl 'http://CAMERA_IP/'Response
{
"status": 200,
"content_type": "text/html; charset=utf-8",
"headers": {
"content-type": "text/html; charset=utf-8"
},
"document_kind": "html"
}Network
GET /api/v1/network
Returns the active network state, last confirmed persistent configuration, any pending change, mDNS state, recovery state, and discovery settings.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | network.response |
400 | bad_request | application/json | common.product_error |
503 | network_unavailable | application/json | common.product_error |
Success Response Schemas
200 success response: network.response
Example
Request
curl 'http://CAMERA_IP/api/v1/network'Response
{
"hostname": "camera-example-1",
"state": "dhcp_bound",
"mdns_name": "camera-example-1.local",
"mac": "02:00:00:00:00:01",
"link_up": true,
"speed_mbps": 100,
"full_duplex": true,
"mode": "dhcp",
...PATCH /api/v1/network
Validates or applies DHCP or static IPv4 configuration, optionally staging a confirmable address change.
Query String
No query string is accepted.
Request Body
Body schema: network.patch.request
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | validated | application/json | network.patch.validate_response |
200 | applied | application/json | network.response |
202 | pending | application/json | network.response |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
409 | network_change_pending | application/json | common.product_error |
409 | address_conflict | application/json | common.product_error |
409 | network_busy_conflict | application/json | common.product_error |
503 | busy | application/json | common.product_error |
503 | network_busy_unavailable | application/json | common.product_error |
503 | network_unavailable | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
Success Response Schemas
200 validated response: network.patch.validate_response
200 applied response: network.response
202 pending response: network.response
Example
Validate Baseline Network
Request
curl -X PATCH -H 'Content-Type: application/json' --data '{"mode":"dhcp","hostname":"camera-example-1"}' 'http://CAMERA_IP/api/v1/network'Response
{
"valid": true,
"candidate": {
"mode": "dhcp",
"hostname": "camera-example-1",
"static_ipv4": null
}
}Stage Temporary Hostname For Confirm
Request
curl -X PATCH -H 'Content-Type: application/json' --data '{"mode":"dhcp","hostname":"camera-example-2","apply":true,"confirm_timeout_ms":30000}' 'http://CAMERA_IP/api/v1/network'Response
{
"hostname": "camera-example-1",
"state": "dhcp_bound",
"mdns_name": "camera-example-1.local",
"mac": "02:00:00:00:00:01",
"link_up": true,
"speed_mbps": 100,
"full_duplex": true,
"mode": "dhcp",
...Stage Temporary Hostname For Rollback
Request
curl -X PATCH -H 'Content-Type: application/json' --data '{"mode":"dhcp","hostname":"camera-example-2","apply":true,"confirm_timeout_ms":30000}' 'http://CAMERA_IP/api/v1/network'Response
{
"hostname": "camera-example-1",
"state": "dhcp_bound",
"mdns_name": null,
"mac": "02:00:00:00:00:01",
"link_up": true,
"speed_mbps": 100,
"full_duplex": true,
"mode": "dhcp",
...POST /api/v1/network/confirm
Confirms a staged network configuration using its config_id.
Query String
No query string is accepted.
Request Body
Body schema: network.confirm.request
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | network.response |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
409 | confirm_not_ready | application/json | common.product_error |
409 | confirm_not_reachable | application/json | common.product_error |
409 | no_pending_config | application/json | common.product_error |
409 | network_busy_conflict | application/json | common.product_error |
503 | busy | application/json | common.product_error |
503 | network_busy_unavailable | application/json | common.product_error |
503 | network_unavailable | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
Success Response Schemas
200 success response: network.response
Example
Request
curl -X POST -H 'Content-Type: application/json' --data '{"config_id":"config-2"}' 'http://CAMERA_IP/api/v1/network/confirm'Response
{
"hostname": "camera-example-2",
"state": "dhcp_bound",
"mdns_name": null,
"mac": "02:00:00:00:00:01",
"link_up": true,
"speed_mbps": 100,
"full_duplex": true,
"mode": "dhcp",
...POST /api/v1/network/rollback
Rolls back a staged network configuration using its config_id.
Query String
No query string is accepted.
Request Body
Body schema: network.rollback.request
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
202 | rollback_started | application/json | network.rollback.response |
200 | success | application/json | network.response |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
409 | no_pending_config | application/json | common.product_error |
409 | network_busy_conflict | application/json | common.product_error |
503 | busy | application/json | common.product_error |
503 | network_busy_unavailable | application/json | common.product_error |
503 | network_unavailable | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
Success Response Schemas
202 rollback_started response: network.rollback.response
200 success response: network.response
Example
Request
curl -X POST -H 'Content-Type: application/json' --data '{"config_id":"config-4"}' 'http://CAMERA_IP/api/v1/network/rollback'Response
{
"rollback_started": true,
"config_id": "config-4"
}UDP udp:discovery
Discovers cameras with the canonical JSON broadcast exchange on UDP port 39590.
Query String
No query string is accepted.
Request Body
Body schema: discovery.udp.request
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | discovery.udp.response |
Success Response Schemas
200 success response: discovery.udp.response
Example
Request
UDP port 39590 request
{
"type": "esp32_p4.discover",
"protocol": "esp32-p4-discovery",
"version": 1
}Response
{"type":"esp32_p4.discovery","protocol":"esp32-p4-discovery","version":1,"product_class":"camera","model":"esp32-p4-ar0144-camera","git_sha":"744a7161b3d9626f11475fc40408620ca6b85fc3-dirty","api_version":"1.0","boot_id":"00000000-0000-4000-8000-000000000002","mac":"02:00:00:00:00:01","hostname":"camera-example-1","effective_hostname":"camera-example-1","network_mode":"dhcp","confirmed_config_id":"config-3","pending_config_id":null,"mdns_name":"camera-example-1.local","mdns_publication_phase":"running","mdns_observation_stale":false,"mdns_renamed":false,"ipv4":"192.0.2.1","netmask":"255.255.255.0","gateway":"192.0.2.1","dns":[],"requires_link_local_host_route":false,"link_local_network":null,"base_url":"http://camera-example-1","link_up":true,"recovery_active":false,"ptp_sync_state":"synchronized","ptp_clock_readable":true,"ptp_synchronized":true,"last_failure":"pending_reboot_rollback","recovery_reason":null,"uptime_ms":59833,"http_port":80,"udp_port":39590}Camera
GET /api/v1/camera
Returns the canonical grouped camera state: acquisition, pipeline timing, latest frame, output, and frame-buffer counts.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | camera.camera |
400 | bad_request | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
503 | sensor_read_failed | application/json | common.product_error |
503 | sensor_state_unsupported | application/json | common.product_error |
500 | sensor_readback_mismatch | application/json | common.product_error |
Success Response Schemas
200 success response: camera.camera
Example
Request
curl 'http://CAMERA_IP/api/v1/camera'Response
{
"state": "idle",
"acquisition": null,
"pipeline": {
"mode": "raw10_1280x800",
"width": 1280,
"height": 800,
"period_us": {
"configured": 16811,
...GET /api/v1/camera/capabilities
Returns the installed AR0144 sensor descriptor and immutable pipeline, timing, preview, trigger, network, and feature capabilities.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | camera.capabilities |
400 | bad_request | application/json | common.product_error |
Success Response Schemas
200 success response: camera.capabilities
Example
Request
curl 'http://CAMERA_IP/api/v1/camera/capabilities'Response
{
"sensor": {
"model": "ar0144",
"shutter": "global",
"color": false,
"native_width": 1280,
"native_height": 800,
"interface": "mipi_csi_2",
"lanes": 2
...GET /api/v1/camera/config
Returns current sensor-backed configuration and timing readback.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | camera.config |
400 | bad_request | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
503 | sensor_read_failed | application/json | common.product_error |
503 | sensor_state_unsupported | application/json | common.product_error |
500 | sensor_readback_mismatch | application/json | common.product_error |
Success Response Schemas
200 success response: camera.config
Example
Request
curl 'http://CAMERA_IP/api/v1/camera/config'Response
{
"pipeline_mode": "raw10_1280x800",
"frame_period_us": 16811,
"frame_period_min_us": 16811,
"frame_period_max_us": 1332187,
"max_actual_exposure_duration_ns": 16771516,
"timing_source": "mode_default",
"sensor_test_pattern_enabled": false,
"exposure": {
...PATCH /api/v1/camera/config
Applies mutable pipeline, sensor timing/control, JPEG, and ISP configuration fields.
Query String
No query string is accepted.
Request Body
Body schema: camera.config.patch.request
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | camera.config_patch |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
409 | already_running | application/json | common.product_error |
501 | unsupported | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
503 | sensor_read_failed | application/json | common.product_error |
503 | sensor_state_unsupported | application/json | common.product_error |
500 | sensor_readback_mismatch | application/json | common.product_error |
Success Response Schemas
200 success response: camera.config_patch
Example
Request
curl -X PATCH -H 'Content-Type: application/json' --data '{"sensor_test_pattern_enabled":true}' 'http://CAMERA_IP/api/v1/camera/config'Response
{
"ok": true,
"applied": {
"sensor_test_pattern_enabled": true
},
"config": {
"pipeline_mode": "raw10_1280x800",
"frame_period_us": 16811,
"frame_period_min_us": 16811,
...GET /api/v1/camera/acquisition
Returns acquisition mode and retained-frame buffer state.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | acquisition.state |
400 | bad_request | application/json | common.product_error |
Success Response Schemas
200 success response: acquisition.state
Example
Request
curl 'http://CAMERA_IP/api/v1/camera/acquisition'Response
{
"state": "trigger_ready",
"active_acquisition_mode": "triggered",
"buffer_capacity": 10,
"buffered_frames": 2,
"dropped_frames": 0
}POST /api/v1/camera/acquisition/continuous/start
Starts continuous free-run acquisition.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | acquisition.start_response |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
409 | already_running | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success response: acquisition.start_response
Example
Request
curl -X POST 'http://CAMERA_IP/api/v1/camera/acquisition/continuous/start'Response
{
"ok": true,
"state": "acquiring_continuous"
}POST /api/v1/camera/acquisition/triggered/start
Starts software-trigger-ready acquisition.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | acquisition.start_response |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
409 | already_running | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success response: acquisition.start_response
Example
Request
curl -X POST 'http://CAMERA_IP/api/v1/camera/acquisition/triggered/start'Response
{
"ok": true,
"state": "trigger_ready"
}POST /api/v1/camera/acquisition/stop
Stops acquisition.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | acquisition.stop_response |
400 | bad_request | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success response: acquisition.stop_response
Example
Request
curl -X POST 'http://CAMERA_IP/api/v1/camera/acquisition/stop'Response
{
"ok": true,
"state": "idle"
}POST /api/v1/camera/acquisition/flush
Flushes retained JPEG frames.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | acquisition.flush_response |
400 | bad_request | application/json | common.product_error |
503 | unavailable | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success response: acquisition.flush_response
Example
Request
curl -X POST 'http://CAMERA_IP/api/v1/camera/acquisition/flush'Response
{
"ok": true,
"flushed_frames": 0
}Trigger
GET /api/v1/camera/trigger
Returns software-trigger readiness, compact PTP quality, output state, visible trigger slots, and the earliest admission times.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | trigger.state |
400 | bad_request | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success response: trigger.state
Example
Request
curl 'http://CAMERA_IP/api/v1/camera/trigger'Response
{
"can_schedule": {
"trigger": false,
"ptp": false,
"synchronized": false
},
"ptp": {
"state": "acquiring",
"epoch": null,
...POST /api/v1/camera/trigger/schedule
Schedules a monotonic or PTP software-trigger output and can optionally wait for its associated frame.
Choosing The Scheduled Instant
Prefer exposure_start_time_ns for scheduled image capture because
it expresses the required sensor exposure instant directly. The camera derives
an earlier output-pulse target by subtracting trigger.qualified_trigger_to_exposure_start_latency_ns from the
requested exposure-start time. Use trigger_output_time_ns only when
the required instant is specifically when the camera asserts the software-trigger
output pulse.
The two fields are mutually exclusive and use the domain selected by timestamp_domain. The resulting frame retains the actual exposure
start separately as frame.exposure.start_ns.
Query String
No query string is accepted.
Request Body
Body schema: trigger.schedule.request
Response Statuses
Success Response Schemas
200 success response: trigger.schedule.response
Example
Asap Trigger
Request
curl -X POST -H 'Content-Type: application/json' --data '{"target":"asap","wait_for_frame":false,"request_id":"request-1"}' 'http://CAMERA_IP/api/v1/camera/trigger/schedule'Response
{
"trigger": {
"id": 1,
"state": "scheduled",
"request_id": "request-1",
"basis": "asap",
"timing": {
"domain": "monotonic",
"requested_output_ns": null,
...Future Trigger For Cancel
This is the preferred exposure-start form derived from the bundle's equivalent live output-time example. The request and timing-basis fields below are a coherent documentation projection, not a second live capture.
Request
curl -X POST -H 'Content-Type: application/json' --data '{"timestamp_domain":"ptp","require_synchronized":true,"wait_for_frame":false,"request_id":"request-2","exposure_start_time_ns":"1700000000001469000"}' 'http://CAMERA_IP/api/v1/camera/trigger/schedule'Response
{
"trigger": {
"id": 2,
"state": "scheduled",
"request_id": "request-2",
"basis": "exposure_start",
"timing": {
"domain": "ptp",
"requested_output_ns": null,
...Trigger With Frame
Request
curl -X POST -H 'Content-Type: application/json' --data '{"target":"asap","wait_for_frame":true,"timeout_ms":5000,"request_id":"request-3"}' 'http://CAMERA_IP/api/v1/camera/trigger/schedule'Response
{
"trigger": {
"id": 3,
"state": "frame_ready",
"request_id": "request-3",
"basis": "asap",
"timing": {
"domain": "monotonic",
"requested_output_ns": null,
...POST /api/v1/camera/trigger/cancel
Cancels a retained future scheduled trigger using its required trigger_id.
Query String
No query string is accepted.
Request Body
Body schema: trigger.cancel.request
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | trigger.cancel.response |
400 | bad_request | application/json | common.product_error |
404 | trigger_not_retained | application/json | common.product_error; common.error_details.trigger_not_retained |
503 | unavailable | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success response: trigger.cancel.response
Example
Request
curl -X POST -H 'Content-Type: application/json' --data '{"trigger_id":2}' 'http://CAMERA_IP/api/v1/camera/trigger/cancel'Response
{
"changed": true,
"trigger": {
"id": 2,
"state": "canceled",
"request_id": "request-2",
"basis": "trigger_output",
"timing": {
"domain": "ptp",
...Frames and Streams
GET /api/v1/frames/latest/meta
Returns common metadata for the latest retained frame.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | frames.metadata_response |
400 | bad_request | application/json | common.product_error |
404 | not_found | application/json | common.product_error; common.retained_frame_window_details |
Success Response Schemas
200 success response: frames.metadata_response
Example
Request
curl 'http://CAMERA_IP/api/v1/frames/latest/meta'Response
{
"frame": {
"id": 2,
"time": {
"ns": "1700000000301767720",
"domain": "ptp",
"state": "synchronized",
"epoch": "1",
"generation": 1
...GET /api/v1/frames/latest
Returns the latest retained JPEG with retained timing headers.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | image/jpeg | streams.frame.jpeg_headers |
400 | bad_request | application/json | common.product_error |
404 | not_found | application/json | common.product_error; common.retained_frame_window_details |
Success Response Schemas
200 success headers: streams.frame.jpeg_headers
Example
Request
curl 'http://CAMERA_IP/api/v1/frames/latest'Response
{
"status": 200,
"content_type": "image/jpeg",
"headers": {
"cache-control": "no-store",
"x-camera-boot-id": "00000000-0000-4000-8000-000000000002",
"x-frame-status-flags": "0",
"x-camera-configuration-generation": "2",
"content-type": "image/jpeg",
...GET /api/v1/frames/next
Waits for and returns the next retained JPEG after a required boot-scoped frame cursor.
Query String
Query schema: frames.next.query
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | image/jpeg | streams.frame.jpeg_headers |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
404 | future_frame_cursor | application/json | common.product_error; common.error_details.future_frame_cursor |
410 | stale_frame_cursor | application/json | common.product_error; common.error_details.stale_frame_cursor |
504 | timeout | application/json | common.product_error; common.error_details.timeout |
503 | frame_publisher_unavailable | application/json | common.product_error; common.error_details.frame_publisher_unavailable |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success headers: streams.frame.jpeg_headers
Example
Request
curl 'http://CAMERA_IP/api/v1/frames/next?timeout_ms=5000&after_frame_id=1'Response
{
"status": 200,
"content_type": "image/jpeg",
"headers": {
"cache-control": "no-store",
"x-camera-boot-id": "00000000-0000-4000-8000-000000000002",
"x-frame-status-flags": "0",
"x-camera-configuration-generation": "2",
"content-type": "image/jpeg",
...GET /api/v1/frames/{frame_id}/meta
Returns common metadata for a retained frame by public frame ID.
Path Parameters
frame_id: wire schemacommon.path.frame_id.wire; semantic schemacommon.path.frame_id.semantic
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | frames.metadata_response |
400 | bad_request | application/json | common.product_error |
400 | invalid_frame_id | application/json | common.product_error; common.error_details.invalid_frame_id |
422 | invalid_config | application/json | common.product_error |
404 | future_frame_cursor | application/json | common.product_error; common.error_details.future_frame_cursor |
404 | frame_not_retained | application/json | common.product_error; common.error_details.frame_not_retained |
410 | stale_frame_cursor | application/json | common.product_error; common.error_details.stale_frame_cursor |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success response: frames.metadata_response
Example
Request
curl 'http://CAMERA_IP/api/v1/frames/1/meta'Response
{
"frame": {
"id": 1,
"time": {
"ns": "1700000000000000000",
"domain": "ptp",
"state": "synchronized",
"epoch": "1",
"generation": 1
...GET /api/v1/frames/{frame_id}
Returns a retained JPEG by public frame ID.
Path Parameters
frame_id: wire schemacommon.path.frame_id.wire; semantic schemacommon.path.frame_id.semantic
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | image/jpeg | streams.frame.jpeg_headers |
400 | bad_request | application/json | common.product_error |
400 | invalid_frame_id | application/json | common.product_error; common.error_details.invalid_frame_id |
422 | invalid_config | application/json | common.product_error |
404 | future_frame_cursor | application/json | common.product_error; common.error_details.future_frame_cursor |
404 | frame_not_retained | application/json | common.product_error; common.error_details.frame_not_retained |
410 | stale_frame_cursor | application/json | common.product_error; common.error_details.stale_frame_cursor |
500 | internal_error | application/json | common.product_error |
Success Response Schemas
200 success headers: streams.frame.jpeg_headers
Example
Request
curl 'http://CAMERA_IP/api/v1/frames/1'Response
{
"status": 200,
"content_type": "image/jpeg",
"headers": {
"cache-control": "no-store",
"x-camera-boot-id": "00000000-0000-4000-8000-000000000002",
"x-frame-status-flags": "0",
"x-camera-configuration-generation": "2",
"content-type": "image/jpeg",
...GET /api/v1/preview.mjpg
Validates preview query parameters and redirects to the direct MJPEG server.
Query String
Query schema: preview.query
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
307 | success | application/json | streams.preview.redirect_contract; preview.redirect_response |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
503 | frame_publisher_unavailable | application/json | common.product_error; common.error_details.frame_publisher_unavailable |
Success Response Schemas
307 success contract: streams.preview.redirect_contract
307 success response: preview.redirect_response
Example
Request
curl 'http://CAMERA_IP/api/v1/preview.mjpg?frame_period_us=16811'Response
{
"status": 307,
"content_type": "application/json",
"headers": {
"content-type": "application/json",
"location": "http://camera-example-1:81/stream.mjpg?frame_period_us=16811"
}
}GET /api/v1/events
Streams retained system, frame, and terminal error events using SSE.
Query String
Query schema: events.query
Request Headers
Header schema: events.request_headers
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | text/event-stream | events.system_event,events.frame_event,events.error_event,events.stale_event_cursor,events.sse_capacity_exceeded,events.event_publisher_unavailable; streams.sse.headers |
400 | bad_request | application/json | common.product_error |
422 | invalid_config | application/json | common.product_error |
503 | busy | application/json | common.product_error |
503 | frame_publisher_unavailable | application/json | common.product_error; common.error_details.frame_publisher_unavailable |
Success Response Schemas
200 success event: events.system_event
200 success event: events.frame_event
200 success event: events.error_event
200 success event: events.stale_event_cursor
200 success event: events.sse_capacity_exceeded
200 success event: events.event_publisher_unavailable
200 success headers: streams.sse.headers
Example
Request
curl 'http://CAMERA_IP/api/v1/events?boot_id=00000000-0000-4000-8000-000000000002'Response
id: 3
event: frame
data: {"frame":3,"time":{"ns":"1699999993014336920","domain":"ptp","state":"acquiring","epoch":null,"generation":1},"mode":"raw10_1280x800"}
GET /stream.mjpg
Streams multipart MJPEG directly from TCP port 81.
Query String
Query schema: preview.query
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | multipart/x-mixed-replace | streams.mjpeg.headers; streams.mjpeg.frame_part_headers; streams.mjpeg.error_part_headers; common.frame_publisher_stream_error |
400 | bad_request | text/plain | streams.direct_mjpeg.plain_error_response |
404 | not_found | text/plain | streams.direct_mjpeg.plain_error_response |
422 | invalid_config | text/plain | streams.direct_mjpeg.plain_error_response |
503 | capacity_exhausted | text/plain | streams.direct_mjpeg.plain_error_response |
503 | frame_publisher_unavailable | application/json | common.error_details.frame_publisher_unavailable; streams.direct_mjpeg.json_error_headers; common.product_error |
Success Response Schemas
200 success headers: streams.mjpeg.headers
200 success part headers: streams.mjpeg.frame_part_headers
200 success terminal part headers: streams.mjpeg.error_part_headers
200 success terminal response: common.frame_publisher_stream_error
Example
Request
curl 'http://CAMERA_IP:81/stream.mjpg?frame_period_us=16811'Response
{
"status": 200,
"content_type": "multipart/x-mixed-replace;boundary=esp32p4frame",
"headers": {
"connection": "close",
"cache-control": "no-store, max-age=0",
"pragma": "no-cache",
"x-preview-frame-period-us": "16811",
"x-requested-frame-period-us": "16811",
...Metrics
GET /api/v1/metrics
Returns grouped camera, preview, trigger, and system telemetry.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | metrics.response |
400 | bad_request | application/json | common.product_error |
Success Response Schemas
200 success response: metrics.response
Example
Request
curl 'http://CAMERA_IP/api/v1/metrics'Response
{
"camera": {
"mode": "raw10_1280x800",
"measured_period_us": 0,
"publisher": {
"latest_frame": 4,
"state": "available"
},
"frames": {
...Debug Diagnostics
GET /debug/runtime
Returns internal task, resource, service, lifecycle, and coherent PTP diagnostics.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | debug.runtime |
400 | bad_request | application/json | common.product_error |
Success Response Schemas
200 success response: debug.runtime
Example
Request
curl 'http://CAMERA_IP/debug/runtime'Response
{
"schema_version": 1,
"ptp_time_quality": {
"domain": "ptp",
"clock_readable": true,
"sync_state": "synchronized",
"synchronized": true,
"readiness_epoch": "2",
"clock_mapping_generation": 2
...GET /debug/time
Returns the complete coherent PTP diagnostic projection used by qualification tools.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | debug.time |
400 | bad_request | application/json | common.product_error |
503 | time_unavailable | application/json | common.product_error |
Success Response Schemas
200 success response: debug.time
Example
Request
curl 'http://CAMERA_IP/debug/time'Response
{
"boot_id": "00000000-0000-4000-8000-000000000002",
"timestamp_domain": "ptp",
"device_time_ns": "1700000000000000000",
"monotonic_time_ns": "1700000007578828000",
"ptp_time_ns": "1700000007578862720",
"time_quality": {
"domain": "ptp",
"clock_readable": true,
...GET /debug/camera/sensor
Returns camera-task sensor registers, AR0144 diagnostics, sensor-read timing, and raw-slot ownership.
Query String
No query string is accepted.
Request Body
No JSON request body is accepted.
Response Statuses
| Status | Result | Content | Schemas |
|---|---|---|---|
200 | success | application/json | debug.camera_sensor |
400 | bad_request | application/json | common.product_error |
409 | invalid_state | application/json | common.product_error |
503 | busy | application/json | common.product_error |
504 | timeout | application/json | common.product_error |
500 | internal_error | application/json | common.product_error |
503 | sensor_read_failed | application/json | common.product_error |
503 | sensor_state_unsupported | application/json | common.product_error |
500 | sensor_readback_mismatch | application/json | common.product_error |
Success Response Schemas
200 success response: debug.camera_sensor
Example
Request
curl 'http://CAMERA_IP/debug/camera/sensor'Response
{
"ptp_time_quality": {
"domain": "ptp",
"clock_readable": true,
"sync_state": "synchronized",
"synchronized": true,
"readiness_epoch": "2",
"clock_mapping_generation": 2
},
...Shared Contracts
Common Schemas
Frame And Stream Timing Headers
JPEG responses include boot and configuration lineage plus retained frame timing in X-Camera-Boot-Id, X-Camera-Configuration-Generation, X-Frame-Status-Flags, and the X-Frame-* timing headers.
Exposure and trigger admission use the corresponding X-Exposure-* and X-Trigger-Admission-* headers. Nullable correlation headers are omitted.
MJPEG parts carry frame ID, timestamp and domain, clock readability, synchronization state, and conditional epoch and mapping-generation headers.
Connection Capacity
If public HTTP-session capacity is occupied, the first overflow connection receives 503 Service Unavailable, a JSON busy error, Cache-Control: no-store, and Connection: close. This pre-route
response is distinct from cause-specific busy errors returned by an endpoint.
Busy response
{"error":{"code":"busy","message":"Maximum HTTPD public session clients are already connected.","retryable":true,"details":{}}}Errors
JSON API errors use a top-level error object. Clients should branch on the
HTTP status and error.code, not on human-readable messages. Endpoint status
tables link each error response to its exact schema.