> For the complete documentation index, see [llms.txt](https://docs.flxbl.io/flxbl/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.flxbl.io/flxbl/sfp-server/api-reference/org-explorer.md).

# Org Explorer

## GET /sfp/api/orgs/explorer/components

> Get stored component source data. Pass refresh=true to trigger async re-fetch.

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/orgs/explorer/components":{"get":{"operationId":"OrgExplorerController_getComponent","summary":"Get stored component source data. Pass refresh=true to trigger async re-fetch.","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier (e.g., owner/repo)","schema":{"type":"string"}},{"name":"orgUsername","required":true,"in":"query","description":"Salesforce org username","schema":{"type":"string"}},{"name":"metadataType","required":true,"in":"query","description":"Metadata type (e.g., ApexClass, CustomObject)","schema":{"type":"string"}},{"name":"memberName","required":true,"in":"query","description":"Member name","schema":{"type":"string"}},{"name":"refresh","required":false,"in":"query","description":"If true, triggers an async refresh and returns pending status","schema":{"default":false,"type":"boolean"}}],"responses":{"200":{"description":"Stored component data, not_found, or pending status"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Org Explorer"]}}}}
```

## GET /sfp/api/orgs/explorer/components/list

> List stored components for an org

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/orgs/explorer/components/list":{"get":{"operationId":"OrgExplorerController_listComponents","summary":"List stored components for an org","parameters":[{"name":"orgUsername","required":true,"in":"query","description":"Salesforce org username","schema":{"type":"string"}},{"name":"metadataType","required":false,"in":"query","description":"Filter by metadata type","schema":{"type":"string"}}],"responses":{"200":{"description":"List of stored components with summary info"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Org Explorer"]}}}}
```

## GET /sfp/api/orgs/explorer/metadata

