Docs / AI Box And Video Analytics Software / API Reference
Basic Safety Guard API
The Basic Safety Guard API: personal protective equipment (PPE) on a site's cameras. It gives the compliance index and its trend, the figures per PPE area, the hourly heatmap, the detection log with its export, and the site's settings.
Personal data. Worker names and evidence images exist only when the site's owner has turned accountability on. A token sees them only with the personal_data scope; without it the detection log and its export are the anonymous form (no names, no evidence, named: false).
Calling the API
The same as the platform API: an API account's token as Authorization: Bearer <API_KEY>. Site and camera ids come from the platform API (GET /api/v1/sites, GET /api/v1/cameras). Each operation says who can call it and which scopes it needs. Errors, times, paging and the rate limit follow the platform API.
1.0.0
Compliance
The compliance index, its trend, areas, the hourly heatmap and per-worker figures.
Headline Numbers Of A Period
GET/sites/{id}/overview
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
fromrequired query | date-time | |
torequired query | date-time |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/overview?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/overview?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/overview?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"index": 91.4,
"assessed_minutes": 5220,
"exposure_minutes": 5710,
"items": {
"hard_hat": 96.2,
"vest": 93.8,
"boots": null,
"gloves": null,
"goggles": null
},
"violations": 17,
"hazard_entries": 2,
"on_site": {
"people": 34,
"flagged": 1
},
"target": 95,
"bands": {
"red": 80,
"green": 95
},
"required_items": [
"hard_hat",
"vest"
],
"unique_people": {
"period": 52,
"now": 9
}
}Index And Items Per Hour Or Day (Site Time)
GET/sites/{id}/trend
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
fromrequired query | date-time | |
torequired query | date-time | |
bucket query | string |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/trend?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/trend?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/trend?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"bucket": "hour",
"points": [
{
"t": "2026-11-02T08:00:00Z",
"index": 92.5,
"assessed_minutes": 60,
"exposure_minutes": 60,
"items": {
"hard_hat": 92.5,
"vest": 92.5,
"boots": 92.5,
"gloves": 92.5,
"goggles": 92.5
}
}
]
}Per PPE Area, Worst First
GET/sites/{id}/areas
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
fromrequired query | date-time | |
torequired query | date-time |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/areas?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/areas?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/areas?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"items": [
{
"area": "<area>",
"violations": 12,
"index": 92.5,
"assessed_minutes": 60,
"exposure_minutes": 60,
"items": {
"hard_hat": 92.5,
"vest": 92.5,
"boots": 92.5,
"gloves": 92.5,
"goggles": 92.5
}
}
]
}Violations Per Weekday And 2-Hour Slot Over 7 Days
GET/sites/{id}/heatmap
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
torequired query | date-time |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/heatmap?to=2026-11-02T00%3A00%3A00%2B07%3A00" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/heatmap?to=2026-11-02T00%3A00%3A00%2B07%3A00",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/heatmap?to=2026-11-02T00%3A00%3A00%2B07%3A00", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"days": [
[
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12
],
[
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12
],
[
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12
],
[
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12
],
[
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12
],
[
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12
],
[
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12,
12
]
]
}Unique People On Site Per Hour (One Person Across Cameras Counts Once)
GET/sites/{id}/people
Unique people per hour: people seen across the site's cameras, each counted once. The answer gives the people per hour (only the hours with anyone on site), the period's total and how many were seen in the last minute. A person the box cannot link across cameras counts once per camera. Anonymous: no names. Hours start at the UTC hour (the local hour in Indonesian time zones).
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
fromrequired query | date-time | |
torequired query | date-time | |
bucket query | enum | hour (the only bucket) hour |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/people?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&bucket=hour" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/people?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&bucket=hour",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/people?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&bucket=hour", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"total": 52,
"now": 9,
"bucket": "hour",
"points": [
{
"t": "2026-11-02T00:00:00Z",
"people": 21
},
{
"t": "2026-11-02T01:00:00Z",
"people": 34
},
{
"t": "2026-11-02T02:00:00Z",
"people": 29
}
]
}Figures Per Identified Worker (Accountability On)
GET/sites/{id}/workers
Who can call it: An account that is an admin of the site. Token scopes: read, personal_data.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
fromrequired query | date-time | |
torequired query | date-time |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/workers?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/workers?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/workers?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"items": [
{
"person_id": "<person_id>",
"name": "Main gate",
"employee_id": "<employee_id>",
"company": "<company>",
"violations": 12,
"last_seen": "<last_seen>",
"last_seen_camera": 12,
"index": 92.5,
"assessed_minutes": 60,
"exposure_minutes": 60,
"items": {
"hard_hat": 92.5,
"vest": 92.5,
"boots": 92.5,
"gloves": 92.5,
"goggles": 92.5
}
}
]
}Detection Log
Every person seen, with their PPE and violations; the export and evidence images.
Detection Log, Newest First, Paged
GET/sites/{id}/logs
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read. Without personal_data the answer is the anonymous form: no names, plates, pictures or footage.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
fromrequired query | date-time | |
torequired query | date-time | |
camera query | integer | |
before query | string | |
limit query | integer |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/logs?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&camera=1&before=2026-11-02T08%3A00%3A00Z&limit=50" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/logs?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&camera=1&before=2026-11-02T08%3A00%3A00Z&limit=50",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/logs?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&camera=1&before=2026-11-02T08%3A00%3A00Z&limit=50", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"named": false,
"next_before": "2026-11-02T01:12:40Z",
"items": [
{
"track": "11:4821",
"camera_id": 11,
"first": "2026-11-02T01:14:05Z",
"last": "2026-11-02T01:15:32Z",
"areas": [
"Loading Bay"
],
"items": {
"hard_hat": 100,
"vest": 38.5,
"boots": null,
"gloves": null,
"goggles": null
},
"index": 69.2,
"violations": 1,
"person": null,
"evidence": null
}
]
}The Detection Log Of A Period As A CSV Or XLSX File (Same Filters And Access As The Log; At Most 20 000 Rows; Times In The Site's Time Zone)
GET/sites/{id}/logs/export
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read, export. Without personal_data the answer is the anonymous form: no names, plates, pictures or footage.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
fromrequired query | date-time | |
torequired query | date-time | |
camera query | integer | |
format query | enum | csv (default) or xlsx csv, xlsx |
language query | enum | the column headings' language (default en) en, id |
Responses
| Status | Meaning |
|---|---|
200 | the file (Content-Disposition: attachment) |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/logs/export?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&camera=1&format=csv&language=en" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/logs/export?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&camera=1&format=csv&language=en",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/logs/export?from=2026-11-01T00%3A00%3A00%2B07%3A00&to=2026-11-02T00%3A00%3A00%2B07%3A00&camera=1&format=csv&language=en", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());An Evidence Image Of This Site's Log (Accountability On)
GET/sites/{id}/media/{ref}
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read, personal_data.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer | |
refrequired path | string |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/media/{ref}" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/media/{ref}",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/media/{ref}", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Settings
Required PPE, how long until a violation counts, targets and bands, retention, and each camera's sensitivity.
The Site's Basic Safety Guard Settings (The Defaults At Version 0)
GET/sites/{id}/settings
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/sites/1/settings" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/sites/1/settings",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/settings", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"required_items": [
"hard_hat"
],
"violation_s": 60,
"target": 92.5,
"band_red": 92.5,
"band_green": 92.5,
"stats_days": 30,
"evidence_days": 12,
"identity_days": 12,
"version": 3,
"site_linker": {
"enabled": true,
"reid_threshold": 0.8,
"reid_margin": 0.1,
"max_gap_s": 120,
"overlapping_cameras": [
[
12,
12
]
]
}
}Change The Site's Basic Safety Guard Settings (Applied To Every Camera Of The Site)
PUT/sites/{id}/settings
Who can call it: An account that is an admin of the site. Token scopes: write.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer |
Body
| Field | Type | Description |
|---|---|---|
required_itemsrequired | enum[] | |
violation_srequired | number | |
targetrequired | number | |
band_redrequired | number | |
band_greenrequired | number | |
stats_daysrequired | integer | |
evidence_daysrequired | integer | |
identity_daysrequired | integer | |
version | integer | the version read; a stale one answers 409 changed_meanwhile |
site_linker | object | Linking people across cameras: a person seen on several of the site's cameras counts once (unique people, one alert per person and missing PPE). On by default with cautious values; left out of a request: unchanged. |
site_linker.enabled | boolean | false: each sighting on each camera counts as a person of its own |
site_linker.reid_threshold | number | the similarity threshold: how alike two sightings on different cameras must look to be linked (higher is stricter) |
site_linker.reid_margin | number | the margin: how far the best match must beat every other person before two sightings are linked |
site_linker.max_gap_s | number | the longest gap, in seconds, between two sightings of one person on different cameras |
site_linker.overlapping_cameras | integer[][] | pairs of camera IDs whose views cover the same place (a person may be on both at once) |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X PUT "https://<BOX_HOST>/api/bsg/v1/sites/1/settings" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"required_items":["hard_hat"],"violation_s":60,"target":92.5,"band_red":92.5,"band_green":92.5,"stats_days":30,"evidence_days":12,"identity_days":12,"version":3,"site_linker":{"enabled":true,"reid_threshold":0.8,"reid_margin":0.1,"max_gap_s":120,"overlapping_cameras":[[12,12]]}}'import requests
r = requests.put(
"https://<BOX_HOST>/api/bsg/v1/sites/1/settings",
headers={"Authorization": "Bearer <API_KEY>"},
json={
"required_items": [
"hard_hat"
],
"violation_s": 60,
"target": 92.5,
"band_red": 92.5,
"band_green": 92.5,
"stats_days": 30,
"evidence_days": 12,
"identity_days": 12,
"version": 3,
"site_linker": {
"enabled": True,
"reid_threshold": 0.8,
"reid_margin": 0.1,
"max_gap_s": 120,
"overlapping_cameras": [
[
12,
12
]
]
}
},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/sites/1/settings", {
method: "PUT",
headers: { "Authorization": "Bearer <API_KEY>", "Content-Type": "application/json" },
body: JSON.stringify({
"required_items": [
"hard_hat"
],
"violation_s": 60,
"target": 92.5,
"band_red": 92.5,
"band_green": 92.5,
"stats_days": 30,
"evidence_days": 12,
"identity_days": 12,
"version": 3,
"site_linker": {
"enabled": true,
"reid_threshold": 0.8,
"reid_margin": 0.1,
"max_gap_s": 120,
"overlapping_cameras": [
[
12,
12
]
]
}
}),
});
console.log(r.status, await r.text());Response 200
{
"required_items": [
"hard_hat"
],
"violation_s": 60,
"target": 92.5,
"band_red": 92.5,
"band_green": 92.5,
"stats_days": 30,
"evidence_days": 12,
"identity_days": 12,
"version": 3,
"site_linker": {
"enabled": true,
"reid_threshold": 0.8,
"reid_margin": 0.1,
"max_gap_s": 120,
"overlapping_cameras": [
[
12,
12
]
]
}
}Per-Camera Confidence (null: The Default)
GET/cameras/{id}/sensitivity
Who can call it: An account with a role (viewer or admin) on the site. Token scopes: read.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X GET "https://<BOX_HOST>/api/bsg/v1/cameras/1/sensitivity" \
-H "Authorization: Bearer <API_KEY>"import requests
r = requests.get(
"https://<BOX_HOST>/api/bsg/v1/cameras/1/sensitivity",
headers={"Authorization": "Bearer <API_KEY>"},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/cameras/1/sensitivity", {
method: "GET",
headers: { "Authorization": "Bearer <API_KEY>" },
});
console.log(r.status, await r.text());Response 200
{
"camera": 12,
"default": "<default>",
"thresholds": {
"person": 0.95,
"hard_hat": 0.95,
"vest": 0.95,
"boots": 0.95,
"gloves": 0.95,
"goggles": 0.95
}
}Change It (An Empty Value Resets An Item)
PUT/cameras/{id}/sensitivity
Who can call it: An account that is an admin of the site. Token scopes: write.
Parameters
| Field | Type | Description |
|---|---|---|
idrequired path | integer |
Body
| Field | Type | Description |
|---|---|---|
thresholdsrequired | object | detection thresholds; null keeps the calibrated default |
thresholds.person | number | |
thresholds.hard_hat | number | |
thresholds.vest | number | |
thresholds.boots | number | |
thresholds.gloves | number | |
thresholds.goggles | number |
Responses
| Status | Meaning |
|---|---|
200 | OK |
401 | RFC 9457 problem |
403 | RFC 9457 problem |
404 | RFC 9457 problem |
409 | RFC 9457 problem |
422 | RFC 9457 problem |
502 | RFC 9457 problem |
Request
curl -s -X PUT "https://<BOX_HOST>/api/bsg/v1/cameras/1/sensitivity" \
-H "Authorization: Bearer <API_KEY>" \
-H "Content-Type: application/json" \
-d '{"thresholds":{"person":0.95,"hard_hat":0.95,"vest":0.95,"boots":0.95,"gloves":0.95,"goggles":0.95}}'import requests
r = requests.put(
"https://<BOX_HOST>/api/bsg/v1/cameras/1/sensitivity",
headers={"Authorization": "Bearer <API_KEY>"},
json={
"thresholds": {
"person": 0.95,
"hard_hat": 0.95,
"vest": 0.95,
"boots": 0.95,
"gloves": 0.95,
"goggles": 0.95
}
},
)
print(r.status_code, r.text)const r = await fetch("https://<BOX_HOST>/api/bsg/v1/cameras/1/sensitivity", {
method: "PUT",
headers: { "Authorization": "Bearer <API_KEY>", "Content-Type": "application/json" },
body: JSON.stringify({
"thresholds": {
"person": 0.95,
"hard_hat": 0.95,
"vest": 0.95,
"boots": 0.95,
"gloves": 0.95,
"goggles": 0.95
}
}),
});
console.log(r.status, await r.text());Response 200
{
"camera": 12,
"default": "<default>",
"thresholds": {
"person": 0.95,
"hard_hat": 0.95,
"vest": 0.95,
"boots": 0.95,
"gloves": 0.95,
"goggles": 0.95
}
}