v1

latestOpenAPI 3.0.32026-08-06138294578.6 KB
Bulk Sync

Create Bulk Sync

Creates a new bulk sync.

Bulk syncs are used for the ELT pattern (Extract, Load, and Transform), where you want to sync un-transformed data to your data warehouses, databases, or cloud storage buckets like S3.

All of the functionality described in the product documentation is configurable via the API.

Sample code examples:

  • Bulk sync (ELT) from Salesforce to S3
  • Bulk sync (ELT) from Salesforce to Snowflake
  • Bulk sync (ELT) from HubSpot to PostgreSQL

Connection specific configuration

The destination_configuration is integration-specific configuration for the selected bulk sync destination. This includes settings such as the output schema and is required when creating a new sync.

The source_configuration is optional. It allows configuration for how Polytomic reads data from the source connection. This will not be available for integrations that do not support additional configuration.

Consult the connection configurations to see configurations for particular integrations (for example, here is the available source configuration for the PostgreSQL bulk sync source).

Defaults and selection behavior

If schemas is omitted, the sync is created with all available source schemas selected. Pass schemas explicitly if you want the initial sync to include only a subset of tables or objects.

Schedule times are interpreted in UTC.

When omitted, automatic discovery defaults are conservative:

  • automatically_add_new_objects defaults to not enabling newly discovered source objects automatically.
  • automatically_add_new_fields defaults to enabling newly discovered fields on already selected objects.
  • normalize_names defaults to enabled.
post/api/bulk/syncs

Headers

X-Polytomic-Versionstring

Request body

activeboolean nullable

Whether the sync is active. Inactive syncs do not run on their schedule but can still be triggered manually.

automatically_add_new_fields'all' | 'onlyIncremental' | 'onlyNonIncremental' | 'none' nullable
automatically_add_new_objects'all' | 'onlyIncremental' | 'onlyNonIncremental' | 'none' nullable
concurrency_limitinteger nullable

Override the default concurrency limit for this sync.

data_cutoff_timestampstring date-time nullable

Global cutoff applied across schemas. Source records older than this timestamp are excluded from sync runs.

destination_configurationobject required

Destination-specific bulk sync configuration (e.g. output schema name, file format). The accepted keys depend on the destination connection type.

destination_connection_idstring uuid required

Unique identifier of the connection rows are written to.

disable_record_timestampsboolean nullable

When true, Polytomic will not add its own timestamp columns to destination rows.

mode'snapshot' | 'replicate' nullable required
namestring required

Human-readable name for the bulk sync.

normalize_names'enabled' | 'disabled' | 'legacy' nullable
organization_idstring uuid nullable

Organization the sync is created in. Only used by partner callers; normal callers always create syncs in their own organization.

policiesstring[] nullable

Identifiers of permissions policies applied to the bulk sync.

resync_concurrency_limitinteger nullable

Override the default resync concurrency limit for this sync.

source_configurationobject nullable

Source-specific bulk sync configuration (e.g. replication slot name, sync lookback). The accepted keys depend on the source connection type.

source_connection_idstring uuid required

Unique identifier of the connection rows are read from.

Example request

{
  "active": true,
  "additional_schedules": [
    {
      "day_of_week": "monday",
      "frequency": "weekly",
      "hour": "12",
      "minute": "30",
      "selective_mode": "nonincrementalFields"
    },
    {
      "frequency": "continuous",
      "selective_mode": "incrementalFields"
    }
  ],
  "concurrency_limit": 50,
  "data_cutoff_timestamp": "2023-04-25T12:00:00Z",
  "default_schedule": {
    "day_of_month": "1",
    "day_of_week": "monday",
    "hour": "12",
    "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "minute": "30",
    "month": "1"
  },
  "destination_configuration": {
    "schema": "my_schema"
  },
  "destination_connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
  "name": "My Bulk Sync",
  "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
  "policies": [
    "248df4b7-aa70-47b8-a036-33ac447e668d"
  ],
  "resync_concurrency_limit": 10,
  "schemas": [
    {
      "data_cutoff_timestamp": "2023-04-25T12:00:00Z",
      "disable_data_cutoff": true,
      "enabled": true,
      "fields": [
        {
          "enabled": true,
          "obfuscate": true
        }
      ],
      "filters": [
        {
          "field_id": "field1",
          "value": "value"
        }
      ]
    }
  ],
  "source_configuration": {
    "replication_slot": "slot"
  },
  "source_connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d"
}

Response

OK

Example response

{
  "data": {
    "active": true,
    "additional_schedules": [
      {
        "created_at": "2023-04-25T12:00:00Z",
        "created_by": {
          "id": "12345678-1234-1234-1234-123456789012",
          "name": "John Doe",
          "type": "user"
        },
        "day_of_week": "monday",
        "frequency": "weekly",
        "hour": "12",
        "minute": "30",
        "selective_mode": "nonincrementalFields",
        "updated_at": "2023-04-25T12:00:00Z",
        "updated_by": {
          "id": "12345678-1234-1234-1234-123456789012",
          "name": "John Doe",
          "type": "user"
        }
      },
      {
        "created_at": "2023-04-25T12:00:00Z",
        "created_by": {
          "id": "12345678-1234-1234-1234-123456789012",
          "name": "John Doe",
          "type": "user"
        },
        "frequency": "continuous",
        "selective_mode": "incrementalFields",
        "updated_at": "2023-04-25T12:00:00Z",
        "updated_by": {
          "id": "12345678-1234-1234-1234-123456789012",
          "name": "John Doe",
          "type": "user"
        }
      }
    ],
    "concurrency_limit": 50,
    "created_by": {
      "id": "12345678-1234-1234-1234-123456789012",
      "name": "John Doe",
      "type": "user"
    },
    "data_cutoff_timestamp": "2023-04-25T12:00:00Z",
    "default_schedule": {
      "created_by": {
        "id": "12345678-1234-1234-1234-123456789012",
        "name": "John Doe",
        "type": "user"
      },
      "day_of_month": "1",
      "day_of_week": "monday",
      "hour": "12",
      "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
      "minute": "30",
      "month": "1",
      "updated_by": {
        "id": "12345678-1234-1234-1234-123456789012",
        "name": "John Doe",
        "type": "user"
      }
    },
    "destination_configuration": {
      "schema": "my_schema"
    },
    "destination_connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "name": "My Bulk Sync",
    "organization_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "policies": [
      "248df4b7-aa70-47b8-a036-33ac447e668d"
    ],
    "resync_concurrency_limit": 10,
    "source_configuration": {
      "replication_slot": "slot"
    },
    "source_connection_id": "248df4b7-aa70-47b8-a036-33ac447e668d",
    "updated_by": {
      "id": "12345678-1234-1234-1234-123456789012",
      "name": "John Doe",
      "type": "user"
    }
  }
}