GitLab API

GitlabTool

Actions905

Overview

This node interacts with the GitLab API to create personal access tokens for a user via the POST /api/v4/user/personal_access_tokens endpoint. It is useful for automating the generation of personal access tokens in GitLab, which can be used for API authentication or automation tasks requiring user-level access.

Use Case Examples

  1. Automatically generate a new personal access token for a user when onboarding new team members.
  2. Create tokens with specific scopes for CI/CD pipelines or integrations.

Properties

Name Meaning
Skip Authentication If set to true, the node skips the authentication process.
Authentication Specifies the authentication method to use, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is POST for this operation.
Parameter Schema Schema defining the parameters required in the request body for creating a personal access token.
Request Body Schema Schema defining the structure of the request body for the POST operation.
Request Path The API endpoint path for creating personal access tokens: /api/v4/user/personal_access_tokens.

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 token.
  • created_at - Timestamp when the token was created.
  • token - The actual personal access token string used for authentication.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the GitLab API key credential is valid and has sufficient permissions to create personal access tokens.
  • Verify the baseUrl is correct and accessible from the n8n instance.
  • Check that the request body conforms to the required schema for creating personal access tokens.
  • Common error messages include authentication failures (401 Unauthorized) and validation errors (400 Bad Request) due to missing or incorrect parameters.

Links

Discussion