Create a personal access token
Creates a personal access token for the currently authenticated user. For security purposes, the token is limited to the k8s_proxy and self_rotate scope. Token values are included with the response, but cannot be retrieved later. This feature was introduced in GitLab 16.5.
Authorizations
Section titled “ Authorizations ”Request Body required
Section titled “ Request Body required ”object
The name of the access token
Example
My tokenThe description of the access token
Example
A token used for k8sExpiration date of the access token in ISO format (YYYY-MM-DD). If undefined, the date is set to the maximum allowable lifetime limit.
Example
2021-01-31List of granular scopes to assign to the token
object
Access to configure for the granular scope.
List of permissions for the granular scope
IDs of projects to associate with the granular scope, when access is selected_memberships
IDs of groups to associate with the granular scope, when access is selected_memberships
The array of scopes of the personal access token
Responses
Section titled “ Responses ”Created
object
object
Example
{ "id": 2, "name": "John Doe", "description": "Token to manage api", "scopes": [ "api" ], "user_id": 3, "last_used_at": "2020-08-31T15:53:00.073Z", "expires_at": "2020-08-31T15:53:00.073Z", "granular_scopes": [ { "access": "personal_projects", "permissions": [ "read_job" ], "project_id": 3, "group_id": 5 } ]}Bad Request