Create an impersonation token
Creates an impersonation token. These tokens are used to act on behalf of a user and can perform API calls as well as Git read and write actions. These tokens are not visible to the associated user on their profile settings page. Token values are included with the response, but cannot be retrieved later. Administrators only.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ”The ID of the user
Request Body required
Section titled “ Request Body required ”object
The name of the impersonation token
The description of the personal access token
The expiration date in the format YEAR-MONTH-DAY of the impersonation token
The array of scopes of the impersonation token
List 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
Responses
Section titled “ Responses ”Created
object
The five most recent unique IP addresses that have authenticated with this token. When the limit is reached, the oldest IP address is removed. The list updates once per minute per token.
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", "last_used_ips": [ "127.0.0.1", "127.0.0.2", "127.0.0.3" ], "granular_scopes": [ { "access": "personal_projects", "permissions": [ "read_job" ], "project_id": 3, "group_id": 5 } ]}Bad Request
Not Found