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

Connections

Create a connection

POST
/v1/workspaces/{workspace_id}/connections

Create a connection to an app with the credentials given, after testing them against the app. Only the user of the API key can use the connection unless is_shared_with_workspace is true. Answers the connection without its secrets.

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

Query Parameters

region*string

Data region the connection is stored in

Value in"besg""usnv"

Request Body

The connection to create db.example.com is a placeholder: replace it with your own host, which the API checks before saving (the example as written is refused).

application/json
  1. body

The connection to create

connection_name*string

The name of the connection, unique in the workspace

is_shared_with_workspace*boolean

True to let every editor of the workspace use the connection, false to keep it to the user of the API key

app_type*string

The app to connect, as shown in Stacksync

Value in"postgres""postgres_heroku""salesforce""hubspot""bigquery""amazon_lightsail""amazon_rds""supabase""supabase_oauth""scaleway_postgres""cockroachdb""render_postgres""google_alloydb""snowflake""dynamodb""mongodb""sap""zendesk""zoho_crm""microsoft_dynamics""dynamics365_crm""dynamics365_finance""dynamics365_business_central""pipedrive""marketo""odoo""airtable""attio_crm""motherduck""shopify""oracledb""mysql""mariadb""sqlserver""suiteanalytics""twilio""bamboohr""sendgrid""twenty_crm""monday""acumatica""extensiv"
credentials*

The credentials of the app, checked per app type before the connection is tested: postgres, postgres_heroku: connection_string, schema; mongodb: connection_string, database; hubspot, monday: code (the OAuth authorization code); salesforce: code, account_type (standard or sandbox); sendgrid, twenty_crm: api_key; twilio: account_sid, auth_token; bamboohr: company_domain, api_key; snowflake: account, username, warehouse; suiteanalytics: account_id, consumer_key, consumer_secret, token_id, token_secret, role_id; bigquery: service_account_credentials (the service account JSON: type, project_id, private_key_id, private_key, client_email, client_id, auth_uri, token_uri, auth_provider_x509_cert_url, client_x509_cert_url); acumatica: instance_url, client_id, client_secret, code, redirect_uri; extensiv: client_id, client_secret, optional user_login_id and is_sandbox (boolean). Other app types take the fields their connection form asks for; they are checked when the connection is tested.

Response Body

The connection created

application/json
  1. response

The connection written

data*

A connection as the connection routes answer it

Create a connection
curl -X POST 'https://api.stacksync.com/v1/workspaces/0/connections?region=besg' \  -H 'Content-Type: application/json' \  -d '{  "connection_name": "Production Postgres",  "is_shared_with_workspace": true,  "app_type": "postgres",  "credentials": {    "connection_string": "postgresql://sync_user:********@db.example.com:5432/crm",    "schema": "public"  }}'
{  "data": {    "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12",    "connection_name": "Production Postgres",    "app_type": "postgres",    "is_shared_with_workspace": true,    "created_time": "2026-10-01 09:12:44",    "last_modified_time": "2026-10-01 09:12:44",    "credentials_options": {      "uses_ssh_tunnel": false,      "connection_mode": "direct"    }  }}