GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows users to create a new project hook in a GitLab project by making a POST request to the GitLab API endpoint `/api/v4/projects/{id}/hooks`. It is useful for automating the setup of webhooks that trigger events in GitLab projects, such as CI/CD pipelines, notifications, or integrations with other services.

Use Case Examples

  1. Automatically add a webhook to a GitLab project when a new project is created to trigger a CI/CD pipeline.
  2. Set up a webhook to notify an external system whenever a push event occurs in a specific GitLab project.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, default is false meaning authentication is used.
Authentication Type of authentication used, default is GitLab API key authentication. Hidden if Skip Authentication is true.
baseUrl Base URL of the GitLab instance, default is https://gitlab.com.
Method HTTP method to use for the request, default is GET but for this operation it is POST.
Path Parameters Parameters to be included in the request path, specifically the project ID or URL-encoded path required to identify the project for which the hook is created.

Output

JSON

  • id - The unique identifier of the created project hook.
  • url - The URL that the hook will call when triggered.
  • project_id - The ID of the project to which the hook belongs.
  • push_events - Boolean indicating if the hook triggers on push events.
  • merge_requests_events - Boolean indicating if the hook triggers on merge request events.
  • tag_push_events - Boolean indicating if the hook triggers on tag push events.
  • note_events - Boolean indicating if the hook triggers on note events.
  • enable_ssl_verification - Boolean indicating if SSL verification is enabled for the hook.
  • created_at - Timestamp when the hook was created.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the project ID provided in the path parameters is correct and accessible with the provided authentication.
  • If authentication is skipped, the request may fail due to lack of permissions.
  • Check that the base URL is correctly set to the GitLab instance you are targeting.
  • Verify that the request body schema matches the expected format for creating a project hook in GitLab API.

Links

Discussion