See Stacksync in action with a solution architect. Book a demo ↗
Syncs

Syncs

Edit a sync

PUT
/v1/workspaces/{workspace_id}/bases/{base_id}

Replace the mapping of a sync with the whole sync you send: read it, change tables, columns, directions, rate limits or delete protection, and send it back. A table left out of both apps is removed, a new pair is added. The sync is paused while the edit applies and restarted after it. Send validate_only: true to run every check without changing the sync.

Authorization

Authorizationstringheaderrequired

Bearer <key>, where <key> is a workspace API key or a user API key. See Authentication.

Path Parameters

workspace_id*integer

The workspace the resources belong to

base_id*string

The sync (a sync is called a base in these paths)

Formatuuid

Request Body

The whole sync after the edit

application/json
  1. body

The whole sync after the edit: read the sync, change it, send it back (the sync is paused and restarted by the edit)

base_id*string

The sync; must equal the base_id of the path

Formatuuid
base_name*string

The name of the sync

base_region*string

The data region of the sync

Value in"besg""usnv"
apps*array<>

Exactly two apps, with their app_id

Items2 <= items <= 2
base_resource_id?string

The stable id of the sync

Match^[A-Za-z0-9_]{1,60}$
base_status?string

Accepted and stored as given; leave it out

validate_only?boolean

Run every check of the edit, including reading the apps, and answer the sync as it would be stored without changing it

Defaultfalse

Response Body

The sync after the edit (with validate_only, as it would be stored)

application/json
  1. response

The written sync

data*

A sync as a create or an edit answers it (the mapping, not the settings: read the sync for those)

Edit a sync
curl -X PUT 'https://api.stacksync.com/v1/workspaces/0/bases/497f6eca-6276-4993-bfeb-53cbbbba6f08' \  -H 'Content-Type: application/json' \  -d '{  "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",  "base_name": "Salesforce accounts to Postgres",  "base_region": "usnv",  "apps": [    {      "app_id": "3f9a1c2e",      "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",      "tables": [        {          "table_name": "Account",          "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",          "sync_direction": "outgoing",          "columns": [            {              "column_name": "Name",              "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"            }          ]        }      ]    },    {      "app_id": "b71d04e5",      "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",      "tables": [        {          "table_name": "accounts",          "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",          "sync_direction": "incoming",          "columns": [            {              "column_name": "name",              "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"            }          ]        }      ]    }  ]}'
{  "data": {    "base_id": "3f6c1d2e-8a4b-4c7d-9e21-5b6f7a8c9d01",    "base_name": "Salesforce accounts to Postgres",    "base_region": "usnv",    "base_resource_id": "salesforce_accounts_to_postgres",    "apps": [      {        "app_id": "3f9a1c2e",        "connection_id": "c7d8e9f0-2a3b-4c5d-9e6f-7a8b9c0d1e2f",        "tables": [          {            "table_name": "Account",            "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",            "sync_direction": "outgoing",            "columns": [              {                "column_name": "Name",                "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"              }            ]          }        ]      },      {        "app_id": "b71d04e5",        "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",        "tables": [          {            "table_name": "accounts",            "table_mapping_id": "7e8f9a0b-1c2d-4e3f-8a4b-5c6d7e8f9a0b",            "sync_direction": "incoming",            "columns": [              {                "column_name": "name",                "column_mapping_id": "1a2b3c4d-5e6f-4a7b-9c8d-0e1f2a3b4c5d"              }            ]          }        ]      }    ]  }}