Rotate the GitLab access token
Replace the GitLab access token Gitar uses with a newer token for the same GitLab user, e.g. right after GitLab issues it. Gitar validates the new token against the connected instance and group before storing it, and the previous token stays in use if validation fails.
Requires an API token with the gitlab_token:rotate scope, which Administrator tokens include. The new token must authenticate as the same GitLab user as the current one. To connect a different user, update the token in Gitar’s GitLab settings.
Selecting a GitLab instance. Organizations with a single connected GitLab instance can omit host. Once an organization connects more than one instance, host is required.
Prerequisites
Restrictions
The new token must authenticate as the same GitLab user as the current token. This endpoint renews a credential and does not switch accounts. To connect a different GitLab user, update the token from the GitLab settings page in Gitar. The new token must pass the same checks as the connect form, including theapi scope and access to the connected group.
Each rotation is recorded in the organization’s audit log with the API token that made it.
Example
host, e.g. "host": "https://gitlab.example.com".Authorizations
Body
Request to replace the connected GitLab token.
Response
Token validated and stored