From 0ea3fcec397b69815975647f5e2aa5fe944a8486 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Mon, 20 Jun 2022 11:10:13 +0000 Subject: Add latest changes from gitlab-org/gitlab@15-1-stable-ee --- doc/api/personal_access_tokens.md | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) (limited to 'doc/api/personal_access_tokens.md') diff --git a/doc/api/personal_access_tokens.md b/doc/api/personal_access_tokens.md index c49af2a745c..46a4c674560 100644 --- a/doc/api/personal_access_tokens.md +++ b/doc/api/personal_access_tokens.md @@ -70,6 +70,29 @@ curl --header "PRIVATE-TOKEN: " "https://gitlab.example.com/a ] ``` +## Get single personal access token by ID + +> [Introduced](https://gitlab.com/gitlab-org/gitlab/-/issues/362239) in GitLab 15.1. + +Get a single personal access token by its ID. Users can get their own tokens. +Administrators can get any token. + +```plaintext +GET /personal_access_tokens/:id +``` + +| Attribute | Type | required | Description | +|-----------|---------|----------|---------------------| +| `id` | integer/string | yes | ID of personal access token | + +```shell +curl --request GET --header "PRIVATE-TOKEN: " "https://gitlab.example.com/api/v4/personal_access_tokens/" +``` + +### Responses + +- `401: Unauthorized` if the user doesn't have access to the token they're requesting the ID or if the token with matching ID doesn't exist. + ## Revoke a personal access token Revoke a personal access token by either: -- cgit v1.2.3