---
title: "Gitlab Webhook"
method: POST
path: "/api/v1/webhooks/gitlab"
---

# Gitlab Webhook

`POST /api/v1/webhooks/gitlab`

Receive a GitLab CI webhook, verify token, and create ci-fix tasks.

Handles the following event types:
- ``pipeline`` (failed) - creates a ci-fix task, capped at
  ``MAX_CI_RETRIES`` active attempts per branch.
- ``job`` (failed) - creates a ci-fix task for the specific job.

Reads ``GITLAB_WEBHOOK_TOKEN`` from environment. GitLab sends a simple
plaintext token in the ``x-gitlab-token`` header.
Returns 200 on success, 401 on bad/missing token.

## Response `200`

Successful Response

- unknown

## Changes

> 15 revisions in range; 7 could not be searched.

- **2026-07-26** `2a1299ef19fa` — 1 info
  - endpoint added

[Change history](https://skmtc.dev/sipyourdrink-ltd/apis/bernstein-task-server/changes/api/v1/webhooks/gitlab/post.md)

---

[API](https://skmtc.dev/sipyourdrink-ltd/apis/bernstein-task-server.md) · [All operations](https://skmtc.dev/sipyourdrink-ltd/apis/bernstein-task-server/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/sipyourdrink-ltd/bernstein-task-server/revisions/7f4871ff054a/schema)
