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
POST /v1/{workspaceUrl}/projects/{projectUrl}/push -- Push resource files to a repositoryTriggers pushing the project's resource files to the linked repository.
The push can be performed in one of two modes:
| Push Type | Behaviour |
|---|---|
PUSH | Creates a direct commit on the target branch |
PULL_REQUEST | Opens a pull / merge request with the changes |
Note: If no
pushTypeis specified, the project's default push type will be used.
Path Parameters
| Parameter | Type | Description |
|---|---|---|
workspaceUrl | string | URL slug of the workspace |
projectUrl | string | URL slug of the project |
Request Body — PushFilesRequest
PushFilesRequestAll fields are optional. Omitted values fall back to the project's default configuration.
| Field | Type | Description |
|---|---|---|
branch | string | Target branch name. Defaults to the branch configured in the repository connection. |
pushType | string | "PUSH" for a direct commit, "PULL_REQUEST" for a pull/merge request. Defaults to project setting. |
commitMessage | string | Custom commit message. A default message is generated if omitted. |
commitDescription | string | Extended commit description providing additional context. |
path | string | Restrict the push to resource files under this path (e.g. "/src/config/locales"). |
languageCode | string | Restrict the push to a single locale — ISO 639-1 code (e.g. "en", "de-AT"). |
pullRequestBranch | string | Branch to create for the PR/MR. Only applicable when pushType is PULL_REQUEST. |
pullRequestTitle | string | Title of the PR/MR. Only applicable when pushType is PULL_REQUEST. |
pullRequestDescription | string | Body/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
| Status | Meaning |
|---|---|
200 | OK — push operation was successfully triggered (empty response body) |
400 | Bad Request — project has no linked repository, or push parameters are invalid |
401 | Unauthorized — authentication credentials are missing or invalid |
403 | Forbidden — insufficient resourcesManage permission on the project |
404 | Not Found — the specified workspace or project does not exist |
