GitLab API

GitlabTool

Actions1000

Overview

This node operation retrieves the memberships of a specific user from the GitLab API (version 4). It is useful for scenarios where you need to fetch information about the projects or namespaces a user is a member of, such as managing user access or auditing memberships in GitLab projects or groups.

Use Case Examples

  1. Fetch all project memberships for a user to verify their access rights.
  2. Retrieve namespace memberships to understand group affiliations of a user in GitLab.

Properties

Name Meaning
Skip Authentication Option to skip authentication for the request, useful for public or unauthenticated API calls.
Authentication Type of authentication used for the API request, defaulting to GitLab API key authentication.
baseUrl Base URL of the GitLab instance to which the API request is sent, default is https://gitlab.com.
Method HTTP method used for the API request, default is GET.
Query Parameters Optional query parameters to filter or paginate the memberships data.
Path Parameters Path parameters required for the API endpoint, specifically the user_id to identify the user whose memberships are being retrieved.

Output

JSON

  • id - The unique identifier of the membership.
  • source_id - The ID of the project or namespace the user is a member of.
  • source_type - The type of source, either Project or Namespace.
  • access_level - The access level the user has in the project or namespace.
  • notification_level - The notification level set for the membership.
  • state - The state of the membership (e.g., active, blocked).
  • created_at - Timestamp when the membership was created.
  • expires_at - Timestamp when the membership expires, if applicable.

Dependencies

  • GitLab API key credential

Troubleshooting

  • Ensure the user_id path parameter is correctly set and corresponds to an existing user in GitLab.
  • Verify that the API key credential has sufficient permissions to access user membership information.
  • Check the baseUrl to ensure it points to the correct GitLab instance, especially if using a self-hosted GitLab server.
  • Common error messages include 401 Unauthorized (due to missing or invalid API key) and 404 Not Found (if the user_id does not exist). Resolving these involves verifying credentials and user existence respectively.

Links

Discussion