GitLab API icon

GitLab API

Gitlab

Actions917

Overview

This node interacts with the GitLab API to retrieve personal access tokens (PATs) using the API v4 endpoint. It is useful for scenarios where you need to manage or audit personal access tokens for users in a GitLab instance, such as filtering tokens by user ID, state, creation date, or usage date. For example, an administrator can use this node to list all active tokens created after a certain date or to find tokens that have been revoked.

Use Case Examples

  1. Retrieve all active personal access tokens for a specific user.
  2. Filter tokens created before a certain date to audit old tokens.
  3. Search tokens by name to find specific tokens.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated endpoints.
Authentication Select the authentication method, defaulting to GitLab API key authentication.
baseUrl The base URL of the GitLab instance to connect to, defaulting to https://gitlab.com.
Method HTTP method to use for the request, default is GET.
Query Parameters Collection of optional filters and pagination parameters to refine the request for personal access tokens.

Output

JSON

  • id - Unique identifier of the personal access token.
  • name - Name of the personal access token.
  • user_id - ID of the user who owns the token.
  • scopes - Scopes or permissions granted by the token.
  • created_at - Timestamp when the token was created.
  • expires_at - Expiration date of the token, if any.
  • revoked - Boolean indicating if the token has been revoked.
  • last_used_at - Timestamp of the last time the token was used.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the GitLab API key credential is correctly configured and has sufficient permissions to access personal access tokens.
  • Verify the baseUrl is correct and accessible from the network where the node runs.
  • Check that query parameters are correctly formatted, especially date-time strings, to avoid API errors.
  • Common error messages include authentication failures (401 Unauthorized) and invalid parameters (400 Bad Request). Resolving these involves checking credentials and parameter formats.

Links

Discussion