GC Ledger

sfp server API reference for GC Ledger: 5 endpoints.

POST/sfp/api/gc-ledger/events

Records component drop observations (detected, moved) from a build's source scan. Each event upserts the ledger entry for the component on the branch.

Resolution states are never client-asserted: restored/handled transitions are derived server-side from published package manifests, and dismissals go through the dismiss endpoint with user identity.

Repeat detections of an unchanged state refresh the entry's lastEventAt without growing its event history. Dismissed entries are not re-opened by repeat detections.

Ingestion also triggers reconciliation of the branch's open entries against the latest published package manifests — builds with no drops still post (with an empty events array) so previously dropped components that were restored, moved, or covered by destructive changes get resolved.

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/gc-ledger/events" \  -H "Content-Type: application/json" \  -d '{    "repositoryIdentifier": "flxbl-io/sf-core",    "branch": "main",    "events": [      {        "type": "detected",        "packageName": "core",        "componentType": "ApexClass",        "fullName": "LeadScoring"      }    ]  }'
Empty
GET/sfp/api/gc-ledger

Lists components dropped from packages across a repository, optionally scoped to a branch. Filter by status to see what is pending garbage collection (status=detected) or what has been resolved.

Authorization

access-token
AuthorizationBearer <token>

In: header

Query Parameters

repositoryIdentifier*string
branch?string

Branch to scope to; omit for all branches

status?string

Value in

  • "detected"
  • "moved"
  • "handled"
  • "restored"
  • "dismissed"
  • "owned-elsewhere"
  • "reclaimed"
package?string

Filter by package name

limit?number

Max entries (default 100, max 500)

Response Body

curl -X GET "https://example.com/sfp/api/gc-ledger?repositoryIdentifier=flxbl-io%2Fsf-core"
Empty
PATCH/sfp/api/gc-ledger/dismiss

Manually acknowledges a dropped component so it no longer shows as pending garbage collection. Dismissal is sticky against repeat detections; the entry only re-opens if the component is restored and dropped again.

Authorization

access-token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PATCH "https://example.com/sfp/api/gc-ledger/dismiss" \  -H "Content-Type: application/json" \  -d '{    "repositoryIdentifier": "flxbl-io/sf-core",    "branch": "main",    "packageName": "core",    "componentType": "ApexClass",    "fullName": "LeadScoring"  }'
Empty
POST/sfp/api/gc-ledger/org-check

Records the verified presence of dropped components in one registered environment's org. When an entry is positively confirmed absent in ALL registered environments tracking the branch, it is removed from the ledger. unknown results never count as absent, and nothing is removed while zero environments are registered.

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/gc-ledger/org-check" \  -H "Content-Type: application/json" \  -d '{    "repositoryIdentifier": "flxbl-io/sf-core",    "branch": "main",    "environment": "qa",    "results": [      {        "packageName": "core",        "componentType": "ApexClass",        "fullName": "LeadScoring",        "presence": "present"      }    ]  }'
Empty
PATCH/sfp/api/gc-ledger/reopen

Returns a dismissed entry to detected (pending cleanup). Only dismissed entries can be reopened; the action is recorded with the acting user.

Authorization

access-token
AuthorizationBearer <token>

In: header

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

curl -X PATCH "https://example.com/sfp/api/gc-ledger/reopen" \  -H "Content-Type: application/json" \  -d '{    "repositoryIdentifier": "flxbl-io/sf-core",    "branch": "main",    "packageName": "core",    "componentType": "ApexClass",    "fullName": "LeadScoring"  }'
Empty