GitLab API

GitlabTool

Actions1000

Overview

This node operation allows adding a GPG key to a specific user in GitLab by making a POST request to the GitLab API endpoint `/api/v4/users/{id}/gpg_keys`. It is useful for managing user security keys programmatically, such as automating the addition of GPG keys for users in a GitLab instance.

Use Case Examples

  1. Automatically add a GPG key to a new user after account creation.
  2. Manage GPG keys for multiple users in bulk via workflow automation.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated API calls.
Authentication Select the authentication method, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but POST is used for this operation.
Path Parameters Parameters to be included in the request path, specifically the user ID for this operation.

Output

JSON

  • id - The ID of the newly added GPG key.
  • key - The GPG key content.
  • created_at - Timestamp when the GPG key was created.
  • expires_at - Expiration date of the GPG key, if any.
  • can_edit - Indicates if the GPG key can be edited.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the user ID provided in the path parameters is valid and exists in the GitLab instance.
  • Verify that the API key used for authentication has sufficient permissions to add GPG keys to users.
  • Check the base URL to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (invalid user ID), and 400 Bad Request (invalid GPG key data).

Links

Discussion