GitLab API

GitlabTool

Actions905

Overview

This node operation allows creating a personal access token for a specified user in GitLab via the GitLab API. It is useful for automating the generation of tokens that can be used for API authentication or other access control purposes within GitLab. For example, an admin can programmatically create tokens for users to enable integrations or automated workflows.

Use Case Examples

  1. Create a personal access token for a user to enable API access without sharing the user's password.
  2. Automate token creation for multiple users in a GitLab instance to streamline access management.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication credentials 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, defaulting to https://gitlab.com.
Method The HTTP method to use for the API request, defaulting to GET but here relevant for POST to create the token.
Path Parameters Parameters to be included in the API request path, specifically the user_id to identify the user for whom the personal access token is created.

Output

JSON

  • id - The unique identifier of the created personal access token.
  • name - The name assigned to the personal access token.
  • scopes - The scopes or permissions granted to the personal access token.
  • created_at - Timestamp when the personal access token was created.
  • token - The actual personal access token string used for authentication.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the user_id path parameter is correctly provided and corresponds to an existing user in GitLab.
  • Verify that the API key used has sufficient permissions to create personal access tokens for users.
  • Check the baseUrl is correctly set to the GitLab instance URL if using a self-hosted GitLab.
  • Common errors include 401 Unauthorized if authentication fails, 404 Not Found if the user_id does not exist, and 403 Forbidden if permissions are insufficient.

Links

Discussion