Managed Licenses API (deprecated)

caution
This feature was deprecated in GitLab 15.9.
caution
“approval” and “blacklisted” approval statuses are changed to “allowed” and “denied” in GitLab 15.0.

List managed licenses

Get all managed licenses for a given project.

GET /projects/:id/managed_licenses
AttributeTypeRequiredDescription
idinteger/stringyesThe 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": "allowed"
  },
  {
    "id": 3,
    "name": "ISC",
    "approval_status": "denied"
  }
]

Show an existing managed license

Shows an existing managed license.

GET /projects/:id/managed_licenses/:managed_license_id
AttributeTypeRequiredDescription
idinteger/stringyesThe ID or URL-encoded path of the project owned by the authenticated user
managed_license_idinteger/stringyesThe 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": "denied"
}

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
AttributeTypeRequiredDescription
idinteger/stringyesThe ID or URL-encoded path of the project owned by the authenticated user
namestringyesThe name of the managed license
approval_statusstringyesThe approval status of the license. “allowed” or “denied”.
curl --data "name=MIT&approval_status=denied" --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/api/v4/projects/1/managed_licenses"

Example response:

{
  "id": 1,
  "name": "MIT",
  "approval_status": "allowed"
}

Delete a managed license

Deletes a managed license with a given ID.

DELETE /projects/:id/managed_licenses/:managed_license_id
AttributeTypeRequiredDescription
idinteger/stringyesThe ID or URL-encoded path of the project owned by the authenticated user
managed_license_idinteger/stringyesThe 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
AttributeTypeRequiredDescription
idinteger/stringyesThe ID or URL-encoded path of the project owned by the authenticated user
managed_license_idinteger/stringyesThe ID or URL-encoded name of the license belonging to the project
approval_statusstringyesThe approval status of the license. “allowed” or “denied”.
curl --request PATCH --data "approval_status=denied" \
     --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": "denied"
}