Docs
/
/

Warehouse syncs mAPI reference

Complete reference documentation for the Warehouse syncs resource.

Warehouse syncs

#

A warehouse sync reads rows from a warehouse on a schedule and writes them to Knock as users, tenants, objects, audience members, or subscriptions.

You can list, retrieve, upsert, and validate syncs, change their schedule, run them, and list their recent runs. Upserting a sync saves a draft. Pass commit=true to publish it. Syncs are identified by their key and belong to one environment. They aren't promoted between environments, and they aren't available in branch environments.

Run a warehouse sync

#

Starts a run of the published warehouse sync now, instead of waiting for its schedule. Refused while a run is in progress.

Endpoint

PUT/v1/warehouse_syncs/{warehouse_sync_key}/run

Path parameters

warehouse_sync_key
string

The key of the warehouse sync to run.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Returns

WrappedWarehouseSyncResponse

Wraps the WarehouseSync response under the warehouse_sync key.

warehouse_sync

A warehouse sync reads rows from a warehouse on a schedule and writes them to Knock as users, tenants, objects, audience members, or subscriptions.

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

created_at
string(date-time)

When the sync was created. (read-only).

description
string

An optional description of the sync. Maximum of 280 characters allowed.

enabled
boolean

Whether the sync runs on its schedule.

environment
string

The slug of the environment the sync belongs to. (read-only).

frequency_minutes
integer

How often the sync runs, in minutes.

has_unpublished_changes
boolean

Whether the sync has a draft that hasn't been published.

key
string

The unique key of the sync in its environment.

last_failure
object

The last run failure, cleared when a run succeeds.

message
string

What went wrong.

stage
enum(string)

Where the run failed: reading the warehouse (extract), sending rows to Knock (load), or applying them (apply).

extractloadapply
last_published_at
string(date-time)

When the sync was last published.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

publish_error
string

Why the last publish didn't go live, when it failed.

sha
string

The SHA hash of the sync's definition. (read-only).

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)
Required

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

status
enum(string)

The status of the sync.

draftpublishingdelivery_failedpausedneeds_attentionlive

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
updated_at
string(date-time)

When the returned version was saved. (read-only).

version_id
string(uuid)

The ID of the version returned. Send it back when saving to make sure nobody saved since.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

Update a warehouse sync's settings

#

Pauses or resumes a warehouse sync, or changes how often it runs. Settings take effect right away and don't need a publish.

Endpoint

PUT/v1/warehouse_syncs/{warehouse_sync_key}/settings

Path parameters

warehouse_sync_key
string

The key of the warehouse sync to update.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Request body

enabled
boolean

Whether the sync runs on its schedule.

frequency_minutes
integer

How often the sync runs, in minutes.

Returns

WrappedWarehouseSyncResponse

Wraps the WarehouseSync response under the warehouse_sync key.

warehouse_sync

A warehouse sync reads rows from a warehouse on a schedule and writes them to Knock as users, tenants, objects, audience members, or subscriptions.

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

created_at
string(date-time)

When the sync was created. (read-only).

description
string

An optional description of the sync. Maximum of 280 characters allowed.

enabled
boolean

Whether the sync runs on its schedule.

environment
string

The slug of the environment the sync belongs to. (read-only).

frequency_minutes
integer

How often the sync runs, in minutes.

has_unpublished_changes
boolean

Whether the sync has a draft that hasn't been published.

key
string

The unique key of the sync in its environment.

last_failure
object

The last run failure, cleared when a run succeeds.

message
string

What went wrong.

stage
enum(string)

Where the run failed: reading the warehouse (extract), sending rows to Knock (load), or applying them (apply).

extractloadapply
last_published_at
string(date-time)

When the sync was last published.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

publish_error
string

Why the last publish didn't go live, when it failed.

sha
string

The SHA hash of the sync's definition. (read-only).

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)
Required

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

status
enum(string)

The status of the sync.

draftpublishingdelivery_failedpausedneeds_attentionlive

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
updated_at
string(date-time)

When the returned version was saved. (read-only).

version_id
string(uuid)

The ID of the version returned. Send it back when saving to make sure nobody saved since.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

List warehouse syncs

#

