Migrate a model
Copies a model from one Omni connection to another by reading the source model’s YAML at a specific git ref and writing it to the target model. Supports same-organization and cross-organization migrations.
This API:
- Reads the full model YAML from the source model’s git repository at the specified
gitRef(merged with the default branch). - If
branchNameis provided and the branch already exists on the target model, the API writes to that branch. If the branch doesn’t exist, one is created. - Writes the YAML to the target model or branch, replacing its model definition.
Requirements
To successfully migrate a model:
- The user performing the migration must have:
- For the source model - Querier, Modeler, or Connection Admin permissions
- For the target model - Modeler or Connection Admin permissions
- For cross-organization migrations - The user must be a member of both organizations
- The source model must have git configured. This is required so the API can read the model YAML from the repository.
- The target model should have an identical schema model to the source model at the instant the git ref was committed.
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.
Authorizations
Requires an Organization API Key. Personal Access Tokens (PATs) are not supported for this endpoint.
Include in the Authorization header as: Bearer ORGANIZATION_API_KEY
Path Parameters
The shared model ID to read YAML from.
Body
Git reference (branch name, tag, or commit SHA) to read the source model YAML from.
"main"
The shared model ID to write the YAML to.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Required if the target model has git enabled.. Branch name on the target model. If the branch doesn't exist, it will be created.
"migrate-from-prod"
Git commit message.
"Migrate model from production"
Response
Model migrated successfully
Whether the migration completed successfully.
true