Edge device integration
Edge devices run detection at the inspection point and push results to the API. Edge endpoints use API key authentication and address containers by container number, not record ID.
Request bodies are JSON with a 50 MB limit. Send images as base64 JPEG, either raw or as a data: URL.
Send one request per scan session
Don’t send a request per frame. Track objects across frames, keep the highest-confidence detection for each tracked object, and submit once when the session ends. A session usually ends when no new objects appear for a few seconds, when OCR reads a different container, or when an operator completes the scan manually.
1. Identify the container
Send the container number once OCR has read it consistently across frames.
The response tells you whether the container is new:
2. Submit the defect scan
detectionsis required. Send an empty array for a clean scan.- Send boxes as
x1,y1,x2,y2. Setbox_formattonormalized_xyxywhen coordinates are fractions of the frame size between 0 and 1. - Send
class_name,confidence, andboxonly. The API assigns severity, structural integrity, and the AI decision; anyseverityyou send is ignored. See Inspection lifecycle. - If the container hasn’t been identified yet, the API creates it.
3. Submit the category scan
The category scan carries segmentation results for the cargo. detections and image are required. Each detection can include polygon (x and y arrays), area_percentage, quantity, and volume. When the container has a manifest, the API checks the detected categories against it.
Report stream health
Send a stream event whenever a camera stream changes state so the dashboard can show stream health:
camera_id and event_type are required. event_type is one of STARTED, STOPPED, ERROR, or RECONNECTING. Credentials in rtsp_url are stripped before storage.
POST /v1/tracking-data and POST /v1/tracking-data/batch are deprecated per-frame telemetry endpoints. Don’t build new integrations on them; container scans belong under /v1/edge/*.
Handle failures
400means the request will never succeed as sent. Fix the payload; don’t retry it unchanged.401means the API key is missing or wrong.5xxand network errors are transient. Retry with backoff, and log locally instead of blocking inference.
