API
Base URL: https://korb.sh. JSON in, JSON out. This is the control surface — everything the dashboard does goes through this API, and everything the CLI does too. (The other surface, ingest, is not an API to speak of: it's the URL you point vendors at — https://korb.sh/<token>, see Concepts.)
Authentication
Two interchangeable credentials:
| How | Power | |
|---|---|---|
| Dashboard session | magic-link cookie | Full, incl. billing & account |
| API token | Authorization: Bearer korb_… | Read-only or read+write, by scope |
Tokens are minted in the dashboard (Settings → API tokens) and are shown once. Rules enforced server-side:
- Non-GET over a read-only token →
403. - Billing, token management, members, and account deletion are session-only — a token can never cancel a plan or delete a tenant.
- Member invitations / removals and billing mutations are owner-only.
sh
export KORB=https://korb.sh
export TOK=korb_... # read+write token for the examples belowSources
sh
# list
curl -H "Authorization: Bearer $TOK" $KORB/api/sources
# create — token is returned ONCE
curl -X POST $KORB/api/sources \
-H "Authorization: Bearer $TOK" -H "content-type: application/json" \
-d '{"name":"stripe-prod","preset":"stripe"}'
# → 201 {"id":"…","name":"stripe-prod","preset":"stripe","token":"…"}| Endpoint | Notes |
|---|---|
GET /api/sources | id, name, preset, status, secret_set, last_event_at |
POST /api/sources | {name, preset?} (default generic) → 201 with one-time token |
PATCH /api/sources/:id | {name?, status?: active|paused, silence_alerts?, drift_alerts?} |
DELETE /api/sources/:id | cascades routes |
POST /api/sources/:id/token | rotate → new one-time token; previous accepts for 24 h |
POST /api/sources/:id/secret | {secret} (16–256 chars) or {secret: null} to clear |
POST /api/sources/:id/test | fire test event; {body} optional custom payload |
The ingest URL is https://korb.sh/<token> — path-form, no header needed.
Destinations & routes
| Endpoint | Notes |
|---|---|
GET/POST /api/destinations | {url, timeout_s, rate_limit_per_s, preset, headers} — live immediately, no handshake; dials optional (defaults 30s / 5 per s, clamped: timeout 5–60, rate 1..plan ceiling) |
PATCH/DELETE /api/destinations/:id | edit name, url, timeout_s, rate_limit_per_s / remove |
POST /api/destinations/:id/resume | un-suspend after cooldown |
POST /api/destinations/:id/headers | custom headers korb adds to deliveries |
GET/POST /api/routes | source → destination edges; optional filter: array of event-type patterns — exact or one trailing * prefix (["invoice.*"]), ≤20 patterns ×100 chars; 400 on sources with no type extraction. Filtered-out fan-outs aren't billed |
PATCH/DELETE /api/routes/:id | rename / remove / edit filter |
POST /api/pipelines | composite create: source + destination + route in one call |
Events
| Endpoint | Notes |
|---|---|
GET /api/events | windowed list: since/until (epoch ms, max 31 d), source, cursor |
GET /api/events/:id | headers + raw body + deliveries + attempt timeline |
POST /api/events/:id/replay | redeliver (retries and replays are free) |
sh
curl -H "Authorization: Bearer $TOK" \
"$KORB/api/events?since=$(( $(date +%s) - 3600 ))000"Everything else
| Endpoint | Notes |
|---|---|
GET /api/presets | public — the whole catalog, no auth |
GET /api/me | session/token identity |
GET /api/usage | cycle counter + caps (the server is the source of truth) |
GET /api/stats, GET/POST /api/settings/stats | delivery stats + stats webhook |
GET/PATCH /api/settings/alerts | alert webhook |
POST /api/settings/redact | redact sensitive values in dashboard views |
GET /api/members | roster (any member) |
POST /api/members/invite | owner-only; caps at plan seats |
DELETE /api/members/invites/:id, DELETE /api/members/:id | owner-only |
GET/POST /api/tokens, DELETE /api/tokens/:id | session-only |
GET /api/billing/status, POST /api/billing/checkout, POST /api/billing/portal | session-only |
GET /api/export | your data, out |
POST /api/account/delete | session-only, owner-only |
Error shape
json
{ "error": "not found" }400 bad input · 401 no/invalid credential · 403 scope/role/CSRF · 404 not yours or not there · 413 oversize · 422 semantic refusal · 429 rate/cap (with Retry-After).