跳至主要内容

Replace data streams attached to an alert policy

PUT 

/api/v1/orgs/{orgId}/alert-policies/{alertPolicyId}/data-streams

Send the full desired list of attached data streams. This is a full-replace operation, not an incremental add: streams included in the payload that were not previously attached are attached; streams that were previously attached but are left out of the payload are detached. Sending an empty array detaches all data streams from the policy.

Request Body

An array of device/data-stream pairs, the complete desired binding list for this policy:

  • deviceId (string, required): Device identifier. Case-sensitive. Use the deviceId exactly as WEDA returns it. Ex: 9f75abda56c3.
  • dataStreamId (UUID, required): Data stream identifier. Must exist (both the device and the specific data stream are validated). Attach numeric data streams only. The data stream type is not checked, and a policy attached to a non-numeric stream never fires. A null value is evaluated as 0.

Parameters

  • alertPolicyId (UUID, required): Alert policy identifier.

Responses

  • 200 OK: Returns the final attached list (each item includes alertPolicyId, deviceId, dataStreamId), reflecting the desired state that was just applied.
  • 404 Not Found: Alert policy not found, a deviceId does not exist, or a (deviceId, dataStreamId) pair does not exist.

Request​

Responses​

OK