Skip to content

Rotate a personal access token for an enterprise user

POST
/api/v4/groups/{id}/manage/personal_access_tokens/{pat_id}/rotate

Rotates a specified personal access token for an enterprise user associated with the top-level group. This revokes the previous token and creates a token that expires after one week.

id
required
string

ID or URL-encoded path of the group

pat_id
required
integer

The ID of the personal access token

Media type application/json
object
expires_at

The expiration date of the token

string format: date
nullable
Example
2021-01-31

Created

Media type application/json
object
id
integer format: int64
name
string
revoked
boolean
created_at
string format: date-time
description
string
scopes
array
user_id
integer format: int64
last_used_at
string format: date-time
active
boolean
granular
boolean
expires_at
string format: date-time
token
string
granular_scopes
Array<object>
object
access
string
permissions
array
project_id
integer format: int64
group_id
integer format: int64
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

Not Found