API
This page describes how to use the Census API to manage your connections and syncs.
The Census API lets you integrate core bits of Census's functionality right into your workflows. You can view information about your connections and syncs, as well as create and trigger syncs. Each endpoint returns a status field and either a data object or a single value providing context on what was requested.
In the documentation below, tables that include Response Property detail the results of the entire response. Tables that include Data Property detail the relevant bits of info in the top level data attribute of the response. Tables that include Attributes detail relevant bits of info for nested objects used in requests.

GET /sources

This endpoint will list all of your data sources, such as your connected data warehouse. For information on models and tables associated with a source, query the endpoints for data_sources, models, and tables as described below.
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/sources
Copied!
1
{
2
"status": "success",
3
"data": [
4
{
5
"id": 4,
6
"name": "Snowflake - xxxxxxx.us-east-1",
7
"label": null,
8
"last_test_succeeded": null,
9
"last_tested_at": null,
10
"connection_details": {
11
"account": "xxxxxxx.us-east-1",
12
"user": "DEV",
13
"warehouse": "TEST",
14
"use_keypair": false
15
},
16
"read_only_connection": false
17
},
18
{
19
"id": 10,
20
"name": "BigQuery - Development",
21
"label": "BigQuery",
22
"last_test_succeeded": true,
23
"last_tested_at": "2021-10-07T20:02:19.544Z",
24
"connection_details": {
25
"project_id": "development",
26
"location": "US",
27
"service_account": "xxxxxx.iam.gserviceaccount.com",
28
"location_editable": false
29
},
30
"read_only_connection": false
31
}
32
]
33
}
Copied!
Data Property
Description
List of sources
A list containing information on each source. The properties of a source are described in the next endpoint.
​

GET /sources/[ID]

This endpoint lists information on a specific source.
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/sources/[ID]
Copied!
1
{
2
"status": "success",
3
"data": {
4
"id": 4,
5
"name": "Snowflake - xxxxxxx.us-east-1",
6
"label": null,
7
"last_test_succeeded": null,
8
"last_tested_at": null,
9
"connection_details": {
10
"account": "xxxxxxx.us-east-1",
11
"user": "DEV",
12
"warehouse": "TEST",
13
"use_keypair": false
14
},
15
"read_only_connection": false
16
}
17
}
Copied!
Data Property
Description
id
The id of this source.
name
The name of this source.
label
The label assigned to this source.
last_test_succeeded
Whether or not the last connection test on this source was successful.
last_tested_at
When the last connection test was ran on this source.
connection_details
Connection details associated with this source.
read_only_connection
Whether or not Census has write permissions, for tracking sync state, on this source.
data_sources
A list of models and tables associated with this source. Model and table properties are described in their respective endpoints below.

GET /sources/[ID]/data_sources

This endpoint returns a list of all the data sources (i.e. tables and models) that this source connection contains.
You can pass the following URL parameters to control the response:
  • order - asc or desc. Sorts the sync runs ascending or descending by creation time
  • page - What offset of results to return
  • per_page - How many results to return
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/sources/[ID]/data_sources
Copied!
1
{
2
"status": "success",
3
"data": [
4
{
5
"type": "table",
6
"id": 2,
7
"table_catalog": "public",
8
"table_schema": "development",
9
"table_name": "test"
10
},
11
{
12
"type": "model",
13
"id": 15,
14
"name": "braze_test",
15
"created_at": "2021-10-11T20:52:58.293Z",
16
"updated_at": "2021-10-14T23:15:18.508Z",
17
"query": "select cast('[email protected]' as VARCHAR(2000)) as email, cast('HAAAA' as VARCHAR(2000)) as random_prop"
18
},
19
{
20
"type": "model",
21
"id": 18,
22
"name": "airtable_test",
23
"created_at": "2021-10-20T02:43:07.120Z",
24
"updated_at": "2021-10-20T02:50:35.477Z",
25
"query": "select cast('testid1' as VARCHAR(2000)) as company_id, cast('company0' as VARCHAR(2000)) as name, cast('test0' as VARCHAR(2000)) as about, array_construct(cast('newindustry' as VARCHAR(2000))) as industries, array_construct(cast('jim' as VARCHAR(2000))) as users\n"
26
},
27
{
28
"type": "model",
29
"id": 3,
30
"name": "google_ads_test",
31
"created_at": "2021-10-06T21:26:44.206Z",
32
"updated_at": "2021-10-06T21:39:32.914Z",
33
"query": "select cast('[email protected]' as VARCHAR(2000)) as email, array_construct(cast('audience_v1' as VARCHAR(2000))) as list_id\n"
34
}
35
]
36
}
Copied!
Data Property
Description
List of data sources
Tables and models associated with this connection. Properties are described in the following endpoints.

