v4

latestOpenAPI 3.1.02026-08-01207318738.7 KB
Models

Create field

post/api/v1/models/{modelId}/field

Path parameters

modelIdstring uuid required

Model UUID

Example:123e4567-e89b-12d3-a456-426614174000

Model UUID

Request body

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.

aiContextstring

AI context for the field

descriptionstring

Field description

fieldNamestring required

Field name

formatstring

Field format

hiddenboolean

Whether the field is hidden

labelstring

Field label

sqlstring

SQL expression for the field

tagsstring[]

Tags for the field

topicContextstring

Topic context for topic-scoped fields

viewNamestring required

View to add the field to

Example request

{
  "aggregateType": "SUM",
  "fieldName": "total_revenue",
  "viewName": "orders"
}

Response

Field created successfully

successboolean required

Whether the operation was successful

Example response

{
  "success": true
}