Skip to navigation

Create Model

Creates a new model.

A model defines a query or view over a connection’s data — for example, a SQL query, a filtered object, or a joined dataset. Models are used as sources when creating model syncs.

The connection referenced by connection_id must have source capabilities. Use GET /api/connection_types/{id} to check whether a connection type supports use as a source.

Authentication

AuthorizationBasic

This is the Polytomic deployment key (on-premises only)

OR
AuthorizationBearer
This is the Polytomic API key

Headers

X-Polytomic-VersionstringRequired

Query parameters

asyncbooleanOptional
Run in the background and return a job instead of the result.

Request

This endpoint expects an object.
configurationmap from strings to anyRequired
Model configuration for the source connection type
connection_idstringRequiredformat: "uuid"
Connection ID of the model's source, which cannot be changed after the model is created
namestringRequired
Model name
additional_fieldslist of objects or nullOptional

User-defined fields to add to the model alongside its source fields

enricherobjectOptional
Enrichment to apply to the model
fieldslist of strings or nullOptional

Technical/source field names to publish in the model. Use source names, not model-field UUIDs or display labels. For example, use dealname rather than Deal Name. Omit or pass an empty array to publish all standard source fields.

identifierstringOptional
Source field name of the model's unique identifier
organization_idstring or nullOptionalformat: "uuid"

Ignored for user and organization-scoped API keys, which always act in their own organization

policieslist of strings or nullOptional

Permissions policy IDs applied to the model. On update, a non-empty list replaces the model’s policies and an empty or omitted list leaves them unchanged.

relationslist of objects or nullOptional
Joins from this model's fields to fields on other models
tracking_columnslist of strings or nullOptional
Source field names used to detect changed records
labelslist of strings or nullOptionalDeprecated

Deprecated; ignored

Response

OK
dataobjectOptional
The model
jobobjectOptional
Background job running the request when async is true

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
500
Internal Server Error