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

Connections

Update a connection

POST
/v1/workspaces/{workspace_id}/connections/{connection_id}/update

Rename a connection, share it with the workspace, or replace its credentials (validated by the app first). Any editor who can see a connection shared with the workspace can update it. New credentials that miss a field the app type needs, or that the app refuses, answer Invalid Credentials with field: credentials; the stored ones stay.

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. List the ones your key can reach with GET /v1/workspaces.

connection_id*string

The connection.

Formatuuid

Query Parameters

region*Region

Region of the connection: besg or usnv

Value in"besg""usnv"

Request Body

application/json
  1. body
connection_name?|

The new name: letters, numbers, dashes, underscores and spaces, 3 to 63 characters

Defaultnull
is_shared_with_workspace?|

True to share the connection with every member of the workspace

Defaultnull
credentials?|

The new credentials of the app, checked per app type as on create, then tested by the app before they are stored. They replace the stored credentials whole: send every field the app takes, not only the changed one (a Snowflake connection sends account, username, database, schema, warehouse and public_key again). The stored credentials stay when the new ones are refused.

Defaultnull
validate_only?Validate Only

Run every check of the write and answer 204 without writing: a refused write answers the error the write would

Defaultfalse

Response Body

OK

application/json
  1. response
data*
Update a connection
curl -X POST 'https://api.stacksync.com/v1/workspaces/0/connections/497f6eca-6276-4993-bfeb-53cbbbba6f08/update?region=usnv' \  -H 'Content-Type: application/json' \  -d '{  "connection_name": "Production Postgres"}'
{  "data": {    "connection_id": "<connection_id>",    "connection_name": "<connection_name>",    "app_type": "<app_type>",    "is_shared_with_workspace": false,    "created_time": "<created_time>",    "last_modified_time": "<last_modified_time>",    "credentials_options": {},    "connection_resource_id": "<connection_resource_id>",    "region": "<region>",    "needs_reauthorization": false  }}