Skip to content

Create a schedule (irrigation turn)

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

⚠️ A schedule MATERIALIZES real occurrences in the log (90-day horizon), and confirmationPolicy: "auto" flips them to done on their own with verifiedAt at null. Creating a schedule therefore declares water nobody will have witnessed: pass "manual" to avoid that. EXCLUSIVE target — a probe OR a parcel, never both.

Headers

  • Idempotency-Key string

    Replays the same 2xx response (24 h)

Request body

  • targetModuleId integer

    Probe target. Exclusive with targetParcelId.

  • targetParcelId integer

    Parcel target. Exclusive with targetModuleId.

  • label string
  • freq string required
    Values: dailyweekly
  • intervalDays integer

    In daily mode: every N days. Default 1.

  • weekdays array of integer

    In weekly mode: 1 = Monday … 7 = Sunday. At least one.

  • startTimes array of string required

    LOCAL times (HH:MM), deduplicated and sorted.

  • timezone string required

    IANA time zone. Mandatory, and never UTC — otherwise the time drifts at the daylight-saving switch.

  • startsOn string date required
  • endsOn string date
  • confirmationPolicy string
    Values: automanual
    Default: auto
  • isActive boolean
    Default: true
  • inputMode string required

    How the application is declared. duration requires NO configuration (it is the universal fallback mode) but only yields a dose once the flow rate is known; depth_mm is taken as is; volume_m3 requires the irrigated area.

    Values: durationdepth_mmvolume_m3
  • durationMin integer

    Duration in minutes. Alternative to endedAt — only one of the two is stored.

  • inputDepthMm number

    Depth of water in mm. Required in depth_mm mode, and then taken as is.

  • inputVolumeM3 number

    Volume in m³. Required in volume_m3 mode.

Response

201

Schedule created, upcoming occurrences already produced

  • id integer
  • targetParcelId integer nullable
  • targetModuleId integer nullable
  • label string nullable
  • freq string
    Values: dailyweekly
  • intervalDays integer nullable

    In daily mode: every N days (1–365). null in weekly mode.

  • weekdays array of integer nullable

    In weekly mode: the days kept, 1 = Monday … 7 = Sunday. null or empty in daily mode.

  • startTimes array of string

    LOCAL start times (HH:MM), 1 to 12 of them. An array, not a single value: automatic irrigation commonly runs morning AND evening.

  • timezone string

    IANA time zone, mandatory and never UTC: 06:00 must stay 06:00 for the customer on either side of the daylight-saving switch.

  • inputMode string

    How the application is declared. duration requires NO configuration (it is the universal fallback mode) but only yields a dose once the flow rate is known; depth_mm is taken as is; volume_m3 requires the irrigated area.

    Values: durationdepth_mmvolume_m3
  • durationMin integer nullable
  • inputDepthMm number nullable
  • inputVolumeM3 number nullable
  • startsOn string date
  • endsOn string date nullable
  • confirmationPolicy string

    auto (default): past occurrences flip to done on their own, with verifiedAt at null — so “the schedule says it was watered” stays distinct from “somebody checked”. manual: they stay planned until confirmed.

    Values: automanual
  • isActive boolean
  • materializedUntil string date-time nullable

    How far ahead occurrences have been produced.

Errors

  • 400

    Entry refused

    INVALID_INPUT_MODEINVALID_DURATIONINVALID_ENDED_ATENDED_BEFORE_STARTEDINVALID_DEPTHINVALID_VOLUMEMISSING_DURATIONMISSING_DEPTHMISSING_VOLUMEINVALID_TARGETINVALID_FREQINVALID_INTERVALINVALID_WEEKDAYSINVALID_START_TIMESINVALID_TIMEZONEINVALID_STARTS_ONINVALID_ENDS_ONINVALID_CONFIRMATION_POLICYMODULE_NOT_OWNED
  • 401

    Not authenticated

  • 403

    Insufficient scope/role, or outside your company

  • 404

    Target parcel not found

    PARCEL_NOT_FOUND