GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation deletes a specific project snippet in GitLab by its project ID and snippet ID. It is useful for automating the removal of code snippets or notes associated with a project in GitLab, for example, cleaning up outdated or sensitive snippets programmatically.

Use Case Examples

  1. Automatically delete a project snippet when it is no longer needed to maintain project hygiene.
  2. Remove a snippet as part of a CI/CD pipeline cleanup process.

Properties

Name Meaning
Skip Authentication Whether to skip authentication for the request (boolean). Defaults to false.
Authentication The authentication method used for the request, typically an API key credential for GitLab.
baseUrl The base URL of the GitLab instance. Defaults to https://gitlab.com.
Method The HTTP method to use for the request. Defaults to GET but for this operation should be DELETE.
Path Parameters Parameters required in the URL path to identify the project and snippet to delete.

Output

JSON

  • success - Indicates whether the snippet was successfully deleted (boolean).
  • statusCode - HTTP status code returned by the API after the delete operation.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the project ID and snippet ID are correct and exist in the GitLab instance to avoid 404 errors.
  • Check that the API authentication token has sufficient permissions to delete project snippets.
  • If skipping authentication, ensure the GitLab instance allows unauthenticated delete requests, which is uncommon and may cause authorization errors.

Links

Discussion