Skip to main content
The Google Cloud Storage (GCS) connector lets FlexOrch pull files directly from your GCS bucket using a service account. Once connected, you can reference the connector in processing requests or pair it with Scheduled Sync to automatically process new files as they arrive.

Prerequisites

Before you create the connector, make sure you have the following ready:
  • An active Google Cloud project
  • A GCS bucket containing the documents you want to ingest
  • A service account with the following IAM permissions on the target bucket:
    • storage.objects.get
    • storage.objects.list
  • A service account JSON key file downloaded from the Google Cloud Console

Create the connector

Send a POST /v1/connectors request with type: "gcs" and your project and bucket details in the config object. Pass the contents of your service account JSON key file as a JSON-encoded string in credentials_json.
curl -X POST https://api.flexorch.com/v1/connectors \
  -H "X-API-KEY: dfx_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "type": "gcs",
    "name": "my-gcs-connector",
    "config": {
      "project_id": "my-gcp-project",
      "bucket": "my-documents",
      "credentials_json": "{\"type\": \"service_account\", \"project_id\": \"my-gcp-project\", ...}"
    }
  }'
After creating the connector, test it to confirm FlexOrch can reach your bucket:
cURL
curl -X POST https://api.flexorch.com/v1/connectors/43/test \
  -H "X-API-KEY: dfx_your_key_here"
Service account keys grant access to your GCP resources — treat them like passwords. FlexOrch encrypts your connector configuration at rest, but you should rotate keys regularly and follow the principle of least privilege when assigning roles.

Ingest files from GCS

With the connector in place, pass its id as source.connector_id and supply an array of GCS object names you want to process.
cURL
curl -X POST https://api.flexorch.com/v1/data-process/async \
  -H "X-API-KEY: dfx_your_key_here" \
  -H "Content-Type: application/json" \
  -d '{
    "source": {
      "connector_id": 43,
      "keys": [
        "reports/2024/q3_summary.pdf",
        "reports/2024/q4_summary.pdf"
      ]
    }
  }'

Config field reference

project_id
string
required
The ID of the Google Cloud project that owns the bucket (e.g., my-gcp-project).
bucket
string
required
The name of the GCS bucket FlexOrch will read from.
credentials_json
string
required
The full contents of your service account JSON key file, serialized as a JSON string. You can generate this key in the Google Cloud Console under IAM & Admin → Service Accounts.
prefix
string
An optional object prefix (folder path) used as the default scope for Scheduled Sync — for example, documents/incoming/. Only objects under this prefix will be polled.