---
title: "Create model"
method: POST
path: "/api/v1/models"
tags: ["Models"]
---

# Create model

`POST /api/v1/models`

Create a new model. Supports creating schema, shared, branch, shared_extension, and query models. A query model (modelKind QUERY) is created empty under a workbook model (baseModelId); populate its views and fields via the model YAML endpoint.

## Request body

- CreateModelSchemaBase
  - `accessGrants` object[] — Access grants for the model
    - `accessBoostable` boolean, required
    - `allowedValues` string[]
    - `codeComments` object
    - `ignored` boolean
    - `name` string, required
    - `userAttribute` string
  - `allowAsWorkbookBase` boolean — Allow this model as a workbook base
  - `baseModelId` string — Base model ID for extension or branch models
  - `connectionId` string, required — Connection ID for the model
  - `modelKind` union — Kind of model to create
    - 'SCHEMA'
    - 'SHARED'
    - 'SHARED_EXTENSION'
    - 'BRANCH'
    - 'QUERY'
  - `modelName` string — Name for the model
  - `usesIsolatedBranches` boolean — For SHARED_EXTENSION models, controls if branches are shown on extension model page instead of parent shared model

## Response `200`

Model created successfully

- object — Create model response
  - `error` string — Error message if creation failed
  - `message` string — Additional message
  - `model` object — Created model details
    - `id` string, uuid, required — Created model ID
    - `modelKind` string, required — Kind of model created
    - `name` string, nullable, required — Model name
  - `success` boolean, required — Whether the operation succeeded

## Other responses

- `400` — Invalid request body or model creation not allowed
- `401` — Authentication required
- `403` — Permission denied
- `404` — Connection or base model not found

---

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