BizKitHub
postCron RunVerejné API v1

/api/v1/cron-run/record

Stores a run that already happened (start, end, outcome, up to 100 log entries) with one call instead of start + finish. Meant for short, frequent jobs. The run counts into the job statistics and alerts exactly like a regular one. Errors: PUBLIC_CRON_RUN_RECORD_INVALID (timestamps), PUBLIC_CRON_JOB_CODE_INVALID, PUBLIC_CRON_JOB_LIMIT_EXCEEDED, PUBLIC_CRON_RUN_RATE_LIMITED. Counts into the cron monitor quota of the API key (10,000 requests per hour, separate from other endpoints). Every response carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset (Unix seconds).

cron-runpostApiV1Cron-runRecord

Parametre

JSON telo

Telo požiadavky

application/json
codestringPovinné

Job type identifier. A code seen for the first time creates the job automatically. Normalized to [A-Za-z0-9._:-], max 64 characters. Recommended form: <application>:<job>. Keep it stable: never put ids, dates or arguments into it.

Dĺžka: 1–200
Príkladeshop:sync-orders
namestring | nullVoliteľné

Human-readable job name shown in the admin. Ignored when empty, equal to code, or after the job was renamed in the admin.

Dĺžka: 0–128
expirationnumber | nullVoliteľné

Idle timeout in seconds. Every log / heartbeat call extends it again. When no call arrives in time the run is closed as timeout and a critical log entry is written. Default 3600 (60 min).

Rozsah: 10–604800
Príklad900
metaobject | nullVoliteľné

Context of the run (host, version, arguments), up to 16 KB of JSON.

tierstring | nullVoliteľné

Scheduler bucket, filterable in the admin job list.

Dĺžka: 0–48
Príkladnightly
idempotencyKeystring | nullVoliteľné

When a call is retried with the same key for the same job, the existing run is returned (reused: true).

Dĺžka: 0–64
schedulestring | nullVoliteľné

Expected schedule as a cron expression (5 fields, or 6 with leading seconds; macros like @daily). Enables the dead man's switch: when no run starts within the grace period after an expected time, a critical "missed run" alert is raised. null removes the schedule, omitting it keeps the stored one (falls back to meta.schedule). An invalid value does not reject the run; it is ignored and reported in warnings. A schedule edited in the admin takes precedence.

Dĺžka: 0–120
Príklad*/5 * * * *
scheduleTimezonestring | nullVoliteľné

IANA time zone of schedule. Default UTC.

Dĺžka: 0–64
PríkladEurope/Prague
graceSecondsstring | integerVoliteľné

Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.

Jedna z 2 možností:
Variant 1
stringinteger
Predvolené: 0
Variant 2
integer

Seconds after an expected start before it counts as missed. Default 10 % of the interval, at least 5 min, at most 1 h.

Rozsah: 0–604800
startedAtstringPovinné

ISO-8601 start of the run (at most 7 days old).

Príklad2026-11-05T12:00:00.120Z
finishedAtstringPovinné

ISO-8601 end of the run, not before startedAt.

Príklad2026-11-05T12:00:00.480Z
status"success" | "error"Voliteľné

Outcome of the run. Defaults to success.

messagestring | nullVoliteľné

Final message, e.g. the error text. null = none.

Dĺžka: 0–20000
reportobject | nullVoliteľné

Summary of the run, e.g. { "processed": 120 }, up to 16 KB. null = none.

exitCodestring | integerVoliteľné
Jedna z 2 možností:
Variant 1
stringinteger
Predvolené: 0
Variant 2
integer
Rozsah: -32768–32767
peakMemoryMbstring | integerVoliteľné
Jedna z 2 možností:
Variant 1
stringinteger
Predvolené: 0
Variant 2
integer
Rozsah: 0–∞
heapUsedMbstring | integerVoliteľné
Jedna z 2 možností:
Variant 1
stringinteger
Predvolené: 0
Variant 2
integer
Rozsah: 0–∞
entriesobject[] | nullVoliteľné

Log entries of the run, in order.

Každá položka poľa:
level"info" | "success" | "error" | "warning" | "critical"Voliteľné

Severity of the entry. Defaults to info.

messagestringPovinné

Log message (stored up to 4000 characters).

Dĺžka: 1–20000
contextobject | nullVoliteľné

Structured context, up to 16 KB of JSON.

clientDatestring | nullVoliteľné

ISO-8601 time the entry was produced on the client.

Príklad2026-11-05T10:15:00.000Z

Schéma odpovede

1 zdokumentovaný stavový kód

200Úspech

Táto odpoveď nemá JSON telo.

Ukážka odpovede

application/json
{
  "success": true
}

Ukážka požiadavky

POST /api/v1/cron-run/record

post
curl -X POST "https://api.bizkithub.com/api/v1/cron-run/record" \
  -H "Content-Type: application/json" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -d '{
  "code": "eshop:sync-orders",
  "startedAt": "2026-11-05T12:00:00.120Z",
  "finishedAt": "2026-11-05T12:00:00.480Z"
}'

Potrebujete API kľúč?

Všetky verejné endpointy BizKitHub API sa overujú API kľúčom.

Získať API kľúč