GitLab API

GitlabTool

Actions905

Overview

This node operation allows rotating a personal access token in GitLab by making a POST request to the GitLab API endpoint `/api/v4/personal_access_tokens/{id}/rotate`. It is useful for securely regenerating tokens without manually deleting and creating new ones, which helps maintain continuous access while enhancing security.

Use Case Examples

  1. A user wants to rotate their GitLab personal access token with ID 123 to ensure it is refreshed and secure without interrupting their automated workflows.
  2. An admin automates token rotation for multiple users to comply with security policies.

Properties

Name Meaning
Skip Authentication If set to true, the node will skip using authentication credentials for the 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 request is sent, defaulting to https://gitlab.com.
Method The HTTP method used for the request, which is POST for this operation.
Path Parameters The path parameter 'id' specifies the ID of the personal access token to rotate.

Output

JSON

  • id - The ID of the rotated personal access token.
  • name - The name of the personal access token.
  • scopes - The scopes or permissions granted to the token.
  • created_at - Timestamp when the token was created.
  • expires_at - Expiration date of the token, if set.
  • token - The new token string after rotation.

Dependencies

  • GitLab API key credential for authentication

Troubleshooting

  • Ensure the 'id' path parameter is correctly set to a valid personal access token ID; otherwise, the API will return an error.
  • If authentication is skipped or credentials are invalid, the request will fail with an authentication error.
  • Verify the baseUrl is correct for your GitLab instance; incorrect URLs will cause connection failures.

Links

Discussion