GitLab API icon

GitLab API

Gitlab

Actions880

Overview

This node operation allows creating a new SSH key for the authenticated user in GitLab via the GitLab API. It is useful for automating the management of user SSH keys, such as adding new keys programmatically for access control or deployment automation.

Use Case Examples

  1. Automatically add a new SSH key to a user's GitLab account when onboarding a new developer.
  2. Integrate with a CI/CD pipeline to add deployment keys to GitLab user accounts.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated endpoints.
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 can be set to POST for this operation.
Parameter Schema Schema defining the parameters for the postApiV4UserKeys operation, required in the request body.
Request Body Schema Schema defining the structure of the request body for the postApiV4UserKeys operation.
Request Path 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 or name of the SSH key.
  • key - The actual 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 has sufficient permissions to create user SSH keys.
  • Verify the baseUrl is correct and accessible.
  • Check that the request body conforms to the expected schema for creating SSH keys.
  • Common error: 401 Unauthorized - indicates authentication failure, verify API key.
  • Common error: 400 Bad Request - indicates invalid input data, check the request body format and required fields.

Links

Discussion