Manual
CLI
API
Log in Get started free

Link a project to a GitHub repository

Links an existing project to a repository and opens a pull request that sets up the pipeline.

Links an existing project to a repository and opens a pull request that sets up the pipeline.

HTTP
PUT /projects/{projectId}/repository/github

Access: Session token only. API keys get 403 with insufficient_scope.

Role: Organisation owner or admin. and project manager.

Path parameters #

ParameterDescription
projectIdThe id of the project.

Request body #

JSON.

FieldTypeRequiredDescription
repostringyesThe repository, such as acme/shop.
installationIdintegeryesThe installationId of a connected account, from the overview.
sourcestringyesPath of the source file in the repository, for example locales/en.json. No leading / or ... At most 200 characters.
translationsstringyesPattern of the translation files, which must contain {lang}, for example locales/{lang}.json.
JSON
{ "repo": "acme/shop", "installationId": 123, "source": "locales/en.json", "translations": "locales/{lang}.json" }

Response 201 #

The link.

JSON
{
  "repository": { ... },
  "pullRequestUrl": "https://github.com/acme/shop/pull/1"
}

Response fields #

FieldTypeDescription
repositoryobjectThe link, see Get the repository link.
pullRequestUrlstringThe pull request that was opened.

Errors #

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
404not_foundThe project does not exist in your organisation, you have no access to it, or projectId is not a UUID.
403forbiddenYou are not an owner or admin, or not a manager of the project.
503github_not_configuredThe GitHub integration is not set up on this server.
409repository_linkedThe repository is linked to another project. projectId says which.
404not_foundThe account is not connected to your organisation.
422invalid_requestrepo is not valid, or source or translations is not a valid path (invalid_path, needs_lang).
502github_errorGitHub refused the request. message says why.
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.