curl --request POST \
--url https://api.lighton.ai/api/v3/workspaces/datasource/browse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "sharepoint",
"credentials": {
"tenant_id": "tenant-uuid",
"client_id": "client-uuid",
"client_secret": "secret",
"instance_url": "https://contoso.sharepoint.com",
"site_name": "Engineering"
},
"drive_id": null,
"parent_id": null
}
'{
"folders": [
{
"id": "b!abc",
"name": "Documents",
"has_children": true,
"path": "Documents",
"drive_id": null,
"kind": "library"
},
{
"id": "b!def",
"name": "SyncedWithParadigm",
"has_children": true,
"path": "SyncedWithParadigm",
"drive_id": null,
"kind": "library"
}
]
}Browse datasource folders
⚠️ ALPHA ENDPOINT - This endpoint is in alpha and subject to breaking changes. Use with caution in production environments.
Browse the remote folder hierarchy of a datasource without persisting anything.
Connects to the external provider using the credentials in the payload and returns the immediate subfolders of parent_id (or the top-level entries when parent_id is null). Use this to power a visual folder picker before submitting a datasource configuration via PATCH /api/v3/workspaces/{id} with a datasource payload.
Access: any authenticated user.
Supported providers and credentials:
- googledrive:
service_account_file(JSON string of the service account key file). Whenparent_idis omitted, returns the folders explicitly shared with the service account. - sharepoint:
client_id,client_secret,tenant_id,instance_url,site_name. When bothdrive_idandparent_idarenull, returns the site’s document libraries askind="library"entries (each entry’sidis the drive id). Pass thatidback asdrive_id(withparent_id=null) to list the library root; pass it asdrive_idtogether with a folder’sidasparent_idto descend into a folder.
curl --request POST \
--url https://api.lighton.ai/api/v3/workspaces/datasource/browse \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"type": "sharepoint",
"credentials": {
"tenant_id": "tenant-uuid",
"client_id": "client-uuid",
"client_secret": "secret",
"instance_url": "https://contoso.sharepoint.com",
"site_name": "Engineering"
},
"drive_id": null,
"parent_id": null
}
'{
"folders": [
{
"id": "b!abc",
"name": "Documents",
"has_children": true,
"path": "Documents",
"drive_id": null,
"kind": "library"
},
{
"id": "b!def",
"name": "SyncedWithParadigm",
"has_children": true,
"path": "SyncedWithParadigm",
"drive_id": null,
"kind": "library"
}
]
}Authorizations
Body
Pydantic request model for browsing the remote folder hierarchy of a datasource.
Only browsable providers (Google Drive, SharePoint) are accepted. Credentials are validated against the same models as the credential test endpoint.