BizKitHub
postTrackingPubliczne 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

Treść JSON

Treść żądania

application/json
messagestringWymagane

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.

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

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ługość: 0–64
PrzykładyDNS_SCHED_FUPT_SCHED_FCRN_JOB_FAIL
componentstringOpcjonalne

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ługość: 0–32
Przykładycrondns
subjectstringOpcjonalne

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

Długość: 0–200
PrzykładDNS sync-state write failed for domain 42 (example.com)
level"info" | "success" | "error" | "warning" | "critical"Opcjonalne

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

Wartości: infosuccesserrorwarningcritical
Przykładyerrorwarning
sendNotificationbooleanOpcjonalne

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.

Przykładytruefalse
useDebounceobject | booleanOpcjonalne
Jedna z 2 opcji:
Wariant 1

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

enabledbooleanWymagane

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

Przykładtrue
keystringOpcjonalne

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

Przykładystripe-webhook-timeoutdb-connection-failed
maxIntervalstring | numberWymagane
Jedna z 2 opcji:
Wariant 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.

Przykłady3w 4d 12h10m0.5h2.53,1
Wariant 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.
Przykłady30601501440
Wariant 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.

Przykładytruefalse

Schemat odpowiedzi

1 udokumentowany kod statusu

200Sukces
success"true"Wymagane

Przykład odpowiedzi

application/json
{
  "success": true
}

Przykład żądania

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

Potrzebujesz klucza API?

Wszystkie publiczne endpointy BizKitHub API uwierzytelniają się kluczem API.

Uzyskaj klucz API