​

GET /sources/[ID]/models/[ID]

This endpoint lists information for a given model, including information on what columns it includes.
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/sources/[ID]/models/[ID]
Copied!
1
{
2
"status": "success",
3
"data": {
4
"type": "model",
5
"id": 18,
6
"name": "airtable_test",
7
"created_at": "2021-10-20T02:43:07.120Z",
8
"updated_at": "2021-10-20T02:50:35.477Z",
9
"query": "select cast('test1' as VARCHAR(2000)) as company_id, cast('company0' as VARCHAR(2000)) as name, cast('test0' as VARCHAR(2000)) as about, array_construct(cast('newindustry' as VARCHAR(2000))) as industries\n",
10
"columns": [
11
{
12
"name": "ABOUT",
13
"type": "text (2000)"
14
},
15
{
16
"name": "NAME",
17
"type": "text (2000)"
18
},
19
{
20
"name": "COMPANY_ID",
21
"type": "text (2000)"
22
},
23
{
24
"name": "INDUSTRIES",
25
"type": "array"
26
}
27
]
28
}
29
}
Copied!
Data Property
Description
type
The type of this data source, will always be model.
id
The id of this model.
name
The name of this model.
query
The SQL query associated with this model.
created_at
When this model was created.
updated_at
When this model was last updated.
compiled_query
The compiled query associated with this model if it is built atop a DBT instance.
columns
A list of columns from this model, each with two properties:
  • name - The name of the column
  • type - The data type of the column
​

GET /sources/[ID]/tables/[ID]

This endpoint lists information for a given table, including information on what columns it includes.
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/sources/[ID]/tables/[ID]
Copied!
1
{
2
"status": "success",
3
"data": {
4
"type": "table",
5
"id": 2,
6
"table_catalog": "public",
7
"table_schema": "development",
8
"table_name": "test",
9
"columns": [
10
{
11
"name": "ABOUT",
12
"type": "text (2000)"
13
},
14
{
15
"name": "CUSTOMER_ID",
16
"type": "text (2000)"
17
},
18
{
19
"name": "NAME",
20
"type": "text (2000)"
21
},
22
{
23
"name": "INDUSTRIES",
24
"type": "array"
25
}
26
]
27
}
28
}
Copied!
Data Property
Description
type
The type of this data source, will always be table.
id
The id of this table.
table_catalog
The catalog associated with this table.
table_schema
The schema associated with this table.
table_name
The name of this table.
columns
A list of columns from this table, each with two properties:
  • name - The name of the column
  • type - The data type of the column
​

GET /destinations

This endpoint will list all of your connected destinations. For information on objects associated with a destination, query the endpoint for a specific destination as described below.
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/destinations
Copied!
1
{
2
"status": "success",
3
"data": [
4
{
5
"id": 12,
6
"name": "Google Sheets",
7
"connection_details": {
8
"service_account_email": "xxxxxxx.iam.gserviceaccount.com"
9
}
10
},
11
{
12
"id": 6,
13
"name": "Google Ads Dev",
14
"connection_details": {
15
"account_id": 7515011393,
16
"account_name": "Manager Account Test"
17
}
18
},
19
{
20
"id": 15,
21
"name": "Braze",
22
"connection_details": {
23
"instance_url": "https://rest.iad-03.braze.com"
24
}
25
},
26
{
27
"id": 14,
28
"name": "HubSpot",
29
"credentials": {}
30
}
31
]
32
}
Copied!
Data Property
Description
List of destinations
A list containing information on each destination. The properties of a destination are described in the next endpoint.
​

GET /destinations/[ID]

