The Create or update YAML files endpoint writes one file per request. When you target a git-enabled shared model directly, each write triggers its own git sync. At hundreds or thousands of files, that results in a process that could take hours. The fix is to write against a model branch instead, then merge the branch once when all updates are complete. Git syncs a single time, on the merge.Documentation Index
Fetch the complete documentation index at: https://docs.omni.co/llms.txt
Use this file to discover all available pages before exploring further.
Requirements
To follow the steps in this guide, you’ll need:- An Omni API key
- Modeler or higher permissions on the shared model you want to update
- The shared model’s
modelIdandconnectionId, which you can retrieve using the List models endpoint
Create a branch off the shared model
Call the Create model endpoint with Save two values from the response:
modelKind: "BRANCH". Set baseModelId to the shared model you want to branch from and reuse its connectionId.id— The branch’s UUID, which you’ll pass asbranchIdin the next step.modelName— What you provided in the request body. The merge endpoint identifies the branch by name, not by ID, so you need this exact string later.
Write YAML files against the branch
For each file, call the Create or update YAML files endpoint:In the path, put the shared model’s ID. For the request body:
branchId- The branch UUID from step 1’s response (id). This routes the write operation to the branch instead of the shared model and is required for models where pull requests are required.fileName- The name of the file being created or updated. This can bemodel,relationships,<topic_name>.topicfor topics, or<view_name>.viewfor view files.yaml- The YAML content of the file as a formatted JSON stringmode- Set tocombinedcommitMessage- Required if the model has git enabled. A short commit message for the change.
Validate before merging
Validation is optional but strongly recommended — it catches issues on the branch before they reach the shared model, where they could break existing dashboards and queries.Two endpoints validate different surfaces: Validate model for the YAML itself, and Validate content for the dashboards and queries that depend on it. Run both for the safest merge.
-
Validate the model. Use the Validate model endpoint to catch broken references, invalid types, and structural issues introduced by your YAML writes.
-
Validate content. Use the Validate content endpoint to catch dashboards and queries that reference fields or views the branch renamed or removed. Note the query parameter is
branch_id(snake_case) on this endpoint.
Merge the branch
The Merge branch endpoint can’t be used with models that require pull requests or those using git follower mode. See the Merge branch documentation for more information.
modelName you saved from the step 1 response as the <BRANCH_MODEL_NAME> in the path:delete_branch: true to clean up the branch after the merge succeeds.A successful response returns success: true and for git-enabled models, git_synced: true. This is the one git sync for the entire batch of updates.Next steps
- Branch Mode for the full concept overview and UI workflow equivalents
- Omni API rate limiting to size your batch loop appropriately
- Local development guide for a CLI-driven alternative when you want to edit YAML in your IDE rather than scripting against the API