AI Reports
sfp server API reference for AI Reports: 6 endpoints.
/sfp/api/ai-reports/resultsStore AI analysis results from a Hatchet workflow. Called by the workflow after running sfp project:report.
Append-only: Each publish creates a new row (timestamp in key). No upserts.
Retention: Keeps last 10 reports per scope/scopeName combination.
Authorization
access-token In: header
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Response Body
curl -X POST "https://example.com/sfp/api/ai-reports/results" \ -H "Content-Type: application/json" \ -d '{ "repositoryIdentifier": "flxbl-io/sf-core", "scope": "domain", "scopeName": "sales", "commitSha": "6dcb09b5b57875f334f61aebed695e2e4193db5e", "analyzedAt": "2026-02-25T10:00:00.000Z", "status": "completed", "markdownReport": "string" }'/sfp/api/ai-reportsRetrieve the latest AI report summary per branch/scope/scopeName for a repository. Returns metadata only — no markdown content. Use GET /ai-reports/latest for full report.
Authorization
access-token In: header
Query Parameters
Repository identifier (e.g., flxbl-io/sf-core)
Response Body
curl -X GET "https://example.com/sfp/api/ai-reports?repositoryIdentifier=flxbl-io%2Fsf-core"/sfp/api/ai-reports/statusCheck the current status of AI analysis for a specific scope/scopeName.
Returns one of: never_ran, generating, completed, or failed.
Use this to show real-time status in the UI without triggering a refresh.
Authorization
access-token In: header
Query Parameters
Git branch. Defaults to the repository configured default branch.
Response Body
curl -X GET "https://example.com/sfp/api/ai-reports/status?repositoryIdentifier=flxbl-io%2Fsf-core&scope=domain&scopeName=sales"/sfp/api/ai-reports/latestRetrieve the latest full AI report (including markdown) for a specific scope/scopeName.
Authorization
access-token In: header
Query Parameters
Repository identifier
Analysis scope (repository, domain, or package)
Scope name (e.g., domain name, package name, or "repository")
Git branch. Defaults to the repository configured default branch.
Response Body
curl -X GET "https://example.com/sfp/api/ai-reports/latest?repositoryIdentifier=flxbl-io%2Fsf-core&scope=domain&scopeName=sales"/sfp/api/ai-reports/historyRetrieve historical report metadata (no markdown) for a specific scope/scopeName. Useful for showing a timeline of past analyses.
Authorization
access-token In: header
Query Parameters
Repository identifier
Analysis scope
Scope name
Maximum results to return (default: 10, max: 100)
Git branch. Defaults to the repository configured default branch.
Response Body
curl -X GET "https://example.com/sfp/api/ai-reports/history?repositoryIdentifier=flxbl-io%2Fsf-core&scope=domain&scopeName=sales"/sfp/api/ai-reports/refreshTrigger a new AI analysis via Hatchet workflow. Returns a task execution ID for tracking.
Cost-aware: AI tokens are expensive. Reports are only generated on explicit user request — no auto-trigger.
Authorization
access-token In: header
Query Parameters
Repository identifier
Analysis scope
Scope name
AI model to use
AI provider to use
Git branch to analyze (defaults to the repository configured default branch)
Force re-analysis even if a completed report exists for the current commit (default: false)
Response Body
curl -X POST "https://example.com/sfp/api/ai-reports/refresh?repositoryIdentifier=flxbl-io%2Fsf-core&scope=domain&scopeName=sales"