PATCH
/
syncs
/
{sync_id}
curl --request PATCH \
  --url https://app.getcensus.com/api/v1/syncs/{sync_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '{
  "label": "New Signups to Leads",
  "operation": "mirror",
  "source_attributes": {
    "connection_id": 12,
    "object": {
      "type": "model",
      "name": "test_ads"
    }
  },
  "destination_attributes": {
    "connection_id": 15,
    "object": "user_data"
  },
  "alert_attributes": [
    {
      "type": "FailureAlertConfiguration",
      "send_for": "first_time",
      "should_send_recovery": true,
      "options": null
    },
    {
      "type": "InvalidRecordPercentAlertConfiguration",
      "send_for": "every_time",
      "should_send_recovery": false,
      "options": {
        "threshold": 10
      }
    }
  ],
  "mappings": [
    {
      "from": {
        "type": "column",
        "data": "hashed_email"
      },
      "to": "user_identifier.hashed_email_PREHASHED",
      "is_primary_identifier": true
    },
    {
      "from": {
        "type": "column",
        "data": "list_id"
      },
      "to": "list_id",
      "lookup_object": "user_list",
      "lookup_field": "name"
    },
    {
      "from": {
        "type": "constant_value",
        "data": {
          "value": "cohort_1",
          "basic_type": "text"
        }
      },
      "to": "cohort"
    }
  ],
  "advanced_configuration": {
    "data_source_country": "US, GB",
    "bulk_id_lookup": true
  },
  "mode": {
    "type": "triggered",
    "triggers": {
      "schedule": {
        "frequency": "daily",
        "hour": 10,
        "minute": 30
      }
    }
  },
  "paused": true,
  "field_behavior": "sync_all_properties",
  "field_normalization": "snake_case",
  "high_water_mark_attributes": {
    "use_high_water_mark_diff_type": true,
    "column_name": "updated_at"
  },
  "validate_only": true,
  "failed_run_notifications_enabled": true,
  "failed_record_notifications_enabled": true,
  "failed_record_notifications_threshold_percent": 10
}'
{
  "status": "updated",
  "data": {
    "id": 90967,
    "email": "newuser@example.com",
    "created_at": "2023-09-22T20:25:45.185Z",
    "created_by_id": 13,
    "claimed_at": "2023-09-22T20:25:45.185Z",
    "claimed_by_id": 11,
    "role": "admin",
    "associated_workspace_invitations": [
      {
        "id": 90967,
        "workspace_id": 1234,
        "role": "Viewer"
      }
    ]
  }
}

Authorizations

Authorization
string
headerrequired

Bearer token for the current workspace. Can be retrieved from the Workspace's settings page.

Path Parameters

sync_id
integer
required

ID of the sync

Body

application/json
label
string

A label to give to this sync.

operation
enum<string>
required

How records are synced to the destination.

Available options:
append,
insert,
mirror,
update,
upsert
source_attributes
object
required

Attributes used to identify the data source for this sync.

destination_attributes
object
required
alert_attributes
object[]
mappings
object[]
required
advanced_configuration
object

Set of key-value pairs that describe advanced configuration options for specific destination object types. See the specific destination's documentation for more information on available options.

mode
object

Specify run mode for the sync.

paused
boolean

Whether or not this sync should be paused.

field_behavior
string

Specify "sync_all_properties" to automatically update mappings.

field_normalization
enum<string>

If field_behavior is set to "sync_all_properties", specify how automatic mappings should be named.

Available options:
start_case,
lower_case,
upper_case,
camel_case,
snake_case,
match_source_names
high_water_mark_attributes
object

The high water mark diffing strategy will allow append syncs to use a timestamp column when identifying new records instead of the default Census diff engine (using primary keys).

validate_only
boolean
default: false

When true, checks if the given payload is valid to configure a sync. Does not create the sync.

failed_run_notifications_enabled
boolean
default: truedeprecated

When true, will email all workspace users with email notifications enabled and all workspace additional emails when the sync fails and recovers. DEPRECATION WARNING -- This field will soon be deprecated in favor of the alert_attributes object. If both this field and the alert_attributes object are present, the alert_attributes object will take precedence.

failed_record_notifications_enabled
boolean
default: truedeprecated

When true, will email all workspace users with email notifications enabled and all workspace additional emails when the sync has more than failed_record_notifications_threshold_percent rejected or invalid records in the source or destination. DEPRECATION WARNING -- This field will soon be deprecated in favor of the alert_attributes object. If both this field and the alert_attributes object are present, the alert_attributes object will take precedence.

failed_record_notifications_threshold_percent
integer
default: 75deprecated

The percentage of rejected and invalid records for which failed record emails will be triggered. DEPRECATION WARNING -- This field will soon be deprecated in favor of the alert_attributes object. If both this field and the alert_attributes object are present, the alert_attributes object will take precedence.

Response

200 - application/json
status
enum<string>
required

The outcome of the update request

Available options:
updated
data
object
required