GitLab API icon

GitLab API

Gitlab

Actions880

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 allow API access without using the user's password.
  2. Automate token creation for multiple users in a GitLab instance.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, typically used for testing or when authentication is handled externally.
baseUrl The base URL of the GitLab instance, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET but POST is used for this operation.
Path Parameters Parameters to be included in the request path, specifically the user_id to identify the user for whom the personal access token is created.

Output

JSON

  • token - The created personal access token string returned by the GitLab API.
  • name - The name of the personal access token.
  • scopes - The scopes or permissions granted to the personal access token.
  • expires_at - The expiration date of the personal access token.

Dependencies

  • GitLab API authentication credential

Troubleshooting

  • Ensure the user_id path parameter is correctly provided and corresponds to an existing user in GitLab.
  • Verify that the authentication credential (API token) 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 error messages include 401 Unauthorized (authentication failure), 403 Forbidden (insufficient permissions), and 404 Not Found (invalid user_id). Resolving these involves verifying credentials, permissions, and parameter correctness.

Links

Discussion