Service
API reference
Shapes below are the fields this service returns. FastAPI generates the machine-readable description at /docs/openapi and /openapi.json.
GET /health
Service probe. No API key. Same body as /v1/health.
Response
{
"status": "ok",
"database": "ok"
}GET /v1/health
Service probe on the versioned API. No API key. Same body as /health.
Response
{
"status": "ok",
"database": "ok"
}GET /v1/revocations
Pull list of stored principal revocations. The response sets Cache-Control: public, max-age=300.
Response
{
"revocations": []
}POST /v1/revocations/push
Notifier-signed webhook. The body is the object from sign_revocation_push: at, kata_revocation_push "1", revocation, and signature. signature is a flattened JWS whose protected header typ is kata-revocation-push+jws.
Request
{
"at": "2026-10-04T18:00:00Z",
"kata_revocation_push": "1",
"revocation": {
"agreement_id": "agr_demo",
"at": "2026-10-04T18:00:00Z",
"kata_revocation": "1",
"mandate_hash": "sha256:…",
"reason": "principal revoked",
"signature": {"payload": "…", "protected": "…", "signature": "…"}
},
"signature": {"payload": "…", "protected": "…", "signature": "…"}
}Response
{
"stored": true,
"revocation_id": "sha256:…",
"sequence": 1
}POST /v1/log/entries
Append an agreement, revocation, registration, or incident and sign a new tree head. Authorization: Bearer
Request
{
"kind": "agreement",
"body": {}
}Response
{
"entry": {
"kind": "agreement",
"sequence": 1,
"body": {},
"entry_hash": "sha256:…"
},
"tree_head": {
"algorithm": "EdDSA",
"at": "2026-10-04T14:02:11Z",
"kata_tree_head": "1",
"root": "sha256:…",
"tree_size": 1,
"signature": {"payload": "…", "protected": "…", "signature": "…"}
}
}GET /v1/log/entries/{sequence}
One hash-chained entry. sequence starts at 1.
Response
{
"entry": {
"kind": "revocation",
"sequence": 1,
"body": {},
"entry_hash": "sha256:…"
}
}GET /v1/log/entries/{sequence}/proof
Merkle inclusion proof for that entry. index is sequence minus 1. side is left or right.
Response
{
"sequence": 1,
"index": 0,
"leaf": "sha256:…",
"proof": [{"hash": "sha256:…", "side": "right"}],
"root": "sha256:…",
"tree_size": 1
}GET /v1/log/head
Signed tree head. The same fields are on tree_head from a log append.
Response
{
"algorithm": "EdDSA",
"at": "2026-10-04T14:02:11Z",
"kata_tree_head": "1",
"root": "sha256:…",
"tree_size": 1,
"signature": {"payload": "…", "protected": "…", "signature": "…"}
}GET /.well-known/kata-keys.json
Log public key, plus any records in KATA_PUBLISHED_KEYS. An empty key list is a 200 when no seed is set.
Response
{
"keys": [
{"public_key": {"crv": "Ed25519", "kid": "sha256:…", "kty": "OKP", "x": "…"}}
]
}GET /v1/fx?currency=CAD&reference=USD&day=YYYY-MM-DD
Reference-currency units for one unit of currency on that UTC day. reference_currency is an alias of reference. The default reference is USD. day defaults to the current UTC date. The rate is a decimal string from the configured source (default https://api.frankfurter.dev/v1). The same currency returns rate "1".
Response
{
"currency": "CAD",
"reference_currency": "USD",
"day": "2026-10-04",
"rate": "…"
}POST /demo/check
Signs one sample agreement with the public demo keys and evaluates one payment. principal is K. Uluer and the agent is shopper-01. demo is true. verdict is ALLOW, DENY, or STEP_UP. kata_decision is ALLOW, BLOCK, or STEP_UP. DENY maps to BLOCK.
Request
{
"intent": {
"maximum_amount": 1500,
"currency": "CAD",
"purpose": "purchase",
"category": "electronics",
"natural_language": "Find and buy a laptop for me, maximum CAD 1,500.",
"include_expiry": true,
"time_limit": "2026-12-31"
},
"payment": {
"amount": 1300,
"currency": "CAD",
"merchant": "techstore.example",
"item": "Laptop"
}
}Response
{
"verdict": "ALLOW",
"kata_decision": "ALLOW",
"reasons": [],
"messages": [],
"required_action": "NONE",
"confirmation_text": "…",
"mandate_hash": "sha256:…",
"principal": "K. Uluer",
"principal_fingerprint": "sha256:…",
"agent_id": "shopper-01",
"agreement_id": "agr_demo",
"status": "active",
"demo": true
}GET /v1/score-model
Publishes the agent score weights. No credential is required. risk is 1000 minus the score. Individuals are not scored. GAB_SCORE_WEIGHTS can replace a weight for calibration.
Response
{
"model_version": "gab-score-1",
"subjects": "agents",
"individuals_scored": false,
"risk": "1000 - score",
"reports": {"fraud_incident": -120}
}POST /v1/admin/consortium/members
Admin adds an organization to the fingerprint consortium. A second call returns the same membership.
Request
{
"org_id": "org_…"
}Response
{
"member_id": "cmb_…",
"org_id": "org_…",
"status": "active"
}POST /v1/consortium/sightings
A member records a key fingerprint it has seen. The body is the fingerprint only. The same member and fingerprint is stored once.
Request
{
"fingerprint": "sha256:…"
}Response
{
"sighting_id": "sgt_…",
"fingerprint": "sha256:…",
"seen_at": "2026-10-15T12:00:00Z"
}POST /v1/consortium/match
A member asks whether other members have sighted a fingerprint. The caller is not counted. At or above GAB_CONSORTIUM_MATCH_THRESHOLD (default 2) the response includes other_member_count. Below that threshold the count is omitted. The response does not name the other members.
Request
{
"fingerprint": "sha256:…"
}Response
{
"matched": true,
"other_member_count": 2
}POST /v1/orgs
Admin bootstrap. Creates a participant organization. org_type is agent_operator, wallet, bank_issuer, processor_psp, or merchant.
Request
{
"name": "Harbor Agents",
"org_type": "agent_operator"
}Response
{
"org_id": "org_…",
"name": "Harbor Agents",
"org_type": "agent_operator",
"status": "active"
}POST /v1/orgs/{org_id}/keys
Issues an API key. The raw token is returned once. Stored value is the SHA-256 hash. List responses omit the token.
Request
{
"name": "primary"
}Response
{
"key_id": "key_…",
"prefix": "…",
"scopes": ["registry:read"],
"token": "gab_…"
}POST /v1/agents
An agent operator registers an agent. public_key is an Ed25519 or P-256 JWK with no private d. principal_id is a pseudonymous id. Optional principal_email binds that address to the principal. An address already bound to a different principal is rejected. Optional device_signal and key_signal link the agent to a recently denied agent and inherit a penalty. proofing_evidence is sha256 and 64 hex characters. With proofing on, operator_verified adds 120 points only when that hash is present. Without it the score uses key_bound.
Request
{
"agent_id": "shopper-01",
"principal_id": "prn_demo",
"verification_level": "operator_verified",
"proofing_evidence": "sha256:…",
"public_key": {"kty": "OKP", "crv": "Ed25519", "x": "…"}
}Response
{
"agent_id": "shopper-01",
"status": "active",
"verification_level": "operator_verified",
"assurance_level": "operator_verified",
"fingerprint": "sha256:…",
"score": 700,
"risk": 300,
"model_version": "gab-score-1"
}POST /v1/agents/{agent_id}/proofing
Files operator_review from the agent's operator, or institution_attestation from a wallet or bank. evidence_hash is sha256 and 64 hex characters. The claim in verification_level stays as set. assurance_level is what the score uses. key_binding is written at registration and is not accepted here. The operator, the admin, and the principal can list the rows. Other tenants see assurance_level only.
Request
{
"method": "institution_attestation",
"evidence_hash": "sha256:…"
}Response
{
"agent_id": "shopper-01",
"verification_level": "institution_attested",
"assurance_level": "institution_attested",
"score": 780
}POST /v1/verify
Checks a payment action against the agent's active stored agreement. ALLOW records the spend and the caller's organization as a transaction counterparty, unless counterparty_org_id names another organization. A daily count or amount window above the configured cap returns DENY with kata_decision BLOCK and VELOCITY_COUNT or VELOCITY_AMOUNT and does not record the spend. Other DENY results also use kata_decision BLOCK.
Request
{
"agent_id": "shopper-01",
"action": {"action_id": "act_1", "action_type": "purchase", "amount": 1300, "currency": "CAD", "proposed_at": "2026-10-04T13:55:00Z"}
}Response
{
"verdict": "ALLOW",
"kata_decision": "ALLOW",
"reasons": [],
"agent_id": "shopper-01",
"agreement_id": "agr_demo"
}POST /v1/inquiries
Purpose-coded inquiry. Returns identity, verification, active authorizations, revocations, incident counts, and the trust score. Contributors also receive recent evidence hashes.
Request
{
"agent_id": "shopper-01",
"purpose_code": "payment_authorization"
}Response
{
"inquiry_id": "inq_…",
"agent": {"agent_id": "shopper-01", "status": "active", "verification_level": "institution_attested", "assurance_level": "institution_attested"},
"trust_score": {"score": 724, "risk": 276, "model_version": "gab-score-1", "cold_start": false, "reasons": [{"code": "CHARGEBACK", "points": -56}]}
}POST /v1/reports
Files a transaction outcome, fraud incident, chargeback, or policy violation. evidence_hash is sha256 and 64 hex characters. The same reporter, agent, kind, and hash is a duplicate. The report is accepted only when this organization has an allowed verify with the agent that meets the link minimum. A stored report has counts true.
Request
{
"agent_id": "shopper-01",
"kind": "chargeback",
"evidence_hash": "sha256:…",
"summary": "Disputed purchase.",
"action_id": "act_1"
}Response
{
"report_id": "rpt_…",
"kind": "chargeback",
"counts": true
}POST /v1/subscriptions
Subscribes the caller to signed webhooks for revocation, a new incident, and a score drop of 50 points or more. The signature typ is kata-bureau-alert+jws and uses the log signing key.
Request
{
"agent_id": "shopper-01",
"webhook_url": "https://merchant.example/hooks/gab"
}Response
{
"subscription_id": "sub_…",
"agent_id": "shopper-01"
}POST /v1/webhooks/test
Sends one signed test alert to a subscription this organization already owns. The response is the alert id and whether delivery succeeded. It does not include the payload or the webhook address.
Request
{
"subscription_id": "sub_…"
}Response
{
"alert_id": "alt_…",
"delivered": true,
"kind": "test"
}GET /v1/webhooks/deliveries
Delivery attempts for this organization. detail is delivered, timeout, http_error, or refused. The log does not include error text.
Response
[
{
"delivery_id": "dlv_…",
"alert_id": "alt_…",
"attempt": 1,
"outcome": "delivered",
"http_status": 204,
"detail": "delivered"
}
]POST /v1/portal/magic-link
Sends a portal sign-in link. The response is always sent true. An email already bound to a principal keeps that principal. A new email creates a new principal id and does not move an existing binding. SMTP is used when the host, user, password, and from address are set. Otherwise the link is not printed unless the development mailbox is on.
Request
{
"email": "principal@example.com"
}Response
{
"sent": true
}POST /v1/portal/passkeys/authenticate
Exchanges a passkey assertion for a portal session. The email link remains available at POST /v1/portal/magic-link. GAB_PASSKEY_ENROLLMENT defaults off. When it is set, the ceremony is discoverable: the options name no credential, user verification is preferred, and registration asks for a platform authenticator. A failure uses the same message whether or not an account exists. Registration stays on the signed-in session.
Request
{
"credential": {"id": "…", "type": "public-key", "response": {}}
}Response
{
"token": "gab_sess_…",
"kind": "portal",
"principal_id": "prn_…"
}GET /v1/portal/devices
Lists registered passkeys and consented push devices, plus the storage note. The response has no trust score.
Response
{
"devices": [{"credential_id": "…", "label": "Phone"}],
"stored": ["…"],
"individual_score": false
}POST /v1/portal/disputes
Files a dispute. The body includes a fresh passkey assertion, the same check used to revoke an agent or an intent.
Request
{
"report_id": "rpt_…",
"statement": "…",
"assertion": {}
}Response
{
"dispute_id": "dsp_…",
"status": "open"
}GET /v1/portal/approvals
Lists step-up approvals for this individual. Off unless GAB_STEP_UP_APPROVAL is set. The push text is a fixed sentence and does not include a merchant, an amount, or an agent name.
Response
[
{"approval_id": "apr_…", "status": "pending", "action": {}}
]POST /v1/admin/seed-demo
Inserts the public demo organizations, shopper-01, and agr_demo into the live repository. Authorization is the GAB_ADMIN_TOKEN bearer. The route stays closed unless GAB_ALLOW_DEMO_SEED=1. It does not require GAB_DEMO. A second call returns already_present true and does not insert another copy. The response omits the admin token.
Response
{
"operator_key": "gab_demo_operator_public",
"wallet_key": "gab_demo_wallet_public",
"merchant_key": "gab_demo_merchant_public",
"agent_id": "shopper-01",
"agreement_id": "agr_demo",
"already_present": "false"
}