GitLab API

GitlabTool

Actions905

Overview

This node interacts with the GitLab API to perform operations related to the User resource, specifically allowing the creation of user SSH keys via the POST /api/v4/user/keys endpoint. It is useful for automating user key management in GitLab, such as adding SSH keys for authentication purposes in CI/CD pipelines or user account setups.

Use Case Examples

  1. Automatically add SSH keys to a GitLab user account when onboarding new developers.
  2. Manage user SSH keys programmatically as part of a DevOps workflow.

Properties

Name Meaning
Skip Authentication Determines whether to skip authentication for the API 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, specifying required body parameters for the request.
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 valid and has sufficient permissions to create user keys.
  • Verify the baseUrl is correctly set to the GitLab instance URL.
  • Check that the request body conforms to the expected schema for creating user keys.
  • Common error messages include authentication failures (401 Unauthorized) and validation errors (400 Bad Request) if required fields are missing or malformed.

Links

Discussion