Returns a paginated list of warehouse syncs for the given environment.

Endpoint

GET/v1/warehouse_syncs

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

after
string

The cursor to fetch entries after.

before
string

The cursor to fetch entries before.

limit
integer

The number of entries to fetch per-page.

hide_uncommitted_changes
boolean

Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.

Returns

PaginatedWarehouseSyncResponse

A paginated list of WarehouseSync. Contains a list of entries and page information.

A list of entries.

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

created_at
string(date-time)
Required

When the sync was created. (read-only).

description
string

An optional description of the sync. Maximum of 280 characters allowed.

enabled
boolean
Required

Whether the sync runs on its schedule.

environment
string
Required

The slug of the environment the sync belongs to. (read-only).

frequency_minutes
integer
Required

How often the sync runs, in minutes.

has_unpublished_changes
boolean
Required

Whether the sync has a draft that hasn't been published.

key
string
Required

The unique key of the sync in its environment.

last_failure
object

The last run failure, cleared when a run succeeds.

message
string

What went wrong.

stage
enum(string)

Where the run failed: reading the warehouse (extract), sending rows to Knock (load), or applying them (apply).

extractloadapply
last_published_at
string(date-time)

When the sync was last published.

mappingsRequired

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string
Required

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

publish_error
string

Why the last publish didn't go live, when it failed.

sha
string
Required

The SHA hash of the sync's definition. (read-only).

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)
Required

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

status
enum(string)
Required

The status of the sync.

draftpublishingdelivery_failedpausedneeds_attentionlive

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)
Required

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
updated_at
string(date-time)
Required

When the returned version was saved. (read-only).

version_id
string(uuid)
Required

The ID of the version returned. Send it back when saving to make sure nobody saved since.

warehouse_key
string
Required

The key of the warehouse the sync reads from. Can't change after creation.

page_info

The information about a paginated result.

after
string

The cursor to fetch entries after. Will only be present if there are more entries to fetch.

before
string

The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.

page_size
integer

The number of entries to fetch per-page.

List warehouse sync runs

#

Returns the most recent runs of a warehouse sync, newest first.

Endpoint

GET/v1/warehouse_syncs/{warehouse_sync_key}/runs

Path parameters

warehouse_sync_key
string

The key of the warehouse sync.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Returns

PaginatedWarehouseSyncRunResponse

A paginated list of WarehouseSyncRun. Contains a list of entries and page information.

entries
WarehouseSyncRun[]

A list of entries.

ended_at
string(date-time)

When the run ended.

error
object

Why the run failed.

message
string

What went wrong.

stage
enum(string)

Where the run failed.

extractloadapply
id
string
Required

The ID of the run.

load_id
string

The ID of the delivery of rows to Knock. Null when the run hasn't sent rows yet, failed before sending them, or found no changes.

records_errored
integer

How many rows failed before reaching Knock.

records_processed
integer

How many changed rows were read from the warehouse.

rows_applied
integer

How many rows were applied in Knock.

rows_failed
integer

How many rows failed to apply in Knock.

started_at
string(date-time)

When the run started.

status
enum(string)
Required

The status of the run.

runningcompletedcompleted_with_errorsfailed
submitted_at
string(date-time)

When the run was queued.

page_info

The information about a paginated result.

after
string

The cursor to fetch entries after. Will only be present if there are more entries to fetch.

before
string

The cursor to fetch entries before. Will only be present if there are more entries to fetch before the current page.

page_size
integer

The number of entries to fetch per-page.

Validate a warehouse sync

#

Checks a warehouse sync payload the way an upsert would, without saving it. Returns the payload as sent.

Endpoint

PUT/v1/warehouse_syncs/{warehouse_sync_key}/validate

Path parameters

warehouse_sync_key
string

The key of the warehouse sync to validate.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

Request body

warehouse_syncRequired

A warehouse sync payload for upsert or validate. Fields left out keep their current values. warehouse_key, target_type, and target are required to create a sync and can't change after. Change enabled and frequency_minutes with the settings endpoint.

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

description
string

An optional description of the sync. Maximum of 280 characters allowed.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)
Required

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
version_id
string(uuid)

The version_id of the sync you last read. When it isn't the current version, someone saved since, and the request is refused.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

