Skip to content

Connect and manage cameras

Use a provider-issued integration token authorized for camera configuration and control, or a recently authenticated administrator session. Prepare the camera source address and select a camera name that your integration can recognize.

Save the following fictional example as camera.json. Replace the source with your approved camera connection. A source URL can contain credentials, so keep the file private.

{
"name": "Loading bay integration demo",
"externalId": "integration-loading-bay",
"source": "rtsp://camera.example/stream",
"enabled": true
}
Terminal window
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer ${EOI_SERVICE_TOKEN}" \
--header "Content-Type: application/json" \
--data-binary @camera.json \
"${EOI_API_BASE_URL}/streams"

Create stream returns the stream resource. Store its id in your integration. Customer-owned creation has additional ownership, disabled-camera, and idempotency requirements described by that operation.

Set EOI_STREAM_ID to the returned ID. Use a new UUID as the idempotency key for this logical start request. Reuse that key with the same request if its response is lost.

Terminal window
export EOI_START_KEY="$(python3 -c 'import uuid; print(uuid.uuid4())')"
curl --fail-with-body --silent --show-error \
--header "Authorization: Bearer ${EOI_SERVICE_TOKEN}" \
--header "Idempotency-Key: ${EOI_START_KEY}" \
--header "Content-Type: application/json" \
--data '{"command":"start"}' \
"${EOI_API_BASE_URL}/streams/${EOI_STREAM_ID}/commands"

Command stream returns an operation with 202 Accepted. Check Get stream and List stream runtime status for the camera’s resulting state. A running state confirms processing is active.

Read the current configuration before replacing it. Build a request from the writable fields in Replace stream, preserve settings you intend to retain, and send its current revision in If-Match.

To stop the workload, send {"command":"stop"} to the same command endpoint using a new idempotency key for that stop request. Use Delete stream only when you intend to remove the camera.

Image preview