Download OpenAPI specification:Download
Entrosity Sphere portal REST API: video management for network video
recorders (Dahua NVRs) - live view, playback, PTZ and alarms. This file is the source of
truth for the backend server interfaces (oapi-codegen), request
validation, and the frontend types (openapi-typescript). Run make gen
after editing.
Authentication: Authorization: Bearer <product token>: users sign in
on Entrosity Hub, which issues five-minute product tokens for Sphere
(POST /api/platform/v1/auth/product-token {"product":"sphere"}, with the
Hub's session cookie). Users, tenants (the Hub's organizations) and
roles are managed on the Hub; Sphere keeps a copy.
Every route's access rule (public, authenticated, global admin, tenant
permission) is declared in internal/http/portal/access.go and enforced
before the handler runs.
Returns a token valid for 60 seconds that opens
GET /tenants/{tenantID}/stream?sse_token= for the given tenant and
the caller's session. Access to the tenant is checked when the
stream opens. Keeps the access token out of URLs.
| tenant_id required | string <uuid> |
{- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0"
}{- "token": "string",
- "expires_in": 0
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "email": "string",
- "display_name": "string",
- "status": "active",
- "is_global_admin": true,
- "memberships": [
- {
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "tenant_name": "string",
- "tenant_status": "active",
- "role": "tenant_admin"
}
], - "created_at": "2019-08-24T14:15:22Z"
}{- "tenants_total": 0,
- "tenants_active": 0,
- "global_admins": 0,
- "tenant_users": 0,
- "nvrs_total": 0,
- "nvrs_online": 0,
- "nvrs_failing": 0,
- "cameras_total": 0,
- "connectors_total": 0,
- "connectors_online": 0,
- "alarms_unacked": 0,
- "streams_active": 0,
- "tenants": [
- {
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "name": "string",
- "status": "string",
- "nvrs_total": 0,
- "nvrs_online": 0,
- "nvrs_failing": 0,
- "cameras_total": 0,
- "connectors_total": 0,
- "connectors_online": 0
}
]
}Every stored Sphere connector installer (the newest ten), newest first, each with a link that needs no sign-in until download_expires_at; current marks the release connectors are updated to (SPHERE_CONNECTOR_UPDATE_CHANNEL). adoption counts the enrolled connectors by version. Empty when releases are off.
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "version": "string",
- "channel": "stable",
- "sha256": "string",
- "size_bytes": 0,
- "notes": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "current": true,
- "file_name": "string",
- "download_url": "string",
- "download_expires_at": "2019-08-24T14:15:22Z"
}
], - "adoption": [
- {
- "version": "string",
- "count": 0
}
], - "update_channel": "stable",
- "releases_enabled": true,
- "public_key": "string"
}| page | integer [ 1 .. 100000 ] Default: 1 |
| page_size | integer [ 1 .. 200 ] Default: 50 |
| q | string <= 200 characters |
| status | string (TenantStatus) Enum: "active" "suspended" |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "slug": "string",
- "status": "active",
- "settings": {
- "default_timezone": "string",
- "retention": {
- "job_days": 7,
- "audit_days": 30
}
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
], - "page": 0,
- "page_size": 0,
- "total": 0
}{- "users": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "email": "string",
- "display_name": "string",
- "role": "global_admin",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "status": "active",
- "created_at": "2019-08-24T14:15:22Z"
}
]
}| page | integer [ 1 .. 100000 ] Default: 1 |
| page_size | integer [ 1 .. 200 ] Default: 50 |
| tenant_id | string <uuid> |
| actor_user_id | string <uuid> |
| action | string <= 100 characters |
| resource_type | string <= 100 characters |
| from | string <date-time> |
| to | string <date-time> |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "ts": "2019-08-24T14:15:22Z",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "actor_user_id": "d6ed4497-4325-4995-9f49-e288b7192e46",
- "actor_email": "string",
- "action": "string",
- "resource_type": "string",
- "resource_id": "string",
- "before": { },
- "after": { },
- "ip": "string",
- "request_id": "string"
}
], - "page": 0,
- "page_size": 0,
- "total": 0
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "slug": "string",
- "status": "active",
- "settings": {
- "default_timezone": "string",
- "retention": {
- "job_days": 7,
- "audit_days": 30
}
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
object (TenantSettings) | |||||
| |||||
{- "settings": {
- "default_timezone": "string",
- "retention": {
- "job_days": 7,
- "audit_days": 30
}
}
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "slug": "string",
- "status": "active",
- "settings": {
- "default_timezone": "string",
- "retention": {
- "job_days": 7,
- "audit_days": 30
}
}, - "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
{- "connectors_total": 0,
- "connectors_online": 0,
- "nvrs_total": 0,
- "nvrs_online": 0,
- "nvrs_failing": 0,
- "cameras_total": 0,
- "cameras_enabled": 0,
- "streams_active": 0,
- "sites_total": 0,
- "alarms_today": 0,
- "alarms_unacked": 0
}| tenantID required | string <uuid> |
{- "users": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "email": "string",
- "display_name": "string",
- "role": "global_admin",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "status": "active",
- "created_at": "2019-08-24T14:15:22Z"
}
]
}{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "name": "string",
- "description": "string",
- "timezone": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}| tenantID required | string <uuid> |
| name required | string [ 1 .. 200 ] characters |
| description | string <= 2000 characters |
| timezone | string [ 1 .. 64 ] characters |
{- "name": "string",
- "description": "string",
- "timezone": "string"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "name": "string",
- "description": "string",
- "timezone": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| siteID required | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "name": "string",
- "description": "string",
- "timezone": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| siteID required | string <uuid> |
| name | string [ 1 .. 200 ] characters |
| description | string <= 2000 characters |
| timezone | string [ 1 .. 64 ] characters |
{- "name": "string",
- "description": "string",
- "timezone": "string"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "name": "string",
- "description": "string",
- "timezone": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| siteID required | string <uuid> |
{- "type": "about:blank",
- "title": "string",
- "status": 0,
- "detail": "string",
- "code": "string",
- "instance": "string",
- "request_id": "string",
- "fields": {
- "property1": "string",
- "property2": "string"
}
}| tenantID required | string <uuid> |
| page | integer [ 1 .. 100000 ] Default: 1 |
| page_size | integer [ 1 .. 200 ] Default: 50 |
| actor_user_id | string <uuid> |
| action | string <= 100 characters |
| resource_type | string <= 100 characters |
| from | string <date-time> |
| to | string <date-time> |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "ts": "2019-08-24T14:15:22Z",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "actor_user_id": "d6ed4497-4325-4995-9f49-e288b7192e46",
- "actor_email": "string",
- "action": "string",
- "resource_type": "string",
- "resource_id": "string",
- "before": { },
- "after": { },
- "ip": "string",
- "request_id": "string"
}
], - "page": 0,
- "page_size": 0,
- "total": 0
}| tenantID required | string <uuid> |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "label": "string",
- "max_uses": 0,
- "uses": 0,
- "expires_at": "2019-08-24T14:15:22Z",
- "revoked_at": "2019-08-24T14:15:22Z",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_by_email": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "status": "active"
}
]
}| tenantID required | string <uuid> |
| label | string <= 200 characters |
| site_id | string <uuid> |
| expires_at | string <date-time> |
| max_uses | integer [ 1 .. 100000 ] |
{- "label": "string",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "expires_at": "2019-08-24T14:15:22Z",
- "max_uses": 1
}{- "token": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "tenant_id": "34f5c98e-f430-457b-a812-92637d0c6fd0",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "label": "string",
- "max_uses": 0,
- "uses": 0,
- "expires_at": "2019-08-24T14:15:22Z",
- "revoked_at": "2019-08-24T14:15:22Z",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_by_email": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "status": "active"
}, - "secret": "string",
- "install_command": "string",
- "cli_command": "string",
- "download_url": "string"
}| tenantID required | string <uuid> |
| tokenID required | string <uuid> |
{- "type": "about:blank",
- "title": "string",
- "status": 0,
- "detail": "string",
- "code": "string",
- "instance": "string",
- "request_id": "string",
- "fields": {
- "property1": "string",
- "property2": "string"
}
}Global admins confirm with their own password: they send
step_up_token, which Entrosity Hub issues for the password
(POST /api/platform/v1/auth/step-up, product sphere).
| tenantID required | string <uuid> |
| tokenID required | string <uuid> |
| step_up_token required | string [ 1 .. 4096 ] characters |
{- "step_up_token": "string"
}{- "type": "about:blank",
- "title": "string",
- "status": 0,
- "detail": "string",
- "code": "string",
- "instance": "string",
- "request_id": "string",
- "fields": {
- "property1": "string",
- "property2": "string"
}
}The release connectors are updated to (SPHERE_CONNECTOR_UPDATE_CHANNEL). download_url needs no sign-in and works until download_expires_at. 404 when no release has been published.
| tenantID required | string <uuid> |
{- "version": "0.1.0",
- "channel": "stable",
- "sha256": "string",
- "size_bytes": 0,
- "notes": "string",
- "created_at": "2019-08-24T14:15:22Z",
- "download_url": "string",
- "download_expires_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "name": "string",
- "hostname": "string",
- "domain": "string",
- "version": "string",
- "capabilities": [
- "string"
], - "status": "online",
- "last_seen_at": "2019-08-24T14:15:22Z",
- "nvr_count": 0,
- "created_at": "2019-08-24T14:15:22Z"
}
]
}| tenantID required | string <uuid> |
| connectorID required | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "name": "string",
- "hostname": "string",
- "domain": "string",
- "version": "string",
- "capabilities": [
- "string"
], - "status": "online",
- "last_seen_at": "2019-08-24T14:15:22Z",
- "nvr_count": 0,
- "created_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| connectorID required | string <uuid> |
| name | string <= 200 characters |
| site_id | string <uuid> |
| clear_site | boolean Remove the connector from its site. |
{- "name": "string",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "clear_site": true
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "name": "string",
- "hostname": "string",
- "domain": "string",
- "version": "string",
- "capabilities": [
- "string"
], - "status": "online",
- "last_seen_at": "2019-08-24T14:15:22Z",
- "nvr_count": 0,
- "created_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| connectorID required | string <uuid> |
{- "type": "about:blank",
- "title": "string",
- "status": 0,
- "detail": "string",
- "code": "string",
- "instance": "string",
- "request_id": "string",
- "fields": {
- "property1": "string",
- "property2": "string"
}
}| tenantID required | string <uuid> |
| jobID required | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "type": "string",
- "status": "created",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "sent_at": "2019-08-24T14:15:22Z",
- "finished_at": "2019-08-24T14:15:22Z",
- "progress_pct": 0,
- "progress_message": "string",
- "error_code": "string",
- "error": "string",
- "result": { }
}| tenantID required | string <uuid> |
| site_id | string <uuid> |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "name": "string",
- "driver": "dahua",
- "host": "string",
- "port": 0,
- "https": true,
- "rtsp_port": 0,
- "timezone": "string",
- "username": "string",
- "desired_state": "connected",
- "status": "unknown",
- "status_error": "string",
- "device_type": "string",
- "serial": "string",
- "firmware": "string",
- "channel_count": 0,
- "camera_count": 0,
- "last_seen_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}The password is stored encrypted and never returned. 409 nvr_address_taken when the connector already drives an NVR at that address and port.
| tenantID required | string <uuid> |
| connector_id required | string <uuid> |
| site_id | string <uuid> |
| name required | string [ 1 .. 200 ] characters |
| driver required | string (NvrDriver) Enum: "dahua" "simulator" simulator is a software NVR built into the connector, for trials and tests. |
| host required | string [ 1 .. 255 ] characters ^[A-Za-z0-9.:\[\]-]+$ |
| port | integer [ 1 .. 65535 ] Default: 80 |
| https | boolean Default: false |
| rtsp_port | integer [ 1 .. 65535 ] Default: 554 |
| timezone | string <= 64 characters |
| username required | string [ 1 .. 128 ] characters |
| password required | string <= 256 characters |
| connect | boolean Default: true Sign in right away. |
{- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "name": "string",
- "driver": "dahua",
- "host": "string",
- "port": 80,
- "https": false,
- "rtsp_port": 554,
- "timezone": "string",
- "username": "string",
- "password": "string",
- "connect": true
}{- "nvr": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "name": "string",
- "driver": "dahua",
- "host": "string",
- "port": 0,
- "https": true,
- "rtsp_port": 0,
- "timezone": "string",
- "username": "string",
- "desired_state": "connected",
- "status": "unknown",
- "status_error": "string",
- "device_type": "string",
- "serial": "string",
- "firmware": "string",
- "channel_count": 0,
- "camera_count": 0,
- "last_seen_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}, - "cameras": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "nvr_name": "string",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "channel": 0,
- "name": "string",
- "title": "string",
- "label": "string",
- "enabled": true,
- "ptz": true,
- "online": true,
- "main_codec": "string",
- "sub_codec": "string",
- "nvr_status": "unknown"
}
]
}| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
{- "nvr": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "name": "string",
- "driver": "dahua",
- "host": "string",
- "port": 0,
- "https": true,
- "rtsp_port": 0,
- "timezone": "string",
- "username": "string",
- "desired_state": "connected",
- "status": "unknown",
- "status_error": "string",
- "device_type": "string",
- "serial": "string",
- "firmware": "string",
- "channel_count": 0,
- "camera_count": 0,
- "last_seen_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}, - "cameras": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "nvr_name": "string",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "channel": 0,
- "name": "string",
- "title": "string",
- "label": "string",
- "enabled": true,
- "ptz": true,
- "online": true,
- "main_codec": "string",
- "sub_codec": "string",
- "nvr_status": "unknown"
}
]
}| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
| name | string [ 1 .. 200 ] characters |
| site_id | string <uuid> |
| clear_site | boolean |
| host | string [ 1 .. 255 ] characters ^[A-Za-z0-9.:\[\]-]+$ |
| port | integer [ 1 .. 65535 ] |
| https | boolean |
| rtsp_port | integer [ 1 .. 65535 ] |
| timezone | string <= 64 characters Empty clears it. |
{- "name": "string",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "clear_site": true,
- "host": "string",
- "port": 1,
- "https": true,
- "rtsp_port": 1,
- "timezone": "string"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "name": "string",
- "driver": "dahua",
- "host": "string",
- "port": 0,
- "https": true,
- "rtsp_port": 0,
- "timezone": "string",
- "username": "string",
- "desired_state": "connected",
- "status": "unknown",
- "status_error": "string",
- "device_type": "string",
- "serial": "string",
- "firmware": "string",
- "channel_count": 0,
- "camera_count": 0,
- "last_seen_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
{- "type": "about:blank",
- "title": "string",
- "status": 0,
- "detail": "string",
- "code": "string",
- "instance": "string",
- "request_id": "string",
- "fields": {
- "property1": "string",
- "property2": "string"
}
}| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
| username required | string [ 1 .. 128 ] characters |
| password required | string <= 256 characters |
{- "username": "string",
- "password": "string"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "name": "string",
- "driver": "dahua",
- "host": "string",
- "port": 0,
- "https": true,
- "rtsp_port": 0,
- "timezone": "string",
- "username": "string",
- "desired_state": "connected",
- "status": "unknown",
- "status_error": "string",
- "device_type": "string",
- "serial": "string",
- "firmware": "string",
- "channel_count": 0,
- "camera_count": 0,
- "last_seen_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "name": "string",
- "driver": "dahua",
- "host": "string",
- "port": 0,
- "https": true,
- "rtsp_port": 0,
- "timezone": "string",
- "username": "string",
- "desired_state": "connected",
- "status": "unknown",
- "status_error": "string",
- "device_type": "string",
- "serial": "string",
- "firmware": "string",
- "channel_count": 0,
- "camera_count": 0,
- "last_seen_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "name": "string",
- "driver": "dahua",
- "host": "string",
- "port": 0,
- "https": true,
- "rtsp_port": 0,
- "timezone": "string",
- "username": "string",
- "desired_state": "connected",
- "status": "unknown",
- "status_error": "string",
- "device_type": "string",
- "serial": "string",
- "firmware": "string",
- "channel_count": 0,
- "camera_count": 0,
- "last_seen_at": "2019-08-24T14:15:22Z",
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}Creates an sphere.nvr.test job; poll GET /tenants/{tenantID}/jobs/{jobID}
(or watch job.update) for its result, an NvrTestResult. On
success the NVR's details and cameras are updated. 409
connector_offline when the connector is not connected.
| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "type": "string",
- "status": "created",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "sent_at": "2019-08-24T14:15:22Z",
- "finished_at": "2019-08-24T14:15:22Z",
- "progress_pct": 0,
- "progress_message": "string",
- "error_code": "string",
- "error": "string",
- "result": { }
}Changes the NVR's settings: every camera's sub stream (the one live
grids show) gets a keyframe at least every keyframe_seconds (its
frame rate × that many frames). A viewer joining a stream waits for
the next keyframe before the picture shows, so this bounds the wait.
Main streams, which the NVR records, are never changed, and shorter
intervals are kept. Each channel is then checked in its sub stream:
a camera that keeps a longer interval than the NVR stores is reported
as not changed. Creates an sphere.nvr.tune_live job; its result
is an NvrLiveTuneResult. 409 connector_offline when the connector
is not connected.
| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
| keyframe_seconds | integer [ 1 .. 4 ] Default: 1 |
{- "keyframe_seconds": 1
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "type": "string",
- "status": "created",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "sent_at": "2019-08-24T14:15:22Z",
- "finished_at": "2019-08-24T14:15:22Z",
- "progress_pct": 0,
- "progress_message": "string",
- "error_code": "string",
- "error": "string",
- "result": { }
}| tenantID required | string <uuid> |
| nvrID required | string <uuid> |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "type": "string",
- "status": "created",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "sent_at": "2019-08-24T14:15:22Z",
- "finished_at": "2019-08-24T14:15:22Z",
- "progress_pct": 0,
- "progress_message": "string",
- "error_code": "string",
- "error": "string",
- "result": { }
}
]
}| tenantID required | string <uuid> |
| nvr_id | string <uuid> |
| site_id | string <uuid> |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "nvr_name": "string",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "channel": 0,
- "name": "string",
- "title": "string",
- "label": "string",
- "enabled": true,
- "ptz": true,
- "online": true,
- "main_codec": "string",
- "sub_codec": "string",
- "nvr_status": "unknown"
}
]
}| tenantID required | string <uuid> |
| cameraID required | string <uuid> |
| label | string <= 200 characters |
| enabled | boolean |
{- "label": "string",
- "enabled": true
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "nvr_name": "string",
- "site_id": "72771e6a-6f5e-4de4-a5b9-1266c4197811",
- "channel": 0,
- "name": "string",
- "title": "string",
- "label": "string",
- "enabled": true,
- "ptz": true,
- "online": true,
- "main_codec": "string",
- "sub_codec": "string",
- "nvr_status": "unknown"
}A movement runs from start until stop (hold-to-move); presets
use start only. Cameras the NVR does not report as PTZ are not
refused (detection is best effort). 409 nvr_offline or
connector_offline. Commands expire after 5 seconds, so a late one
never moves the camera.
| tenantID required | string <uuid> |
| cameraID required | string <uuid> |
| code required | string (PtzCode) Enum: "Up" "Down" "Left" "Right" "LeftUp" "RightUp" "LeftDown" "RightDown" "ZoomTele" "ZoomWide" "FocusNear" "FocusFar" "IrisLarge" "IrisSmall" "GotoPreset" "SetPreset" "ClearPreset" |
| action required | string Enum: "start" "stop" |
| speed | integer [ 1 .. 8 ] |
| preset | integer [ 1 .. 255 ] |
{- "code": "Up",
- "action": "start",
- "speed": 1,
- "preset": 1
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "type": "string",
- "status": "created",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "sent_at": "2019-08-24T14:15:22Z",
- "finished_at": "2019-08-24T14:15:22Z",
- "progress_pct": 0,
- "progress_message": "string",
- "error_code": "string",
- "error": "string",
- "result": { }
}Returns a viewer session: play whep_url (WHEP) with
Authorization: Bearer <token> and keep the session alive with
POST /streams/{streamID}/keepalive every 15 seconds (it returns a
fresh token). Live streams are shared by every viewer of the
camera's profile; a playback is the viewer's own. Unwatched streams
stop after 30 seconds. 409 stream_limit when the site's or the
NVR's limit is reached, nvr_offline, connector_offline,
camera_disabled.
| tenantID required | string <uuid> |
| camera_id required | string <uuid> |
| kind | string Default: "live" Enum: "live" "playback" |
| profile | string (StreamProfile) Enum: "main" "sub" main is full resolution; sub the NVR's low-resolution stream (grids). |
| start | string <date-time> Playback from (playback only). |
| end | string <date-time> Playback until |
{- "camera_id": "ecd971da-137d-4ab2-9c2f-7f6725ac305e",
- "kind": "live",
- "profile": "main",
- "start": "2019-08-24T14:15:22Z",
- "end": "2019-08-24T14:15:22Z"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "camera_id": "ecd971da-137d-4ab2-9c2f-7f6725ac305e",
- "kind": "live",
- "profile": "string",
- "path": "string",
- "whep_url": "string",
- "token": "string",
- "token_expires_at": "2019-08-24T14:15:22Z",
- "state": "starting",
- "error": "string",
- "start": "2019-08-24T14:15:22Z",
- "end": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| streamID required | string <uuid> |
{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "camera_id": "ecd971da-137d-4ab2-9c2f-7f6725ac305e",
- "kind": "live",
- "profile": "string",
- "path": "string",
- "whep_url": "string",
- "token": "string",
- "token_expires_at": "2019-08-24T14:15:22Z",
- "state": "starting",
- "error": "string",
- "start": "2019-08-24T14:15:22Z",
- "end": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| streamID required | string <uuid> |
{- "type": "about:blank",
- "title": "string",
- "status": 0,
- "detail": "string",
- "code": "string",
- "instance": "string",
- "request_id": "string",
- "fields": {
- "property1": "string",
- "property2": "string"
}
}Creates an sphere.recordings.find job; its result is a
RecordingsResult. At most 7 days per search.
| tenantID required | string <uuid> |
| cameraID required | string <uuid> |
| from required | string <date-time> |
| to required | string <date-time> |
{- "from": "2019-08-24T14:15:22Z",
- "to": "2019-08-24T14:15:22Z"
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "connector_id": "9389ba6f-3696-4571-84d4-34d588c4b109",
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "type": "string",
- "status": "created",
- "created_by": "ee824cad-d7a6-4f48-87dc-e8461a9201c4",
- "created_at": "2019-08-24T14:15:22Z",
- "sent_at": "2019-08-24T14:15:22Z",
- "finished_at": "2019-08-24T14:15:22Z",
- "progress_pct": 0,
- "progress_message": "string",
- "error_code": "string",
- "error": "string",
- "result": { }
}| tenantID required | string <uuid> |
| before_at | string <date-time> Cursor from the previous page (next_before_at). |
| before_id | string <uuid> |
| from | string <date-time> |
| to | string <date-time> |
| nvr_id | string <uuid> |
| camera_id | string <uuid> |
| acked | boolean |
| code | Array of strings <= 20 items [ items <= 64 characters ] Alarm codes (repeat the parameter for several). |
| limit | integer [ 1 .. 500 ] Default: 100 |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "occurred_at": "2019-08-24T14:15:22Z",
- "code": "string",
- "action": "start",
- "channel": 0,
- "nvr_id": "d377c949-6d3e-4fed-85af-98daf097ef9d",
- "nvr_name": "string",
- "camera_id": "ecd971da-137d-4ab2-9c2f-7f6725ac305e",
- "camera_name": "string",
- "data": { },
- "acked_at": "2019-08-24T14:15:22Z",
- "acked_by_email": "string"
}
], - "next_before_at": "2019-08-24T14:15:22Z",
- "next_before_id": "0ce7fc60-5733-4ae4-967b-4beb905a3fd7"
}| tenantID required | string <uuid> |
| ids | Array of strings <uuid> <= 500 items [ items <uuid > ] |
| before | string <date-time> Acknowledge every alarm up to this moment. |
{- "ids": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "before": "2019-08-24T14:15:22Z"
}{- "acked": 0
}| tenantID required | string <uuid> |
{- "items": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "layout": 1,
- "cells": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "shared": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}
]
}| tenantID required | string <uuid> |
| name required | string [ 1 .. 200 ] characters |
| layout required | integer Enum: 1 4 6 8 9 16 25 36 64 |
| cells required | Array of strings or null <uuid> <= 64 items [ items <uuid > ] |
| shared | boolean Default: false Visible to the whole tenant (needs views:manage). |
{- "name": "string",
- "layout": 1,
- "cells": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "shared": false
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "layout": 1,
- "cells": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "shared": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| viewID required | string <uuid> |
| name required | string [ 1 .. 200 ] characters |
| layout required | integer Enum: 1 4 6 8 9 16 25 36 64 |
| cells required | Array of strings or null <uuid> <= 64 items [ items <uuid > ] |
| shared | boolean Default: false Visible to the whole tenant (needs views:manage). |
{- "name": "string",
- "layout": 1,
- "cells": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "shared": false
}{- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "string",
- "layout": 1,
- "cells": [
- "497f6eca-6276-4993-bfeb-53cbbbba6f08"
], - "shared": true,
- "created_at": "2019-08-24T14:15:22Z",
- "updated_at": "2019-08-24T14:15:22Z"
}| tenantID required | string <uuid> |
| viewID required | string <uuid> |
{- "type": "about:blank",
- "title": "string",
- "status": 0,
- "detail": "string",
- "code": "string",
- "instance": "string",
- "request_id": "string",
- "fields": {
- "property1": "string",
- "property2": "string"
}
}text/event-stream of the tenant's live updates: alarm.new (new
alarms, an array), alarm.ack, nvr.status, stream.state,
connector.status and job.update. Authenticate with a bearer token or, for EventSource,
?sse_token= from POST /auth/sse-token.
| tenantID required | string <uuid> |
| sse_token | string <= 4096 characters |
{- "type": "about:blank",
- "title": "string",
- "status": 0,
- "detail": "string",
- "code": "string",
- "instance": "string",
- "request_id": "string",
- "fields": {
- "property1": "string",
- "property2": "string"
}
}