Browse datasource folders
Browse datasource folders
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/v1/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.
Authorization
bearerAuth Console session token (Authorization: Bearer <session>) or product API key (Authorization: Bearer <api-key> or x-api-key). Session tokens are validated via Better Auth get-session; API keys against the shared database.
In: header
Header Parameters
Request Body
application/json
TypeScript Definitions
Use the request body type in TypeScript.
Request body (WorkspaceDatasourceBrowseRequest).
Response Body
application/json
application/json
application/json
curl -X POST "https://example.com/api/v1/workspaces/datasource/browse" \ -H "Content-Type: application/json" \ -d '{ "type": "googledrive" }'{ "folders": [ { "id": "string", "name": "string", "has_children": true, "path": "string", "drive_id": "string", "kind": "folder" } ]}Create a workspace POST
Create a workspace Create a new custom workspace in the authenticated user's company. Requires the company to have `allow_user_workspace_creation` enabled, unless the caller is a company or instance administrator (who may always create workspaces). Returns **403** if workspace creation is disabled for the company and the caller is not an administrator. The creator is automatically added as OWNER.
Test datasource credentials POST
Test datasource credentials Test datasource credentials without persisting anything. Validates that the provided credentials can connect to the external source. Returns 200 if the connection succeeds, 400 otherwise. No datasource or import is created. Use this before `PATCH /api/v1/workspaces/{id}` with a `datasource` payload to surface connection errors before committing the conversion. **Access:** any authenticated user. Credentials per type: - **googledrive**: `service_account_file` (JSON string of the service account key file) - **sharepoint**: `client_id`, `client_secret`, `tenant_id`, `site_id` (optional), `site_name` (optional) - **servicenow**: `instance_url`, `username`, `password` - **webscrapper**: no credentials required Filter criteria per type: - **googledrive**: `folder_id` (required), `recursive` (optional) - **sharepoint**: `folder_path` (required), `recursive` (optional) - **servicenow**: `doc_type` (required, e.g. `knowledge`) - **webscrapper**: `start_url` (required)