This endpoint lists information on a specific destination.
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/destinations/[ID]
Copied!
1
{
2
"status": "success",
3
"data": {
4
"id": 15,
5
"name": "Braze",
6
"connection_details": {
7
"instance_url": "https://rest.iad-03.braze.com"
8
},
9
"objects": [
10
{
11
"label": "User",
12
"full_name": "user",
13
"allow_custom_fields": true,
14
"allow_case_sensitive_field_names": true
15
},
16
{
17
"label": "Event",
18
"full_name": "event",
19
"allow_custom_fields": true,
20
"allow_case_sensitive_field_names": true
21
}
22
]
23
}
24
}
Copied!
Data Property
Description
id
The id of this destination.
name
The name of this source.
connection_details
Connection details associated with this source.
objects
A list of objects associated with this source. The properties of an object are described in the objects endpoint below.
​

GET /destinations/[ID]/objects/[OBJECT_FULL_NAME]

This endpoint lists information for a given object, including information on what fields it includes.
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/destinations/[ID]/objects/[OBJECT_FULL_NAME]
Copied!
1
{
2
"status": "success",
3
"data": {
4
"label": "User",
5
"full_name": "user",
6
"allow_custom_fields": true,
7
"allow_case_sensitive_field_names": true,
8
"fields": [
9
{
10
"label": "First Name",
11
"full_name": "first_name",
12
"createable": true,
13
"updateable": true,
14
"operations": [],
15
"array": false,
16
"preserve_values_supported": false,
17
"required_for_mapping": false,
18
"can_be_upsert_key": false,
19
"can_be_update_key": false,
20
"can_be_insert_key": false,
21
"can_be_reference_key": false,
22
"lookup_object": null,
23
"type": "String"
24
},
25
{
26
"label": "Last Name",
27
"full_name": "last_name",
28
"createable": true,
29
"updateable": true,
30
"operations": [],
31
"array": false,
32
"preserve_values_supported": false,
33
"required_for_mapping": false,
34
"can_be_upsert_key": false,
35
"can_be_update_key": false,
36
"can_be_insert_key": false,
37
"can_be_reference_key": false,
38
"lookup_object": null,
39
"type": "String"
40
},
41
{
42
"label": "Company",
43
"full_name": "company",
44
"createable": true,
45
"updateable": true,
46
"operations": [],
47
"array": false,
48
"preserve_values_supported": false,
49
"required_for_mapping": false,
50
"can_be_upsert_key": false,
51
"can_be_update_key": false,
52
"can_be_insert_key": false,
53
"can_be_reference_key": false,
54
"lookup_object": "company",
55
"type": "String"
56
},
57
{
58
"label": "External User ID",
59
"full_name": "external_id",
60
"createable": true,
61
"updateable": true,
62
"operations": [],
63
"array": false,
64
"preserve_values_supported": false,
65
"required_for_mapping": false,
66
"can_be_upsert_key": true,
67
"can_be_update_key": true,
68
"can_be_insert_key": true,
69
"can_be_reference_key": true,
70
"lookup_object": null,
71
"type": "String"
72
},
73
{
74
"label": "Email",
75
"full_name": "email",
76
"createable": true,
77
"updateable": true,
78
"operations": [],
79
"array": false,
80
"preserve_values_supported": false,
81
"required_for_mapping": false,
82
"can_be_upsert_key": false,
83
"can_be_update_key": false,
84
"can_be_insert_key": false,
85
"can_be_reference_key": false,
86
"lookup_object": null,
87
"type": "String"
88
}
89
]
90
}
91
}
Copied!
Data Property
Description
label
The label for this object.
full_name
The full name for this object. This is used to identify the object in the API.
allow_custom_fields
Whether or not you can define custom fields on this object.
allow_case_sensitive_fields
Whether or not field names and labels are case sensitive on this object.
fields
A list of fields associated with this source. Field properties are described in the table below.
​

Field Properties

Data Property
Description
label
The label for this field.
full_name
The full name for this field. This is used to identify the field in the API.
createable
Whether or not this field can be created in the destination if it doesn't exist.
updateable
Whether or not this field can be updated in the destination.
operations
For an array type, what operations are supported on this field. One of the following types:
  • overwrite - Overwrite existing values with inputted values
  • merge - Merge inputted values with existing values
