Workspaces

Create a workspace

POST
/api/v1/workspaces

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.

Authorization

bearerAuth
AuthorizationBearer <token>

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

authorization?string|null
x-api-key?string|null

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Request body (StandardWorkspaceCreateRequest).

Response Body

application/json

application/json

curl -X POST "https://example.com/api/v1/workspaces" \  -H "Content-Type: application/json" \  -d '{    "name": "string"  }'
{  "id": 0,  "name": "string",  "workspace_type": "string",  "document_upload_method": "string",  "description": "string",  "created_at": "2019-08-24T14:15:22Z",  "updated_at": "2019-08-24T14:15:22Z",  "files_count": 0,  "user_role": "owner",  "used_storage": 0,  "summaries": [    {      "language": "string",      "summary": "string"    }  ],  "sync": {    "datasource_type": "string",    "source_name": "string",    "last_status": "string",    "updated_at": "2019-08-24T14:15:22Z",    "failed_files_count": 0,    "next_import_date": "2019-08-24T14:15:22Z",    "editable": true,    "name": "string",    "instance_url": "string",    "tenant_id": "string",    "site_name": "string",    "client_id": "string",    "filter_criteria": null  },  "scoped_api_keys": [    {      "id": "string",      "name": "string",      "prefix": "string",      "role": "string",      "created_at": "2019-08-24T14:15:22Z",      "created_by": "string",      "scope_type": "workspace"    }  ]}

List workspaces GET

List workspaces Get the list of accessible workspaces for the authenticated user. Returns workspaces where the user is set as member (through any group: private, company, or custom). Please use instance or company level endpoints to access the workspaces as admin. Supported query filters: `workspace_type`, `document_upload_method`, `datasource_type` (`googledrive`, `sharepoint`, `servicenow`, `webscrapper`), `name` (case-insensitive contains), `group_id`, `group_name`, `user_role`. **API keys:** `scoped_api_keys` lists your own non-revoked keys that can access the workspace. Each entry has a `scope_type`: `workspace` for keys explicitly scoped to it (listed first, with their per-workspace role), or `global` for keys with no scope rows that implicitly reach every workspace (their `role` mirrors your own role on the workspace). Results ordered by creation date (newest first), paginated with 20 elements per page by default.

Browse datasource folders POST

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). When ``parent_id`` is omitted, returns the folders explicitly shared with the service account. - **sharepoint**: `client_id`, `client_secret`, `tenant_id`, `instance_url`, `site_name`. When both ``drive_id`` and ``parent_id`` are ``null``, returns the site's document libraries as ``kind="library"`` entries (each entry's ``id`` is the drive id). Pass that ``id`` back as ``drive_id`` (with ``parent_id=null``) to list the library root; pass it as ``drive_id`` together with a folder's ``id`` as ``parent_id`` to descend into a folder.