Skip to main content
POST
/
v1
/
models
/
{modelId}
/
git
Create git configuration
curl --request POST \
  --url https://{instance}.omniapp.co/api/v1/models/{modelId}/git \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "authMethod": "ssh",
  "cloneUrl": "git@github.com:org/repo.git",
  "baseBranch": "main",
  "gitServiceProvider": "github",
  "modelPath": "omni/blobs_r_us",
  "requirePullRequest": "users-only"
}
'
{
  "authMethod": "ssh",
  "baseBranch": "main",
  "branchPerPullRequest": false,
  "gitFollower": false,
  "gitServiceProvider": "github",
  "modelPath": "omni/my_model",
  "publicKey": "ssh-ed25519 AAAA...",
  "requirePullRequest": "users-only",
  "cloneUrl": "git@github.com:org/repo.git",
  "webUrl": "https://github.com/org/repo",
  "webhookSecret": "whsec_abc123xyz789",
  "webhookUrl": "https://app.omni.co/api/webhooks/model/..."
}

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 shared model.

Body

application/json
cloneUrl
string
required

Clone URL of the git repository. Varies depending on the authMethod:

  • ssh - A string starting with git@...
  • https_token - A string starting with https://...
Example:

"git@github.com:org/repo.git"

authMethod
enum<string>

The authentication method to use:

  • ssh for deploy key
  • https_token for deploy token/PAT
Available options:
ssh,
https_token
Example:

"ssh"

sshUrl
string
deprecated

Deprecated. Use cloneUrl instead. The SSH URL of the git repository.

Example:

"git@github.com:org/repo.git"

token
string

Required when authMethod: https_token. HTTPS token for authentication (deploy token value, PAT, etc.).

Maximum string length: 1000
Pattern: ^[a-zA-Z0-9_\\-.]+$
baseBranch
string
default:main

The target branch for Omni pull requests.

Example:

"main"

branchPerPullRequest
boolean
default:false

If true, all pull requests will create a branch in Omni, even those created outside of the tool.

Example:

false

gitFollower
boolean
default:false

If true, the shared model is read-only and can only be updated by merging pull requests to the baseBranch.

Example:

false

gitServiceProvider
enum<string>
default:auto

The git provider type. Use auto for automatic detection based on the SSH URL.

  • auto - Automatically detect the provider
  • github - GitHub
  • gitlab - GitLab
  • azure_devops - Azure DevOps
  • bitbucket - Bitbucket Cloud
  • bitbucket_datacenter - Bitbucket Data Center (self-hosted)
Available options:
auto,
github,
gitlab,
azure_devops,
bitbucket,
bitbucket_datacenter
Example:

"github"

modelPath
string

Path to model files within the repository.

Example:

"omni/blobs_r_us"

requirePullRequest
enum<string>
default:never

Controls when pull requests are required for changes:

  • always - Required for all changes
  • users-only - Required only for user-initiated changes
  • never - Never required
Available options:
always,
users-only,
never
Example:

"users-only"

webUrl
string

Custom web URL for the git repository. Use when the cloneUrl goes through a tunnel/VPC and differs from the inferred HTTPS address.

Example:

"https://github.com/org/repo"

Response

Git configuration created successfully

authMethod
enum<string>

Authentication method. ssh for deploy key, https_token for deploy token/PAT.

Available options:
ssh,
https_token
Example:

"ssh"

cloneUrl
string

Clone URL of the git repository (SSH or HTTPS)

Example:

"git@github.com:org/repo.git"

baseBranch
string

The target branch for Omni pull requests.

Example:

"main"

branchPerPullRequest
boolean

If true, all pull requests will create a branch in Omni, even those created outside of the tool.

Example:

false

gitFollower
boolean

If true, the shared model is read-only and can only be updated by merging pull requests to the base branch.

Example:

false

gitServiceProvider
enum<string>

The git provider type.

  • github - GitHub
  • gitlab - GitLab
  • azure_devops - Azure DevOps
  • bitbucket - Bitbucket
Available options:
github,
gitlab,
azure_devops,
bitbucket
Example:

"github"

modelPath
string | null

Path to model files in the repository.

Example:

"omni/blobs_r_us"

publicKey

SSH public key for repository access (deploy key). Null for HTTPS token auth (authMethod: https_token).

Example:

"ssh-ed25519 AAAA..."

requirePullRequest
enum<string>

Controls when pull requests are required for changes:

  • always - Required for all changes
  • users-only - Required only for user-initiated changes
  • never - Never required
Available options:
always,
users-only,
never
Example:

"users-only"

sshUrl
string
deprecated

Deprecated. Use cloneUrl instead. SSH URL of the git repository.

Example:

"git@github.com:org/repo.git"

webUrl
string | null

Custom web URL for the git repository, or null if not set.

Example:

"https://github.com/org/repo"

webhookSecret
string

Webhook secret for signature verification. Only included if requested via ?include=webhookSecret.

webhookUrl
string

Webhook URL to configure in your git provider.

Example:

"https://app.omni.co/api/webhooks/model/..."