---
title: "Create GitLab integration"
method: POST
path: "/gitlab-integration/project/{projectId}"
tags: ["GitLab"]
---

# Create GitLab integration

`POST /gitlab-integration/project/{projectId}`

## Request

- Base URL: `https://cloud.kaneo.app/api`
- URL: `https://cloud.kaneo.app/api/gitlab-integration/project/{projectId}`
- Auth: HTTP bearer

Link a project to a GitLab project. Kaneo generates the secret GitLab must send with each webhook; add the webhook in GitLab afterwards. Use the verify route first to confirm the token really reaches the project.

## Path parameters

- `projectId` string, required

## Request body

- object
  - `baseUrl` string, uri, required
  - `accessToken` string: Omit to keep the stored token only when the GitLab base URL is unchanged. A changed URL requires a new token.
  - `tokenType` 'private' | 'bearer': `private` sends the token in PRIVATE-TOKEN, which is what personal, project and group access tokens expect. `bearer` sends it in Authorization, for an OAuth2 token you already hold. Defaults to `private`.
  - `projectPath` string, required

## Response `200`

The stored integration

- GitlabIntegration, nullable
  - `id` string, required
  - `projectId` string, required
  - `baseUrl` string, required: Root URL of the GitLab instance.
  - `projectPath` string, required: Full path of the linked project, nested groups included.
  - `tokenType` 'private' | 'bearer', required
  - `maskedAccessToken` string, required: First and last characters of the stored token, only returned to callers with workspace:manage_settings.
  - `webhookUrl` string: Where GitLab should POST events for this project.
  - `webhookSecret` string: Only returned to callers with workspace:manage_settings, so the value can be pasted into GitLab.
  - `branchPattern` string
  - `commentTaskLinkOnGitlabIssue` boolean: When on, Kaneo comments a link back to the task on each issue opened in GitLab. Issues Kaneo creates from tasks are not commented on.
  - `isActive` boolean, nullable, required
  - `createdAt` string, date-time, required
  - `updatedAt` string, date-time, required

## Other responses

- `400`: Invalid body
- `401`: Missing or invalid credentials
- `403`: No access to the project, or missing workspace:manage_settings
- `404`: Project not found
- `409`: That GitLab project is already linked to another Kaneo project
- `429`: The API key exceeded its rate limit or usage quota. Wait the number of seconds in Retry-After before retrying. The X-RateLimit headers are sent only when the rate limit was hit.

## Changes

- **2026-10-09** `c9984766c765`: 1 info
  - added the non-success response with the status `404`
- **2026-10-08** `c7b8a842601b`: 4 breaking, 5 info
  - removed the media type `text/plain` for the response with the status `400`
  - removed the media type `text/plain` for the response with the status `403`
  - removed the media type `text/plain` for the response with the status `409`
  - removed the media type `text/plain` for the response with the status `429`
  - …5 more
- **2026-10-08** `2ed51b8af657`: 4 breaking, 4 info
  - removed the media type `application/json` for the response with the status `400`
  - removed the media type `application/json` for the response with the status `401`
  - removed the media type `application/json` for the response with the status `403`
  - removed the media type `application/json` for the response with the status `409`
  - …4 more
- **2026-10-07** `df1439c724ee`: 3 breaking, 4 info
  - removed the media type `text/plain` for the response with the status `400`
  - removed the media type `text/plain` for the response with the status `403`
  - removed the media type `text/plain` for the response with the status `409`
  - added the media type `application/json` for the response with the status `400`
  - …3 more
- **2026-09-26** `cfcd17ccaa21`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/usekaneo/apis/kaneo-api/changes/gitlab-integration/project/:projectId/post.md)

---

[API](https://skmtc.dev/usekaneo/apis/kaneo-api.md) - [All operations](https://skmtc.dev/usekaneo/apis/kaneo-api/llms.txt) - [OpenAPI document](https://skmtc.dev/usekaneo/apis/kaneo-api/revisions/93f78789100c?raw)
