v1

latestOpenAPI 3.1.02026-07-2618690613.4 KB
Models

Create or update YAML files

Create or overwrite a YAML file for a model. The file can be a special file (model or relationships) or a YAML file ending in .topic or .view.

The following models cannot be edited using this endpoint:

  • Schema models
  • Models using git follower mode
post/v1/models/{modelId}/yaml

Path parameters

modelIdstring uuid required

The ID of the model.

Request body

branchIdstring uuid

Required if git pull requests are required for the model. The ID of the branch to create or update. To retrieve branch IDs, use the List models endpoint with modelKind=BRANCH.

fileNamestring required

The name of the YAML file. Valid values are:

  • model - Model file
  • relationships - Relationships file
  • <topic_name>.topic - Topic file
  • <view_name>.view - View file
yamlstring required

The YAML contents of the file. This can be empty, in which case:

  • If empty and used with mode: extension the file will be removed from the model
  • If empty and used with mode: combined, the file will be ignored in the model
mode'combined' | 'extension' | 'staged' | 'merged' | 'history' required

The mode to use when creating or overwriting the YAML file.

Note: Workbook models must use combined mode if there is a branchId.

commitMessagestring

Required for git-enabled models. Commit message describing the change.

previousChecksumstring

Checksum of the file when fetched, for conflict detection. Obtain this value from the Get model YAML endpoint by including the includeChecksums parameter.

If the file has been modified since you fetched it, the request will fail with a File has been modified since it was fetched error.

fullyResolvedboolean

If true, accepts fully-resolved YAML. This means that Omni will resolve any extension (extends) usage and place the changes into the appropriate model files.

When false (default), the YAML is saved as-is to the specified file. This means that even if extensions are used, they will not be included in the changes.

Response

YAML file updated successfully

fileNamestring

The name of the file that was created or updated.

successboolean

Indicates the request was successful.