array
Whether or not this field is an array type.
preserve_values_supported
If a value exists in the destination for this field, whether or not it can be overwritten by Census.
required_for_mapping
Whether or not this field is required.
can_be_upsert_key
Whether or not this field can be the primary identifier for an upsert sync.
can_be_update_key
Whether or not this field can be the primary identifier for an update only sync.
can_be_insert_key
Whether or not this field can be the primary identifier for a create only sync.
can_be_reference_key
Whether or not this field can be the identifier for a lookup on its containing object.
lookup_object
What object, if any, that this field references.
type
The type of this field.
​

GET /sync_runs/[ID]

This endpoint returns information on a specific sync run.
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/sync_runs/[ID]
Copied!
1
{
2
"status": "success",
3
"data": {
4
"id": 94,
5
"sync_id": 52,
6
"source_record_count": 1,
7
"records_processed": 1,
8
"records_updated": 1,
9
"records_failed": 0,
10
"records_invalid": 0,
11
"created_at": "2021-10-20T02:51:07.546Z",
12
"updated_at": "2021-10-20T02:52:29.236Z",
13
"completed_at": "2021-10-20T02:52:29.234Z",
14
"scheduled_execution_time": null,
15
"error_code": null,
16
"error_message": null,
17
"error_detail": null,
18
"status": "completed",
19
"canceled": false,
20
"full_sync": true,.
21
"sync_trigger_reason": {
22
"ui_tag": "Manual",
23
"ui_detail": "Manually triggered by [email protected]"
24
}
25
}
26
}
Copied!
Data Properties
Description
id
id of this sync run.
sync_id
id of the parent sync.
status
  • working if the sync is currently executing
  • completed if the sync finished successfully
  • failed if the sync failed during execution
records_processed
Number of new or updated records retrieved from the source.
records_updated
Number of records successfully sent to the destination.
records_invalid
Number of records skipped by Census because of data quality issues.
records_failed
Number of records rejected by the destination.
created_at
When this sync run was created.
updated_at
When this sync run was updated.
completed_at
When this sync run was completed.
scheduled_execution_time
When the sync run was scheduled to run.
error_code
The error code, if any.
error_message
The error message, if any.
error_detail
Details about the error, if any.
canceled
Whether or not this sync run was canceled.
full_sync
Whether or not this was a full sync.
sync_trigger_reason
Details on why this sync was run.
​

GET /syncs/[ID]/sync_runs

This endpoint returns info on the sync runs for a specific sync. You can pass the following URL parameters to control the response:
  • order - asc or desc. Sorts the sync runs ascending or descending by creation time
  • page - What offset of results to return
  • per_page - How many results to return
Request
Response
1
curl https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/syncs/[ID]/sync_runs?page=1&per_page=1&order=asc
Copied!
1
{
2
"status": "success",
3
"data": [
4
{
5
"id": 94,
6
"sync_id": 52,
7
"source_record_count": 1,
8
"records_processed": 1,
9
"records_updated": 1,
10
"records_failed": 0,
11
"records_invalid": 0,
12
"created_at": "2021-10-20T02:51:07.546Z",
13
"updated_at": "2021-10-20T02:52:29.236Z",
14
"completed_at": "2021-10-20T02:52:29.234Z",
15
"scheduled_execution_time": null,
16
"error_code": null,
17
"error_message": null,
18
"error_detail": null,
19
"status": "completed",
20
"canceled": false,
21
"full_sync": true,
22
"sync_trigger_reason": {
23
"ui_tag": "Manual",
24
"ui_detail": "Manually triggered by [email protected]"
25
}
26
},
27
{
28
"id": 93,
29
"sync_id": 52,
30
"source_record_count": 1,
31
"records_processed": null,
32
"records_updated": null,
33
"records_failed": null,
34
"records_invalid": 0,
35
"created_at": "2021-10-20T02:48:40.373Z",
36
"updated_at": "2021-10-20T02:49:53.430Z",
37
"completed_at": null,
38
"scheduled_execution_time": null,
39
"error_code": "JSON_ARRAY_ERROR",
40
"error_message": "The array field being used does not appear to be valid JSON: Please make sure the field \"custom_field:Users\" with value \"jim\" is formatted as a JSON Array. Don't hesitate to reach out to the Census Support Team if you need help with this.",
41
"error_detail": "Please make sure the field \"custom_field:Users\" with value \"jim\" is formatted as a JSON Array. Don't hesitate to reach out to the Census Support Team if you need help with this.",
42
"status": "failed",
43
"current_step": "Running sync",
44
"canceled": false,
45
"full_sync": true,
46
"sync_trigger_reason": {
47
"ui_tag": "Manual",
48
"ui_detail": "Manually triggered by [email protected]"
49
}
50
},
51
{
52
"id": 92,
53
"sync_id": 52,
54
"source_record_count": 1,
55
"records_processed": 1,
56
"records_updated": 1,
57
"records_failed": 0,
58
"records_invalid": 0,
59
"created_at": "2021-10-20T02:44:35.381Z",
60
"updated_at": "2021-10-20T02:45:55.949Z",
61
"completed_at": "2021-10-20T02:45:55.947Z",
62
"scheduled_execution_time": null,
63
"error_code": null,
64
"error_message": null,
65
"error_detail": null,
66
"status": "completed",
67
"canceled": false,
68
"full_sync": true,
69
"sync_trigger_reason": {
70
"ui_tag": "Manual",
71
"ui_detail": "Manually triggered by [email protected]"
72
}
73
}
74
]
75
}
Copied!
​

