Skip to main content
Source: equa-server/modules/api/src/endpoints/google-drive-endpoints.ts
These endpoints are currently disabled in production. The source file exists but is commented out in the endpoint registration (endpoints.ts). These endpoints are documented here for reference and will become active when the feature is re-enabled.

Google Drive Endpoints

Endpoints for connecting an organization’s data room with Google Drive. Supports OAuth connection, folder browsing, sync configuration, manual sync triggers, and sync history. All Google Drive endpoints require authentication.

Connection

Get Auth URL

GET /v1/organization/:organization/google-drive/auth-url
FieldValue
AuthRequired
PermissioncanEditDocuments
Get the Google OAuth URL to initiate the connection flow. Redirect the user to this URL to authorize Google Drive access. Response:
{
  "url": "https://accounts.google.com/o/oauth2/v2/auth?..."
}

Connect Google Drive

POST /v1/organization/:organization/google-drive/connect
FieldValue
AuthRequired
PermissioncanEditDocuments
Complete the OAuth flow by exchanging the authorization code for tokens. If a connection already exists, the tokens are refreshed. Request:
{
  "organization": "uuid",
  "code": "google-authorization-code"
}
Response:
{
  "success": true,
  "connectionId": "uuid",
  "email": "user@gmail.com"
}

Disconnect Google Drive

DELETE /v1/organization/:organization/google-drive/connection
FieldValue
AuthRequired
PermissioncanEditDocuments
Disconnect Google Drive from the organization. Deactivates the connection without deleting synced files.

Get Connection Status

GET /v1/organization/:organization/google-drive/status
FieldValue
AuthRequired
PermissioncanViewOrganization
Check whether Google Drive is connected and get sync configuration details. Response (connected):
{
  "connected": true,
  "connectionId": "uuid",
  "email": "user@gmail.com",
  "lastSyncAt": "2025-06-15T10:30:00Z",
  "syncError": null,
  "syncConfigurations": [
    {
      "id": "uuid",
      "googleFolderId": "google-folder-id",
      "googleFolderName": "Company Documents",
      "targetDataRoomPath": "/synced/company-docs",
      "syncEnabled": true,
      "syncSubfolders": true,
      "lastSyncAt": "2025-06-15T10:30:00Z",
      "syncError": null
    }
  ]
}
Response (not connected):
{
  "connected": false
}

Folder Browsing

List Folders

GET /v1/organization/:organization/google-drive/folders
FieldValue
AuthRequired
PermissioncanViewOrganization
Browse Google Drive folders. If parentId is omitted, returns root-level folders. Query parameters:
ParameterTypeDescription
parentIdstringGoogle Drive folder ID to list children of

Sync Configuration

Create Sync Config

POST /v1/organization/:organization/google-drive/sync-config
FieldValue
AuthRequired
PermissioncanEditDocuments
Create a folder sync configuration that maps a Google Drive folder to a data room path. Request:
{
  "organization": "uuid",
  "googleFolderId": "google-folder-id",
  "googleFolderName": "Company Documents",
  "targetDataRoomPath": "/synced/company-docs",
  "syncSubfolders": true,
  "fileTypeFilter": "pdf,docx,xlsx"
}
Response:
{
  "success": true,
  "configurationId": "uuid"
}

Update Sync Config

PATCH /v1/organization/:organization/google-drive/sync-config/:id
FieldValue
AuthRequired
PermissioncanEditDocuments
Update an existing sync configuration (enable/disable, change target path, toggle subfolder sync, update file type filter).

Delete Sync Config

DELETE /v1/organization/:organization/google-drive/sync-config/:id
FieldValue
AuthRequired
PermissioncanEditDocuments
Soft-delete a sync configuration.

Sync Operations

Trigger Sync

POST /v1/organization/:organization/google-drive/sync
FieldValue
AuthRequired
PermissioncanEditDocuments
Manually trigger a sync operation. If configurationId is provided, only that configuration is synced; otherwise all enabled configurations are synced. Request:
{
  "organization": "uuid",
  "configurationId": "uuid-or-omit-for-all"
}
Response:
{
  "results": [
    {
      "configurationId": "uuid",
      "filesProcessed": 15,
      "filesAdded": 3,
      "filesUpdated": 2,
      "filesSkipped": 10,
      "filesFailed": 0
    }
  ]
}

Get Sync History

GET /v1/organization/:organization/google-drive/sync-history
FieldValue
AuthRequired
PermissioncanViewOrganization
Get the sync history for the organization (last 50 entries). Optionally filter by configurationId. Query parameters:
ParameterTypeDescription
configurationIdstringFilter by sync configuration ID
Response:
{
  "history": [
    {
      "id": "uuid",
      "configurationId": "uuid",
      "status": "completed",
      "errorMessage": null,
      "filesProcessed": 15,
      "filesAdded": 3,
      "filesUpdated": 2,
      "filesSkipped": 10,
      "filesFailed": 0,
      "startedAt": "2025-06-15T10:30:00Z",
      "completedAt": "2025-06-15T10:31:15Z",
      "triggeredAt": "2025-06-15T10:30:00Z"
    }
  ]
}