Skip to content

API V1 · Repository

Push resource files to a repository

POST
/v1/{workspaceUrl}/projects/{projectUrl}/push
curl --request POST \
--url https://api.lingohub.com/v1/WORKSPACE_URL/projects/PROJECT_URL/push \
--header 'Authorization: Bearer YOUR_API_KEY' \
--header 'Content-Type: application/json' \
--data '{
"branch": "main",
"commitMessage": "Update translations for release 2.3.0",
"commitDescription": "Includes updated French and German translations",
"path": "/src/config/locales",
"languageCode": "en",
"pullRequestBranch": "lingohub/update-translations",
"pullRequestTitle": "Update translations",
"pullRequestDescription": "This PR updates the translation files exported from LingoHub."
}'

Triggers pushing the project’s resource files to the linked repository. A repository connection (e.g. GitHub, GitLab, Bitbucket, or Azure DevOps) must have been configured for the project beforehand. The push can be performed either as a direct commit or as a pull/merge request depending on the configuration or the explicit pushType parameter.

workspaceUrl
required
string

WorkspaceUrl

projectUrl
required
string

ProjectUrl

Media typeapplication/json

The information needed to perform the push operation

object
branch

Name of the branch to push to. If left empty, the default branch configured in the repository connection will be used.

string

Example

main
pushType

The type of push to perform: PUSH for a direct commit, or PULL_REQUEST for creating a pull/merge request. If left empty, the project’s default push type will be used.

string
Allowed values: PUSH PULL_REQUEST
commitMessage

The commit message for the push. If left empty, a default commit message will be generated.

string

Example

Update translations for release 2.3.0
commitDescription

An optional extended commit description providing additional context for the push.

string

Example

Includes updated French and German translations
path

Restrict the push to resource files under this path. If not set, all resource files of the project will be pushed.

string

Example

/src/config/locales
languageCode

Restrict the push to resource files of this locale. Specified as an ISO 639-1 code (e.g. ‘en’, ‘de-AT’) and matched against the project’s languages ignoring case, so ‘de-at’ selects ‘de-AT’. A code the project has no language for is rejected.

string

Example

en
pullRequestBranch

Name of the branch to create for the pull/merge request. Only applicable when pushType is PULL_REQUEST.

string

Example

lingohub/update-translations
pullRequestTitle

The title of the pull/merge request. Only applicable when pushType is PULL_REQUEST.

string

Example

Update translations
pullRequestDescription

The description body of the pull/merge request. Only applicable when pushType is PULL_REQUEST.

string

Example

This PR updates the translation files exported from LingoHub.

Successfully triggered the push operation. Returns an empty body.

Bad Request: The project has no linked repository or the push parameters are invalid.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}

Unauthorized: Authentication credentials are missing or invalid.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}

Forbidden: The authenticated user does not have resource management permission on this project.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}

Not Found: The specified workspace or project does not exist.

Media typeapplication/json
object
url
string
message
string
text
string

Example generated

{
"url": "example",
"message": "example",
"text": "example"
}

Unprocessable Entity: The branch does not exist in the repository, or the project has no language with the given languageCode.

Media typeapplication/json
object
error
object
code
string
description
string
status
object
error
boolean
is4xxClientError
boolean
is5xxServerError
boolean
is1xxInformational
boolean
is2xxSuccessful
boolean
is3xxRedirection
boolean
validationErrors
Array<object>
object
field
string
errors
Array<object>
object
code
string
description
string
parameters
object
key
additional properties

Example generated

{
"error": {
"code": "example",
"description": "example",
"status": {
"error": true,
"is4xxClientError": true,
"is5xxServerError": true,
"is1xxInformational": true,
"is2xxSuccessful": true,
"is3xxRedirection": true
}
},
"validationErrors": [
{
"field": "example",
"errors": [
{
"code": "example",
"description": "example",
"parameters": {
"additionalProperty": "example"
}
}
]
}
]
}