GitLab API icon

GitLab API

Gitlab

Actions917

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 programmatically as part of a CI/CD pipeline setup.

Properties

Name Meaning
Skip Authentication If set to true, the node skips using authentication credentials for the request.
Authentication Selects the authentication method to use, defaulting to GitLab API authentication.
baseUrl The base URL of the GitLab instance to which the API requests are sent, defaulting to https://gitlab.com.
Method HTTP method to use for the request, defaulting to POST for this operation.
Parameter Schema Defines the schema for the parameters sent in the request body, required for creating personal access tokens.
Request Body Schema Schema for the request body payload, defining the structure of the personal access token data to be sent.
Request Path The API endpoint path for creating personal access tokens, fixed to /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 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 credentials (an API key credential)

Troubleshooting

  • Ensure the GitLab API credentials are correctly configured and have sufficient permissions to create personal access tokens.
  • Verify the baseUrl is correct and accessible, especially if using a self-hosted GitLab instance.
  • Check that the request body conforms to the required schema for creating personal access tokens; missing or invalid fields will cause errors.
  • Common error messages include authentication failures (401 Unauthorized) and validation errors (400 Bad Request) due to incorrect parameters.

Links

Discussion