Creates a project, links the repository and opens a merge request that sets up the pipeline.
HTTP
POST /integrations/gitlab/projectsAccess: Session token only. API keys get 403 with insufficient_scope.
Role: Organisation owner or admin.
Request body #
JSON.
| Field | Type | Required | Description |
|---|---|---|---|
repo | string | yes | The repository, such as acme/shop. |
connectionId | string | yes | The connectionId of a connected account, from the overview. |
source | string | yes | Path of the source file in the repository, for example locales/en.json. No leading / or ... At most 200 characters. |
translations | string | yes | Pattern of the translation files, which must contain {lang}, for example locales/{lang}.json. |
name | string | no | The name of the project. Default: the name of the repository. |
sourceLanguage | string | no | Default en. |
targetLanguages | list of string | yes | Language 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 #
| Field | Type | Description |
|---|---|---|
project | object | The project, see Get a project. |
pullRequestUrl | string | The merge request that was opened. |
warnings | list of string | Things that could not be set up. |
Errors #
| Status | error | When |
|---|---|---|
| 401 | unauthenticated | The token is missing or not valid. |
| 403 | forbidden | You are not an owner or admin. |
| 503 | gitlab_not_configured | The GitLab integration is not set up on this server. |
| 409 | repository_linked | The repository is linked to another project. projectId says which. |
| 404 | not_found | The account is not connected to your organisation. |
| 422 | invalid_request | repo is not valid, or source or translations is not a valid path (invalid_path, needs_lang). |
| 502 | gitlab_error | GitLab refused the request. message says why. |
| 429 | rate_limited | Too many requests, see Rate limiting. |
See Errors for the error format.
Notes #
If linking fails, the project is deleted again.