Skip to content

Create a project access token

POST
/api/v4/projects/{id}/access_tokens

Creates a project access token for a specified project. You cannot create a token with an access level greater than your account. For example, a user with the Maintainer role cannot create a project access token with the Owner role. You must use a personal access token with this endpoint. You cannot authenticate with a project access token.

id
required
string

The project ID

Example
2
Media type application/json
object
name
required

The name of the access token

string
nullable
Example
My token
description

The description of the access token

string
nullable
Example
A token used for k8s
expires_at

The expiration date of the token. If ‘Require personal access token expiry’ is enabled, you must provide a valid value, if not, the token will never expire.

string format: date
nullable
Example
2026-02-14
scopes
required

The permissions of the token

Array<string>
access_level

The access level of the token in the project

integer
default: 40 nullable
Allowed values: 10 15 20 25 30 40 50

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
last_used_ips

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.

Array<string>
granular_scopes
Array<object>
object
access
string
permissions
array
project_id
integer format: int64
group_id
integer format: int64
access_level
integer
resource_type
string
resource_id
integer
token
string
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
}
],
"access_level": 40,
"resource_type": "project",
"resource_id": 1234
}

Bad Request

Not Found