Skip to navigation

Update a data model from a code representation

View as Markdown

This endpoint replaces a data model with the contents defined in a code representation. You can programmatically update the data model’s structure, metadata, and contents. This creates a new version of the data model, which is accessible from the Sigma UI.

For more information on managing data models via the Sigma API, see Manage data models as code. For more information on using this endpoint, including an end-to-end example, see Update a data model from a code representation.

Usage notes

  • To perform this operation, you must use API credentials owned by a user assigned an account type with Create, edit, and publish data models permission.
  • To perform this operation, you must use API credentials owned by a user with Can edit access to the data model.
  • Retrieve a representation of an existing data model by calling the /v2/dataModels/{dataModelId}/spec endpoint.
  • To create a new data model from code, use the /v2/dataModels/spec endpoint.
  • The endpoint only supports updates to the pages array and its contents. Additional fields are not required and are ignored in the request body.
  • When documentVersion is provided in the request body, the update fails when the data model has changed since that version. If omitted, the update preserves last-write-wins behavior.
  • Partial updates are not supported. You must provide the entire representation of the data model in the request body.
  • The default format of the representation is JSON. To use YAML, add the header Content-Type: application/yaml.

Usage scenarios

  • Automation: If you want to update several data models across one or more organizations, or in response to external events, you can use this endpoint to programmatically update the data models.
  • Integration: Using this endpoint, you can update data models based on external data sources or integrate Sigma with other tools and platforms.
  • Version control: Developers can use this endpoint to programmatically manage, update, and version control data models between several organizations or tenants.
  • Agentic workflows: Agents can use these endpoints to directly manage data model contents in code.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Path parameters

dataModelIdstringRequired
Unique identifier of the data model.

Request

The request body.
schemaVersionenumRequired
The schema version used by this representation of the data model.
Allowed values:
pageslist of objectsRequired
The pages of the data model and their contents.
kindenumOptional
Document kind. Informational field, ignored when creating or updating a document.
Allowed values:
documentVersiondoubleOptional
When provided, update only if the data model is still at this document version.

Response

The response body.
successboolean
dataModelIdstring