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

App schema

Get an app schema

GET
/v1/workspaces/{workspace_id}/helpers/app-schema

List the tables Stacksync can sync through a connection, with the primary key of each. Columns are not read by this route: use the generate app schema route with table_names to read them.

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 of the connection

Value in"besg""usnv"
connection_id*string

The connection to read the schema through; the user of the API key must have created it or it must be shared with the workspace

Formatuuid

Response Body

The tables of the app

application/json
  1. response

The tables and columns Stacksync can read through a connection

app_type*string

The app of the connection, as shown in Stacksync

can_create_tables*boolean

Whether a sync may create a new table in this app (table_options.create_new_table: true)

tables*array<>

Every table of the app

Get an app schema
curl -X GET 'https://api.stacksync.com/v1/workspaces/0/helpers/app-schema?region=besg&connection_id=497f6eca-6276-4993-bfeb-53cbbbba6f08'
{  "app_type": "postgres",  "can_create_tables": true,  "tables": [    {      "table_name": "accounts",      "table_id": "accounts",      "table_options": {        "primary_key": {          "column_name": "id",          "column_type": "uuid"        }      },      "columns": []    },    {      "table_name": "contacts",      "table_id": "contacts",      "table_options": {},      "columns": []    }  ]}