Analysis

sfp server API reference for Analysis: 3 endpoints.

POST/sfp/api/analysis/results

Store analysis results from sfp analyze. Called by the CLI when --publish-results is used.

Dual write: Stores full results (with markdown and linter data) in the results table and a lightweight summary in the summary table.

Duplicate handling: If results already exist for the same PR + commit, they are overwritten (same commit = updated analysis).

Retention: Keeps last 500 results per repository.

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/analysis/results" \  -H "Content-Type: application/json" \  -d '{    "repositoryIdentifier": "flxbl-io/sf-core",    "commitSha": "6dcb09b5b57875f334f61aebed695e2e4193db5e",    "status": "completed",    "hasIssues": true,    "hasFailedLinters": true,    "linters": [      "duplicates",      "compliance",      "architecture",      "code-analyzer"    ],    "results": [      {        "type": "duplicates",        "hasIssues": true,        "data": {}      }    ]  }'
Empty
GET/sfp/api/analysis/results

Retrieve lightweight analysis summaries for a repository. Returns only the fields needed for list/table views — no markdown content or raw linter data.

Use cases:

  • Table view: list all recent analyses with status badges
  • Filter by base branch to see analyses targeting a specific branch
  • Filter by PR number to see summary for a specific PR

Results are ordered by most recent first.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

repositoryIdentifier*string

Repository identifier (e.g., flxbl-io/sf-core)

pullRequestNumber?string

Filter by PR number

baseBranch?string

Filter by target/base branch (e.g., main, release/1.0)

limit?number

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

Response Body

curl -X GET "https://example.com/sfp/api/analysis/results?repositoryIdentifier=flxbl-io%2Fsf-core"
Empty
GET/sfp/api/analysis/pr/{prNumber}

Retrieve all analysis runs for a specific PR with full data including markdown content and raw linter results.

Use cases:

  • PR detail view: show full linter markdown reports per tab
  • Compare analysis results between commits on the same PR

Each entry represents a separate analysis run (typically one per commit push). Same commit re-analyzed = latest result only (overwritten on publish).

Authorization

access-token
AuthorizationBearer <token>

In: header

Path Parameters

prNumber*string

Pull request number

Query Parameters

repositoryIdentifier*string

Repository identifier (e.g., flxbl-io/sf-core)

Response Body

curl -X GET "https://example.com/sfp/api/analysis/pr/617?repositoryIdentifier=flxbl-io%2Fsf-core"
Empty