BizKitHub
DocsAPI ReferenceTracking/api/v1/tracking/log
postTrackingPublic API v1

/api/v1/tracking/log

Sentry-like logging endpoint for centralized log ingestion.

Accepts log events from frontends (React/Next.js), backend services, workers and third-party systems. Each request creates a single log entry bound to the organisation, classified by severity and optionally eligible for notifications.

Debouncing can be enabled to group repeated/noisy events. useDebounce supports a simple boolean or an advanced configuration with a custom key and a relative time window (maxInterval, e.g. 10m, 1h 30m, or minutes).

trackingpostApiV1TrackingLog

Parameters

JSON body

Request body

application/json
messagestringRequired

Log message payload. Intended for system/application logs coming from external services/websites. Keep it human-readable or JSON; include essential context (e.g., module, action, identifiers) to make triage easier. For structured data, serialize into the message or extend the endpoint to accept extra fields.

Examples[checkout] Payment callback failed: missing transId (orderId=25000233)Unhandled exception in worker: TypeError: Cannot read properties of undefined (jobId=abcd1234)
codestringOptional

Application-defined log code (short slug). Groups related events for anomaly detection and links to docs.bizkithub.com/system-codes/<code>. Defaults to API_TRK when omitted.

Length: 064
ExamplesDNS_SCHED_FUPT_SCHED_FCRN_JOB_FAIL
componentstringOptional

Sub-system that produced the log. Used for dashboard grouping. Free-form short slug — typical values: common, cron, dns, geoIp, crawler, abuseIp, uptime, robotsTxt.

Length: 032
Examplescrondns
subjectstringOptional

One-line summary used as the subject of any notification email dispatched for this log entry.

Length: 0200
ExampleDNS sync-state write failed for domain 42 (example.com)
level"info" | "success" | "error" | "warning" | "critical"Optional

Severity level of the log entry. Used for filtering, alerting and retention rules.

  • info = diagnostic signal
  • success = positive milestone
  • warning = potential issue
  • error = failure that impacted a request/job
  • critical = high priority incident requiring immediate attention.

If omitted, the backend should treat it as a default level (commonly info).

Values: infosuccesserrorwarningcritical
Exampleserrorwarning
sendNotificationbooleanOptional

When true, the log entry is eligible to trigger notifications (e.g., email/Slack/push) according to organisation settings. Use sparingly for actionable events (typically error/critical). If omitted, the system decides based on level and notification rules.

Examplestruefalse
useDebounceobject | booleanOptional
One of 2:
Variant 1

Advanced debounce configuration. maxInterval defines maximum grouping window for duplicates (if omitted, backend uses a default interval).

enabledbooleanRequired

Enable/disable debouncing for this event. If omitted, the backend treats it as enabled.

Exampletrue
keystringOptional

Optional custom debounce key. When provided, logs sharing the same key will be grouped together (useful for dynamic messages).

Examplesstripe-webhook-timeoutdb-connection-failed
maxIntervalstring | numberRequired
One of 2:
Variant 1
string

Relative time interval expressed as a string.

Supported units and conversion (REAL_TIME_CHAR_TO_MINUTES):

Unit Name Minutes Notes
m minute 1
h hour 60
d day 1440 24h
w week 10080 7d
y year 525600 365d

Rules:

  • Units are case-insensitive and can be combined: 3w 4d 12h.
  • Decimal values are allowed: 0.5h, 2.5d.
  • Spaces and unit variants are tolerated: 10m, 10 min, 10 minutes.
  • Numeric value without a unit is interpreted as hours.

Rounding:

  • Result is returned in minutes and rounded up (Math.ceil).

Invalid or empty input returns 0.

Examples3w 4d 12h10m0.5h2.53,1
Variant 2
number

Relative time interval expressed as a number of minutes.

Rules:

  • Value is taken directly as minutes (e.g. 30 = 30 minutes).
  • No unit parsing or conversion is applied.
Examples30601501440
Variant 2
boolean

Simple debounce toggle. When true, repeated logs may be deduplicated/grouped within a backend-defined window. When false, debouncing is disabled and every event is stored.

Examplestruefalse

Response schema

1 status code documented

200Success
success"true"Required

Response example

application/json
{
  "success": true
}

Request example

POST /api/v1/tracking/log

post
curl -X POST "https://api.bizkithub.com/api/v1/tracking/log" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "message": "[checkout] Payment callback failed: missing transId (orderId=25000233)",
  "code": "DNS_SCHED_F",
  "component": "cron",
  "subject": "DNS sync-state write failed for domain 42 (example.com)",
  "level": "error",
  "sendNotification": true
}'

Need an API key?

All BizKitHub public API endpoints require authentication via API key.

Get API Key