Cabinhub News API v1.0.0

Docs / Refresh

Refresh

Start a pipeline run (operator).

POST/v1/refresh
Auth
client bearer + X-Admin-Token
Cache-Control
no-store
Source of truth
clients/openapi.json and docs/API.md §12

Webhook delivery admin — X-Admin-Token

backend/app/api/webhook_admin.py, mounted by webhook_admin.mount(app) under /v1/admin/webhooks. This is the read-and-replay surface over the signed-delivery outbox (backend/app/webhooks.py) that used to be reachable only over SSH (python -m app.workers.webhook_worker --list-dead / --requeue-dead).

A webhook URL is a credential. Every response carries the endpoint masked: scheme://host[:port]/# plus a 12-hex digest of the path and query. The path and query never appear in a body, in a header or in this application's log lines, and the endpoint filter below accepts only the masked form. The stored last_error text is likewise never emitted: it embeds up to 200 characters of the receiver's own response body.

Auth is the same admin gate as §3.4: 503 when NEWS_ADMIN_TOKEN is unset, 401 when the token is wrong, and neither value is ever echoed. All three routes are no-store.

GET /v1/admin/webhooks/deliveries

Newest first, in the total order (updated_at DESC, id DESC) — the row id breaks every timestamp tie, so two deliveries written in the same second still have one order.

ParameterDefaultBounds
statusallpending \delivered \dead; anything else 400
endpointallthe masked form (https://hooks.example.com/#1a2b3c4d5e6f); a raw URL is 400
limit501..200; out of range is 400
cursor—next_cursor from the previous page; any other value is 400

POST /v1/admin/webhooks/deliveries/{delivery_id}/replay

Requeues exactly one dead delivery: status -> pending, attempts -> 0, last_error -> "", next_attempt_at -> now, delivered_at -> null. No row is inserted and no attempt is counted, so replaying is not a delivery: the dispatcher makes the next attempt on its next pass.

GET /v1/admin/webhooks/summary

Description: docs/API.md §12

Parameters

NameInRequiredTypeExampleNotes
X-Admin-TokenheadernostringOperator token (NEWS_ADMIN_TOKEN). A client bearer is refused here.

Example request

curl
Shell
curl -sS -X POST \
  'https://vg.tempproject.online/v1/refresh' \
  -H "Authorization: Bearer $NEWS_KEY" \
  -H "X-Admin-Token: $NEWS_ADMIN_TOKEN"
Python, standard library only
Python
import json
import os
import urllib.request

URL = "https://vg.tempproject.online/v1/refresh"
KEY = os.environ["NEWS_KEY"]


def call() -> dict:
    req = urllib.request.Request(URL, method="POST", headers={
        "Authorization": f"Bearer {KEY}",
        "X-Admin-Token": os.environ["NEWS_ADMIN_TOKEN"],
    })
    with urllib.request.urlopen(req, timeout=15) as res:
        print(res.status, res.headers.get("Location"))
        text = res.read().decode("utf-8")
        return json.loads(text) if text else {}


if __name__ == "__main__":
    print(call())
TypeScript, Node 18+, no dependencies
TypeScript
const res = await fetch(
  "https://vg.tempproject.online/v1/refresh",
  {
    method: "POST",
    headers: {
      authorization: `Bearer ${process.env.NEWS_KEY}`,
      "x-admin-token": process.env.NEWS_ADMIN_TOKEN!,
    },
  },
);
if (!res.ok) throw new Error(`${res.status} ${await res.text()}`);
console.log(res.headers.get("etag"), await res.json());

The requests are generated from the path template and the parameters in clients/openapi.json, so a new parameter appears here without an edit to this site.

Example response

Response body
JSON
{"run_id": "b3cd20b4cce24570858a3c5fd83a6a71", "status": "started"}

Response example in docs/API.md §12 (POST /v1/refresh)

Failures

This operation can answer 202, 400, 401, 404, 409, 422, 429, 503. The full envelope for each status, with its body, is on Errors.