BizKitHub
postTrackingVeřejné 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

Parametry

JSON tělo

Tělo požadavku

application/json
messagestringPovinné

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.

Příklady[checkout] Payment callback failed: missing transId (orderId=25000233)Unhandled exception in worker: TypeError: Cannot read properties of undefined (jobId=abcd1234)
codestringVolitelné

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.

Délka: 0–64
PříkladyDNS_SCHED_FUPT_SCHED_FCRN_JOB_FAIL
componentstringVolitelné

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

Délka: 0–32
Příkladycrondns
subjectstringVolitelné

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

Délka: 0–200
PříkladDNS sync-state write failed for domain 42 (example.com)
level"info" | "success" | "error" | "warning" | "critical"Volitelné

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).

Hodnoty: infosuccesserrorwarningcritical
Příkladyerrorwarning
sendNotificationbooleanVolitelné

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.

Příkladytruefalse
useDebounceobject | booleanVolitelné
Jedna z 2 možností:
Varianta 1

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

enabledbooleanPovinné

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

Příkladtrue
keystringVolitelné

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

Příkladystripe-webhook-timeoutdb-connection-failed
maxIntervalstring | numberPovinné
Jedna z 2 možností:
Varianta 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.

Příklady3w 4d 12h10m0.5h2.53,1
Varianta 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.
Příklady30601501440
Varianta 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.

Příkladytruefalse

Schéma odpovědi

1 zdokumentovaný stavový kód

200Úspěch
success"true"Povinné

Ukázka odpovědi

application/json
{
  "success": true
}

Ukázka požadavku

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

Potřebujete API klíč?

Všechny veřejné endpointy BizKitHub API se ověřují API klíčem.

Získat API klíč