Skip to content

Rotate a personal access token

POST
/api/v4/personal_access_tokens/self/rotate

Rotates a personal access token by passing it to the API in a header

Media type application/json
object
expires_at

The expiration date of the token

string format: date
nullable
Example
2021-01-31

OK

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

Unauthorized

Forbidden

Method not allowed