GET /syncs

This endpoint returns a list of your syncs.
You can pass the following URL parameters to control the response:
  • order - asc or desc. Sorts the sync runs ascending or descending by creation time
  • page - What offset of results to return
  • per_page - How many results to return
Request
Response
1
curl -X GET https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/syncs
Copied!
1
{
2
"status": "success",
3
"data": [
4
{
5
"id": 61,
6
"label": null,
7
"schedule_frequency": "never",
8
"schedule_day": null,
9
"schedule_hour": null,
10
"schedule_minute": null,
11
"created_at": "2021-10-22T00:40:11.246Z",
12
"updated_at": "2021-10-22T00:43:44.173Z",
13
"operation": "upsert",
14
"paused": false,
15
"status": "Ready",
16
"lead_union_insert_to": null,
17
"trigger_on_dbt_cloud_rebuild": false,
18
"field_behavior": "specific_properties",
19
"field_normalization": null,
20
"source_attributes": {
21
"connection_id": 4,
22
"data_source": {
23
"type": "model",
24
"id": 15,
25
"name": "braze_test",
26
"created_at": "2021-10-11T20:52:58.293Z",
27
"updated_at": "2021-10-14T23:15:18.508Z",
28
"query": "select cast('[email protected]' as VARCHAR(2000)) as email, cast('random' as VARCHAR(2000)) as random_prop"
29
}
30
},
31
"destination_attributes": {
32
"connection_id": 15,
33
"object": "user"
34
},
35
"mappings": [
36
{
37
"from": "EMAIL",
38
"to": "external_id",
39
"is_primary_identifier": true,
40
"generate_field": false,
41
"preserve_values": false,
42
"operation": null
43
},
44
{
45
"from": {
46
"value": "test",
47
"basic_type": "text"
48
},
49
"to": "first_name",
50
"is_primary_identifier": false,
51
"generate_field": false,
52
"preserve_values": false,
53
"operation": null
54
}
55
]
56
},
57
{
58
"id": 60,
59
"label": null,
60
"schedule_frequency": "never",
61
"schedule_day": null,
62
"schedule_hour": null,
63
"schedule_minute": null,
64
"created_at": "2021-10-22T00:38:32.191Z",
65
"updated_at": "2021-10-22T00:43:47.858Z",
66
"operation": "upsert",
67
"paused": false,
68
"status": "Ready",
69
"lead_union_insert_to": null,
70
"trigger_on_dbt_cloud_rebuild": false,
71
"field_behavior": "specific_properties",
72
"field_normalization": null,
73
"source_attributes": {
74
"connection_id": 4,
75
"data_source": {
76
"type": "model",
77
"id": 15,
78
"name": "braze_test",
79
"created_at": "2021-10-11T20:52:58.293Z",
80
"updated_at": "2021-10-14T23:15:18.508Z",
81
"query": "select cast('[email protected]' as VARCHAR(2000)) as email, cast('random' as VARCHAR(2000)) as random_prop"
82
}
83
},
84
"destination_attributes": {
85
"connection_id": 15,
86
"object": "user"
87
},
88
"mappings": [
89
{
90
"from": "EMAIL",
91
"to": "external_id",
92
"is_primary_identifier": true,
93
"generate_field": false,
94
"preserve_values": false,
95
"operation": null
96
},
97
{
98
"from": {
99
"value": "usa",
100
"basic_type": "text"
101
},
102
"to": "country",
103
"is_primary_identifier": false,
104
"generate_field": false,
105
"preserve_values": false,
106
"operation": null
107
}
108
]
109
}
110
]
111
}
Copied!
Data Property
Description
A list of syncs
A list of your syncs. The properties of a sync are expanded on below in the POST /syncs endpoint.
​
Along with the properties mentioned above, this endpoint returns an id, created_at, updated_at, and status for each sync.
​

