---
title: "Get an app schema"
method: GET
path: "/v1/workspaces/{workspace_id}/helpers/app-schema"
tags: ["App schema"]
---

# Get an app schema

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

## Request

- Base URL: `https://api.stacksync.com`
- URL: `https://api.stacksync.com/v1/workspaces/{workspace_id}/helpers/app-schema`
- Auth: HTTP bearer

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.

## Path parameters

- `workspace_id` integer, required

## Query parameters

- `region` 'besg' | 'usnv', required
- `connection_id` string, uuid, required

## Response `200`

The tables of the app

- AppSchema: The tables and columns Stacksync can read through a connection
  - `app_type` string, required: The app of the connection, as shown in Stacksync
  - `can_create_tables` boolean, required: Whether a sync may create a new table in this app (`table_options.create_new_table: true`)
  - `tables` AppSchemaTable[], required: Every table of the app
    - `table_name` string, required: The name of the table in the app: the value to send as `table_name` when creating a sync (its id is accepted too)
    - `table_id` string, required: The id of the table in the app, when the app has one apart from the name (BigQuery: `project.dataset.table`)
    - `table_options` AppSchemaTableOptions, required: The options of a table of the app
      - `primary_key` AppSchemaPrimaryKey: The primary key of a table
        - `column_name` string: The name of the primary key column
        - `column_type` string: The Stacksync type of the column (for example `string`, `int`, `uuid`, `datetime`)
    - `columns` AppSchemaColumn[], required: The columns of the table; only filled for the tables named in `table_names`, empty for the others
      - `column_name` string, required: The name of the column in the app: the value to send as `column_name` when creating a sync
      - `column_type` string, required: The Stacksync type of the column (for example `string`, `int`, `number`, `boolean`, `datetime`, `uuid`, `json`)
      - `writable` boolean: Whether a sync can write to the column; absent when the app does not say

## Other responses

- `400`: The `region` is missing or not one of besg, usnv; `connection_id` is missing or not a UUID; the app does not support syncs (`App Not Supported`); the app refused the credentials (`Connection Authorization Error`); Stacksync could not connect to the app (`Connection Error`); the schema could not be read (`Error generating app schema`, `Error retrieving app schema`)
- `403`: Forbidden: invalid API key, API key of another workspace, insufficient scope, workspace unavailable, or a non-GET request without `Content-Type: application/json`
- `404`: The connection does not exist in the workspace and region, or is not visible to the user of the API key (`Error retrieving connection`)

---

[API](https://skmtc.dev/stacksync/apis/stacksync-api.md) - [All operations](https://skmtc.dev/stacksync/apis/stacksync-api/llms.txt) - [OpenAPI document](https://skmtc.dev/stacksync/apis/stacksync-api/revisions/21f4ba4b214e?raw)
