GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node operation allows creating a personal access token for a specific 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 automation 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.
Method The HTTP method used for the API request, defaulting to GET but here it is POST for creating tokens.
Parameter Schema Defines the required parameters for the operation, including the user ID in the path and the request body schema for the personal access token creation.
Request Body Schema Schema defining the structure of the request body for creating a personal access token.
Request Path The API endpoint path for creating a personal access token for a user, with a placeholder for user ID.
Path Parameters Collection of path parameters required for the API call, specifically the user_id identifying the user for whom the 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 set and corresponds to an existing user in GitLab.
  • Verify that the authentication credentials (GitLab API key) have sufficient permissions to create personal access tokens for users.
  • Check that the request body conforms to the expected schema for creating personal access tokens, including required fields like name and scopes.
  • Common error messages may include 401 Unauthorized if authentication fails, 404 Not Found if the user_id does not exist, or 400 Bad Request if the request body is invalid.

Links

Discussion