GET /syncs/[ID]

This endpoint returns information on a specific sync.
Request
Response
1
curl -X GET https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/syncs/[ID]
Copied!
1
{
2
"status": "success",
3
"data": {
4
"id": 61,
5
"label": null,
6
"schedule_frequency": "never",
7
"schedule_day": null,
8
"schedule_hour": null,
9
"schedule_minute": null,
10
"created_at": "2021-10-22T00:40:11.246Z",
11
"updated_at": "2021-10-22T00:43:44.173Z",
12
"operation": "upsert",
13
"paused": false,
14
"status": "Ready",
15
"lead_union_insert_to": null,
16
"trigger_on_dbt_cloud_rebuild": false,
17
"field_behavior": "specific_properties",
18
"field_normalization": null,
19
"source_attributes": {
20
"connection_id": 4,
21
"data_source": {
22
"type": "model",
23
"id": 15,
24
"name": "braze_test",
25
"created_at": "2021-10-11T20:52:58.293Z",
26
"updated_at": "2021-10-14T23:15:18.508Z",
27
"query": "select cast('[email protected]' as VARCHAR(2000)) as email, cast('random' as VARCHAR(2000)) as random_prop"
28
}
29
},
30
"destination_attributes": {
31
"connection_id": 15,
32
"object": "user"
33
},
34
"mappings": [
35
{
36
"from": "EMAIL",
37
"to": "external_id",
38
"is_primary_identifier": true,
39
"generate_field": false,
40
"preserve_values": false,
41
"operation": null
42
},
43
{
44
"from": {
45
"value": "test",
46
"basic_type": "text"
47
},
48
"to": "first_name",
49
"is_primary_identifier": false,
50
"generate_field": false,
51
"preserve_values": false,
52
"operation": null
53
}
54
]
55
}
56
}
Copied!
Data Property
Description
A sync
Information on a sync. The properties of a sync are expanded on below in the POST /syncs endpoint.
​
Along with the properties mentioned above, this endpoint returns an id, created_at, updated_at, and status for the sync.
​

POST /syncs

This endpoint creates a sync with the given data.
Request
Response
1
curl --location --request POST 'https://app.getcensus.com/api/v1/syncs' \
2
--header 'Authorization: Bearer [API_TOKEN]' \
3
--header 'Content-Type: application/json' \
4
--data-raw '{
5
"label": "TEST 1",
6
"operation": "mirror",
7
"schedule_frequency": "daily",
8
"destination_attributes": {
9
"connection_id": 15,
10
"object": "user_data"
11
},
12
"source_attributes": {
13
"connection_id": 12,
14
"data_source": {
15
"type": "model",
16
"name": "test_ads"
17
}
18
},
19
"mappings": [
20
{
21
"from": "hashed_email",
22
"to": "user_identifier.hashed_email_PREHASHED",
23
"is_primary_identifier": true
24
},
25
{
26
"from": "list_id",
27
"to": "list_id",
28
"lookup_object": "user_list",
29
"lookup_field": "name"
30
},
31
{
32
"from": {
33
"value": "cohort_1",
34
"type": "text"
35
},
36
"to": "cohort"
37
}
38
]
39
}'
Copied!
1
{
2
"status": "created",
3
"data": {
4
"sync_id": 4545
5
}
6
}
Copied!
Request Property
Description
label (optional)
A label to give to this sync.
operation
How records are synced to the destination. Valid options:
  • append
  • insert
  • mirror
  • update
  • upsert
