Mixpeek reads files directly from Google Drive — personal folders, shared drives, and team collaboration folders. You create a storage connection (how to authenticate), then a bucket sync that points at a folder. New and changed files are picked up automatically.
Mixpeek only reads from your Drive. It never writes or deletes files in your Drive.
1. Authenticate
Two auth methods are supported. Service account is recommended for unattended, server-to-server sync.
- In Google Cloud Console, create a service account and download its JSON key.
- Share the target Drive folder (or shared drive) with the service account’s
client_email — this is what grants Mixpeek access. Viewer permission is enough.
- Create the connection with the fields from the JSON key file:
curl -sS -X POST "$MP_API_URL/v1/connections" \
-H "Authorization: Bearer $MP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Marketing Google Drive",
"provider_type": "google_drive",
"provider_config": {
"provider_type": "google_drive",
"credentials": {
"type": "service_account",
"project_id": "my-project",
"private_key_id": "<from JSON key file>",
"private_key": "-----BEGIN PRIVATE KEY-----\n...\n-----END PRIVATE KEY-----\n",
"client_email": "sync@my-project.iam.gserviceaccount.com",
"client_id": "<from JSON key file>"
},
"shared_drive_id": "0AH-Xabc123"
}
}'
shared_drive_id is optional — include it only when syncing a shared drive (find it in the drive’s URL). For a folder in a regular My Drive, omit it and point the sync at the folder ID instead (step 2). private_key and the other secrets are encrypted at rest.Use OAuth when syncing a specific user’s Drive. Supply a client ID/secret and a long-lived refresh token:curl -sS -X POST "$MP_API_URL/v1/connections" \
-H "Authorization: Bearer $MP_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "My Drive",
"provider_type": "google_drive",
"provider_config": {
"provider_type": "google_drive",
"credentials": {
"type": "oauth",
"client_id": "<oauth client id>",
"client_secret": "<oauth client secret>",
"refresh_token": "<long-lived refresh token>"
}
}
}'
The response includes a connection_id (conn_...).
List folders and files the connection can see with GET /v1/connections/{connection_id}/google-drive/folders and …/files — handy for finding the folder ID to sync.
2. Sync a folder into a bucket
Create a bucket first, then attach a sync. source_path is the Drive folder ID (the trailing segment of the folder’s URL, e.g. 1A2b3C...):
curl -sS -X POST "$MP_API_URL/v1/buckets/$BUCKET_ID/syncs" \
-H "Authorization: Bearer $MP_API_KEY" \
-H "X-Namespace: $MP_NAMESPACE" \
-H "Content-Type: application/json" \
-d '{
"provider_type": "google_drive",
"connection_id": "conn_abc123",
"sync_config": {
"source_path": "1A2b3C4d5E6f7G8h9I",
"sync_mode": "continuous",
"polling_interval_seconds": 3600
}
}'
Then trigger the first sync:
curl -sS -X POST "$MP_API_URL/v1/buckets/$BUCKET_ID/syncs/$SYNC_ID/trigger" \
-H "Authorization: Bearer $MP_API_KEY" -H "X-Namespace: $MP_NAMESPACE"
After the initial sync, new and changed files in the folder are picked up automatically at the polling interval. See Syncs for file/metadata filters, on_delete cascade behavior, and monitoring.
Next steps