BizKitHub
postTrackingÖffentliche 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

Parameter

JSON-Body

Request-Body

application/json
messagestringPflicht

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.

Beispiele[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.

Länge: 0–64
BeispieleDNS_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.

Länge: 0–32
Beispielecrondns
subjectstringOptional

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

Länge: 0–200
BeispielDNS 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).

Werte: infosuccesserrorwarningcritical
Beispieleerrorwarning
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.

Beispieletruefalse
useDebounceobject | booleanOptional
Eine von 2 Varianten:
Variante 1

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

enabledbooleanPflicht

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

Beispieltrue
keystringOptional

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

Beispielestripe-webhook-timeoutdb-connection-failed
maxIntervalstring | numberPflicht
Eine von 2 Varianten:
Variante 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.

Beispiele3w 4d 12h10m0.5h2.53,1
Variante 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.
Beispiele30601501440
Variante 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.

Beispieletruefalse

Antwortschema

1 dokumentierter Statuscode

200Erfolg
success"true"Pflicht

Antwortbeispiel

application/json
{
  "success": true
}

Anfragebeispiel

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
}'

Sie brauchen einen API-Schlüssel?

Alle öffentlichen Endpunkte der BizKitHub-API authentifizieren per API-Schlüssel.

API-Schlüssel erhalten