GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node interacts with the GitLab API, specifically supporting the operation to create user SSH keys via the POST /api/v4/user/keys endpoint. It is useful for automating the management of user SSH keys in GitLab, such as adding new keys programmatically for CI/CD pipelines or user access management.

Use Case Examples

  1. Automatically add SSH keys for new users in GitLab during onboarding.
  2. Integrate with a system that manages SSH keys for multiple GitLab users to keep keys up to date.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the request.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to which the API requests are sent.
Method The HTTP method to use for the API request, defaulting to GET but supporting POST, PUT, DELETE, HEAD, and PATCH.
Parameter Schema Defines the schema for the parameters of the postApiV4UserKeys operation, required in the request body.
Request Body Schema Defines the schema for the request body of the postApiV4UserKeys operation.
Request Path The API endpoint path for creating user keys, fixed to /api/v4/user/keys.

Output

JSON

  • id - The unique identifier of the created SSH key.
  • title - The title of the SSH key.
  • key - The SSH public key string.
  • created_at - Timestamp when the SSH key was created.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the GitLab API key credential is correctly configured and has sufficient permissions to create user keys.
  • Verify the baseUrl is correct and accessible, especially if using a self-hosted GitLab instance.
  • Check that the request body conforms to the expected schema for creating user keys, including required fields like title and key.
  • Common error messages include authentication failures (401 Unauthorized) and validation errors (400 Bad Request) if the key data is malformed or missing.

Links

Discussion