Use this API to interact with CI/CD job token scopes.
All requests to the CI/CD job token scope API endpoint must be authenticated. The authenticated user must have the Maintainer or Owner role for the project.
Retrieve the CI/CD job token access settings for a project
GET /api/v4/projects/{id}/job_token_scope
Retrieves the CI/CD job token access settings (job token scope) of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Update the CI/CD job token access settings for a project
PATCH /api/v4/projects/{id}/job_token_scope
Updates the Authorized groups and projects setting (job token scope) of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
enabledRequired | Boolean | Indicates CI/ |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
List all projects in a CI/CD job token allowlist
GET /api/v4/projects/{id}/job_token_scope/allowlist
Lists all projects in the CI/CD job token allowlist of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Add a project to a CI/CD job token allowlist
POST /api/v4/projects/{id}/job_token_scope/allowlist
Adds a project to the CI/CD job token allowlist of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer | ID of user project Example: 1 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
target_Required | Integer | ID of target project Example: 2 |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
422 | Unprocessable entity | — |
Delete a project from a CI/CD job token allowlist
DELETE /api/v4/projects/{id}/job_token_scope/allowlist/{target_project_id}
Deletes a project from the CI/CD job token allowlist of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer | ID of user project Example: 1 |
target_Path, | Integer | ID of the project to be removed from the allowlist Example: 2 |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
List all groups in a CI/CD job token allowlist
GET /api/v4/projects/{id}/job_token_scope/groups_allowlist
Lists all groups in the CI/CD job token allowlist of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | String or integer | The ID or URL- |
pageQuery | Integer | Current page number Default: 1Example: 1 |
per_Query | Integer | Number of items per page Default: 20Example: 20 |
Responses
| Code | Description | Schema |
|---|---|---|
200 | OK | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Add a group to a CI/CD job token allowlist
POST /api/v4/projects/{id}/job_token_scope/groups_allowlist
Adds a group to the CI/CD job token allowlist of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer | ID of user project Example: 1 |
Request body (application/json)
| Property | Type | Description |
|---|---|---|
target_Required | Integer | ID of target group Example: 2 |
Responses
| Code | Description | Schema |
|---|---|---|
201 | Created | APIEntities |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
422 | Unprocessable entity | — |
Delete a group from a CI/CD job token allowlist
DELETE /api/v4/projects/{id}/job_token_scope/groups_allowlist/{target_group_id}
Deletes a group from the CI/CD job token allowlist of a specified project.
Parameters
| Name | Type | Description |
|---|---|---|
idPath, | Integer | ID of user project Example: 1 |
target_Path, | Integer | ID of the group to be removed from the allowlist Example: 2 |
Responses
| Code | Description | Schema |
|---|---|---|
204 | No Content | — |
400 | Bad Request | — |
401 | Unauthorized | — |
403 | Forbidden | — |
404 | Not found | — |
Schemas
Objects returned by the operations above and objects nested in their request bodies.
APIEntitiesBasicGroupDetails
| Property | Type | Description |
|---|---|---|
id | Integer (int64) | — |
name | String | Example:Diaspora |
web_ | String | Example:http: |
APIEntitiesBasicProjectDetails
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:http: |
created_ | String (date- | Example:2020- |
custom_ | APIEntities | — |
default_ | String | Example:main |
description | String | Example:desc |
forks_ | Integer | Example:1 |
http_ | String | Example:https: |
id | Integer (int64) | Example:1 |
last_ | String (date- | Example:2013- |
license | APIEntities | — |
license_ | String | Example:https: |
name | String | Example:project1 |
name_ | String | Example:John Doe / |
namespace | APIEntities | — |
path | String | Example:project1 |
path_ | String | Example:namespace1/ |
readme_ | String | Example:https: |
repository_ | String | Example:default |
ssh_ | String | Example:git@gitlab. |
star_ | Integer | Example:1 |
tag_ | Array of strings | Example:["tag"] |
topics | Array of strings | Example:["topic"] |
visibility | String | Example:public |
web_ | String | Example:https: |
APIEntitiesCustomAttribute
| Property | Type | Description |
|---|---|---|
key | String | Example:foo |
value | String | Example:bar |
APIEntitiesGroupScopeLink
| Property | Type | Description |
|---|---|---|
source_ | Integer (int64) | — |
target_ | Integer (int64) | — |
APIEntitiesLicenseBasic
| Property | Type | Description |
|---|---|---|
html_ | String | Example:http: |
key | String | Example:gpl- |
name | String | Example:GNU General Public License v3. |
nickname | String | Example:GNU GPLv3 |
source_ | String | — |
APIEntitiesNamespaceBasic
| Property | Type | Description |
|---|---|---|
avatar_ | String | Example:https: |
full_ | String | Example:group/ |
id | Integer (int64) | Example:2 |
kind | String | Example:project |
name | String | Example:project |
parent_ | Integer (int64) | Example:1 |
path | String | Example:my_ |
web_ | String | Example:https: |
APIEntitiesProjectJobTokenScope
| Property | Type | Description |
|---|---|---|
inbound_ | Boolean | — |
outbound_ | Boolean | — |
APIEntitiesProjectScopeLink
| Property | Type | Description |
|---|---|---|
source_ | Integer (int64) | — |
target_ | Integer (int64) | — |