- Spec:
../../openapi.yaml (OpenAPI 3.1.0, 124 path, 152 operasi, 20 webhook receiver, 107 schema) - Base:
/v1 - Status: Source of truth untuk bentuk API. Dokumen ini hanya peta navigasi.
| Tag | Path | Operasi | Cell |
|---|
| Decisions | 5 | 8 | project:<id> |
| Sessions | 6 | 8 | project:<id> |
| Agents | 3 | 5 | project:<id> |
| Datasets | 5 | 6 | project:<id> + R2 |
| Connectors | 3 | 6 | project:<id> |
| Actions | 3 | 5 | project:<id> |
| Action invocations | 3 | 4 | project:<id> |
| Credentials | 2 | 3 | project:<id> + KMS |
| Onboarding | 9 | 11 | project:<id> |
| Syncs | 3 | 5 | project:<id> |
| World | 3 | 5 | feed:<topic> |
| Jobs | 4 | 5 | project:<id> / pool |
| Approvals | 2 | 4 | project:<id> |
| Assumptions | 3 | 3 | project:<id> |
| Periods & financials | 2 | 2 | project:<id> / Neon |
| Projections & scenarios | 4 | 6 | project:<id> |
| Documents | 3 | 4 | project:<id> + pool |
| Evals | 3 | 3 | project:<id> + pool |
| Audit | 2 | 2 | ledger WORM + cell |
| Webhooks | 3 | 6 | project:<id> |
| Usage | 1 | 1 | project:<id> |
| Whoami | 1 | 1 | project:<id> |
| Access | 12 | 12 | control D1 + project:<id> |
| Requests | 2 | 2 | control D1 |
| Members | 2 | 3 | control D1 |
| Settings | 1 | 2 | project:<id> |
| Method | Path | Fungsi |
|---|
| GET | /access/overview | Kesehatan konsumsi API |
| GET | /access/keys | Daftar key + scope + environment |
| POST | /access/keys | Buat key; scope dipilih pemanggil |
| POST | /access/keys/{keyId}/rotate | Rotasi key |
| DELETE | /access/keys/{keyId} | Revoke key |
| GET | /access/scopes | Katalog scope |
| GET | /access/rate-limits | Window limit project/key |
| GET | /access/requests | Request log dengan filter |
| GET | /access/requests/{requestId} | Detail request |
| POST | /access/confirmations | Buat confirmation token |
| POST | /access/confirmations/{confirmationId}/approve | Dual control |
| GET | /projects/{projectId}/members | Daftar member |
| PATCH | /projects/{projectId}/members/{memberId} | Ubah role |
| DELETE | /projects/{projectId}/members/{memberId} | Hapus member |
| GET/PATCH | /settings | Runtime setting project |
Semua operasi membawa metadata x-agnestra-scope, x-agnestra-actor,
x-agnestra-danger, dan x-agnestra-idempotent. bun run test:api menjaga parity.
| Method | Path | Fungsi |
|---|
| POST | /decisions | Buat keputusan; sinkron atau 202 bila async |
| GET | /decisions | List + filter (status, agent, mode, waktu) |
| GET | /decisions/{decisionId} | Detail trace, evidence, biaya |
| GET | /decisions/{decisionId}/events | SSE progres |
| POST | /decisions/{decisionId}/feedback | Label sebenarnya untuk eval |
| POST | /decisions:batch | NDJSON, 202 + Job |
Schema: DecisionCreate, Decision, DecisionStatus, AgentMode, Evidence, Cost,
FeedbackCreate.
| Method | Path | Fungsi |
|---|
| POST | /sessions | Buat conversation (agent, fork, ownership, overrides) |
| GET | /sessions | List |
| GET | /sessions/{sessionId} | Detail |
| DELETE | /sessions/{sessionId} | Tutup; hard delete async |
| POST | /sessions/{sessionId}/messages | Submit input (Idempotency-Key wajib) |
| GET | /sessions/{sessionId}/events | SSE multi-klien |
| POST | /sessions/{sessionId}/fork | Fork pada forkAt |
| GET | /sessions/{sessionId}/transcript | Cursor-based transcript |
| Method | Path | Fungsi |
|---|
| GET | /agents | List agent |
| POST | /agents | Buat agent |
| GET | /agents/{agentId} | Detail (mode, model, tools, budget) |
| PATCH | /agents/{agentId} | Ubah; mode naik butuh approval |
| GET | /agents/{agentId}/contract | Decision contract untuk codegen SDK |
| Method | Path | Fungsi |
|---|
| POST | /datasets | Registrasi + presigned upload |
| GET | /datasets | List |
| GET | /datasets/{datasetId} | Status, rows, checksum, quality gates |
| PUT | /datasets/{datasetId}/commit | Transisi ke ingesting |
| GET | /datasets/{datasetId}/schema | Schema |
| POST | /datasets/{datasetId}/query | Query terstruktur, read-only, limit |
| Method | Path | Fungsi |
|---|
| POST | /onboarding/sources | Daftar sumber (s3, postgres_cdc, webhook, upload) |
| GET | /onboarding/sources | List sumber |
| POST | /onboarding/analyze | Profil + usulan kontrak + pertanyaan → 202 |
| GET | /onboarding/analysis | Hasil analisis |
| GET | /onboarding/questions | Pertanyaan terbuka (opsi tertutup) |
| POST | /onboarding/answers | Jawab pertanyaan |
| GET | /onboarding/contract | Kontrak aktif |
| PUT | /onboarding/contract | Deklarasi manusia (If-Match) |
| POST | /onboarding/validate | Blocking + warning + health score |
| POST | /onboarding/backfill | 202 + Job resumable |
| GET | /onboarding/status | Tahap, progres, sisa pertanyaan |
| POST | /onboarding/activate | Aktifkan (butuh gate lulus + approval) |
| Method | Path | Fungsi |
|---|
| GET | /syncs | Status sinkronisasi |
| GET | /syncs/{syncId} | Detail (lag, drift, freeze) |
| POST | /syncs/{syncId}/pause | Hentikan sementara |
| POST | /syncs/{syncId}/resume | Lanjutkan |
| GET | /syncs/{syncId}/quarantine | Batch ditolak + alasan |
| Method | Path | Fungsi |
|---|
| POST | /connectors | Daftar OpenAPI / MCP / deklaratif |
| GET | /connectors | List |
| GET | /connectors/{connectorId} | Detail |
| DELETE | /connectors/{connectorId} | Hapus; action nonaktif |
| POST | /connectors/{connectorId}/discover | 202 Job action-discover |
| Method | Path | Fungsi |
|---|
| GET | /actions | Registry + risk + guardrail |
| GET | /actions/{actionId} | Detail |
| PATCH | /actions/{actionId} | Ubah guardrail (If-Match) |
| POST | /actions/{actionId}/test | Dry-run, tidak menyentuh sistem klien |
| Method | Path | Fungsi |
|---|
| GET | /action-invocations | Log lengkap |
| GET | /action-invocations/{invocationId} | Detail + hash request/response |
| POST | /action-invocations/{invocationId}/reconcile | Selesaikan unknown_effect |
| Method | Path | Fungsi |
|---|
| POST | /credentials | Simpan (write-only) |
| GET | /credentials | List tanpa secret |
| DELETE | /credentials/{credentialId} | Cabut → fail closed |
| Method | Path | Fungsi |
|---|
| POST | /world/subscriptions | Topik + webhook |
| GET | /world/subscriptions | List |
| DELETE | /world/subscriptions/{subscriptionId} | Hapus |
| GET | /world/signals | Cursor-based signal |
Signal wajib punya source; drivers opsional. Feed cell per topik.
| Method | Path | Fungsi |
|---|
| GET | /jobs | List job |
| GET | /jobs/{jobId} | Status + progress + checkpoint |
| POST | /jobs/{jobId}/cancel | Batalkan |
| POST | /jobs/{jobId}/resume | Lanjut dari checkpoint |
| Method | Path | Fungsi |
|---|
| GET | /approvals | List + state=pending |
| POST | /approvals | Buat (subject: decision/contract/assumption/projection/agent-mode/document/action-invocation) |
| GET | /approvals/{approvalId} | Detail |
| POST | /approvals/{approvalId}/decide | Setujui/tolak; four-eyes |
| Method | Path | Fungsi |
|---|
| GET | /assumptions | List driver + nilai aktif |
| PUT | /assumptions/{driverId} | Simpan (sourceRef wajib) |
| GET | /assumptions/history | Versi & approval |
| Method | Path | Fungsi |
|---|
| GET | /periods | Periode fiskal |
| GET | /financials | Baris GL (from, to, coa) |
| Method | Path | Fungsi |
|---|
| POST | /projections | Jalankan engine |
| GET | /projections/{projectionId} | Statements, ratios, constraints |
| POST | /projections/{projectionId}/scenarios | Buat skenario |
| GET | /projections/{projectionId}/scenarios | List |
| GET | /projections/{projectionId}/scenarios/{scenarioId} | Detail |
| GET | /projections/{projectionId}/deviations | Realisasi vs rencana (provider-defined) |
| Method | Path | Fungsi |
|---|
| POST | /documents/render | Render template → 202 Job |
| GET | /documents/{documentId} | Metadata + signed URL |
| POST | /documents/{documentId}/corrections | Koreksi manusia → bahan eval |
| Method | Path | Fungsi |
|---|
| POST | /evals | extraction-f1, decision-agreement, reason-code-precision, deviation-accuracy, fairness |
| GET | /evals/{evalId} | Metrik + breakdown |
| Method | Path | Fungsi |
|---|
| GET | /audit | Query ledger (from, to, actor, type) |
| GET | /audit/{entryId}/proof | Hash chain + Object Lock info |
Tipe entry: decision, approval, contract-change, assumption-change, submission,
export, residency.
| Method | Path | Fungsi |
|---|
| GET | /webhooks | List |
| POST | /webhooks | Buat (secret sekali) |
| DELETE | /webhooks/{webhookId} | Hapus |
| GET | /webhooks/{webhookId}/deliveries | Log delivery |
| POST | /webhooks/{webhookId}/replay | Kirim ulang |
| Kelompok | Event |
|---|
| Decision | decision.decided, decision.needs_review, decision.failed |
| Session | session.completed |
| Onboarding | onboarding.question, onboarding.ready |
| Data | data.contract.drift, data.quality.failed, data.backfill.checkpoint |
| Approval | approval.requested, approval.decided |
| Job | job.completed, job.failed |
| Document | document.ready |
| Projection | projection.ready |
| Eval | eval.completed |
| Action | action.proposed, action.pending_approval, action.executed, action.unknown_effect |
| World | world.signal |
| Method | Path | Fungsi |
|---|
| GET | /usage | Budget, token, breakdown per agent/model |
| GET | /whoami | Actor, roles, residency, limits |
/whoami adalah sumber kapabilitas UI. Jangan hardcode role di frontend.
| Kelompok | Schema |
|---|
| Umum | Problem, ValidationIssue, Job |
| Decision | Decision, DecisionCreate, DecisionStatus, AgentMode, Evidence, Cost, FeedbackCreate |
| Session | Session, SessionCreate, SessionFork, MessageCreate, Submission, TranscriptEntry |
| Agent | Agent |
| Data | Dataset, DatasetCreate, DatasetQuery, DatasetQueryResult, Contract, FieldSpec, ValidationResult |
| Sync | Sync, QuarantineBatch |
| Action | Connector, Action, ActionArg, ActionRisk, Guardrail, IdempotencySpec, ActionInvocation, ActionInvocationStatus, Credential |
| World | Signal, WorldSubscription |
| Approval | Approval, ApprovalCreate |
| Planning | Assumption, AssumptionPut, Projection, ProjectionCreate, Scenario, ScenarioCreate, Period, FinancialLine |
| Dokumen | Document, DocumentRender, Correction |
| Eval | Eval, EvalCreate |
| Audit | AuditEntry, AuditProof |
| Webhook | Webhook, WebhookCreate, WebhookDelivery, WebhookEvent |
| Usage | Usage, WhoAmI |
| Endpoint | Cell | Operasi |
|---|
POST /decisions | project:<id> | harness.root() → submit({requestId}) |
POST /sessions | project:<id> | tx.createConversation() |
POST /sessions/{id}/fork | project:<id> | conversation.fork(entry) |
GET /sessions/{id}/events | project:<id> | stream task |
GET /world/signals | feed:<topic> | baca SQLite feed |
POST /datasets | project:<id> | tulis tabel + presign R2 |
GET /usage | project:<id> | counter budget |
POST /onboarding/backfill | project:<id> + pool | Job chunked |
POST /documents/render | project:<id> + pool | Job render |
GET /audit | ledger + cell | query WORM |
Setiap endpoint jatuh ke tepat satu cell. Jika butuh join lintas cell, itu tanda harus
menjadi resource baru — bukan query lintas tenant.
# lint
bunx @redocly/cli lint openapi.yaml
# preview (Redocly v2)
bunx @redocly/cli preview
# build HTML statis
bunx @redocly/cli build-docs openapi.yaml -o redoc-static.html
# generate tipe
bunx openapi-typescript openapi.yaml -o packages/api-types/src/api.d.ts
Tipe adalah hasil generate; jangan diedit manual. Spec berubah → regenerate → typecheck.