Skip to content

List all personal access tokens for a project service account

GET
/api/v4/projects/{id}/service_accounts/{user_id}/personal_access_tokens

Lists all personal access tokens for a specified project service account

id
required
One of:
string

The ID or URL-encoded path of the project

user_id
required
integer

The ID of the service account

revoked
boolean
nullable

Filter tokens where revoked state matches parameter

Example
false
state
string
nullable
Allowed values: active inactive

Filter tokens which are either active or not

Example
active
created_before
string format: date-time
nullable

Filter tokens which were created before given datetime

Example
2022-01-01T00:00:00Z
created_after
string format: date-time
nullable

Filter tokens which were created after given datetime

Example
2021-01-01T00:00:00Z
last_used_before
string format: date-time
nullable

Filter tokens which were used before given datetime

Example
2021-01-01T00:00:00Z
last_used_after
string format: date-time
nullable

Filter tokens which were used after given datetime

Example
2022-01-01T00:00:00Z
expires_before
string format: date
nullable

Filter tokens which expire before given datetime

Example
2022-01-01
expires_after
string format: date
nullable

Filter tokens which expire after given datetime

Example
2021-01-01
search
string
nullable

Filters tokens by name

Example
token
sort
string
nullable

Sort tokens

Example
created_at_desc
page
integer
default: 1 nullable

Current page number

Example
1
per_page
integer
default: 20 nullable

Number of items per page

Example
20

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
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"
}

Bad Request

401 Unauthorized

Forbidden

404 Project Not Found