Skip to content

HTTP Webhook Reference ​

CosmoEdge supports pushing alarm/event data to an external platform over HTTP. The push configuration is currently maintained through system interfaces, and the event payload fields come from the current event DTO and the packaged HTML interface documentation.

Configuration API ​

Query:

text
/gtw/cwai/System/QueryHttpInterfaceParam

Set:

text
/gtw/cwai/System/SetHttpInterfaceParam

Set request example:

json
{
  "switch": true,
  "url": "http://example.com/cosmo/events"
}

Query response example:

json
{
  "resCode": 1,
  "resMsg": [],
  "resData": {
    "enable": true,
    "switch": true,
    "url": "http://example.com/cosmo/events"
  }
}

Fields:

FieldTypeDescription
switchbooleanWhether HTTP push is enabled.
enablebooleanWhether HTTP push is enabled; compatibility field in the query response.
urlstringReceiver URL.

Event Payload ​

A typical event payload:

json
{
  "messageId": "MSG-001",
  "devId": "DEVICE_SN",
  "taskId": "TASK_ID",
  "videoChannelId": "CHANNEL_ID",
  "channelName": "Entrance Camera",
  "timestamp": "1792147200000",
  "algorithmId": "ALG_ID",
  "algorithmCode": "helmet",
  "algorithmName": "Helmet Detection",
  "areaId": "AREA_ID",
  "areaName": "Work Zone",
  "orignalPicture": "/data/event/original.jpg",
  "fullPicture": "/data/event/full.jpg",
  "detectedPicture": "/data/event/target.jpg",
  "video": "/data/event/alarm.mp4",
  "videostructured": "/data/event/structured.json",
  "overviewFile": "/data/event/overview.json",
  "recordId": "RECORD_ID",
  "isRetryMessage": false,
  "category": "alarm",
  "targets": [
    {
      "label": "category0",
      "confidence": 0.93,
      "trackId": "TARGET_TRACK_ID",
      "box": {"x": 120, "y": 80, "width": 240, "height": 360}
    }
  ],
  "property": {}
}

For field details, see API Fields.

Note: The DTO also defines the itimestamp and files fields, but the current outbound to_json serialization does not emit them, so they are intentionally omitted from the payload above.

Detection Targets ​

targets lists the detection targets that triggered the event:

FieldTypeDescription
labelstringModel detection label, such as category0, person, or Pedestrian
confidencenumberDetection confidence
trackIdstringTarget tracking ID; may be omitted when tracking is disabled
boxobjectPixel-coordinate bounding box with x, y, width, and height

Aggregate events without individual targets may omit targets. Initial HTTP delivery and offline retries use the same structure.

Property Object ​

property changes with the algorithm type. The property categories that can currently be confirmed include:

CategoryDescription
faceFace quality, age, gender, mask, glasses, feature files, and face image.
bodyBody attributes, body features, and body image.
vehicleLicense plate, vehicle color, vehicle type, direction, and vehicle attributes.
behaviorBehavior count, duration, and target ID.
machineMaterialMaterial/equipment status match result.
peoplePeople flow statistics.
carVehicle flow statistics.
workClothesRecognitionWork-clothes recognition match result.
personCountPerson count.
countNumberCount number.

Additional sub-objects may appear alongside the main categories:

Sub-objectDescription
recognitionFace-library match result; accompanies face.
personsPerson target list; accompanies personCount.
targetTarget enter/exit area time and image; optional across types.

Receiver Recommendations ​

  • The receiver should return 2xx to indicate successful processing.
  • Use messageId or recordId for idempotent processing.
  • Perform lazy fetching with retry for image, video, and structured file URLs.
  • Do not assume all fields in property are present; different algorithms only populate the relevant fields.
  • The current implementation retains legacy field names such as orignalPicture; receivers must be tolerant of them.

Packaged HTML Reference ​

The repository currently retains:

text
data/Interface/ai-box-interface_v1.0.html

After installation, the entry point is:

text
web/staticfile/httpInterface.html

This HTML can be used as a historical interface reference, but open-source documentation should preferentially rely on the current DTO and Markdown references.

Engine code: Apache-2.0. Models and dependencies retain their own licenses.

CosmoEdge / Contact

Let’s talk about your edge AI project.

Model deployment, hardware selection or system integration—start with the question you’re working on.

Business & project enquiries

hello@cosmowander.ai
Email us

Installation, usage and open-source questionsVisit community discussions
What should I include?

Share what you know; we can work through the remaining details together.

  • Use case

    What to detect and how events will be used

  • Existing setup

    Existing models, hardware or systems

  • Workload

    Stream count, frequency and latency needs

  • Project stage

    Your project stage and immediate questions