Skip to main content
POST
/
unstable
/
models
/
{modelId}
/
branch
/
{branchName}
/
merge
Merge a branch
curl --request POST \
  --url https://{instance}.omniapp.co/api/unstable/models/{modelId}/branch/{branchName}/merge \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "delete_branch": true,
  "publish_drafts": true,
  "commit_message": "Merged revenue metrics branch via CI/CD pipeline",
  "force_override_git_settings": false
}
'
{
"success": true,
"published_drafts_count": 2,
"failed_drafts_count": 0,
"git_synced": true
}
For PR-required and git follower models, direct merges via API are rejected by default as they would bypass the intended git workflow. You can use the force_override_git_settings flag to override this check when necessary, but git will not be synced to avoid force-pushing to main.
Model ConfigurationDefault BehaviorWith force_override_git_settings: true
No gitMerge succeeds, no git syncN/A
Git enabled (no PR required)Merge succeeds, syncs to gitN/A
Git + PR requiredRejected with 400 errorMerge succeeds, no git sync
Git + git followerRejected with 400 errorMerge succeeds, no git sync

Authorizations

Authorization
string
header
required

Can be either an Organization API Key or Personal Access Token (PAT).

Include in the Authorization header as: Bearer YOUR_TOKEN

Path Parameters

modelId
string<uuid>
required

The unique identifier of the model

branchName
string
required

The name of the branch to merge

Body

application/json
delete_branch
boolean
default:false

Delete the branch after merging

publish_drafts
boolean
default:true

When enabled, publish branch-attached drafts when merging

commit_message
string

Custom commit message for git sync. Defaults to "branch <name> merged via API"

Example:

"Merged revenue metrics branch via CI/CD pipeline"

force_override_git_settings
boolean
default:false

Allow merge for PR-required or git-follower models.

When enabled, the merge will succeed but git will not be synced to avoid force-pushing to main.

Response

Branch merged successfully

success
boolean

Whether the merge was successful

Example:

true

published_drafts_count
integer

Number of drafts that were published during the merge

Example:

2

failed_drafts_count
integer

Number of drafts that failed to publish

Example:

0

git_synced
boolean

Whether the changes were synced to git

Example:

true