AI Reports

sfp server API reference for AI Reports: 6 endpoints.

POST/sfp/api/ai-reports/results

Store 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
AuthorizationBearer <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"  }'
Empty
GET/sfp/api/ai-reports

Retrieve 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
AuthorizationBearer <token>

In: header

Query Parameters

repositoryIdentifier*string

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"
Empty
GET/sfp/api/ai-reports/status

Check 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
AuthorizationBearer <token>

In: header

Query Parameters

repositoryIdentifier*string
scope*string
scopeName*string
branch?string

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"
Empty
GET/sfp/api/ai-reports/latest

Retrieve the latest full AI report (including markdown) for a specific scope/scopeName.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

repositoryIdentifier*string

Repository identifier

scope*string

Analysis scope (repository, domain, or package)

scopeName*string

Scope name (e.g., domain name, package name, or "repository")

branch?string

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"
Empty
GET/sfp/api/ai-reports/history

Retrieve historical report metadata (no markdown) for a specific scope/scopeName. Useful for showing a timeline of past analyses.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

repositoryIdentifier*string

Repository identifier

scope*string

Analysis scope

scopeName*string

Scope name

limit?number

Maximum results to return (default: 10, max: 100)

branch?string

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"
Empty
POST/sfp/api/ai-reports/refresh

Trigger 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
AuthorizationBearer <token>

In: header

Query Parameters

repositoryIdentifier*string

Repository identifier

scope*string

Analysis scope

scopeName*string

Scope name

model?unknown

AI model to use

provider?unknown

AI provider to use

branch?unknown

Git branch to analyze (defaults to the repository configured default branch)

force?boolean

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"
Empty