GitLab API icon

GitLab API

Gitlab

Actions1062

Personal_access_tokens → postApiV4ProjectsIdAccessTokensSelfRotate

AI-generated

Summary

Rotate the current user's personal access token for a specified GitLab project, replacing it with a new token to maintain secure access.

Inputs

  • id (required) — The ID of the GitLab project for which the personal access token will be rotated.
  • postApiV4ProjectsIdAccessTokensSelfRotate (required) — The request body containing the details required to perform the token rotation (exact schema as per GitLab API definition).
  • skipAuthentication — Optionally skip authentication for this request; defaults to false (authentication used).
  • baseUrl — The base URL of the GitLab instance; defaults to 'https://gitlab.com'.

Output shape

a JSON object representing the newly rotated personal access token details returned by the GitLab API

Requires the project ID as a path parameter and a properly structured request body according to the API schema. The response contains details of the new access token. Authentication is used by default but can be skipped if explicitly set.

Examples

Example 1: Rotate a personal access token for project ID '12345'

Provide '12345' as the 'id' path parameter, supply the required token details in the body as 'postApiV4ProjectsIdAccessTokensSelfRotate', and execute the operation to get the new token.

Links

Discussion