Repository

Push localization resource files from a LingoHub project to a linked source code repository.

Authentication is required. The operation is guarded by the resourcesManage team permission on the target project.


Prerequisites

Before using this endpoint, a repository connection must already be configured for the project.
Supported providers are:

  • GitHub
  • GitLab
  • Bitbucket
  • Azure DevOps

Endpoint

POST /v1/{workspaceUrl}/projects/{projectUrl}/push -- Push resource files to a repository

Triggers pushing the project's resource files to the linked repository.
The push can be performed in one of two modes:

Push TypeBehaviour
PUSHCreates a direct commit on the target branch
PULL_REQUESTOpens a pull / merge request with the changes

Note: If no pushType is specified, the project's default push type will be used.

Path Parameters

ParameterTypeDescription
workspaceUrlstringURL slug of the workspace
projectUrlstringURL slug of the project

Request Body — PushFilesRequest

All fields are optional. Omitted values fall back to the project's default configuration.

FieldTypeDescription
branchstringTarget branch name. Defaults to the branch configured in the repository connection.
pushTypestring"PUSH" for a direct commit, "PULL_REQUEST" for a pull/merge request. Defaults to project setting.
commitMessagestringCustom commit message. A default message is generated if omitted.
commitDescriptionstringExtended commit description providing additional context.
pathstringRestrict the push to resource files under this path (e.g. "/src/config/locales").
languageCodestringRestrict the push to a single locale — ISO 639-1 code (e.g. "en", "de-AT").
pullRequestBranchstringBranch to create for the PR/MR. Only applicable when pushType is PULL_REQUEST.
pullRequestTitlestringTitle of the PR/MR. Only applicable when pushType is PULL_REQUEST.
pullRequestDescriptionstringBody/description of the PR/MR. Only applicable when pushType is PULL_REQUEST.

Example Request Body

{
  "branch": "main",
  "pushType": "PULL_REQUEST",
  "commitMessage": "Update translations for release 2.3.0",
  "commitDescription": "Includes updated French and German translations",
  "pullRequestBranch": "lingohub/update-translations",
  "pullRequestTitle": "Update translations",
  "pullRequestDescription": "This PR updates the translation files exported from Lingohub.",
  "path": "/src/config/locales",
  "languageCode": "en"
}

Responses

StatusMeaning
200OK — push operation was successfully triggered (empty response body)
400Bad Request — project has no linked repository, or push parameters are invalid
401Unauthorized — authentication credentials are missing or invalid
403Forbidden — insufficient resourcesManage permission on the project
404Not Found — the specified workspace or project does not exist