source_attributes
Attributes used to identify the data source for this sync. The specific properties are described below.
destination_attributes
Attributes used to identify the destination for this sync. The specific properties are described below.
mappings
A list of mappings between the source and destination. The specific properties are described below.
schedule_frequency (optional)
When this sync should be run. Valid options:
  • never
  • continuous
  • quarter_hourly
  • hourly
  • daily
  • weekly
schedule_day (optional)
What day of the week this sync should run. Valid options:
  • Sunday
  • Monday
  • Tuesday
  • Wednesday
  • Thursday
  • Friday
  • Saturday
schedule_hour (optional)
What hour of the day this sync should run. Valid values are integers between 0 and 24 inclusive.
schedule_minute (optional)
What minute of the hour this sync should run. Valid values are integers between 0 and 59 inclusive.
paused (optional)
Whether or not this sync should be paused.
trigger_on_dbt_cloud_rebuild (optional)
Whether or not this sync should trigger on a DBT cloud rebuild.
field_behavior (optional)
Specify sync_all_properties to configure this to automatically update mappings when the source changes.
field_normalization (optional)
If sync_all_properties is specified, specify how you would like automatic mappings to be named. Valid options are:
  • start_case
  • lower_case
  • upper_case
  • camel_case
  • snake_case
  • match_source_names
high_water_mark_attributes (optional)
Attributes used to identify the sync type. Only valid for append operation and source warehouse SnowflakeThe specific properties are described below.
​
Source Attribute
Description
connection_id
The id used to identify the source connection.
data_source
Attributes of the data source. Properties are expanded on immediately below.
id (optional if type and name or type and table_name, table_schema, and table_catalog are specified)
The id of the data source.
type (optional if id specified)
The type of your data source. Valid options:
  • table
  • model
name (optional if id specified)
If type is model, the name of the model. Not used if type is table.
table_name (optional if id specified)
If type is table, the name of the table. Not used if type is model.
table_schema (optional if id specified)
If type is table, the schema of the table. Not used if type is model.
table_catalog (optional if id specified)
If type is table, the catalog of the table. Not used if type is model.
​
Destination Attribute
Description
connection_id
The id used to identify the destination connection
object
The full name of the destination object
lead_union_insert_to (optional)
Where to insert a union object (for Salesforce connections)
​
Mapping Attribute
Description
from
The name of the column in the source, or an object with the following properties:
  • value - A constant value
  • type - The type of this value (can be boolean, datetime, number, or text)
to
The full name of the field to sync in to
is_primary_identifier (optional, but exactly one mapping must have this specified and set to true)
Whether or not this mapping is the primary identifier for this sync
generate_field (optional)
Whether or not this mapping generate a custom field
preserve_values (optional)
Whether or not an existing destination value should be overwritten
operation (optional)
For array types, whether we should merge or overwrite values
lookup_object (optional)
For a reference field, the full name of the object it refers to
lookup_field (optional)
For a reference field, the field to lookup the referenced object by
HighWaterMark Attribute
Description
use_high_water_mark_diff_type
true or false to indicate use of high water mark diff type sync. Only valid for append operation and source warehouse Snowflake
column_name
The name of the column in the source
Response Property
Description
status
created or error indicating whether the sync was triggered.
data
Present if successful. An object containing the sync_id
message
Present if error. Contains message describing the error.
​

POST /syncs/[ID]/trigger

This endpoint triggers a specific sync to run.
Request
Response
1
curl -X POST https://bearer:[API_TOKEN]@app.getcensus.com/api/v1/syncs/[ID]/trigger
Copied!
1
{
2
"status": "success",
3
"data": {
4
"sync_run_id": 1234567890
5
}
6
}
Copied!
Response Property
Description
status
success or error indicating whether the sync was triggered.
data
Present if successful. An object containing the sync_run_id
message
Present if error. Contains message describing the error.
Last modified 22d ago