GitLab API icon

GitLab API

Gitlab

Actions1062

Personal_access_tokens → postApiV4PersonalAccessTokensIdRotate

AI-generated

Summary

Rotate (regenerate) a personal access token for the specified token ID in GitLab by sending a POST request to the /api/v4/personal_access_tokens/{id}/rotate endpoint.

Inputs

  • id (required) — The ID of the personal access token to rotate. This is a path parameter and must be provided as a string representing an integer.
  • skipAuthentication — Optionally skip authentication for this operation; defaults to false.
  • baseUrl — The base URL of the GitLab instance; defaults to https://gitlab.com.

Output shape

a single object representing the rotated personal access token details returned from GitLab's API.

The operation returns the JSON response from GitLab's API after rotating the specified personal access token. The output is not paginated and requires providing a valid token ID.

Examples

Example 1: Rotate a personal access token with ID '12345' on gitlab.com

Set 'id' path parameter to '12345', use default 'baseUrl' (https://gitlab.com), and authenticate with valid GitLab API credentials.

Links

Discussion