CreatePackageLicenseQuery
Creates a query to fetch merged license data (PackageLicense + PackageLicenseOverride) for a package version from all the namespaces in the namespace chain. This is the primary API for the Edit Dependency UI page. The response combines:
- Original licenses/copyrights/notices from PackageLicense (fetched from OSS namespace).
- Any overrides from PackageLicenseOverride (fetched from user namespace).
- Selection states for each item (defaults to selected if not in selection map).
curl --request POST \
--url https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries \
--header 'Content-Type: application/json' \
--data '
{
"tenant_meta": {}
}
'import requests
url = "https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries"
payload = { "tenant_meta": {} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({tenant_meta: {}})
};
fetch('https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tenant_meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries"
payload := strings.NewReader("{\n \"tenant_meta\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries")
.header("Content-Type", "application/json")
.body("{\n \"tenant_meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenant_meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"name": "<string>",
"annotations": {},
"create_time": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"index_data": {
"data": [
"<string>"
],
"search_score": 123,
"tenant": "<string>",
"will_be_deleted_at": "2023-11-07T05:31:56Z"
},
"kind": "<string>",
"parent_kind": "<string>",
"parent_uuid": "<string>",
"references": {},
"tags": [
"<string>"
],
"update_time": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"upsert_time": "2023-11-07T05:31:56Z",
"version": "<string>"
},
"spec": {
"package_version_uuid": "<string>",
"applied_overrides": [
{
"namespace": "<string>",
"override_uuid": "<string>"
}
],
"copyrights": [
{
"copyright_text": "<string>",
"file_locations": [
{
"end_byte": 123,
"end_line": 123,
"relative_path": "<string>",
"start_byte": 123,
"start_line": 123
}
],
"identifier": "<string>",
"is_edited": true,
"resolved_namespace": "<string>",
"resolved_override_uuid": "<string>",
"selected": true
}
],
"licenses": [
{
"file_locations": [
{
"end_byte": 123,
"end_line": 123,
"relative_path": "<string>",
"start_byte": 123,
"start_line": 123
}
],
"identifier": "<string>",
"is_edited": true,
"license_text": "<string>",
"resolved_namespace": "<string>",
"resolved_override_uuid": "<string>",
"selected": true,
"source": "<string>",
"spdx_expr": "<string>"
}
],
"notices": [
{
"file_locations": [
{
"end_byte": 123,
"end_line": 123,
"relative_path": "<string>",
"start_byte": 123,
"start_line": 123
}
],
"identifier": "<string>",
"is_edited": true,
"notices_text": "<string>",
"resolved_namespace": "<string>",
"resolved_override_uuid": "<string>",
"selected": true
}
],
"package_license_name": "<string>"
},
"tenant_meta": {
"namespace": "<string>"
},
"uuid": "<string>"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}Path Parameters
Namespaces are a way to organize organizational units into virtual groupings of resources. Namespaces must be a fully qualified name, for example, the child namespace of namespace "endor.prod" called "app" is called "endor.prod.app".
Body
PackageLicenseQuery represents the merged result of PackageLicense + PackageLicenseOverride. This response combines original license data from PackageLicense with any overrides and selection states from PackageLicenseOverride across all namespaces in the namespace chain, providing a complete view for the UI.
Response
A successful response.
PackageLicenseQuery represents the merged result of PackageLicense + PackageLicenseOverride. This response combines original license data from PackageLicense with any overrides and selection states from PackageLicenseOverride across all namespaces in the namespace chain, providing a complete view for the UI.
Was this page helpful?
curl --request POST \
--url https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries \
--header 'Content-Type: application/json' \
--data '
{
"tenant_meta": {}
}
'import requests
url = "https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries"
payload = { "tenant_meta": {} }
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({tenant_meta: {}})
};
fetch('https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'tenant_meta' => [
]
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries"
payload := strings.NewReader("{\n \"tenant_meta\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries")
.header("Content-Type", "application/json")
.body("{\n \"tenant_meta\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.endorlabs.com/v1/namespaces/{tenant_meta.namespace}/queries/package-license-queries")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"tenant_meta\": {}\n}"
response = http.request(request)
puts response.read_body{
"meta": {
"name": "<string>",
"annotations": {},
"create_time": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"description": "<string>",
"index_data": {
"data": [
"<string>"
],
"search_score": 123,
"tenant": "<string>",
"will_be_deleted_at": "2023-11-07T05:31:56Z"
},
"kind": "<string>",
"parent_kind": "<string>",
"parent_uuid": "<string>",
"references": {},
"tags": [
"<string>"
],
"update_time": "2023-11-07T05:31:56Z",
"updated_by": "<string>",
"upsert_time": "2023-11-07T05:31:56Z",
"version": "<string>"
},
"spec": {
"package_version_uuid": "<string>",
"applied_overrides": [
{
"namespace": "<string>",
"override_uuid": "<string>"
}
],
"copyrights": [
{
"copyright_text": "<string>",
"file_locations": [
{
"end_byte": 123,
"end_line": 123,
"relative_path": "<string>",
"start_byte": 123,
"start_line": 123
}
],
"identifier": "<string>",
"is_edited": true,
"resolved_namespace": "<string>",
"resolved_override_uuid": "<string>",
"selected": true
}
],
"licenses": [
{
"file_locations": [
{
"end_byte": 123,
"end_line": 123,
"relative_path": "<string>",
"start_byte": 123,
"start_line": 123
}
],
"identifier": "<string>",
"is_edited": true,
"license_text": "<string>",
"resolved_namespace": "<string>",
"resolved_override_uuid": "<string>",
"selected": true,
"source": "<string>",
"spdx_expr": "<string>"
}
],
"notices": [
{
"file_locations": [
{
"end_byte": 123,
"end_line": 123,
"relative_path": "<string>",
"start_byte": 123,
"start_line": 123
}
],
"identifier": "<string>",
"is_edited": true,
"notices_text": "<string>",
"resolved_namespace": "<string>",
"resolved_override_uuid": "<string>",
"selected": true
}
],
"package_license_name": "<string>"
},
"tenant_meta": {
"namespace": "<string>"
},
"uuid": "<string>"
}{
"code": 123,
"details": [
{
"@type": "<string>"
}
],
"message": "<string>"
}