---
title: "Update git configuration"
method: PATCH
path: "/api/v1/models/{modelId}/git"
tags: ["Models"]
---

# Update git configuration

`PATCH /api/v1/models/{modelId}/git`

Update git configuration for a model. Only provided fields are changed. For SSH auth, a bring-your-own deploy key can be set via deployPrivateKey (with deployKeyPassphrase for encrypted keys), enabling zero-downtime key rotation: authorize the matching public key with the git provider first, then set the key here.

## Path parameters

- `modelId` string, uuid, required — Model UUID

## Request body

- ModelsGitUpdateBody
  - `authMethod` 'ssh' | 'https_token' | 'github_app' — Authentication method to change to.
  - `baseBranch` string — The target branch for Omni pull requests
  - `branchPerPullRequest` boolean — If true, all pull requests will create a branch in Omni
  - `cloneUrl` string — Clone URL of the git repository (SSH or HTTPS).
  - `commitSigningCommitterEmail` string, email, nullable — Verified email of the GitHub user that owns the registered signing key, written into signed commits (github_app auth only). Send a string to set it, null to clear it (disabling signing), or omit it to leave the stored value unchanged. Must be set, cleared, or omitted together with commitSigningCommitterName.
  - `commitSigningCommitterName` string, nullable — Display name written into signed commits (github_app auth only). Send a string to set it, null to clear it (disabling signing), or omit it to leave the stored value unchanged. Must be set, cleared, or omitted together with commitSigningCommitterEmail.
  - `deployKeyPassphrase` string — Passphrase for deployPrivateKey when it is encrypted. Omni uses it once to decrypt the key, then stores the key under its own encryption at rest; the passphrase itself is not retained.
  - `deployPrivateKey` string — Bring-your-own SSH deploy private key in PEM format (RSA or ED25519, as produced by ssh-keygen), used instead of an Omni-generated keypair. On update it replaces the current key, enabling zero-downtime rotation: authorize the matching public key with your git provider first, then set it here. Only valid for SSH auth.
  - `gitFollower` boolean — If true, the shared model will be read-only
  - `gitServiceProvider` 'github' | 'gitlab' | 'azure_devops' | 'bitbucket' | 'bitbucket_datacenter' | 'auto' — The git provider type
  - `githubAppInstallationId` string — Numeric GitHub App installation ID (the value in the URL after installing the Omni GitHub App on the repo). Required when authMethod is "github_app".
  - `modelPath` string — Path to model files in the repository
  - `requirePullRequest` 'always' | 'users-only' | 'never' — Controls when pull requests are required
  - `sshUrl` string — Deprecated — use cloneUrl. Clone URL of the git repository.
  - `token` string — HTTPS token for authentication (deploy token value, PAT, etc.).
  - `webUrl` string — Custom web URL for the git repository. Use when the clone URL goes through a tunnel/VPC and differs from the inferred HTTPS address

## Response `200`

Git configuration updated

- ModelsGitUpdateResponse
  - `authMethod` 'ssh' | 'https_token' | 'github_app', required — Authentication method. "ssh" for deploy key, "https_token" for deploy token/PAT, "github_app" for a GitHub App installation.
  - `baseBranch` string, required — The target branch for Omni pull requests
  - `branchPerPullRequest` boolean, required — If true, all pull requests will create a branch in Omni, even those created outside of the tool
  - `cloneUrl` string, required — Clone URL of the git repository (SSH or HTTPS)
  - `commitSigningCommitterEmail` string, nullable, required — Committer email written into signed commits (github_app auth). Null when signing is not configured.
  - `commitSigningCommitterName` string, nullable, required — Committer display name written into signed commits (github_app auth). Null when signing is not configured.
  - `commitSigningPublicKey` string, nullable, required — SSHSIG signing public key to register on the committer’s GitHub user (github_app auth). Null for other auth methods.
  - `gitFollower` boolean, required — If true, the shared model is read-only and can only be updated by merging pull requests to the base branch
  - `gitServiceProvider` string, required — The git provider type
  - `githubAppInstallationId` string, nullable, required — GitHub App installation ID. Null unless github_app auth.
  - `modelPath` string, nullable, required — Path to model files in the repository
  - `publicKey` string, nullable, required — SSH public key for repository access (deploy key). Null for HTTPS token auth.
  - `requirePullRequest` 'always' | 'users-only' | 'never', required — When pull requests are required: "always" for all changes, "users-only" for user-initiated changes only, "never" for direct commits.
  - `sshUrl` string, required — Deprecated — use cloneUrl. Clone URL of the git repository.
  - `webUrl` string, nullable, required — Custom web URL for the git repository, or null if not set
  - `webhookSecret` string — Webhook secret for signature verification. Only included if requested via ?include=webhookSecret
  - `webhookUrl` string, required — Webhook URL to configure in your git provider

## Other responses

- `400` — Invalid SSH URL or configuration
- `401` — Authentication required
- `403` — Permission denied
- `404` — Model not found or git not configured

---

[API](https://skmtc.net/omniapp/apis/omni-api.md) · [All operations](https://skmtc.net/omniapp/apis/omni-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/omniapp/omni-api/versions/4701f292c621/schema)
