---
title: "Get Model From Sql"
method: POST
path: "/dbt/v1/sqltomodel"
tags: ["DBT"]
---

# Get Model From Sql

`POST /dbt/v1/sqltomodel`

## Headers

- `x-tenant` string, required

## Request body

- SQLToModelRequest
  - `sql` string, required
  - `adapter` string, required
  - `models` ModelNode[], required
    - `database` string, nullable
    - `schema_name` string, nullable
    - `package_name` string, nullable
    - `name` string, nullable
    - `alias` string, required
    - `uniqueId` string, required
    - `columns` object, required
  - `sources` SourceMetaData[], required
    - `uniqueId` string, required
    - `database` string, required
    - `name` string, required
    - `schema_name` string, required
    - `tables` SourceTable[], required
      - `name` string, required

## Response `200`

Successful Response

- object

## Other responses

- `400` — Not supported for public user
- `403` — Not supported for public user
- `422` — Validation Error

---

[API](https://skmtc.net/myaltimate/apis/fastapi.md) · [All operations](https://skmtc.net/myaltimate/apis/fastapi/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/myaltimate/fastapi/versions/aab3fe5c9f05/schema)
