Tasks — mailing campaign lifecycle

Best-time modes and the actual task date

A contact's best_send_time is a recommendation; the actual mailing task's scheduledAt also reflects automatic jitter (unchanged spread of 8 hours) and send-window gates. Choose senderConfig.bestSendTimeMode: TIME_OF_DAY uses the next preferred local time; WEEKDAY_AND_TIME also preserves the weekday. New campaigns default to TIME_OF_DAY. Existing campaigns without a mode keep LEGACY behavior; LEGACY is a read-only label, not a third choice. When requesting a campaign recommendation, pass its mode explicitly: standalone best-send-time and contact backfill still default to WEEKDAY_AND_TIME.

Use the Best send time guide for the guarded edit and operation recovery. Read task capabilities, preview the exact local date and timezone, obtain confirmation, use operationId and expectedVersion, then read back and poll. Preparation and outbox have separate edit contracts. Never report SENT without transport acceptance evidence.

List tasks (mailing campaigns)

curl -s "https://api.live-direct-marketing.online/api/tasks?status=ACTIVE&pageSize=10" \
  -H "Authorization: Bearer $LDM_KEY"

Start / pause / stop / restart

Scope: tasks:write. restart re-queues errored items; stop is a hard halt (not resumable).

# start (required: status=APPROVED|DRAFT_APPROVED)
curl -s -X POST "https://api.live-direct-marketing.online/api/tasks/$T/start" -H "Authorization: Bearer $LDM_KEY"

# pause / stop / restart
curl -s -X POST "https://api.live-direct-marketing.online/api/tasks/$T/pause"   -H "Authorization: Bearer $LDM_KEY"
curl -s -X POST "https://api.live-direct-marketing.online/api/tasks/$T/stop"    -H "Authorization: Bearer $LDM_KEY"
curl -s -X POST "https://api.live-direct-marketing.online/api/tasks/$T/restart" -H "Authorization: Bearer $LDM_KEY"

Analytics — delivery rate, error rate, speed

Scope: tasks:read. Returns counts per item-status (PENDING/PROCESSING/DONE/ERROR/SKIPPED), deliveryRate, errorRate, durationSec, speedPerHour.

curl -s "https://api.live-direct-marketing.online/api/tasks/$T/analytics" \
  -H "Authorization: Bearer $LDM_KEY"

Live monitor (items as they progress)

curl -s "https://api.live-direct-marketing.online/api/tasks/$T/monitor" \
  -H "Authorization: Bearer $LDM_KEY"

Errors & circuit breaker (auto-pause on AI / bounce thresholds)

curl -s "https://api.live-direct-marketing.online/api/tasks/$T/errors"          -H "Authorization: Bearer $LDM_KEY"
curl -s "https://api.live-direct-marketing.online/api/tasks/$T/circuit-breaker" -H "Authorization: Bearer $LDM_KEY"