Description: Create a custom license that can be used for license compliance management. Custom licenses are user-defined and can be assigned to components for tracking and compliance purposes. The license name must be unique and comply with length constraints.
Since: Xray 3.132.0
Applicable Environment: JFrog SaaS, JFrog Self-Hosted
Security: Requires a valid user with Admin permission.
Usage: POST /api/v1/licensesNames/customLicense
Consumes: application/json
Produces: application/json
Request body:
Name | Type | Required/Optional | Description |
|---|---|---|---|
| string | required | License key/identifier. Maximum length: 128 characters. Must be unique across all licenses. |
| string | optional | Full display name of the license. |
| string | optional | Description or full text of the license. |
| array of strings | optional | Array of URLs or references related to the license. |
| array of strings | optional | Array of alternative names for the license. Each alias has a maximum length of 128 characters. |
| string | optional | License category. Defaults to Valid values include:
|
| integer | optional | License priority value. If not specified, the default priority for the category will be used. |
Response body:
Name | Type | Description |
|---|---|---|
| string | License key/identifier. |
| string | Full display name of the license. |
| string | Description or full text of the license. |
| array of strings | Array of URLs or references related to the license. |
| array of strings | Array of alternative names for the license. |
| string | License category. |
| boolean | Indicates this is a custom license (always |
| integer | License priority (optional; may be included in the response). |
| integer | Default priority for the license category (optional; may be included in the response). |
Response Codes:
Code | Description |
|---|---|
200 | OK — Custom license created successfully. |
400 | Bad request — License name already exists, or validation failed (for example, name or alias exceeds maximum length of 128 characters). |
403 | Permission denied — User does not have Admin permission. |
415 | Unsupported media type — Failed to parse request body (invalid JSON format). |
500 | Internal server error — Failed to create custom license due to server error. |
Example Request Body:
{
"name": "MyCustomLicense",
"full_name": "My Custom License Full Name",
"text": "This is a custom license description",
"references": [
"https://example.com/license",
"https://example.com/legal"
],
"aliases": [
"MCL",
"MyLicense"
],
"category": "Permissive"
}Example Successful Response (200 OK):
{
"name": "MyCustomLicense",
"full_name": "My Custom License Full Name",
"text": "This is a custom license description",
"references": [
"https://example.com/license",
"https://example.com/legal"
],
"aliases": [
"MCL",
"MyLicense"
],
"category": "Permissive",
"isCustom": true
}Sample Request:
POST /api/v1/licensesNames/customLicense Content-Type: application/json Accept: application/json
curl -u <user>:<password> \
-X POST "https://<xray-host>/xray/api/v1/licensesNames/customLicense" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d '{
"name": "MyCustomLicense",
"full_name": "My Custom License Full Name",
"text": "This is a custom license description",
"references": [
"https://example.com/license",
"https://example.com/legal"
],
"aliases": [
"MCL",
"MyLicense"
],
"category": "Permissive"
}'Sample Error Responses:
400 Bad Request - License Already Exists
{
"error": "License name already exists"
}
400 Bad Request - Validation Failed
{
"error": "license name 'VeryLongLicenseNameThatExceedsTheMaximumAllowedLengthOfOneHundredAndTwentyEightCharacters' is longer than max length allowed (128)"
}
415 Unsupported Media Type
{
"error": "Failed to parse message"
}
500 Internal Server Error
{
"error": "Failed to set custom license"
}