Need help? Get answers from the docs with Omni's in-app AI! Log in to your Omni instance and open the Omni Agent in the sidebar.
curl --request POST \
--url https://{instance}.omniapp.co/api/v1/models/{modelId}/git/commit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"commit_message": "Add new customer dimension",
"allow_branch_exists": true,
"require_branch_exists": false
}
'{
"pr_url": "https://github.com/myorg/repo/compare/main...feature?expand=1",
"git_sha": "abc123def456",
"in_sync": true,
"did_sync": true
}This endpoint requires Modeler or Connection Admin permisisons.
Pushes a branch’s model contents to git and creates or updates a pull request. This mirrors the Create Pull Request / Update Pull Request buttons in Omni allowing API consumers and AI agents to drive the pull request workflow programmatically.
By default, the endpoint automatically detects whether the git branch exists. If a branch doesn’t exist, a successful request will create a new git branch and open a pull request. If a branch does exist, a commit will be added to the branch.
The allow_branch_exists and require_branch_exists parameters constrain this behavior:
allow_branch_exists: false) - Fails if the git branch already existsrequire_branch_exists: true) - Fails if the git branch doesn’t existcurl --request POST \
--url https://{instance}.omniapp.co/api/v1/models/{modelId}/git/commit \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"branch_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
"commit_message": "Add new customer dimension",
"allow_branch_exists": true,
"require_branch_exists": false
}
'{
"pr_url": "https://github.com/myorg/repo/compare/main...feature?expand=1",
"git_sha": "abc123def456",
"in_sync": true,
"did_sync": true
}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.
Can be either an Organization API Key or Personal Access Token (PAT).
Include in the Authorization header as: Bearer YOUR_TOKEN
The unique identifier of the shared model.
UUID of the Omni branch to commit.
"a1b2c3d4-e5f6-7890-abcd-ef1234567890"
Commit message for the git commit.
"Add new customer dimension"
Set false to fail if git branch already exists (Create-only mode).
true
Set true to fail if git branch doesn't exist (Update-only mode).
false
Commit operation completed successfully
URL of the created or updated pull request.
"https://github.com/myorg/repo/compare/main...feature?expand=1"
The git SHA of the commit.
"abc123def456"
Whether the model is currently in sync with the git repository.
true
Whether a sync operation was performed.
true
Was this page helpful?