GitLab API

GitlabTool

Actions1000

Overview

This node operation disables two-factor authentication (2FA) for a specified user in GitLab by sending a PATCH request to the GitLab API endpoint `/api/v4/users/{id}/disable_two_factor`. It is useful for administrators who need to manage user security settings, such as disabling 2FA for users who have lost access to their authentication device or require account recovery.

Use Case Examples

  1. An admin disables 2FA for a user with ID 123 to help them regain account access.
  2. Automated workflows that manage user security settings based on organizational policies.

Properties

Name Meaning
Skip Authentication Option to skip API authentication for the request.
Authentication The authentication method used for the API request, defaulting to GitLab API key authentication.
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 PATCH is used for this operation.
Path Parameters Parameters to be included in the request path, specifically the user ID to identify which user's 2FA to disable.

Output

JSON

  • id - The ID of the user whose two-factor authentication was disabled.
  • message - Response message from the API indicating success or failure of the operation.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the user ID provided in the path parameters is valid and exists in the GitLab instance.
  • Check that the API key used has sufficient permissions to disable two-factor authentication for users.
  • If skipping authentication, the request will likely fail unless the GitLab instance allows unauthenticated access for this operation.
  • Common error messages include 401 Unauthorized (invalid or missing API key), 404 Not Found (user ID does not exist), and 403 Forbidden (insufficient permissions).

Links

Discussion