---
title: "Create field"
method: POST
path: "/api/v1/models/{modelId}/field"
tags: ["Models"]
---

# Create field

`POST /api/v1/models/{modelId}/field`

## Path parameters

- `modelId` string, uuid, required — Model UUID

## Request body

- ModelsCreateFieldBody
  - `aggregateType` 'AVERAGE' | 'COUNT' | 'COUNT_DISTINCT' | 'LIST' | 'MAX' | 'MIN' | 'SUM' | 'MEDIAN' | 'PERCENTILE' | 'AVERAGE_DISTINCT_ON' | 'SUM_DISTINCT_ON' | 'MEDIAN_DISTINCT_ON' | 'PERCENTILE_DISTINCT_ON' | 'SEMANTIC_VIEW_AGG' — Aggregate type for measures. Setting this property promotes the field to a measure (written under `measures:`); omit it to create a dimension (written under `dimensions:`). Values must be uppercase canonical names.
  - `aiContext` string — AI context for the field
  - `description` string — Field description
  - `fieldName` string, required — Field name
  - `format` string — Field format
  - `hidden` boolean — Whether the field is hidden
  - `label` string — Field label
  - `sql` string — SQL expression for the field
  - `tags` string[] — Tags for the field
  - `topicContext` string — Topic context for topic-scoped fields
  - `viewName` string, required — View to add the field to

## Response `201`

Field created successfully

- SuccessResponse
  - `success` boolean, required — Whether the operation was successful

## Other responses

- `400` — Invalid request body
- `401` — Authentication required
- `403` — Permission denied
- `404` — Model or view 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/4701f292c621/schema)
