Creates an access token for a project
Creates an access token for a project
Path parameters
-
The ID or URL-encoded path of the project
Query parameters
-
The name of the project access token
-
Defines read and write permissions for the token
Values are
api
,read_api
,read_registry
,write_registry
,read_repository
, orwrite_repository
. -
expires_at date
Date when the token expires. Time of day is Midnight UTC of that date.
POST
/v4/projects/{id}/access_tokens
curl \
-X POST https://gitlab.com/api/v4/projects/{id}/access_tokens?name=string&scopes=api
Response examples (200)
{
"id": 58,
"name": "test",
"token": "D4y...Wzr",
"active": true,
"scopes": [
"api",
"read_repository"
],
"revoked": false,
"user_id": 166,
"created_at": "2021-01-20T14:13:35Z",
"expires_at": "2022-01-31"
}