# Update the project's git integration

`PATCH https://api.lingohub.com/v2/projects/{projectId}/integrations/git`

LingoHub API V2 (Beta) · [Git Integrations](https://developers.lingohub.com/reference/v2/operations/tags/git-integrations.md) · operation `updateProjectGitIntegration`

Changes the project's git integration (JSON merge-patch): connection, sync schedule, push settings or selection; send only what changes, lists are replaced as a whole. All changes apply together or not at all. Selection changes have side effects: turning branching off deletes every branch except the default one, new branch filters add or remove tracked branches, and new path filters start an import on every branch. A new `git_branch` renames the default branch. Requires stack-level settings management permission.

## Parameters

| Parameter | In | Required | Type | Description |
| --- | --- | --- | --- | --- |
| `projectId` | path | yes | string |  |
| `If-Match` | header | no | string | Optional precondition. Send the quoted ETag from a GET of this resource. The mutation only runs if a strong tag matches the current representation, checked under the write lock. A comma-separated list is allowed; '*' req… |

## Example request

```sh
curl --request PATCH \
  --url https://api.lingohub.com/v2/projects/PROJECT_ID/integrations/git \
  --header 'Authorization: Bearer YOUR_API_KEY' \
  --header 'Content-Type: application/json' \
  --data '{
  "git_authentication_id": "iau_0197c8f2-5a6b-7cde-8f12-3456789abcde",
  "namespace": "company",
  "name": "app",
  "git_branch": "main"
}'
```

## Responses

- `200`: The changed git integration.
- `400`: 
- `401`: 
- `403`: 
- `404`: 
- `409`: `git_integration_unauthorized`: the git host refused the connection's credentials. `branch_not_ready`: the default branch is still being created. `conflict`: the integration changed while the git host was asked; read it…
- `412`: 
- `422`: `validation_failed`: every invalid field at once, also the combinations the sections must agree on (a `PERIODIC` mode needs its schedule, `ON_COMPLETION` a push type for at least one kind of branch, branch filters need b…
- `429`: 
- `500`: 
- `502`: `upstream_error`: the git host failed, or answered with more or other data than LingoHub accepts.
- `503`: 
- `504`: `upstream_timeout`: the git host didn't answer in time.

## OpenAPI definition

The complete definition of this operation, with every schema it references:

````json
{
  "openapi": "3.1.0",
  "info": {
    "title": "LingoHub API V2 (Beta)",
    "version": "2.0"
  },
  "servers": [
    {
      "url": "https://api.lingohub.com",
      "description": "LingoHub"
    }
  ],
  "tags": [
    {
      "name": "Git Integrations",
      "description": "Connect a project to a Git repository and sync files with it as async jobs."
    }
  ],
  "paths": {
    "/v2/projects/{projectId}/integrations/git": {
      "patch": {
        "tags": [
          "Git Integrations"
        ],
        "summary": "Update the project's git integration",
        "description": "Changes the project's git integration (JSON merge-patch): connection, sync schedule, push settings or selection; send only what changes, lists are replaced as a whole. All changes apply together or not at all. Selection changes have side effects: turning branching off deletes every branch except the default one, new branch filters add or remove tracked branches, and new path filters start an import on every branch. A new `git_branch` renames the default branch. Requires stack-level settings management permission.",
        "operationId": "updateProjectGitIntegration",
        "parameters": [
          {
            "name": "projectId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "description": "Public id that is created from the type prefix of the corresponding resource and its UUID. I.e : For a project, a valid value would be : pr_0197c8f2-5a6b-7cde-8f12-3456789abcde",
              "pattern": "^pr_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
            }
          },
          {
            "name": "If-Match",
            "in": "header",
            "description": "Optional precondition. Send the quoted ETag from a GET of this resource. The mutation only runs if a strong tag matches the current representation, checked under the write lock. A comma-separated list is allowed; '*' requires an existing representation. Weak tags never match. Omit this header for an unconditional write. For an action, use the ETag from GET of the target resource, without the action suffix. A stale tag returns 412; read the current state before retrying.",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectGitIntegration"
              }
            },
            "application/merge-patch+json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProjectGitIntegration"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "The changed git integration.",
            "headers": {
              "ETag": {
                "$ref": "#/components/headers/ETag"
              },
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectGitIntegration"
                }
              }
            }
          },
          "400": {
            "$ref": "#/components/responses/BadRequest"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "$ref": "#/components/responses/NotFound"
          },
          "409": {
            "description": "`git_integration_unauthorized`: the git host refused the connection's credentials. `branch_not_ready`: the default branch is still being created. `conflict`: the integration changed while the git host was asked; read it again and retry.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "412": {
            "$ref": "#/components/responses/PreconditionFailed"
          },
          "422": {
            "description": "`validation_failed`: every invalid field at once, also the combinations the sections must agree on (a `PERIODIC` mode needs its schedule, `ON_COMPLETION` a push type for at least one kind of branch, branch filters need branching). A repository or remote branch the git host does not know is `not_found` on `name` or `git_branch`.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "$ref": "#/components/responses/TooManyRequests"
          },
          "500": {
            "$ref": "#/components/responses/InternalServerError"
          },
          "502": {
            "description": "`upstream_error`: the git host failed, or answered with more or other data than LingoHub accepts.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "$ref": "#/components/responses/ServiceUnavailable"
          },
          "504": {
            "description": "`upstream_timeout`: the git host didn't answer in time.",
            "headers": {
              "RateLimit": {
                "$ref": "#/components/headers/RateLimit"
              },
              "RateLimit-Policy": {
                "$ref": "#/components/headers/RateLimit-Policy"
              }
            },
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "UpdateProjectGitIntegration": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request body to change a project's git integration (JSON merge-patch): send only what changes. A new connection, repository or `git_branch` is checked with the git host, as when connecting the project.",
        "properties": {
          "git_authentication_id": {
            "type": "string",
            "description": "A git connection from listIntegrationAuthentications.",
            "example": "iau_0197c8f2-5a6b-7cde-8f12-3456789abcde",
            "pattern": "^iau_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "namespace": {
            "type": "string",
            "description": "The repository's namespace, as the repository lookups name it; empty for CodeCommit.",
            "example": "company",
            "maxLength": 4096
          },
          "name": {
            "type": "string",
            "description": "The repository's name.",
            "example": "app",
            "maxLength": 4096,
            "minLength": 1
          },
          "git_branch": {
            "type": "string",
            "description": "The remote branch the project's default branch syncs with; the default branch is renamed after it.",
            "example": "main",
            "maxLength": 255,
            "minLength": 1
          },
          "sync": {
            "$ref": "#/components/schemas/UpdateGitSync",
            "description": "When LingoHub pulls and pushes by itself."
          },
          "push": {
            "$ref": "#/components/schemas/UpdateGitPush",
            "description": "How LingoHub pushes."
          },
          "selection": {
            "$ref": "#/components/schemas/UpdateGitSelection",
            "description": "Which files and branches LingoHub syncs."
          }
        }
      },
      "UpdateGitSync": {
        "type": "object",
        "additionalProperties": false,
        "description": "When LingoHub pulls and pushes by itself (JSON merge-patch). A schedule exists only for a `PERIODIC` mode: entering `PERIODIC` needs one, leaving it drops it.",
        "properties": {
          "import_mode": {
            "$ref": "#/components/schemas/GitImportMode",
            "description": "When LingoHub pulls by itself.",
            "example": "PERIODIC"
          },
          "import_schedule": {
            "description": "When LingoHub pulls; required for `PERIODIC`, null otherwise.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/SetGitSchedule"
              },
              {
                "type": "null"
              }
            ]
          },
          "export_mode": {
            "$ref": "#/components/schemas/GitExportMode",
            "description": "When LingoHub pushes by itself.",
            "example": "ON_COMPLETION"
          },
          "export_schedule": {
            "description": "When LingoHub pushes; required for `PERIODIC`, null otherwise.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/SetGitSchedule"
              },
              {
                "type": "null"
              }
            ]
          }
        }
      },
      "GitImportMode": {
        "type": "string",
        "description": "Configured automatic repository import mode.",
        "enum": [
          "NONE",
          "AUTOMATIC",
          "PERIODIC"
        ]
      },
      "SetGitSchedule": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request body to configure a periodic Git schedule in UTC.",
        "properties": {
          "period": {
            "$ref": "#/components/schemas/GitSchedulePeriod",
            "description": "Daily or weekly repetition.",
            "example": "DAILY"
          },
          "time": {
            "type": "string",
            "description": "Execution time in UTC, HH:mm.",
            "example": "10:30",
            "pattern": "(?:[01][0-9]|2[0-3]):[0-5][0-9]"
          },
          "day_of_week": {
            "description": "Required for WEEKLY; null for DAILY.",
            "example": "MONDAY",
            "oneOf": [
              {
                "$ref": "#/components/schemas/GitScheduleWeekday"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "period",
          "time"
        ]
      },
      "GitSchedulePeriod": {
        "type": "string",
        "description": "Period of a persisted repository schedule.",
        "enum": [
          "DAILY",
          "WEEKLY"
        ]
      },
      "GitScheduleWeekday": {
        "type": "string",
        "description": "Weekday of a weekly repository schedule.",
        "enum": [
          "MONDAY",
          "TUESDAY",
          "WEDNESDAY",
          "THURSDAY",
          "FRIDAY",
          "SATURDAY",
          "SUNDAY"
        ]
      },
      "GitExportMode": {
        "type": "string",
        "description": "Configured automatic repository export mode.",
        "enum": [
          "NONE",
          "PERIODIC",
          "ON_COMPLETION"
        ]
      },
      "UpdateGitPush": {
        "type": "object",
        "additionalProperties": false,
        "description": "How LingoHub pushes (JSON merge-patch).",
        "properties": {
          "push_type": {
            "$ref": "#/components/schemas/PushType",
            "description": "Whether a push commits to the branch or opens a pull request.",
            "example": "PULL_REQUEST"
          },
          "commit_message": {
            "type": "string",
            "description": "Commit message template.",
            "example": "Update translations",
            "maxLength": 16384,
            "minLength": 1
          },
          "commit_description": {
            "type": "string",
            "description": "Commit description template; may be empty.",
            "example": "Translations from LingoHub",
            "maxLength": 16384
          },
          "pull_request_title": {
            "type": "string",
            "description": "Pull request title template.",
            "example": "Update translations",
            "maxLength": 16384,
            "minLength": 1
          },
          "pull_request_description": {
            "type": "string",
            "description": "Pull request description template; may be empty.",
            "example": "Translations from LingoHub",
            "maxLength": 16384
          },
          "pull_request_branch": {
            "type": "string",
            "description": "Template of the branch a pull request comes from.",
            "example": "lingohub/translations_{base_branch}",
            "maxLength": 16384,
            "minLength": 1
          },
          "auto_push_default_branch_type": {
            "$ref": "#/components/schemas/GitAutoPushType",
            "description": "How the default branch is pushed when its translations are complete.",
            "example": "PULL_REQUEST"
          },
          "auto_push_other_branches_type": {
            "$ref": "#/components/schemas/GitAutoPushType",
            "description": "How other branches are pushed when their translations are complete.",
            "example": "PUSH"
          }
        }
      },
      "PushType": {
        "type": "string",
        "description": "How files should be pushed to git repositories.",
        "enum": [
          "PUSH",
          "PULL_REQUEST"
        ]
      },
      "GitAutoPushType": {
        "type": "string",
        "description": "Automatic completion push behavior for a branch kind.",
        "enum": [
          "NONE",
          "PUSH",
          "PULL_REQUEST"
        ]
      },
      "UpdateGitSelection": {
        "type": "object",
        "additionalProperties": false,
        "description": "Which files and branches LingoHub syncs (JSON merge-patch; lists are replaced as a whole). Branch filters exist only while branching: turning branching off drops them.",
        "properties": {
          "is_branching": {
            "type": "boolean",
            "description": "Whether LingoHub keeps a branch for every remote branch `branch_filters` select. Turning it off deletes every branch except the default one.",
            "example": true
          },
          "path_filters": {
            "type": "array",
            "description": "The files LingoHub syncs; empty for none. New path filters start an import on every branch.",
            "example": [
              {
                "type": "INCLUDE",
                "value": "locales/**"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/SetGitFilter"
            },
            "maxItems": 1000
          },
          "branch_filters": {
            "type": "array",
            "description": "The remote branches LingoHub keeps a branch for; only while branching. New branch filters add or remove the branches they select.",
            "example": [
              {
                "type": "INCLUDE",
                "value": "locales/**"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/SetGitFilter"
            },
            "maxItems": 1000
          }
        }
      },
      "SetGitFilter": {
        "type": "object",
        "additionalProperties": false,
        "description": "Request body to select repository paths or branches with the existing include/exclude glob rules.",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/GitFilterType",
            "description": "Include or exclude matching paths.",
            "example": "INCLUDE"
          },
          "value": {
            "type": "string",
            "description": "Repository glob pattern; leading slashes are removed.",
            "example": "locales/**",
            "maxLength": 4096,
            "minLength": 0,
            "pattern": "^[^\\x00]*$"
          }
        },
        "required": [
          "type",
          "value"
        ]
      },
      "GitFilterType": {
        "type": "string",
        "description": "Stored repository filter inclusion or exclusion.",
        "enum": [
          "INCLUDE",
          "EXCLUDE"
        ]
      },
      "ProjectGitIntegration": {
        "type": "object",
        "description": "A project's git integration: the repository and connection, when LingoHub pulls and pushes, how it pushes, and which files and branches it syncs. Its id is the project's.",
        "example": {
          "object_type": "PROJECT_GIT_INTEGRATION",
          "id": "pr_0197c8f2-5a6b-7cde-8f12-3456789abcde",
          "provider": "GITHUB",
          "git_authentication_id": "iau_0197c8f2-5a6b-7cde-8f12-3456789abcde",
          "connection_status": "ACTIVE",
          "is_self_hosted": false,
          "provider_origin": "https://github.com",
          "provider_region": null,
          "namespace": "company",
          "name": "app",
          "git_branch": "main",
          "sync": {
            "import_mode": "AUTOMATIC",
            "import_schedule": null,
            "export_mode": "PERIODIC",
            "export_schedule": {
              "period": "DAILY",
              "time": "10:30",
              "day_of_week": null
            }
          },
          "push": {
            "push_type": "PULL_REQUEST",
            "commit_message": "Update translations",
            "commit_description": "Translations from LingoHub",
            "pull_request_title": "Update translations",
            "pull_request_description": "Translations from LingoHub",
            "pull_request_branch": "lingohub/translations",
            "auto_push_default_branch_type": "PULL_REQUEST",
            "auto_push_other_branches_type": "PUSH"
          },
          "selection": {
            "is_branching": true,
            "path_filters": [
              {
                "type": "INCLUDE",
                "value": "locales/**"
              }
            ],
            "branch_filters": [
              {
                "type": "INCLUDE",
                "value": "release/*"
              }
            ]
          },
          "last_pull_at": "2026-09-30T08:15:00.123Z",
          "last_push_at": "2026-09-30T09:30:00.123Z",
          "created_at": "2026-09-01T10:00:00.123Z",
          "updated_at": "2026-09-15T12:00:00.123Z"
        },
        "properties": {
          "object_type": {
            "type": "string",
            "description": "Always `PROJECT_GIT_INTEGRATION`.",
            "enum": [
              "PROJECT_GIT_INTEGRATION"
            ],
            "example": "PROJECT_GIT_INTEGRATION"
          },
          "id": {
            "type": "string",
            "description": "The project's id.",
            "example": "pr_0197c8f2-5a6b-7cde-8f12-3456789abcde",
            "minLength": 1,
            "pattern": "^pr_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "provider": {
            "$ref": "#/components/schemas/GitProvider",
            "description": "The git host of the repository.",
            "example": "GITHUB"
          },
          "git_authentication_id": {
            "type": "string",
            "description": "The git connection the integration uses, from listIntegrationAuthentications.",
            "example": "iau_0197c8f2-5a6b-7cde-8f12-3456789abcde",
            "pattern": "^iau_[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"
          },
          "connection_status": {
            "$ref": "#/components/schemas/GitConnectionStatus",
            "description": "The connection's status, as in listIntegrationAuthentications.",
            "example": "ACTIVE"
          },
          "is_self_hosted": {
            "type": "boolean",
            "description": "Whether the connection is to a self-hosted git server.",
            "example": false
          },
          "provider_origin": {
            "type": [
              "string",
              "null"
            ],
            "description": "Scheme, host and port of the git host, without credentials or path; null for CodeCommit.",
            "example": "https://github.com"
          },
          "provider_region": {
            "type": [
              "string",
              "null"
            ],
            "description": "The AWS region of a CodeCommit repository; null for other git hosts.",
            "example": "us-east-1"
          },
          "namespace": {
            "type": "string",
            "description": "The repository's namespace, as the repository lookups name it; empty for CodeCommit.",
            "example": "company"
          },
          "name": {
            "type": "string",
            "description": "The repository's name.",
            "example": "app"
          },
          "git_branch": {
            "type": "string",
            "description": "The remote branch the project's default branch syncs with.",
            "example": "main"
          },
          "sync": {
            "$ref": "#/components/schemas/GitSync",
            "description": "When LingoHub pulls and pushes by itself."
          },
          "push": {
            "$ref": "#/components/schemas/GitPush",
            "description": "How LingoHub pushes."
          },
          "selection": {
            "$ref": "#/components/schemas/GitSelection",
            "description": "Which files and branches LingoHub syncs."
          },
          "last_pull_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a pull of any branch last succeeded; null before the first one.",
            "example": "2026-09-30T08:15:00.123Z"
          },
          "last_push_at": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time",
            "description": "When a push of any branch last succeeded; null before the first one.",
            "example": "2026-09-30T09:30:00.123Z"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the project was connected to git.",
            "example": "2026-09-01T10:00:00.123Z"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "description": "When the git settings last changed.",
            "example": "2026-09-15T12:00:00.123Z"
          }
        },
        "required": [
          "connection_status",
          "created_at",
          "git_authentication_id",
          "git_branch",
          "id",
          "is_self_hosted",
          "last_pull_at",
          "last_push_at",
          "name",
          "namespace",
          "object_type",
          "provider",
          "provider_origin",
          "provider_region",
          "push",
          "selection",
          "sync",
          "updated_at"
        ]
      },
      "GitProvider": {
        "type": "string",
        "description": "Repository provider.",
        "enum": [
          "GITHUB",
          "BITBUCKET",
          "GITLAB",
          "AZURE",
          "AWS_CODE_COMMIT"
        ]
      },
      "GitConnectionStatus": {
        "type": "string",
        "description": "Stored provider authentication lifecycle; not a live connectivity check.",
        "enum": [
          "ACTIVE",
          "SUSPENDED",
          "REVOKED"
        ]
      },
      "GitSync": {
        "type": "object",
        "description": "When LingoHub pulls from and pushes to the repository by itself. A schedule exists only for a `PERIODIC` mode.",
        "properties": {
          "import_mode": {
            "$ref": "#/components/schemas/GitImportMode",
            "description": "`NONE`: only on request; `AUTOMATIC`: whenever the repository reports a push; `PERIODIC`: on `import_schedule`.",
            "example": "AUTOMATIC"
          },
          "import_schedule": {
            "description": "When LingoHub pulls, for `PERIODIC`; null otherwise.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/GitSchedule"
              },
              {
                "type": "null"
              }
            ]
          },
          "export_mode": {
            "$ref": "#/components/schemas/GitExportMode",
            "description": "`NONE`: only on request; `PERIODIC`: on `export_schedule`; `ON_COMPLETION`: when a branch's translations are complete, as the push settings' `auto_push_*` say.",
            "example": "PERIODIC"
          },
          "export_schedule": {
            "description": "When LingoHub pushes, for `PERIODIC`; null otherwise.",
            "oneOf": [
              {
                "$ref": "#/components/schemas/GitSchedule"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "export_mode",
          "export_schedule",
          "import_mode",
          "import_schedule"
        ]
      },
      "GitSchedule": {
        "type": "object",
        "description": "Persisted periodic schedule. Missing configuration is represented by null, without inventing a schedule.",
        "properties": {
          "period": {
            "$ref": "#/components/schemas/GitSchedulePeriod",
            "description": "Daily or weekly schedule.",
            "example": "DAILY"
          },
          "time": {
            "type": "string",
            "description": "Stored execution time of day in UTC.",
            "example": "10:30"
          },
          "day_of_week": {
            "description": "Stored weekday, or null for a daily schedule.",
            "example": "MONDAY",
            "oneOf": [
              {
                "$ref": "#/components/schemas/GitScheduleWeekday"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "day_of_week",
          "period",
          "time"
        ]
      },
      "GitPush": {
        "type": "object",
        "description": "How LingoHub pushes: as a commit or a pull request, with these message templates. A push that names none of them uses these.",
        "properties": {
          "push_type": {
            "$ref": "#/components/schemas/PushType",
            "description": "Whether a push commits to the branch or opens a pull request.",
            "example": "PULL_REQUEST"
          },
          "commit_message": {
            "type": "string",
            "description": "Commit message template.",
            "example": "Update translations"
          },
          "commit_description": {
            "type": "string",
            "description": "Commit description template; may be empty.",
            "example": "Translations from LingoHub"
          },
          "pull_request_title": {
            "type": "string",
            "description": "Pull request title template.",
            "example": "Update translations"
          },
          "pull_request_description": {
            "type": "string",
            "description": "Pull request description template; may be empty.",
            "example": "Translations from LingoHub"
          },
          "pull_request_branch": {
            "type": "string",
            "description": "Template of the branch a pull request comes from.",
            "example": "lingohub/translations"
          },
          "auto_push_default_branch_type": {
            "$ref": "#/components/schemas/GitAutoPushType",
            "description": "How the default branch is pushed when its translations are complete.",
            "example": "PULL_REQUEST"
          },
          "auto_push_other_branches_type": {
            "$ref": "#/components/schemas/GitAutoPushType",
            "description": "How other branches are pushed when their translations are complete.",
            "example": "PUSH"
          }
        },
        "required": [
          "auto_push_default_branch_type",
          "auto_push_other_branches_type",
          "commit_description",
          "commit_message",
          "pull_request_branch",
          "pull_request_description",
          "pull_request_title",
          "push_type"
        ]
      },
      "GitSelection": {
        "type": "object",
        "description": "Which files and branches LingoHub syncs.",
        "properties": {
          "is_branching": {
            "type": "boolean",
            "description": "Whether LingoHub keeps a branch for every remote branch `branch_filters` select, besides the default branch.",
            "example": true
          },
          "path_filters": {
            "type": "array",
            "description": "The files LingoHub syncs, sorted by type and value; empty for none.",
            "example": [
              {
                "type": "INCLUDE",
                "value": "locales/**"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/GitFilter"
            }
          },
          "branch_filters": {
            "type": "array",
            "description": "The remote branches LingoHub keeps a branch for while branching, sorted by type and value; empty when not branching.",
            "example": [
              {
                "type": "INCLUDE",
                "value": "locales/**"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/GitFilter"
            }
          }
        },
        "required": [
          "branch_filters",
          "is_branching",
          "path_filters"
        ]
      },
      "GitFilter": {
        "type": "object",
        "description": "A glob that includes or excludes repository paths or branches.",
        "properties": {
          "type": {
            "$ref": "#/components/schemas/GitFilterType",
            "description": "Whether matching paths or branches are included or excluded.",
            "example": "INCLUDE"
          },
          "value": {
            "type": "string",
            "description": "The glob.",
            "example": "locales/**"
          }
        },
        "required": [
          "type",
          "value"
        ]
      },
      "Error": {
        "type": "object",
        "description": "RFC 9457 problem details. `code` identifies the problem type (one per `type` URL); `errors` lists rejected fields or parameters; `required_permission` names the permission a 403 lacked.",
        "properties": {
          "type": {
            "type": "string",
            "description": "URL identifying the problem type and pointing to its documentation.",
            "example": "https://api.lingohub.com/errors/resource-not-found"
          },
          "title": {
            "type": "string",
            "description": "Short, constant summary of the problem type.",
            "example": "Resource not found"
          },
          "status": {
            "type": "integer",
            "format": "int32",
            "description": "HTTP status code.",
            "example": 404
          },
          "detail": {
            "type": "string",
            "description": "Human-readable explanation of this occurrence of the problem.",
            "example": "Resource with ID 'pr_0197c8f2-5a6b-7cde-8f12-3456789abcde' was not found."
          },
          "instance": {
            "type": "string",
            "description": "Path of the request that produced the problem.",
            "example": "/v2/projects/pr_0197c8f2-5a6b-7cde-8f12-3456789abcde"
          },
          "code": {
            "$ref": "#/components/schemas/ErrorCode",
            "description": "Machine-readable problem type.",
            "example": "resource_not_found"
          },
          "request_id": {
            "type": "string",
            "description": "Correlation id of the request, also returned in the `X-Request-ID` header. Quote it when contacting support.",
            "example": "f47ac10b-58cc-4372-a567-0e02b2c3d479"
          },
          "errors": {
            "type": "array",
            "description": "Rejected fields or parameters. Present when the problem concerns specific fields or parameters.",
            "example": [
              {
                "detail": "must be at least 2 characters long",
                "pointer": "#/name",
                "parameter": "limit",
                "code": "minLength"
              }
            ],
            "items": {
              "$ref": "#/components/schemas/FieldError"
            }
          },
          "required_permission": {
            "$ref": "#/components/schemas/RequiredPermission",
            "description": "The permission the API key lacks. Present on 403 responses."
          }
        },
        "required": [
          "code",
          "detail",
          "instance",
          "request_id",
          "status",
          "title",
          "type"
        ]
      },
      "ErrorCode": {
        "type": "string",
        "description": "Machine-readable problem type of a V2 error response. Each code has a fixed HTTP status and documentation at its `type` URL.",
        "enum": [
          "invalid_json",
          "invalid_parameter",
          "missing_parameter",
          "unknown_parameter",
          "invalid_filter",
          "invalid_cursor",
          "bad_request",
          "missing_api_key",
          "invalid_api_key",
          "expired_api_key",
          "revoked_api_key",
          "disabled_api_key",
          "insufficient_permissions",
          "resource_not_found",
          "route_not_found",
          "method_not_allowed",
          "not_acceptable",
          "precondition_failed",
          "content_too_large",
          "unsupported_media_type",
          "already_exists",
          "idempotency_outcome_unknown",
          "idempotency_key_in_use",
          "stack_not_empty",
          "branch_not_ready",
          "backup_not_ready",
          "backup_in_use",
          "default_branch_protected",
          "owner_membership_protected",
          "source_language_protected",
          "branch_limit_reached",
          "context_image_limit_reached",
          "automation_limit_reached",
          "translation_order_pending",
          "git_integration_not_configured",
          "branch_git_integration_not_configured",
          "git_integration_unauthorized",
          "conflict",
          "validation_failed",
          "idempotency_key_mismatch",
          "rate_limit_exceeded",
          "internal_error",
          "upstream_error",
          "service_unavailable",
          "upstream_timeout"
        ]
      },
      "FieldError": {
        "type": "object",
        "description": "A rejected field or parameter. `pointer` locates a body field (RFC 6901 JSON Pointer), `parameter` a query, path or header parameter or a field of a multipart upload; both are set for a position inside a JSON-valued parameter such as `filter`.",
        "properties": {
          "detail": {
            "type": "string",
            "description": "Human-readable description of the problem.",
            "example": "must be at least 2 characters long"
          },
          "pointer": {
            "type": [
              "string",
              "null"
            ],
            "description": "JSON Pointer to the offending body field, or to the position inside a JSON-valued parameter.",
            "example": "#/name"
          },
          "parameter": {
            "type": [
              "string",
              "null"
            ],
            "description": "Name of the offending query, path or header parameter, or of the multipart form field.",
            "example": "limit"
          },
          "code": {
            "$ref": "#/components/schemas/FieldErrorCode",
            "description": "Why the field or parameter was rejected.",
            "example": "minLength"
          }
        },
        "required": [
          "code",
          "detail",
          "parameter",
          "pointer"
        ]
      },
      "FieldErrorCode": {
        "type": "string",
        "description": "Why a field or parameter was rejected: the JSON Schema keyword of the violated rule, or one of the documented rules that no schema can express.",
        "enum": [
          "required",
          "type",
          "enum",
          "minLength",
          "maxLength",
          "minimum",
          "maximum",
          "pattern",
          "format",
          "additionalProperties",
          "minItems",
          "maxItems",
          "uniqueItems",
          "already_exists",
          "not_found",
          "not_supported",
          "unsupported_file_extension",
          "file_too_large",
          "file_empty",
          "invalid_archive",
          "empty_archive"
        ]
      },
      "RequiredPermission": {
        "type": "object",
        "description": "The permission the API key lacks, in the vocabulary of the API key permission settings.",
        "properties": {
          "scope": {
            "$ref": "#/components/schemas/PermissionScope",
            "description": "Where the permission applies.",
            "example": "STACK"
          },
          "target": {
            "$ref": "#/components/schemas/PermissionTarget",
            "description": "The area the permission governs.",
            "example": "SETTINGS"
          },
          "level": {
            "$ref": "#/components/schemas/PermissionLevel",
            "description": "The access level required.",
            "example": "MANAGE"
          }
        },
        "required": [
          "level",
          "scope",
          "target"
        ]
      },
      "PermissionScope": {
        "type": "string",
        "description": "Where a permission applies: `WORKSPACE` permissions cover workspace-level resources, `STACK` permissions the resources of a stack (its projects, branches, resources, languages, ...).",
        "enum": [
          "WORKSPACE",
          "STACK"
        ]
      },
      "PermissionTarget": {
        "type": "string",
        "description": "The area a permission governs.",
        "enum": [
          "GENERAL",
          "BILLING_SUBSCRIPTION",
          "WORKSPACES",
          "MEMBERS",
          "PLUGINS_INTEGRATIONS",
          "LOGS",
          "API_ACCESS",
          "STACKS",
          "TRANSLATION_ORDERS",
          "WORK_REPORTS",
          "STYLE_GUIDES",
          "GLOSSARIES",
          "TRANSLATION_MEMORIES",
          "LABELS",
          "AI_TRANSLATION",
          "QUICK_TRANSLATIONS",
          "SETTINGS",
          "ACTIVITIES",
          "RESOURCES",
          "CONTEXT_IMAGES",
          "LANGUAGES",
          "SEGMENT_KEYS",
          "SEGMENTS",
          "SEGMENT_TEXTS"
        ]
      },
      "PermissionLevel": {
        "type": "string",
        "description": "Access level of a permission: `MANAGE` includes `WRITE` and `VIEW`.",
        "enum": [
          "NO_ACCESS",
          "VIEW",
          "WRITE",
          "MANAGE"
        ]
      }
    },
    "headers": {
      "ETag": {
        "description": "Opaque strong validator for this representation. Keep its quotation marks and use it as If-Match on a documented conditional write. A replay carries the original ETag, which may now be stale.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit": {
        "description": "State of the rate-limit policy currently closest to rejection (IETF draft-ietf-httpapi-ratelimit-headers): the quoted policy name with `r` = requests remaining right now and `t` = seconds until the full quota is available again. Example: `\"api-key\";r=42;t=7`. Advisory: absent when the request fails authentication or the limiter state is momentarily unknown.",
        "schema": {
          "type": "string"
        }
      },
      "RateLimit-Policy": {
        "description": "The rate-limit policies applied to the request: each quoted policy name with `q` = sustained request quota per window of `w` seconds. Example: `\"api-key\";q=180;w=60, \"workspace\";q=600;w=60`. Advisory: absent when the request fails authentication or the limiter state is momentarily unknown.",
        "schema": {
          "type": "string"
        }
      },
      "Retry-After": {
        "description": "Seconds to wait before retrying.",
        "schema": {
          "type": "integer",
          "format": "int32"
        }
      }
    },
    "responses": {
      "BadRequest": {
        "description": "The request is malformed: an unknown or invalid query parameter, an invalid id in the path, or a body that is not valid JSON. `code` names the problem, `errors` the parameter or field.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Unauthorized": {
        "description": "Invalid or missing API key.",
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "Forbidden": {
        "description": "Insufficient permissions.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "NotFound": {
        "description": "The resource does not exist, or the API key cannot see it.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "PreconditionFailed": {
        "description": "The current representation does not match If-Match (`precondition_failed`). No change was applied.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "TooManyRequests": {
        "description": "The API rate limit was exceeded. Wait for the number of seconds given in the Retry-After header, then retry.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "InternalServerError": {
        "description": "An unexpected internal server error occurred.",
        "headers": {
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      },
      "ServiceUnavailable": {
        "description": "The service is temporarily unavailable. Retry after the number of seconds in the Retry-After header.",
        "headers": {
          "Retry-After": {
            "$ref": "#/components/headers/Retry-After"
          },
          "RateLimit": {
            "$ref": "#/components/headers/RateLimit"
          },
          "RateLimit-Policy": {
            "$ref": "#/components/headers/RateLimit-Policy"
          }
        },
        "content": {
          "application/problem+json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "type": "http",
        "description": "API key authentication. Create API keys in your LingoHub workspace settings. Keys use the `lh-api_` prefix. Pass the full key as the Bearer token.",
        "scheme": "bearer"
      }
    }
  }
}
````
