- List managed licenses
- Show an existing managed license
- Create a new managed license
- Delete a managed license
- Edit an existing managed license
Managed Licenses API
List managed licenses
Get all managed licenses for a given project.
GET /projects/:id/managed_licenses
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer/string | yes | The ID or URL-encoded path of the project |
curl --header "PRIVATE-TOKEN: <your_access_token>" https://gitlab.example.com/api/v4/projects/1/managed_licenses
Example response:
[
{
"id": 1,
"name": "MIT",
"approval_status": "approved"
},
{
"id": 3,
"name": "ISC",
"approval_status": "blacklisted"
}
]
Show an existing managed license
Shows an existing managed license.
GET /projects/:id/managed_licenses/:managed_license_id
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer/string | yes | The ID or URL-encoded path of the project owned by the authenticated user |
managed_license_id
| integer/string | yes | The ID or URL-encoded name of the license belonging to the project |
curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses/6"
Example response:
{
"id": 1,
"name": "MIT",
"approval_status": "blacklisted"
}
Create a new managed license
Creates a new managed license for the given project with the given name and approval status.
POST /projects/:id/managed_licenses
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer/string | yes | The ID or URL-encoded path of the project owned by the authenticated user |
name
| string | yes | The name of the managed license |
approval_status
| string | yes | The approval status. “approved” or “blacklisted” |
curl --data "name=MIT&approval_status=blacklisted" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses"
Example response:
{
"id": 1,
"name": "MIT",
"approval_status": "approved"
}
Delete a managed license
Deletes a managed license with a given id.
DELETE /projects/:id/managed_licenses/:managed_license_id
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer/string | yes | The ID or URL-encoded path of the project owned by the authenticated user |
managed_license_id
| integer/string | yes | The ID or URL-encoded name of the license belonging to the project |
curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses/4"
When successful, it replies with an HTTP 204 response.
Edit an existing managed license
Updates an existing managed license with a new approval status.
PATCH /projects/:id/managed_licenses/:managed_license_id
Attribute | Type | Required | Description |
---|---|---|---|
id
| integer/string | yes | The ID or URL-encoded path of the project owned by the authenticated user |
managed_license_id
| integer/string | yes | The ID or URL-encoded name of the license belonging to the project |
approval_status
| string | yes | The approval status. “approved” or “blacklisted” |
curl --request PATCH --data "approval_status=blacklisted" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses/6"
Example response:
{
"id": 1,
"name": "MIT",
"approval_status": "blacklisted"
}
Help and feedback
If there's something you don't like about this feature
To propose functionality that GitLab does not yet offer
To further help GitLab in shaping new features
If you didn't find what you were looking for
If you want help with something very specific to your use case, and can use some community support
POST ON GITLAB FORUM
If you have problems setting up or using this feature (depending on your GitLab subscription)
REQUEST SUPPORT
To view all GitLab tiers and features or to upgrade
If you want to try all features available in GitLab.com
If you want to try all features available in GitLab self-managed
If you spot an error or a need for improvement and would like to fix it yourself in a merge request
EDIT THIS PAGE
If you would like to suggest an improvement to this doc