For AI agents: a documentation index is available at the root level at /llms.txt and /llms-full.txt. Append /llms.txt to any URL for a page-level index, or .md for the markdown version of any page.
Log inBook a demo
GuidesAPI Reference
GuidesAPI Reference
  • Getting started
    • Introduction
    • IP Whitelisting
    • Obtaining API keys
    • LLMs.txt
    • MCP server
    • Quickstart
    • Native clients
    • Concepts
    • Embedding authentication
    • Multitenancy
    • Versioning
    • Idempotent requests
    • Events
    • Self-hosted option
    • 2025-09-18 Migration Guide
  • Configuring your connections
    • Overview
    • CDC streaming from databases
    • Syncing to custom webhooks
  • Code examples
    • Overview
    • Bulk sync (ELT) from HubSpot to PostgreSQL
    • Bulk sync (ELT) from Salesforce to S3
    • Bulk sync (ELT) from Salesforce to Snowflake
    • Model sync (Reverse ETL) from Snowflake query to Salesforce
    • Model sync (Reverse ETL) from MongoDB to Salesforce
    • Adding users from Snowflake to Salesloft Cadence
    • Adding contacts from Snowflake to Gong Engage
    • Joined model sync from Postgres, Airtable, and Stripe to Hubspot
    • Model sync from MySQL to Snowflake
    • Model sync from Salesforce to Netsuite
    • Querying Salesforce using SOQL
    • Syncing audiences from Snowflake to LinkedIn Ads
    • Syncing contacts from Google Cloud Storage to Salesforce
    • Syncing contacts from Google Cloud Storage to webhooks
    • Transactional calls with LinkedIn Ads audiences
  • Terraform examples
    • Overview
    • Model sync (Reverse ETL) from BigQuery to Salesforce
    • Model sync (Reverse ETL) from BigQuery to LinkedIn Ads
Logo
Log inBook a demo
On this page
  • Code
  • 1. Create a webhook Connection
  • 2. Create a Google Cloud Storage Connection
  • 3. Verify Connection readiness
  • 4. Create a source model over the GCS CSV
  • 5. Sync the GCS model to the webhook
Code examples

Syncing contacts from Google Cloud Storage to webhooks

Was this page helpful?
Previous

Transactional calls with LinkedIn Ads audiences

Next

Code

Set your Polytomic API key as an environment variable:

$export POLYTOMIC_API_KEY=YOUR-API-TOKEN

This example covers five steps:

  1. Create a webhook Connection.
  2. Create a Google Cloud Storage Connection.
  3. Verify the Connection is ready.
  4. Create a model over a Google Cloud Storage CSV file.
  5. Sync the model to your webhook.

1. Create a webhook Connection

Create the webhook Connection through Polytomic Connect’s embedded authentication or the Create Connection endpoint. See the webhook configuration reference for the required fields.

2. Create a Google Cloud Storage Connection

The following request creates a Google Cloud Storage Connection.

cURL
Python
Typescript
Go
$curl --request POST \
> --url https://app.polytomic.com/api/connections \
> --header "accept: application/json" \
> --header "content-type: application/json" \
> --header "X-Polytomic-Version: 2025-09-18" \
> --header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
> -d '{"name": "Google Cloud Storage Connection","type": "gcs", "configuration": { "service_account": "${GOOGLE_SERVICE_ACCOUNT_JSON_KEY}", "bucket": "gcs://mybucket/mypath"}}'

3. Verify Connection readiness

Before syncing, poll the Get Schema Status endpoint for your Google Cloud Storage Connection ID until cache_status is true. Once it is, the Connection is ready to use.

4. Create a source model over the GCS CSV

Next, create a model over a CSV file in Google Cloud Storage (GCS). A model is a view — a collection of fields you can sync to other systems in whole or in part.

Call the Create Model endpoint to expose every column in high_paying_users.csv:

cURL
Python
Typescript
Go
$curl --request POST \
> --url https://app.polytomic.com/api/models \
> --header "accept: application/json" \
> --header "content-type: application/json" \
> --header "X-Polytomic-Version: 2025-09-18" \
> --header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
> -d '{
> "name": "GCS Contacts",
> "configuration": {
> "model_from": "single_file",
> "key": "high_paying_users.csv"
> },
> "connection_id": "YOUR_GCS_CONNECTION_ID"
> }'

5. Sync the GCS model to the webhook

The sync sends email, first_name, and last_name from the GCS model to the webhook. Add more entries to the fields array to sync additional columns.

Create the sync with the Create Sync endpoint:

cURL
TypeScript
Python
Go
$curl --request POST \
> --url https://app.polytomic.com/api/syncs \
> --header "accept: application/json" \
> --header "content-type: application/json" \
> --header "Authorization: Bearer ${POLYTOMIC_API_KEY}" \
> -d '{
> "name": "Sync GCS to Webhook",
> "active": true,
> "mode": "updateOrCreate",
> "fields": [
> {
> "source": {
> "field": "email_address",
> "model_id": "YOUR_MODEL_ID"
> },
> "target": "record"
> },
> {
> "source": {
> "field": "first_name",
> "model_id": "YOUR_MODEL_ID"
> },
> "target": "record"
> },
> {
> "source": {
> "field": "last_name",
> "model_id": "YOUR_MODEL_ID"
> },
> "target": "record"
> }
> ],
> "target": {
> "connection_id": "YOUR_WEBHOOK_CONNECTION_ID",
> "object": "http",
> "configuration": {
> "batch_size": 100,
> "record_requests": true
> }
> },
> "schedule": {
> "frequency": "manual"
> }
> }'

This example uses a manual schedule, so the sync runs only when you trigger it. Use a manual schedule when you drive syncs from your own orchestration. To run the sync on a recurring schedule instead, set a different schedule frequency.