ActionBoxDOCS

Watch Operations

Operate scheduled heartbeat Watches, understand incidents, and protect heartbeat capabilities.

Watch availability

Watch support may not be available in every hosted environment yet. If the API returns WATCHES_DISABLED or WATCH_INGRESS_DISABLED, there is no client setting to change; contact ActionBox support before relying on Watch evaluation or heartbeat signals.

Use a Watch when a worker, cron job, or long-running process must prove that it is alive. ActionBox evaluates the expected schedule and grace period; a missed signal, failed run, or exceeded runtime creates one ordinary Action for human review.

Lifecycle

StatusMeaningNext step
newCreated, but not armed by a signal yetSend ping, start, or success, or resume it.
healthySignals are arriving within the scheduleKeep the job emitting its configured signal.
downA failure, missed schedule, or runtime deadline was observedInspect the linked incident Action and recover the job.
pausedEvaluation is suspendedResume only when the job should be monitored again.

The API also returns derived running and late values. Treat status and the timestamps in the Watch response as the source of truth, not a dashboard badge or push notification.

Create a Watch

Watch management uses a user session and requires an owner or admin role:

curl -fsS -X POST https://api.actionbox.cloud/v1/watches \
  -H "Authorization: Bearer $ACTIONBOX_USER_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "source_id": "src_<source_id>",
    "name": "Nightly backup",
    "schedule_type": "interval",
    "interval_seconds": 3600,
    "grace_seconds": 300,
    "timezone": "UTC",
    "max_runtime_seconds": 7200,
    "priority": "high",
    "signal_method": "post"
  }'

An interval is between 60 seconds and 30 days. A cron schedule uses exactly five valid cron fields and an IANA timezone. Grace and maximum runtime are bounded to 30 days. The response returns a raw heartbeat_url once; store it in the job's secret manager before closing the response.

Send signals

The returned capability URL supports these paths:

SignalUse it whenEffect
/hb/<token>A periodic liveness pulse arrivedRecords heartbeat and success; the Watch is healthy.
/hb/<token>/startA scheduled run beganRecords the run and starts the optional runtime deadline.
/hb/<token>/successA run completed successfullyRecords success, clears the active run, and can resolve an open Watch incident.
/hb/<token>/failA run failedMarks the Watch down and creates or updates its incident Action.

For a POST-only Watch, send signals like this:

curl -fsS -X POST "$ACTIONBOX_HEARTBEAT_URL/success"

Successful heartbeat requests return 204 with no credential-bearing response. GET is accepted only when signal_method is any; a POST-only Watch returns 405 WATCH_POST_REQUIRED. Do not add arbitrary metadata to a heartbeat—the schedule, timestamps, and signal type are the durable health record.

Incidents and recovery

The evaluator considers a Watch late after the expected occurrence plus grace_seconds, or when max_runtime_seconds is exceeded for an active run. It creates one deduplicated ordinary Action and links it through incident_action_id. Repeated evaluator passes do not create a second Action.

When a healthy signal arrives, ActionBox system-resolves the open incident. A human-resolved incident is not reopened by a later evaluation. If a failure is expected, pause the Watch before maintenance; paused signals are recorded but do not evaluate the schedule or create Actions.

Management endpoints

OperationEndpointCredential
List or inspectGET /v1/watches, GET /v1/watches/{id}User session
Create or editPOST /v1/watches, PATCH /v1/watches/{id}Owner/admin user session
Read event historyGET /v1/watches/{id}/eventsUser session
Pause/resumePOST /v1/watches/{id}/pause or /resumeOwner/admin user session
Rotate capabilityPOST /v1/watches/{id}/token/rotateOwner/admin user session
ArchiveDELETE /v1/watches/{id}Owner/admin user session

A Source key can manage only its own active Watches through /v1/source/watches and the corresponding pause, resume, rotate, and archive routes. Source-scoped creation keeps the source_id equal to the authenticated Source. A Watch capability URL is not a user session and cannot list or edit a Watch.

Capability safety

  • Keep the heartbeat URL in a secret manager; never put it in logs, source control, issue attachments, browser code, or a referrer.
  • Prefer signal_method: "post" so link scanners and previewers cannot record a GET signal.
  • Rotate the capability immediately after a suspected disclosure and update the job. The old URL stops working after rotation.
  • Archive a Watch that is no longer expected to run. Revoking its Source also pauses the Watch and invalidates its heartbeat capability.
  • Use the Watch event history for diagnosis; do not infer health from a missing notification.

Common issues

SymptomLikely causeFix
Watch stays newNo first signal or resume yetSend ping, start, or success, or resume the Watch.
404 WATCH_NOT_FOUNDURL was rotated/archived, Source revoked, or token is wrongFetch the Watch metadata with a user session and update the job's secret.
405 WATCH_POST_REQUIREDGET used for a POST-only WatchSend the signal with POST and no token in query parameters.
Watch is down after a healthy job runWrong timezone/cron, insufficient grace, missing signal, or runtime exceededCompare next_expected_at, timezone, grace_seconds, run_deadline_at, and the job's emitted signal.
Multiple alerts for one outageSeparate Watches or a new incident after recoveryCheck watch_id and incident_action_id; one Watch deduplicates its open incident.
Heartbeat returns success but no inbox alertSignals make a Watch healthy; alerts are for missed/failed healthInspect Watch state and event history rather than expecting an Action for every pulse.

Escalate with redacted evidence

Include the Watch ID, Source ID, signal time with timezone, status, relevant timestamps, HTTP status, error code, and X-Request-ID. Redact the raw heartbeat URL, Source key, user token, callback secret, Action content, and customer data.

On this page