Skip to content

Create an alert threshold

POST /alerts
  • Scope alerts:write
  • API key x-api-key
  • Base URL https://api.hub.akuasense.com/v1

The alert watches the moisture of the module’s summary curve. The key’s user is its first recipient. ⚠️ Only alerts carrying a moduleId are evaluated.

Headers

  • Idempotency-Key string

    Replays the same 2xx response (24 h)

Request body

  • moduleId integer

    Module to watch.

  • parcelId integer

    Parcel. ⚠️ Without a moduleId, the alert is never evaluated.

  • threshold number required

    Threshold, in % volumetric moisture.

  • hysteresis number

    Resolution margin, in percentage points.

    Default: 5
  • reminderTime string

    LOCAL time of the daily reminder (HH:MM:SS), in the company’s time zone.

    Default: 08:00:00

Response

201

Alert created

  • id string uuid always present
  • companyId integer always present
  • moduleId integer nullable always present

    Module being watched.

  • parcelId integer nullable always present

    Parcel. ⚠️ Only a module’s measurements are evaluated: an alert with no moduleId never fires.

  • annotationId string uuid nullable always present

    The “wilting point” line the alert was born from (source: annotation). Moving the line moves the threshold; deleting it disables the alert.

  • threshold string always present

    Decimal number sent as a STRING, with no loss of precision ("11", "25.5625"): to be converted client-side.

  • hysteresis string always present

    Decimal number sent as a STRING, with no loss of precision ("11", "25.5625"): to be converted client-side.

  • reminderTime string always present

    LOCAL time of the daily reminder (HH:MM:SS), in the company’s time zone (timezone of GET /company).

  • source string always present

    manual: created directly (POST /alerts). annotation: born from a “wilting point” line.

    Values: manualannotation
  • isActive boolean always present

    false: disabled, no longer evaluated.

  • createdBy string always present

    Creator: userId of a member.

  • createdAt string date-time always present
  • updatedAt string date-time always present
  • recipients array of AlertRecipient always present

    The key’s user, who created the alert, is automatically its first recipient.

    Show 3 attributes Hide attributes
    • id string uuid always present
    • alertId string uuid always present
    • userId string always present

      E-mail recipient: userId of a member.

Errors

  • 400

    Entry refused

    invalid_body
  • 401

    Not authenticated

  • 403

    Insufficient scope or role, resource outside your company, or key with no user

    insufficient_scopeinsufficient_roleforbidden_resourceno_user