---
title: "List Models"
method: GET
path: "/models"
---

# List Models

`GET /models`

List all the models in the current workspace including parent and related models

## Query parameters

- `name` string
- `slug` string
- `offset` number, double
- `limit` number, double
- `orderBy` 'id' | 'name' | 'slug' | 'createdAt' | 'updatedAt'
- `tags` string[]

## Response `200`

Ok

- object
  - `data` Model[], required
    - `id` number, double, required — The id of the model
    - `name` string, required — The name of the model
    - `slug` string, required — The slug of the model
    - `description` string, required — The description of the model
    - `workspaceId` number, double, required — The id of the workspace where the model belongs to
    - `primaryKey` string, required — The primary key will be null if the query doesn't get directly synced (e.g. a relationship table for visual querying)
    - `createdAt` string, date-time, required — The timestamp when model was created
    - `updatedAt` string, date-time, required — The timestamp when model was lastly updated
    - `sourceId` number, double, required — The id of the source that model is connected to
    - `queryType` string, required — The type of the query. Available options: custom, raw_sql, tabel, dbt and visual.
    - `tags` object, required — The tags of the model
    - `isSchema` boolean, required — If is_schema is true, the model is just used to build other models. Either as part of visual querying, or as the root of a visual query.
    - `syncs` number[], required — The list of id of syncs that uses this model
    - `visual` object — Visual query, used by audience
      - `secondaryLabel` string
      - `primaryLabel` string
      - `filter` unknown, required
      - `parentId` number, double, required — Parent id of the schema that visual query is based on
    - `custom` object — Custom query for sources that doesn't support sql. For example, Airtable.
      - `query` unknown, required
    - `table` object — Table-based query that fetches on a table instead of SQL
      - `name` string, required
    - `dbt` object — Query that is based on a dbt model
      - `dbtUniqueId` string, required — Unique ID of the model assigned by dbt (usually some combination of the schema and table name)
      - `compiledSql` string, required — Compiled SQL in the dbt model
      - `rawSql` string, required — Raw SQL in the dbt model
      - `database` string, required — Name of the database containing the generated table
      - `schema` string, required — Name of the schema containing the generated table
      - `name` string, required — Name of the table generated by the dbt model
      - `modelId` number, double, required — Model id that refer to a dbt model
    - `dbt_cloud` object
      - `dbtUniqueId` string, required — Unique ID of the model assigned by dbt (usually some combination of the schema and table name)
      - `compiledSql` string, required — Compiled SQL in the dbt model
      - `rawSql` string, required
      - `name` string, required — Name of the table generated by the dbt model
      - `modelId` number, double, required — Model id that refer to a dbt model
    - `raw` object — Standard raw SQL query
      - `sql` string, required
    - `folderId` string
    - `lastRunSize` number, double, nullable, required — The number of rows returned by the most recent successful sync run of this model. Null if the model has never been synced successfully.

## Other responses

- `400` — Bad request
- `401` — Unauthorized
- `422` — Validation Failed

---

[API](https://skmtc.net/hightouch/apis/hightouch-api.md) · [All operations](https://skmtc.net/hightouch/apis/hightouch-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/hightouch/hightouch-api/revisions/24a8012aa8c8/schema)
