Stowe Family Law
Stowe Error HandlingHelp and integration guide

Logging events

One endpoint does the logging: POST /api/v1/events. This page explains each field and the conventions that make the data useful. The formal contract lives in the Swagger reference.

Required fields

event_typeerror or success
error_classRequired for errors: technical (infrastructure faults: bad gateways, timeouts, connection failures, usually retryable, routed to IT) or business (data problems: malformed input, missing fields, needs human review, surfaced to the business/Salesforce).
integrationA stable, lowercase name for the process or flow, e.g. salesforce-nebulaw-sync. Pick one name per flow and stick to it; reports group by this.
messageOne human-readable sentence (max 500 chars). Someone reading only this line should understand what went wrong.
occurred_atWhen it happened in YOUR system, ISO 8601 with timezone, e.g. 2026-08-13T06:15:00Z. We convert and store UTC.

Optional but valuable

severityinfo, warning, error or critical. Defaults to error for errors and info for successes. Alerting keys off this: reserve critical for "wake someone up".
codeA short machine code, e.g. HTTP_502, MISSING_FIELD. The system groups recurrences by app + integration + code (first seen, last seen, occurrence counts), so a consistent code makes a repeating fault show as one story instead of scattered noise. The code HEARTBEAT_MISSED is reserved for the heartbeat monitor.
detailThe long version: stack trace, response body, anything a developer will thank you for.
payloadA JSON snapshot of the offending data (object or string). Invaluable for business errors someone must fix by hand.
source_refExternal record reference, e.g. Salesforce:006Ab00001XyZ or an invoice number.
correlation_idYour run or request id. All events sharing it can be found together with one filter.
retryabletrue if the same call could plausibly succeed later.
Do not log secrets. Keep passwords, API keys and tokens out of message, detail and payload. Personal client data belongs there only when needed to fix the problem.

Reading and updating events

Any app key can also query, which is how Salesforce or a dashboard can pull business errors:

# List: filter by anything, page through results
GET /api/v1/events?app=toca-ai&event_type=error&status=open&per_page=50

# One event
GET /api/v1/events/123

# Update the workflow status (open | in_progress | resolved | ignored)
PATCH /api/v1/events/123
{ "status": "resolved", "status_notes": "Re-ran after fix", "resolved_by": "jane.smith" }

Filters: app, event_type, error_class, severity, status, integration, correlation_id, from/to (ISO 8601 against occurred_at), plus page and per_page (max 200).

Next: Alerts and notifications