Update a Git Sync installation configuration

Updates the installation configuration, then queues a sync operation using the new settings. A git priority queues an import from the selected repository and branch into GitBook; a gitbook priority queues an export from GitBook to the repository. Site imports require a gitbook-docs.yaml file at the configured project directory and return a conflict without saving or queuing the sync when the file is missing. Updates to GitLab instances also return a conflict if their settings changed while the update was being prepared; reload the installation before retrying.

patch
Authorizations
AuthorizationstringRequired
Bearer authentication header of the form Bearer <token>.
Path parameters
installationIdstringRequired

Identifier of the installation

Body

Provider-specific setup payload for a Git Sync installation.

projectDirectorystringOptional

Optional directory used when syncing a monorepo subdirectory.

commitMessageTemplatestringOptional

Optional template used when generating commit messages.

previewExternalBranchesbooleanOptional

Whether previews should be generated from branches outside the configured branch. For space installations belonging to a parent installation, this field is inherited from the parent installation and cannot be set.

prioritystring · enumOptional

Which side should be treated as the source of truth when Git Sync is configured.

Possible values:
Responses
200

Git Sync installation was updated successfully

application/json

Provider-specific setup payload for a Git Sync installation.

projectDirectorystringOptional

Optional directory used when syncing a monorepo subdirectory.

commitMessageTemplatestringOptional

Optional template used when generating commit messages.

previewExternalBranchesbooleanOptional

Whether previews should be generated from branches outside the configured branch. For space installations belonging to a parent installation, this field is inherited from the parent installation and cannot be set.

prioritystring · enumOptional

Which side should be treated as the source of truth when Git Sync is configured.

Possible values:
objectstring · enumRequiredPossible values:
idstringRequired

Unique identifier of the Git Sync installation.

parentInstallationIdstringOptional

The ID of the parent Git Sync installation, if any.

targetone ofRequired

Resource targeted by a Git Sync installation.

or
statusstring · enumRequiredPossible values:
createdAtstring · date-timeRequired
createdBystringRequired

Identifier of the user who created the installation.

authorizedBystring · nullableRequired

Identifier of the user who connected the Git provider credentials. Only this user can browse repositories or change the repository and branch with them. Null when it is unknown, for credentials connected before it was recorded, until someone reconnects the provider.

updatedAtstring · date-timeRequired
patch/git/installations/{installationId}
PATCH /v1/git/installations/{installationId} HTTP/1.1
Host: api.gitbook.com
Authorization: Bearer YOUR_SECRET_TOKEN
Content-Type: application/json
Accept: */*
Content-Length: 289

{
  "projectDirectory": "text",
  "commitMessageTemplate": "text",
  "previewExternalBranches": true,
  "agentInstructions": [
    "agents"
  ],
  "priority": "git",
  "provider": "github",
  "providerConfiguration": {
    "repositoryId": 1,
    "branch": "text"
  },
  "childInstallationProjectDirectories": {
    "ANY_ADDITIONAL_PROPERTY": "text"
  }
}
{
  "projectDirectory": "text",
  "commitMessageTemplate": "text",
  "previewExternalBranches": true,
  "agentInstructions": [
    "agents"
  ],
  "priority": "git",
  "provider": "github",
  "providerConfiguration": {
    "repositoryId": 1,
    "branch": "text"
  },
  "object": "git-sync-installation",
  "id": "text",
  "parentInstallationId": "text",
  "target": {
    "type": "space",
    "spaceId": "text",
    "siteId": "text"
  },
  "status": "unauthenticated",
  "repositoryConnection": {
    "object": "git-repository-connection",
    "id": "text",
    "provider": "github",
    "repositoryId": "text",
    "repositoryName": "text",
    "repositoryUrl": "https://example.com",
    "defaultBranch": "text",
    "authState": "pending",
    "capabilities": {
      "pullRequests": true,
      "commitStatuses": true
    },
    "createdAt": "2026-01-01T00:00:00.000Z",
    "updatedAt": "2026-01-01T00:00:00.000Z"
  },
  "repositoryRef": {
    "object": "git-repository-ref",
    "id": "text",
    "name": "text",
    "type": "branch",
    "latestObservedCommitId": "text",
    "latestImportedCommitId": "text",
    "updatedAt": "2026-01-01T00:00:00.000Z"
  },
  "syncRoot": {
    "object": "git-sync-root",
    "id": "text",
    "installationId": "text",
    "target": {
      "type": "space",
      "spaceId": "text",
      "siteId": "text"
    },
    "defaultMergeAuthorityPolicy": "provider",
    "status": "active",
    "createdAt": "2026-01-01T00:00:00.000Z",
    "updatedAt": "2026-01-01T00:00:00.000Z"
  },
  "createdAt": "2026-01-01T00:00:00.000Z",
  "createdBy": "text",
  "authorizedBy": "text",
  "updatedAt": "2026-01-01T00:00:00.000Z",
  "urls": {
    "location": "https://example.com"
  }
}

Last updated

Was this helpful?

Powered by GitBook