---
title: "PATCH /api/database/data-sync/{data_sync_id}/"
method: PATCH
path: "/api/database/data-sync/{data_sync_id}/"
tags: ["Database tables"]
---

# PATCH /api/database/data-sync/{data_sync_id}/

`PATCH /api/database/data-sync/{data_sync_id}/`

Updates the properties of the provided data sync, if the user has the right permissions. Note that if the `synced_properties` is not provided, the available properties change, then the unavailable ones will automatically be removed.

## Path parameters

- `data_sync_id` integer, required

## Request body

- union
  - ICalCalendarDataSyncUpdateDataSync
    - `synced_properties` string[]
    - `auto_add_new_properties` boolean — If enabled and new properties are detected on sync, then they're automatically added. Note that this means all properties will always be added.
    - `delete_unmatched_rows` boolean — If enabled, rows that are no longer present in the source are deleted from the synced table on every sync. If disabled, those rows are kept and reused if the matching source row reappears.
    - `two_way_sync` boolean — If enabled, then it's possible to make changes to the synced table. They will automatically be synced with the source data. Note that this is only possible if the data sync type has a two-way sync strategy.
    - `ical_url` string, uri, required
  - LocalBaserowTableDataSyncUpdateDataSync
    - `synced_properties` string[]
    - `auto_add_new_properties` boolean — If enabled and new properties are detected on sync, then they're automatically added. Note that this means all properties will always be added.
    - `delete_unmatched_rows` boolean — If enabled, rows that are no longer present in the source are deleted from the synced table on every sync. If disabled, those rows are kept and reused if the matching source row reappears.
    - `two_way_sync` boolean — If enabled, then it's possible to make changes to the synced table. They will automatically be synced with the source data. Note that this is only possible if the data sync type has a two-way sync strategy.
    - `source_table_id` integer, required — The ID of the source table that must be synced.
    - `source_table_view_id` integer, nullable — If provided, then only the visible fields and rows matching the filters will be synced.
  - JiraIssuesDataSyncUpdateDataSync
    - `synced_properties` string[]
    - `auto_add_new_properties` boolean — If enabled and new properties are detected on sync, then they're automatically added. Note that this means all properties will always be added.
    - `delete_unmatched_rows` boolean — If enabled, rows that are no longer present in the source are deleted from the synced table on every sync. If disabled, those rows are kept and reused if the matching source row reappears.
    - `two_way_sync` boolean — If enabled, then it's possible to make changes to the synced table. They will automatically be synced with the source data. Note that this is only possible if the data sync type has a two-way sync strategy.
    - `jira_url` string, uri, required — The base URL of your Jira instance (e.g., https://your-domain.atlassian.net).
    - `jira_project_key` string — The project key of the Jira project (e.g., PROJ).
    - `jira_authentication` 'API_TOKEN' | 'PERSONAL_ACCESS_TOKEN' — * `API_TOKEN` - API_TOKEN * `PERSONAL_ACCESS_TOKEN` - PERSONAL_ACCESS_TOKEN
    - `jira_username` string — The username of the Jira account used to authenticate. Is only used if the `jira_authentication` is equal `API_TOKEN`
  - GitHubIssuesDataSyncUpdateDataSync
    - `synced_properties` string[]
    - `auto_add_new_properties` boolean — If enabled and new properties are detected on sync, then they're automatically added. Note that this means all properties will always be added.
    - `delete_unmatched_rows` boolean — If enabled, rows that are no longer present in the source are deleted from the synced table on every sync. If disabled, those rows are kept and reused if the matching source row reappears.
    - `two_way_sync` boolean — If enabled, then it's possible to make changes to the synced table. They will automatically be synced with the source data. Note that this is only possible if the data sync type has a two-way sync strategy.
    - `github_issues_owner` string, required — The owner of the repository on GitHub.
    - `github_issues_repo` string, required — The name of the repository on GitHub.
  - GitLabIssuesDataSyncUpdateDataSync
    - `synced_properties` string[]
    - `auto_add_new_properties` boolean — If enabled and new properties are detected on sync, then they're automatically added. Note that this means all properties will always be added.
    - `delete_unmatched_rows` boolean — If enabled, rows that are no longer present in the source are deleted from the synced table on every sync. If disabled, those rows are kept and reused if the matching source row reappears.
    - `two_way_sync` boolean — If enabled, then it's possible to make changes to the synced table. They will automatically be synced with the source data. Note that this is only possible if the data sync type has a two-way sync strategy.
    - `gitlab_url` string, uri — The base URL to your GitLab instance (e.g. https://gitlab.com)
    - `gitlab_project_id` string, required — The ID of the GitLab project where to sync the issues with.
  - HubSpotContactsDataSyncUpdateDataSync
    - `synced_properties` string[]
    - `auto_add_new_properties` boolean — If enabled and new properties are detected on sync, then they're automatically added. Note that this means all properties will always be added.
    - `delete_unmatched_rows` boolean — If enabled, rows that are no longer present in the source are deleted from the synced table on every sync. If disabled, those rows are kept and reused if the matching source row reappears.
    - `two_way_sync` boolean — If enabled, then it's possible to make changes to the synced table. They will automatically be synced with the source data. Note that this is only possible if the data sync type has a two-way sync strategy.
  - PostgreSQLDataSyncUpdateDataSync
    - `synced_properties` string[]
    - `auto_add_new_properties` boolean — If enabled and new properties are detected on sync, then they're automatically added. Note that this means all properties will always be added.
    - `delete_unmatched_rows` boolean — If enabled, rows that are no longer present in the source are deleted from the synced table on every sync. If disabled, those rows are kept and reused if the matching source row reappears.
    - `two_way_sync` boolean — If enabled, then it's possible to make changes to the synced table. They will automatically be synced with the source data. Note that this is only possible if the data sync type has a two-way sync strategy.
    - `postgresql_host` string, required
    - `postgresql_username` string, required
    - `postgresql_port` integer
    - `postgresql_database` string, required
    - `postgresql_schema` string
    - `postgresql_table` string, required
    - `postgresql_sslmode` 'disable' | 'allow' | 'prefer' | 'require' | 'verify-ca' | 'verify-full' — * `disable` - disable * `allow` - allow * `prefer` - prefer * `require` - require * `verify-ca` - verify-ca * `verify-full` - verify-full

## Response `200`

- DataSync
  - `id` integer, required
  - `type` string, required
  - `table_id` integer, required — The table where the data is synced into.
  - `database_id` string, required
  - `synced_properties` DataSyncSyncedProperty[], required
    - `field_id` integer, required
    - `key` string, required — The matching `key` of the `DataSyncProperty`.
    - `unique_primary` boolean — Indicates whether the data sync property is used for unique identification when syncing.
  - `last_sync` string, date-time, nullable — Timestamp when the table was last synced.
  - `last_error` string, nullable
  - `auto_add_new_properties` boolean — If enabled and new properties are detected on sync, then they're automatically added. Note that this means all properties will always be added.
  - `delete_unmatched_rows` boolean — If enabled, rows that are no longer present in the source are deleted from the synced table on every sync. If disabled, those rows are kept and reused if the matching source row reappears.
  - `two_way_sync` boolean — If enabled, then it's possible to make changes to the synced table. They will automatically be synced with the source data. Note that this is only possible if the data sync type has a two-way sync strategy.

## Other responses

- `400`
- `404`

---

[API](https://skmtc.net/baserow/apis/baserow-api-spec.md) · [All operations](https://skmtc.net/baserow/apis/baserow-api-spec/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/baserow/baserow-api-spec/versions/0c490e5b0c7f/schema)
