Models

Create or update YAML files

Changed on

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, .view, or .composite_topic.

The following models cannot be edited using this endpoint:

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

Request

  • Base URL
    https://blobsrus.omniapp.co/api
  • URL
    https://blobsrus.omniapp.co/api/v1/models/{modelId}/yaml
  • Auth
    HTTP bearer

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
  • <composite_topic_name>.composite_topic - Composite 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:

  • combined - Workbook models must use this mode if there is a branchId.
  • extension
  • staged
  • merged - Requires a branchId on a shared or shared extension model.
  • history
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.

rejectIfViewExistsboolean

Only applies to <view_name>.view files. If true, rejects the upload when the target model layer already defines the resolved view name. Doesn't apply to uploads that extend an inherited view.

Incompatible with branchId, as a branch only sees the branch's own views and can't reliably identify a duplicate in the shared model.

Omitted or false preserves the existing behavior, where the upload merges into or duplicates an existing view.

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.

Changes