App schema
Generate an app schema
Read the tables of a connection and the columns of the tables named, so a sync can be built from exact table and column names. The credentials are read from the connection, never sent. Readable with a read-only key.
Authorization
AuthorizationstringheaderrequiredBearer <key>, where <key> is a workspace API key or a user API key. See Authentication.
workspace_id*integerThe workspace the resources belong to
region*stringData region of the connection
"besg""usnv"The connection and the tables to read the columns of
application/json- body
The connection to read, and the tables to read the columns of
connection_id*stringThe connection to read the schema through
uuidtable_names?array<string>The tables to read the columns of, by table_name or table_id exactly as the schema lists them; the answer lists every table but fills columns for these only
[]The tables of the app, with the columns of the tables named
application/json- response
The tables and columns Stacksync can read through a connection
app_type*stringThe app of the connection, as shown in Stacksync
can_create_tables*booleanWhether a sync may create a new table in this app (table_options.create_new_table: true)
tables*array<>Every table of the app
curl -X POST 'https://api.stacksync.com/v1/workspaces/0/helpers/generate-app-schema?region=besg' \ -H 'Content-Type: application/json' \ -d '{ "connection_id": "9b2e4f60-1c3d-4a5e-8f70-2d4c6e8a0b12", "table_names": [ "accounts" ]}'{ "app_type": "postgres", "can_create_tables": true, "tables": [ { "table_name": "accounts", "table_id": "accounts", "table_options": { "primary_key": { "column_name": "id", "column_type": "uuid" } }, "can_create_columns": true, "columns": [ { "column_name": "id", "column_type": "uuid", "external_column_type": "postgres_uuid", "writable": false }, { "column_name": "name", "column_type": "string", "external_column_type": "postgres_text", "writable": true }, { "column_name": "website", "column_type": "string", "external_column_type": "postgres_text", "writable": true } ] }, { "table_name": "contacts", "table_id": "contacts", "table_options": {}, "can_create_columns": true, "columns": [] } ]}GETGet an 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.
GETList syncs
List the syncs of the workspace in every region, newest first, with their apps, tables, columns and settings. Deleted syncs are not listed. No `region` parameter: both regions are read.