Skip to main content

Receive GitLab webhook

POST/webhooks/gitlab/{webhookId}
Signed request

Proven by Standard Webhooks headers or X-Gitlab-Token, not by a session.

POST /webhooks/gitlab/{webhookId} needs no session or CSRF token, and ReleaseFlow proves the delivery with that source's own secret before it reads the payload. Which check applies is chosen when the source is connected:

Read more: Receive GitLab webhooksSource: GitLabWebhookController#receive(opens in new tab)

Path parameters​

NameTypeRequiredNotes
webhookIdstringRequired

Headers​

NameTypeRequiredNotes
webhook-idstringOptional
webhook-timestampstringOptional
webhook-signaturestringOptional
X-Gitlab-TokenstringOptional
X-Gitlab-EventstringOptional
X-Gitlab-Event-UUIDstringOptional

Request body​

application/json · The body is optional.

The provider’s JSON payload, exactly as it was signed.

Response​

Success: 200

FieldTypeRequiredNotes
outcomestringOptional

Errors​

StatusCodeApplies to
400invalid_parametera path or query parameter is missing or does not convert, such as an ID that is not a UUIDAny endpoint
404not_foundno such addressAny endpoint
405method_not_allowedthe address does not take that methodAny endpoint
415unsupported_media_typethe address does not read a body of that typeAny endpoint
500internal_errora fault ReleaseFlow did not foresee; the body never carries the exception behind itAny endpoint
400webhook_payload_malformedWebhooks area
401webhook_signature_invalidWebhooks area
413webhook_payload_too_largeWebhooks area
422webhook_repository_mismatchWebhooks area

Request

bash
# Sign the exact bytes of payload.json with the webhook secret (see the guide).
curl -X POST "http://localhost:8080/webhooks/gitlab/$WEBHOOK_ID" \
-H "webhook-id: $WEBHOOK_ID" \
-H "webhook-timestamp: $WEBHOOK_TIMESTAMP" \
-H "webhook-signature: $WEBHOOK_SIGNATURE" \
-H "X-Gitlab-Token: $X_GITLAB_TOKEN" \
-H "X-Gitlab-Event: $X_GITLAB_EVENT" \
-H "X-Gitlab-Event-UUID: $X_GITLAB_EVENT_UUID" \
-H "Content-Type: application/json" \
--data-binary @payload.json

Response

200

Example

{
  "outcome": "<string>"
}