DOCUMENTATION / API REFERENCE

Automatic reporting

Read campaign synchronization health and recover delayed reports without duplicate paid actions.

Markdown

Reports continue when your agent is offline

Prepared live campaigns are queued for background delivery reads and reconciliation of observed advertising costs. Active campaigns target a check every five minutes. The scheduler runs every five minutes, so actual spacing is typically five to ten minutes plus execution time. Inactive campaigns target hourly checks; campaigns that ended more than seven days ago target daily checks for late reporting. These are scheduling targets, not a delivery, attribution-freshness or hard-spend guarantee.

GET /api/v1/campaigns/{id}/performance requires campaigns:read and returns synchronization alongside cached metrics, recommendations and control history. Live campaigns require a live key. All records are scoped to the authenticated workspace. GET remains read-only and does not contact the advertising provider. POST /api/v1/campaigns/{id}/reconcile requests an explicit refresh with campaigns:write.

Read synchronization health

  • eligible is true for live campaigns with a prepared provider campaign. Sandbox and unprepared campaigns return not_applicable.
  • configured indicates whether the deployment has scheduled-task credentials. It is not evidence that a scheduled invocation succeeded.
  • status is pending, scheduled, running, retrying, not_configured or not_applicable.
  • target_interval_seconds describes the normal cadence; next_sync_at is the next due time, not a promised completion time.
  • last_attempt_at and last_success_at distinguish attempts from completed reporting/accounting reconciliation.
  • last_error_code is a sanitized recovery code. consecutive_failures resets after a completed check.
  • overdue is true when eligible configured work is more than five minutes past due and no unexpired worker lease exists. Use it to detect scheduler delay; do not equate it with upstream attribution age.

Failed provider reads preserve existing campaign metrics. Failures retry after five minutes, then ten, twenty and so on, capped at one day. A later successful attempt resets the cadence. The console exposes the same information under Automatic updates.

If last_error_code is control_unresolved, read controls.pending from the same performance response and recover the exact original command using its retry_key and input. The background worker does not replay uncertain launch or budget operations. For provider credentials, account binding or persistent permission failures, escalate to the operator with the campaign ID. Do not create replacement campaigns to fix a reporting failure.

Keep reporting separate from authority

Background checks read delivery and reconcile recorded media spend, the campaign service fee and known allocated payment costs. Read GET /api/v1/campaigns/{id}/billing for those costs. Unknown costs remain unknown; a completed check does not establish final settlement or release reserved credit.

This worker never launches or resumes ads, raises budgets, charges cards or releases funds. Existing funding protection may pause delivery when reconciliation detects a hold or overspend. Owner-approved cost guards have a separate review process and may make only their authorized adjustments. Background reporting is not a replacement for owner approval or a provider-enforced total spending cap.

The worker uses expiring database leases to avoid overlapping work. Campaign updates use optimistic concurrency so a report fetched before a newer campaign change cannot overwrite it. A recovered lease or failed network read does not authorize additional paid work.