Skip to main content
POST
/
v1
/
models
/
{modelId}
/
migrate
Migrate a model
curl --request POST \
  --url https://{instance}.omniapp.co/api/v1/models/{modelId}/migrate \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "gitRef": "main",
  "targetModelId": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
  "branchName": "migrate-from-prod",
  "commitMessage": "Migrate model from production"
}
'
{
  "success": true
}

Authorizations

Authorization
string
header
required

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

modelId
string<uuid>
required

The shared model ID to read YAML from.

Body

application/json
gitRef
string
required

Git reference (branch name, tag, or commit SHA) to read the source model YAML from.

Example:

"main"

targetModelId
string<uuid>
required

The shared model ID to write the YAML to.

Example:

"a1b2c3d4-e5f6-7890-abcd-ef1234567890"

branchName
string

Required if the target model has git enabled.. Branch name on the target model. If the branch doesn't exist, it will be created.

Example:

"migrate-from-prod"

commitMessage
string

Git commit message.

Example:

"Migrate model from production"

Response

Model migrated successfully

success
boolean

Whether the migration completed successfully.

Example:

true