Returns

WrappedWarehouseSyncRequestResponse

Wraps the WarehouseSyncRequest response under the warehouse_sync key.

warehouse_sync

A warehouse sync payload for upsert or validate. Fields left out keep their current values. warehouse_key, target_type, and target are required to create a sync and can't change after. Change enabled and frequency_minutes with the settings endpoint.

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

description
string

An optional description of the sync. Maximum of 280 characters allowed.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)
Required

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
version_id
string(uuid)

The version_id of the sync you last read. When it isn't the current version, someone saved since, and the request is refused.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

Get a warehouse sync

#

Retrieve a warehouse sync by its key in a given environment.

Endpoint

GET/v1/warehouse_syncs/{warehouse_sync_key}

Path parameters

warehouse_sync_key
string

The key of the warehouse sync to retrieve.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

hide_uncommitted_changes
boolean

Whether to hide uncommitted changes. When true, only committed changes will be returned. When false, both committed and uncommitted changes will be returned.

Returns

A warehouse sync reads rows from a warehouse on a schedule and writes them to Knock as users, tenants, objects, audience members, or subscriptions.

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

created_at
string(date-time)

When the sync was created. (read-only).

description
string

An optional description of the sync. Maximum of 280 characters allowed.

enabled
boolean

Whether the sync runs on its schedule.

environment
string

The slug of the environment the sync belongs to. (read-only).

frequency_minutes
integer

How often the sync runs, in minutes.

has_unpublished_changes
boolean

Whether the sync has a draft that hasn't been published.

key
string

The unique key of the sync in its environment.

last_failure
object

The last run failure, cleared when a run succeeds.

message
string

What went wrong.

stage
enum(string)

Where the run failed: reading the warehouse (extract), sending rows to Knock (load), or applying them (apply).

extractloadapply
last_published_at
string(date-time)

When the sync was last published.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

publish_error
string

Why the last publish didn't go live, when it failed.

sha
string

The SHA hash of the sync's definition. (read-only).

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

status
enum(string)

The status of the sync.

draftpublishingdelivery_failedpausedneeds_attentionlive

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
updated_at
string(date-time)

When the returned version was saved. (read-only).

version_id
string(uuid)

The ID of the version returned. Send it back when saving to make sure nobody saved since.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

Upsert a warehouse sync

#

Creates a warehouse sync, or saves a new draft of it if it exists. Fields left out keep their current values. Pass commit=true to publish the draft. A draft that fails to publish stays saved.

Endpoint

PUT/v1/warehouse_syncs/{warehouse_sync_key}

Path parameters

warehouse_sync_key
string

The key of the warehouse sync to upsert.

Query parameters

environment
string

The environment slug. When omitted, the account's default environment is used.

commit
boolean

Whether to commit the resource at the same time as modifying it.

commit_message
string

The message to commit the resource with, only used if commit is true.

Request body

warehouse_syncRequired

A warehouse sync payload for upsert or validate. Fields left out keep their current values. warehouse_key, target_type, and target are required to create a sync and can't change after. Change enabled and frequency_minutes with the settings endpoint.

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

description
string

An optional description of the sync. Maximum of 280 characters allowed.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)
Required

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
version_id
string(uuid)

The version_id of the sync you last read. When it isn't the current version, someone saved since, and the request is refused.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

Returns

WrappedWarehouseSyncResponse

Wraps the WarehouseSync response under the warehouse_sync key.

warehouse_sync

A warehouse sync reads rows from a warehouse on a schedule and writes them to Knock as users, tenants, objects, audience members, or subscriptions.

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

created_at
string(date-time)

When the sync was created. (read-only).

description
string

An optional description of the sync. Maximum of 280 characters allowed.

enabled
boolean

Whether the sync runs on its schedule.

environment
string

The slug of the environment the sync belongs to. (read-only).

frequency_minutes
integer

How often the sync runs, in minutes.

has_unpublished_changes
boolean

Whether the sync has a draft that hasn't been published.

key
string

The unique key of the sync in its environment.

last_failure
object

The last run failure, cleared when a run succeeds.

message
string

What went wrong.

stage
enum(string)

Where the run failed: reading the warehouse (extract), sending rows to Knock (load), or applying them (apply).

