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 '{
  "advanced_configuration": {
    "bulk_id_lookup": true,
    "data_source_country": "US, GB"
  },
  "alert_attributes": [
    {
      "options": null,
      "send_for": "first_time",
      "should_send_recovery": true,
      "type": "FailureAlertConfiguration"
    },
    {
      "options": {
        "threshold": 10
      },
      "send_for": "every_time",
      "should_send_recovery": false,
      "type": "InvalidRecordPercentAlertConfiguration"
    }
  ],
  "cron_expression": "* 1 * * *",
  "destination_attributes": {
    "connection_id": 123,
    "lead_union_insert_to": "<string>",
    "object": "<string>"
  },
  "failed_record_notifications_enabled": true,
  "failed_record_notifications_threshold_percent": 10,
  "failed_run_notifications_enabled": true,
  "field_behavior": "sync_all_properties",
  "field_normalization": "snake_case",
  "high_water_mark_attributes": {
    "column_name": "updated_at",
    "use_high_water_mark_diff_type": true
  },
  "label": "New Signups to Leads",
  "mappings": [
    {
      "from": {
        "data": "hashed_email",
        "type": "column"
      },
      "is_primary_identifier": true,
      "to": "user_identifier.hashed_email_PREHASHED"
    },
    {
      "from": {
        "data": "list_id",
        "type": "column"
      },
      "lookup_field": "name",
      "lookup_object": "user_list",
      "to": "list_id"
    },
    {
      "from": {
        "data": {
          "basic_type": "text",
          "value": "cohort_1"
        },
        "type": "constant_value"
      },
      "to": "cohort"
    }
  ],
  "operation": "mirror",
  "paused": true,
  "schedule_day": "Monday",
  "schedule_frequency": "daily",
  "schedule_hour": 10,
  "schedule_minute": 30,
  "source_attributes": {
    "connection_id": 123,
    "filter_segment_id": 123,
    "object": {
      "id": 1543,
      "name": "New Signups",
      "table_catalog": "data_mart",
      "table_name": "events",
      "table_schema": "publish",
      "type": "table"
    }
  },
  "triggers": {
    "dbt_cloud": {
      "job_id": "123456",
      "project_id": "12345"
    },
    "fivetran": {
      "job_id": "test_job_id",
      "job_name": "test_job_name"
    },
    "sync_sequence": {
      "sync_id": 123
    }
  },
  "validate_only": true
}'
{
  "data": {
    "associated_workspace_invitations": [
      {
        "id": 90967,
        "role": "Viewer",
        "workspace_id": 1234
      }
    ],
    "claimed_at": "2023-09-22T20:25:45.185Z",
    "claimed_by_id": 11,
    "created_at": "2023-09-22T20:25:45.185Z",
    "created_by_id": 13,
    "email": "newuser@example.com",
    "id": 90967,
    "role": "admin"
  },
  "status": "updated"
}

Authorizations

Authorization
string
headerrequired

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

sync_id
integer
required

ID of the sync

Body

application/json
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.

alert_attributes
object[]
cron_expression
string

Specify what cron schedule this sync should run on if the schedule_frequency is set to "experessions".

destination_attributes
object
required
failed_record_notifications_enabled
boolean
default: true

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: 75

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.

failed_run_notifications_enabled
boolean
default: true

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.

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).

label
string

A label to give to this sync.

mappings
object[]
required
operation
enum<string>
required

How records are synced to the destination.

Available options:
append,
insert,
mirror,
update,
upsert
paused
boolean

Whether or not this sync should be paused.

schedule_day
enum<string>

What day of the week this sync should run if schedule_frequency is set to "weekly".

Available options:
Sunday,
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday
schedule_frequency
enum<string>

When this sync should be run.

Available options:
never,
continuous,
quarter_hourly,
hourly,
daily,
weekly,
expression
schedule_hour
integer

What hour of the day this sync should run if schedule_frequency is set to "weekly" or "daily".

schedule_minute
integer

What minute of the hour this sync should run if scheule_frequency is set to "weekly", "daily" or "hourly".

source_attributes
object
required

Attributes used to identify the data source for this sync.

triggers
object

Specify triggers for the sync. More than one type trigger can be configured.

validate_only
boolean
default: false

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

Response

200 - application/json
data
object
required
status
enum<string>
required

The outcome of the update request

Available options:
updated