REST API Reference • v1.0.0

OutcomeGuard API Documentation

OutcomeGuard provides a high-reliability, low-latency REST interface for monitoring business outcome deadlines, tracking operations across microservices and automations, and alerting when confirmations fail to arrive.

Important MVP Architectural Scope Notice

OutcomeGuard tracks reported confirmations against strict UTC deadlines. This means your downstream automation steps, webhooks, or CRM listeners report confirmations to the API. The initial MVP does not perform arbitrary independent database scans or direct CRM introspection without an explicit custom integration.

Looking for practical automation recipes?Read our in-depth diagnosis guide: n8n Execution Successful but Workflow Did Nothing?
Read Guide→

Authentication

All API endpoints under /api/v1/ require a Bearer token in the Authorization header. API keys begin with the prefix og_live_.

Authorization: Bearer og_live_7a8f9024c...
POST/api/v1/outcomes/start

Registers the start of an asynchronous business operation. Calculates the UTC deadline from timeout_seconds and transitions state to PENDING.

Request Body Parameters

workflowstring (1-100 chars). The unique slug of the workflow or process.
correlation_idstring (1-128 chars). Business identifier (e.g. lead ID, invoice number).
expected_outcomestring (1-100 chars). The exact outcome label expected upon completion.
timeout_secondsinteger (5 to 86400). Maximum time allowed before outcome is flagged overdue.
metadataoptional JSON object (max 4KB) for non-sensitive contextual tags.

Example Request

{
  "workflow": "website-lead-capture",
  "correlation_id": "lead_12345",
  "expected_outcome": "crm_record_confirmed",
  "timeout_seconds": 300,
  "metadata": {
    "source": "contact_form"
  }
}
POST/api/v1/outcomes/confirm

Reports the arrival of a matching outcome confirmation. If received before the deadline, marks status as CONFIRMED. If the deadline has already passed, rejects with an explicit 409 Conflict (EXPIRED).

Request Body Parameters

correlation_idstring. The matching business identifier used during /start.
outcomestring. The outcome received. Must match the expected_outcome.
event_idoptional string. Unique downstream event ID for strict replay prevention.

Example Request

{
  "correlation_id": "lead_12345",
  "outcome": "crm_record_confirmed",
  "event_id": "evt_unique_12345",
  "metadata": {
    "crm_record_id": "crm_rec_99482"
  }
}
GET/api/v1/outcomes

Returns paginated outcomes belonging exclusively to the authenticated API key's owner. Supports filtering by status and workflow.

GET/api/health

Public minimal health check. Returns status code 200 without exposing database credentials or internal infrastructure.