GitLab API icon

GitLab API

Gitlab

Actions880

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. Automate adding GPG keys for new users in GitLab.
  2. Manage user GPG keys in bulk via workflows.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication Type of authentication used for the API request, defaulting to GitLab API key.
baseUrl Base URL of the GitLab instance to which the request is sent.
Method HTTP method used for the request, default is GET but POST is used for this operation.
Path Parameters Parameters included in the request path, specifically the user ID for this operation.

Output

JSON

  • id - The ID of the user to whom the GPG key is being added
  • gpg_key - The GPG key data added to the user

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 baseUrl to ensure it points to the correct GitLab instance.
  • Common error messages include 401 Unauthorized (authentication issues), 404 Not Found (invalid user ID), and 400 Bad Request (invalid GPG key data). Resolving these involves correcting credentials, user ID, or request body data respectively.

Links

Discussion