Skip to content

DefendableCloud API

Base URL:

https://api.defendablecloud.com

Local development:

Terminal window
cd defendable-cloud-v2/api
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt
cp .env.example .env
alembic upgrade head
uvicorn app.main:app --reload --port 8080
MethodPathPurpose
GET/healthzService, database, and storage health.
POST/auth/requestRequest magic-link sign-in.
POST/auth/verifyExchange one-time token for JWT.
POST/auth/accept-inviteAccept owner-created organization invite.
GET/auth/meCurrent authenticated principal.
GET/orgCurrent organization.
GET/POST/org/api-keysOwner-managed API keys.
GET/org/membersOrganization members.
PUT/org/members/{user_id}/roleOwner updates member role.
GET/POST/org/invitesOwner invite flow.
GET/org/usageUsage summary.
GET/POST/projectsProject list/create.
GET/POST/runsRun list/create.
GET/runs/{run_id}Composite run detail.
POST/runs/{run_id}/evidenceAttach evidence metadata/content.
POST/runs/{run_id}/evidence/uploadUpload and hash file evidence.
POST/runs/{run_id}/submissionAttach agent submission.
POST/runs/{run_id}/auditRun flight-sheet audit.
PATCH/runs/{run_id}/checks/{check_id}Grade checklist rule.
POST/runs/{run_id}/checksRun core check engine.
POST/runs/{run_id}/approveApproval decision.
POST/runs/{run_id}/receiptMint run receipt.
GET/share/{token}Public redacted receipt JSON.
GET/share/{token}/pdfPublic receipt PDF.
GET/ledgerPublic ledger view.
GET/ledger/verifyVerify chain integrity.
MethodPathPurpose
GET/datasetsMembers-only dataset list (entitlement-aware).
GET/datasets/catalogPublic dataset catalog.
GET/datasets/catalog/{slug}Dataset package detail.
POST/datasets/catalog/{slug}/downloadMembers-only dataset download grant and receipt.
GET/datasets/catalog/{slug}/samplesDataset samples.
GET/models/catalogModel catalog.
GET/models/catalog/{slug}Model card.
POST/models/catalog/{slug}/pinPin a model choice into a receipt.
POST/runs/{run_id}/cookCreate cook request.
GET/cooksList cook jobs.
GET/cooks/{cook_id}Cook detail.
POST/runner/cooks/nextRunner claims next cook (internal-key gated).
POST/runner/cooks/{cook_id}/statusRunner status update.
POST/runner/cooks/{cook_id}/completeRunner completion.
POST/runner/cooks/{cook_id}/failRunner failure.
GET/POST/PATCH/incidentsIncident records and updates.
POST/incidents/{incident_id}/receiptIncident receipt.
GET/POST/agent-profilesAgent profile registry.
POST/agent-profiles/{profile_id}/watchdogAgent health incident hook.
GET/stack-planner/optionsCompute/model planning choices.
POST/stack-assessmentCompute/model fit report.
GET/membershipCurrent membership state.
POST/membership/applySubmit a membership application.
POST/membership/approveApprove an application (internal-key gated).
POST/membership/checkoutCreate a Stripe Checkout session ($100/yr).
GET/policy/training-dataTraining-data policy.
POST/stripe/webhookStripe webhook activation.
GET/POST/internal/*Internal staging surfaces gated by internal key.
GET/admin/applicationsAdmin: list membership applications.
POST/admin/applications/{slug}/approveAdmin: approve an application.
GET/admin/healthAdmin: gated health/diagnostics.

User auth uses bearer JWTs from magic-link verification.

API keys are owner-created and hashed at rest. Use API keys for service automation where a full user session is not appropriate.

Internal runner/stager routes use internal credentials and should never be exposed as public unauthenticated surfaces.

The API contract is protected by tests in the cloud repo. A route or schema break should fail CI before merge.

Terminal window
cd defendable-cloud-v2/api
pytest tests/test_openapi.py