> Get org metadata sync summary

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}}},"paths":{"/sfp/api/orgs/explorer/metadata":{"get":{"operationId":"OrgExplorerController_getOrgMetadata","summary":"Get org metadata sync summary","parameters":[{"name":"repositoryIdentifier","required":true,"in":"query","description":"Repository identifier (e.g., owner/repo)","schema":{"type":"string"}},{"name":"orgUsername","required":true,"in":"query","description":"Salesforce org username","schema":{"type":"string"}}],"responses":{"200":{"description":"Metadata sync summary or not_synced status"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Org Explorer"]}}}}
```

## POST /sfp/api/orgs/explorer/metadata/refresh

> Trigger full org metadata sync (describe, list, retrieve all)

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"RefreshOrgMetadataDto":{"type":"object","properties":{"repositoryIdentifier":{"type":"string","description":"Repository identifier (e.g., owner/repo)"},"orgUsername":{"type":"string","description":"Salesforce org username"},"typeFilter":{"description":"Optional list of metadata types to limit the sync","type":"array","items":{"type":"string"}}},"required":["repositoryIdentifier","orgUsername"]}}},"paths":{"/sfp/api/orgs/explorer/metadata/refresh":{"post":{"operationId":"OrgExplorerController_refreshOrgMetadata","summary":"Trigger full org metadata sync (describe, list, retrieve all)","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RefreshOrgMetadataDto"}}}},"responses":{"200":{"description":"Metadata sync triggered"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Org Explorer"]}}}}
```

## POST /sfp/api/orgs/explorer/internal/components

> Publish retrieved org explorer component source to object storage

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"PublishOrgExplorerComponentDto":{"type":"object","properties":{"orgUsername":{"type":"string","description":"Salesforce org username"},"metadataType":{"type":"string","description":"Salesforce metadata type"},"memberName":{"type":"string","description":"Salesforce metadata member name"},"parent":{"description":"Parent component for child metadata","allOf":[{"$ref":"#/components/schemas/OrgExplorerComponentParentDto"}]},"sourceData":{"description":"Retrieved source files to store in object storage","type":"array","items":{"$ref":"#/components/schemas/PublishOrgExplorerSourceFileDto"}},"retrievedAt":{"type":"string","description":"ISO timestamp for retrieve completion"},"duration":{"type":"number","description":"Retrieve duration in seconds"}},"required":["orgUsername","metadataType","memberName","sourceData"]},"OrgExplorerComponentParentDto":{"type":"object","properties":{"metadataType":{"type":"string","description":"Parent metadata type"},"memberName":{"type":"string","description":"Parent member name"},"key":{"type":"string","description":"Parent org explorer component key"}},"required":["metadataType","memberName","key"]},"PublishOrgExplorerSourceFileDto":{"type":"object","properties":{"fileName":{"type":"string","description":"Source file name"},"fullName":{"type":"string","description":"Salesforce metadata full name"},"type":{"type":"string","description":"Salesforce metadata type for the file"},"fileContent":{"type":"string","description":"Retrieved source file content"},"state":{"type":"string","description":"Retrieve file state"}},"required":["fileName","fullName","type","fileContent","state"]}}},"paths":{"/sfp/api/orgs/explorer/internal/components":{"post":{"operationId":"OrgExplorerController_publishComponentSource","summary":"Publish retrieved org explorer component source to object storage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOrgExplorerComponentDto"}}}},"responses":{"201":{"description":"Component source stored"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Org Explorer"]}}}}
```

## POST /sfp/api/orgs/explorer/internal/components/batch

> Publish a batch of retrieved org explorer components to object storage

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"PublishOrgExplorerComponentBatchDto":{"type":"object","properties":{"orgUsername":{"type":"string","description":"Salesforce org username"},"retrievedMetadataType":{"type":"string","description":"Metadata type used for the source retrieve that produced this batch"},"components":{"description":"Retrieved components to store in object storage","type":"array","items":{"$ref":"#/components/schemas/PublishOrgExplorerComponentBatchItemDto"}},"retrievedAt":{"type":"string","description":"Default ISO timestamp for retrieve completion"},"duration":{"type":"number","description":"Default retrieve duration in seconds"}},"required":["orgUsername","components"]},"PublishOrgExplorerComponentBatchItemDto":{"type":"object","properties":{"metadataType":{"type":"string","description":"Salesforce metadata type"},"memberName":{"type":"string","description":"Salesforce metadata member name"},"parent":{"description":"Parent component for child metadata","allOf":[{"$ref":"#/components/schemas/OrgExplorerComponentParentDto"}]},"sourceData":{"description":"Retrieved source files to store in object storage","type":"array","items":{"$ref":"#/components/schemas/PublishOrgExplorerSourceFileDto"}},"retrievedAt":{"type":"string","description":"ISO timestamp for retrieve completion"},"duration":{"type":"number","description":"Retrieve duration in seconds"}},"required":["metadataType","memberName","sourceData"]},"OrgExplorerComponentParentDto":{"type":"object","properties":{"metadataType":{"type":"string","description":"Parent metadata type"},"memberName":{"type":"string","description":"Parent member name"},"key":{"type":"string","description":"Parent org explorer component key"}},"required":["metadataType","memberName","key"]},"PublishOrgExplorerSourceFileDto":{"type":"object","properties":{"fileName":{"type":"string","description":"Source file name"},"fullName":{"type":"string","description":"Salesforce metadata full name"},"type":{"type":"string","description":"Salesforce metadata type for the file"},"fileContent":{"type":"string","description":"Retrieved source file content"},"state":{"type":"string","description":"Retrieve file state"}},"required":["fileName","fullName","type","fileContent","state"]}}},"paths":{"/sfp/api/orgs/explorer/internal/components/batch":{"post":{"operationId":"OrgExplorerController_publishComponentBatch","summary":"Publish a batch of retrieved org explorer components to object storage","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOrgExplorerComponentBatchDto"}}}},"responses":{"201":{"description":"Component source batch stored"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Org Explorer"]}}}}
```

## POST /sfp/api/orgs/explorer/internal/components/manifest-batch

> Publish a batch of org explorer component descriptors after internal object upload

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"PublishOrgExplorerComponentManifestBatchDto":{"type":"object","properties":{"orgUsername":{"type":"string","description":"Salesforce org username"},"retrievedMetadataType":{"type":"string","description":"Metadata type used for the source retrieve that produced this batch"},"components":{"description":"Uploaded components to persist","type":"array","items":{"$ref":"#/components/schemas/PublishOrgExplorerComponentManifestBatchItemDto"}},"retrievedAt":{"type":"string","description":"Default ISO timestamp for retrieve completion"},"duration":{"type":"number","description":"Default retrieve duration in seconds"}},"required":["orgUsername","components"]},"PublishOrgExplorerComponentManifestBatchItemDto":{"type":"object","properties":{"metadataType":{"type":"string","description":"Salesforce metadata type"},"memberName":{"type":"string","description":"Salesforce metadata member name"},"parent":{"description":"Parent component for child metadata","allOf":[{"$ref":"#/components/schemas/OrgExplorerComponentParentDto"}]},"sourceData":{"description":"Uploaded source file descriptors","type":"array","items":{"$ref":"#/components/schemas/PublishOrgExplorerUploadedSourceFileDto"}},"retrievedAt":{"type":"string","description":"ISO timestamp for retrieve completion"},"duration":{"type":"number","description":"Retrieve duration in seconds"}},"required":["metadataType","memberName","sourceData"]},"OrgExplorerComponentParentDto":{"type":"object","properties":{"metadataType":{"type":"string","description":"Parent metadata type"},"memberName":{"type":"string","description":"Parent member name"},"key":{"type":"string","description":"Parent org explorer component key"}},"required":["metadataType","memberName","key"]},"PublishOrgExplorerUploadedSourceFileDto":{"type":"object","properties":{"fileName":{"type":"string","description":"Source file name"},"fullName":{"type":"string","description":"Salesforce metadata full name"},"type":{"type":"string","description":"Salesforce metadata type for the file"},"state":{"type":"string","description":"Retrieve file state"},"objectKey":{"type":"string","description":"Object storage key for the uploaded source file"},"contentType":{"type":"string","description":"Stored object content type"},"sizeBytes":{"type":"number","description":"Stored object size in bytes"},"sha256":{"type":"string","description":"Stored object SHA-256 digest"},"fetchedAt":{"type":"string","description":"ISO timestamp when the source file was retrieved/uploaded"}},"required":["fileName","fullName","type","state","objectKey","contentType","sizeBytes","sha256","fetchedAt"]}}},"paths":{"/sfp/api/orgs/explorer/internal/components/manifest-batch":{"post":{"operationId":"OrgExplorerController_publishComponentManifestBatch","summary":"Publish a batch of org explorer component descriptors after internal object upload","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOrgExplorerComponentManifestBatchDto"}}}},"responses":{"201":{"description":"Component descriptor batch stored"},"403":{"description":"Forbidden - Requires role: application"}},"tags":["Org Explorer"]}}}}
```

## POST /sfp/api/orgs/explorer/internal/metadata-sync

> Publish org explorer metadata sync summary

```json
{"openapi":"3.0.0","info":{"title":"sfp server","version":"51.40.2"},"security":[{"access-token":[]}],"components":{"securitySchemes":{"access-token":{"scheme":"bearer","bearerFormat":"JWT","type":"http","in":"header"}},"schemas":{"PublishOrgExplorerSyncSummaryDto":{"type":"object","properties":{"orgUsername":{"type":"string","description":"Salesforce org username"},"typeNames":{"description":"Discovered metadata type names","type":"array","items":{"type":"string"}},"syncedAt":{"type":"string","description":"ISO timestamp for sync completion"},"duration":{"type":"number","description":"Sync duration in seconds"},"typesCount":{"type":"number","description":"Number of metadata types discovered"},"componentsCount":{"type":"number","description":"Number of metadata components listed"},"filesRetrieved":{"type":"number","description":"Number of source files retrieved"},"failedTypes":{"description":"Metadata types that failed during sync","type":"array","items":{"type":"string"}}},"required":["orgUsername","typeNames","syncedAt","duration","typesCount","componentsCount","filesRetrieved","failedTypes"]}}},"paths":{"/sfp/api/orgs/explorer/internal/metadata-sync":{"post":{"operationId":"OrgExplorerController_publishSyncSummary","summary":"Publish org explorer metadata sync summary","parameters":[],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PublishOrgExplorerSyncSummaryDto"}}}},"responses":{"201":{"description":"Metadata sync summary stored"},"403":{"description":"Forbidden - Requires role: member, owner, application"}},"tags":["Org Explorer"]}}}}
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.flxbl.io/flxbl/sfp-server/api-reference/org-explorer.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