extractloadapply
last_published_at
string(date-time)

When the sync was last published.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

publish_error
string

Why the last publish didn't go live, when it failed.

sha
string

The SHA hash of the sync's definition. (read-only).

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)
Required

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

status
enum(string)

The status of the sync.

draftpublishingdelivery_failedpausedneeds_attentionlive

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
updated_at
string(date-time)

When the returned version was saved. (read-only).

version_id
string(uuid)

The ID of the version returned. Send it back when saving to make sure nobody saved since.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

WarehouseSync

#

A warehouse sync reads rows from a warehouse on a schedule and writes them to Knock as users, tenants, objects, audience members, or subscriptions.

Attributes

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

created_at
string(date-time)

When the sync was created. (read-only).

description
string

An optional description of the sync. Maximum of 280 characters allowed.

enabled
boolean

Whether the sync runs on its schedule.

environment
string

The slug of the environment the sync belongs to. (read-only).

frequency_minutes
integer

How often the sync runs, in minutes.

has_unpublished_changes
boolean

Whether the sync has a draft that hasn't been published.

key
string

The unique key of the sync in its environment.

last_failure
object

The last run failure, cleared when a run succeeds.

message
string

What went wrong.

stage
enum(string)

Where the run failed: reading the warehouse (extract), sending rows to Knock (load), or applying them (apply).

extractloadapply
last_published_at
string(date-time)

When the sync was last published.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

publish_error
string

Why the last publish didn't go live, when it failed.

sha
string

The SHA hash of the sync's definition. (read-only).

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

status
enum(string)

The status of the sync.

draftpublishingdelivery_failedpausedneeds_attentionlive

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
updated_at
string(date-time)

When the returned version was saved. (read-only).

version_id
string(uuid)

The ID of the version returned. Send it back when saving to make sure nobody saved since.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

WarehouseSyncTarget

#

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

Attributes

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

WarehouseSyncRequest

#

A warehouse sync payload for upsert or validate. Fields left out keep their current values. warehouse_key, target_type, and target are required to create a sync and can't change after. Change enabled and frequency_minutes with the settings endpoint.

Attributes

How the sync detects changed and deleted rows.

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

description
string

An optional description of the sync. Maximum of 280 characters allowed.

How columns map to Knock fields.

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string
Required

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string
Required

The Knock field to write the value to.

name
string

The name of the sync. Must be at minimum 1 character and at maximum 255 characters in length.

primary_key_column
string

The column that uniquely identifies each row.

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

mode
enum(string)

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

The collection or audience the sync writes to. object and subscription syncs set collection, and static_audience_membership syncs set audience_key. Null for user and tenant syncs.

audience_key
string

The key of the static audience the rows become members of.

collection
string

The object collection the rows are written to.

target_type
enum(string)

What each row becomes in Knock. Can't change after creation.

usertenantobjectstatic_audience_membershipsubscription
version_id
string(uuid)

The version_id of the sync you last read. When it isn't the current version, someone saved since, and the request is refused.

warehouse_key
string

The key of the warehouse the sync reads from. Can't change after creation.

WarehouseSyncMapping

#

Maps one column from the warehouse to one field in Knock.

Attributes

on_null
enum(string)

What to do when the column is NULL. set_null clears the Knock field, and preserve keeps its current value.

set_nullpreserve
source_column
string

The column to read. Can be a dotted path into an object column, such as PROPERTIES.plan.

target_field
string

The Knock field to write the value to.

WarehouseSyncChangeTracking

#

How the sync detects changed and deleted rows.

Attributes

is_deleted_column
string

A boolean column that marks a row as deleted. Requires last_modified_column.

last_modified_column
string

A timestamp column that changes whenever a row changes. With it, each run reads only rows changed since the last run.

WarehouseSyncSource

#

The rows a warehouse sync reads: a table or view (relation), or the result of a SQL query (sql).

Attributes

mode
enum(string)

Whether the sync reads a table or view, or a SQL query.

relationsql
name
string

The name of the table or view. Required when mode is relation.

query
string

The SQL query to read. Required when mode is sql.

schema
string

The schema of the table or view. Required when mode is relation.

New chat