Manual
CLI
API
Log in Get started free

Create a project from a GitLab repository

Creates a project, links the repository and opens a merge request that sets up the pipeline.

Creates a project, links the repository and opens a merge request that sets up the pipeline.

HTTP
POST /integrations/gitlab/projects

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

Role: Organisation owner or admin.

Request body #

JSON.

FieldTypeRequiredDescription
repostringyesThe repository, such as acme/shop.
connectionIdstringyesThe connectionId 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.
namestringnoThe name of the project. Default: the name of the repository.
sourceLanguagestringnoDefault en.
targetLanguageslist of stringyesLanguage codes. At least one besides the source language.
JSON
{ "repo": "acme/shop", "connectionId": "...", "source": "locales/en.json", "translations": "locales/{lang}.json", "targetLanguages": ["de", "fr"] }

Response 201 #

The project and the link of the merge request.

JSON
{
  "project": { ... },
  "pullRequestUrl": "https://gitlab.com/acme/shop/pull/1",
  "warnings": []
}

Response fields #

FieldTypeDescription
projectobjectThe project, see Get a project.
pullRequestUrlstringThe merge request that was opened.
warningslist of stringThings that could not be set up.

Errors #

StatuserrorWhen
401unauthenticatedThe token is missing or not valid.
403forbiddenYou are not an owner or admin.
503gitlab_not_configuredThe GitLab 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).
502gitlab_errorGitLab refused the request. message says why.
429rate_limitedToo many requests, see Rate limiting.

See Errors for the error format.

Notes #

If linking fails, the project is deleted again.