Get licenses¶
GET/
Licensing API · Licensing
Get tenant licenses.
Parameters¶
| Name | In | Type | Required | Description |
|---|---|---|---|---|
X-Tenant-ID | header | string (uuid) | Yes | Tenant ID. |
Request samples¶
curl -X GET "https://api.central.sophos.com/licenses/v1/licenses" -H "Authorization: Bearer <access-token>" -H "X-Tenant-ID: <tenant-id>"
import requests
response = requests.get(
"https://api.central.sophos.com/licenses/v1/licenses",
headers={
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
)
print(response.json())
$headers = @{
"Authorization" = "Bearer <access-token>"
"X-Tenant-ID" = "<tenant-id>"
}
Invoke-RestMethod -Method GET -Uri "https://api.central.sophos.com/licenses/v1/licenses" -Headers $headers
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, err := http.NewRequest("GET", "https://api.central.sophos.com/licenses/v1/licenses", nil)
if err != nil {
panic(err)
}
req.Header.Set("Authorization", "Bearer <access-token>")
req.Header.Set("X-Tenant-ID", "<tenant-id>")
resp, err := http.DefaultClient.Do(req)
if err != nil {
panic(err)
}
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println(string(body))
}
const response = await fetch("https://api.central.sophos.com/licenses/v1/licenses", {
method: "GET",
headers: {
"Authorization": "Bearer <access-token>",
"X-Tenant-ID": "<tenant-id>",
},
});
const data = await response.json();
console.log(data);
Responses¶
200 — Tenant licenses.¶
Response fields
organizationobjectrequiredTenant's organization.
Show child attributesHide child attributes
idstring (uuid)requiredOrganization ID.
partnerobjectTenant's partner.
Show child attributesHide child attributes
idstring (uuid)requiredPartner ID.
tenantobjectLinked tenant.
Show child attributesHide child attributes
idstring (uuid)requiredTenant ID.
licensesarray of objectrequiredItems must be unique.
License object.
Show child attributesHide child attributes
idstringrequiredLicense ID.
licenseIdentifierstringrequiredLicense identifier.
productobjectrequiredLicensed product.
Show child attributesHide child attributes
codestringrequiredProduct code.
namestringProduct name.
genericCodestringGeneric product code.
startDatestring (date)requiredLicense start date. The license is valid from the start of the day in the UTC timezone.
endDatestring (date)License end date. The license is valid until the end of the day in the UTC timezone. Not present for perpetual licenses.
perpetualbooleanrequiredWhether the license is perpetual or not.
typestringrequiredLicense type.
Must be one of:
Must be one of:
trial, term, usage, ordered, enterprise, perpetual.quantityintegerAssigned quantity.
unlimitedbooleanrequiredTrue if
quantity is missing.usageobjectLicense usage records.
Show child attributesHide child attributes
currentobjectrequiredLicense usage count for a specific date.
Show child attributesHide child attributes
countintegerrequiredLicense usage count.
datestring (date)requiredLicense usage date.
collectedAtstring (date-time)requiredDate and time when the usage was collected.
Errors¶
| Status | Meaning |
|---|---|
500 | Unexpected error. |
All error responses share the same shape — see the error response object.
Response examples¶
200¶
{
"organization": {
"id": "00000000-0000-0000-0000-000000000000"
},
"partner": {
"id": "00000000-0000-0000-0000-000000000000"
},
"tenant": {
"id": "00000000-0000-0000-0000-000000000000"
},
"licenses": [
{
"id": "string",
"licenseIdentifier": "string",
"product": {
"code": "string",
"name": "string",
"genericCode": "string"
},
"startDate": "2026-07-28",
"endDate": "2026-07-28",
"perpetual": true,
"type": "trial",
"quantity": 0,
"unlimited": true,
"usage": {
"current": {
"count": 0,
"date": "2026-07-28",
"collectedAt": "2026-07-28T00:00:00Z"
}
}
}
]
}
See the guide for a narrative walkthrough of this API.