# List licenses

Returns the licenses of your account, the newest first.

`GET /v1/licenses`

## Use cases

- Find a license from the license key that a customer sends to your support team.
- Find the licenses that a customer owns, to show them in your own customer portal.
- List the licenses that expire in the next 30 days, to send renewal reminders.
- Copy every license into your own system, one page at a time.

## Authentication

Send an API key. This endpoint requires the scope `licenses:read`. See [Authentication](../../authentication/) and [Scopes](../../integrations-and-scopes/#scopes).

An integration that is limited to one product can list only the licenses of that product. See [Product](../../integrations-and-scopes/#product).

## Request

### Query parameters

| Parameter | Type | Required | Description |
| --- | --- | --- | --- |
| `key` | string | No | A whole license key. The list holds the license that has this key. An unknown key answers an empty list. |
| `q` | string | No | A search term. It matches a part of the license ID, of the name of the license, and of the name, email address and external reference of the owner. A whole license key matches too. |
| `status` | string | No | `active`, `grace`, `expired` or `suspended`. See [Statuses](../../../concepts/licenses/#statuses). |
| `activation` | string | No | `activated` lists the licenses that were claimed at least once. `not_activated` lists the others. See [Activation](../../../concepts/licenses/#activation). |
| `expiring` | string | No | `30d` lists the licenses that expire in the next 30 days and are not suspended. The list is ordered by the expiry date, the soonest first. |
| `capacity` | string | No | `near` lists the licenses that use at least 80 percent of their device limit or their seat limit. Suspended and expired licenses are not listed. A license in its grace period is listed. The list is ordered by use, the fullest first. |
| `product_id` | string | No | The ID of a product. For an integration that is limited to one product, the ID of another product answers an empty list. |
| `policy_id` | string | No | The ID of a policy. |
| `entitlement_id` | string | No | The ID of an entitlement. The list holds the licenses that grant this entitlement themselves. A license that gets the entitlement only from its policy is not listed. See [Policies and licenses](../../../concepts/entitlements/#policies-and-licenses). |
| `customer_id` | string | No | The ID of a customer. The list holds the licenses that this customer owns. A seat that the customer holds does not count. |
| `cursor` | string | No | The value of `next_cursor` from the previous page. See [Pagination](../../#pagination). |

A license must match every parameter that the request sends. An ID that no object in your account has answers an empty list.

### Headers

| Header | Required | Description |
| --- | --- | --- |
| `Authorization` | Yes | The word `Bearer`, a space and the API key. |

## Response

The answer has the status 200.

| Field | Type | Description |
| --- | --- | --- |
| `licenses` | array of objects | The licenses on this page. See [License](#license). |

The answer also has the fields `total` and `next_cursor`. See [Pagination](../../#pagination).

### License

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The ID of the license. |
| `product_id` | string | The ID of the product of the license. |
| `policy_id` | string | The ID of the policy that the license was issued from. |
| `customer_id` | string or null | The ID of the customer who owns the license. It is `null` when the license has no owner. |
| `customer` | object or null | The customer who owns the license. It is `null` when the license has no owner. See [Customer](#customer). |
| `name` | string or null | The name of the license. |
| `key` | string | The license key. See [License keys](../../../concepts/licenses/#license-keys). |
| `status` | string | `active`, `grace`, `expired` or `suspended`. See [Statuses](../../../concepts/licenses/#statuses). |
| `expires_at` | string or null | The time when the license expires. It is `null` when the license has no expiry date. See [Expiry](../../../concepts/licenses/#expiry). |
| `activated_at` | string or null | The time of the first successful claim. It is `null` when the license was never claimed. |
| `suspended_at` | string or null | The time when the license was suspended. It is `null` when the license is not suspended. |
| `last_validated_at` | string or null | The time of the last validation through the License API. It is `null` when the license was never validated. |
| `expiration_strategy` | string or null | The After expiry rule of the license itself: `expire`, `keep_access` or `perpetual_fallback`. It is `null` when the rule of the policy applies. See [License overrides](../../../concepts/policies/#license-overrides). |
| `max_devices` | integer or null | The device limit of the license itself. It is `null` when the limit of the policy applies. |
| `max_seats` | integer or null | The seat limit of the license itself. It is `null` when the limit of the policy applies. |
| `max_processes` | integer or null | The process limit per device of the license itself. It is `null` when the limit of the policy applies. |
| `resolved` | object | The settings that apply to the license. The overrides of the license are already applied to the settings of the policy. See [Resolved](#resolved). |
| `created_at` | string | The time when the license was created. |
| `updated_at` | string | The time when the license was last changed. |

### Customer

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The ID of the customer. |
| `external_ref` | string | The ID of the customer in your own system. See [Customers](../../../concepts/customers/). |
| `email` | string or null | The email address of the customer. |
| `first_name` | string or null | The first name of the customer. |
| `last_name` | string or null | The last name of the customer. |

### Resolved

| Field | Type | Description |
| --- | --- | --- |
| `duration_seconds` | integer or null | The duration of a license in seconds. It is `null` when the policy is a lifetime policy. |
| `grace_period_seconds` | integer or null | The grace period in seconds. It is `null` when the policy has no grace period. |
| `expiration_basis` | string | `issue` or `first_activation`. The duration starts when the license is created or at the first claim. |
| `expiration_strategy` | string | `expire`, `keep_access` or `perpetual_fallback`. See [After expiry](../../../concepts/policies/#after-expiry). |
| `binds_device` | boolean | A claim must send a device fingerprint. |
| `binds_customer` | boolean | A claim must name the customer who takes the seat. |
| `max_devices` | integer or null | The device limit. It is `null` when there is no limit. |
| `max_seats` | integer or null | The seat limit. It is `null` when there is no limit. |
| `max_processes` | integer or null | The process limit per device. It is `null` when there is no limit. |
| `requires_heartbeat` | boolean | Each device keeps its binding with heartbeats. |
| `heartbeat_interval_seconds` | integer or null | The time between two heartbeats in seconds. |
| `heartbeat_grace_seconds` | integer or null | The extra time for a late heartbeat in seconds. |
| `process_interval_seconds` | integer or null | The time between two process heartbeats in seconds. It is `null` when process tracking is off. |
| `process_grace_seconds` | integer or null | The extra time for a late process heartbeat in seconds. |
| `offline_validation` | boolean | The application can check out a signed license file. |
| `license_file_ttl_seconds` | integer or null | The lifetime of a license file in seconds. It is `null` when the default of 30 days applies. |
| `license_file_encrypted` | boolean | License files are encrypted. |
| `entitlements` | array of objects | The entitlements of the policy together with the entitlements of the license. See [Entitlement](#entitlement). |

See [Policies](../../../concepts/policies/) for the meaning of each setting.

### Entitlement

| Field | Type | Description |
| --- | --- | --- |
| `id` | string | The ID of the entitlement. |
| `code` | string | The code that your application checks for, such as `PRO`. |
| `name` | string | The name of the feature. |
| `description` | string or null | A sentence that says what the entitlement unlocks. |
| `created_at` | string | The time when the entitlement was created. |
| `updated_at` | string | The time when the entitlement was last changed. |

## Errors

| Status | Reason | Description |
| --- | --- | --- |
| 400 | `The submitted details are not valid.` | A query parameter is not valid. The `errors` field names it. See the table below. |
| 400 | `The license cursor is not valid.` | No license in your account has the ID in `cursor`. |
| 401 | `An API key is required.` | The request has no `Authorization` header, the header is empty, or the header does not use the `Bearer` scheme. |
| 401 | `The API key is not valid.` | No integration has this key. |
| 401 | `The API key has expired.` | The expiry date of the key has passed. |
| 403 | `This integration does not have the licenses:read scope.` | The integration has neither `licenses:read` nor `licenses:write`. |
| 429 | `There are too many requests. Try again later.` | See [Rate limits](../../#rate-limits). |

These fields can be in `errors`:

| Field | Description |
| --- | --- |
| `key` | The key is empty or too long. |
| `q` | The search term is too long. |
| `status` | The value is not `active`, `grace`, `expired` or `suspended`. |
| `activation` | The value is not `activated` or `not_activated`. |
| `expiring` | The value is not `30d`. |
| `capacity` | The value is not `near`. |
| `product_id` | The value is not an ID. |
| `policy_id` | The value is not an ID. |
| `entitlement_id` | The value is not an ID. |
| `customer_id` | The value is not an ID. |
| `cursor` | The value is not an ID, or no license in your account has this ID. |

See [Errors](../../#errors).

## Example

{{< tabs >}}
{{< tab name="curl" >}}
```bash
curl "https://api.seatify.dev/v1/licenses?key=$LICENSE_KEY" \
  -H "Authorization: Bearer $SEATIFY_API_KEY"
```
{{< /tab >}}
{{< tab name="Swift" >}}
```swift
import Foundation

struct LicensePage: Decodable {
    let licenses: [License]
    let total: Int
    let nextCursor: String?

    enum CodingKeys: String, CodingKey {
        case licenses, total
        case nextCursor = "next_cursor"
    }
}

struct License: Decodable {
    let id: String
    let key: String
    let status: String
}

var components = URLComponents(string: "https://api.seatify.dev/v1/licenses")!
components.queryItems = [URLQueryItem(name: "key", value: licenseKey)]

var request = URLRequest(url: components.url!)
request.setValue("Bearer \(apiKey)", forHTTPHeaderField: "Authorization")

let (data, _) = try await URLSession.shared.data(for: request)
let page = try JSONDecoder().decode(LicensePage.self, from: data)
let license = page.licenses.first
```
{{< /tab >}}
{{< tab name="C#" >}}
```csharp
using System.Net.Http.Headers;
using System.Net.Http.Json;
using System.Text.Json.Serialization;

using var client = new HttpClient();
client.DefaultRequestHeaders.Authorization = new AuthenticationHeaderValue("Bearer", apiKey);

var page = await client.GetFromJsonAsync<LicensePage>(
    $"https://api.seatify.dev/v1/licenses?key={Uri.EscapeDataString(licenseKey)}");
var license = page?.Licenses.FirstOrDefault();

record LicensePage(License[] Licenses, long Total, [property: JsonPropertyName("next_cursor")] string? NextCursor);
record License(string Id, string Key, string Status);
```
{{< /tab >}}
{{< tab name="Go" >}}
```go
query := url.Values{"key": {licenseKey}}

req, err := http.NewRequest("GET", "https://api.seatify.dev/v1/licenses?"+query.Encode(), nil)
if err != nil {
	return err
}
req.Header.Set("Authorization", "Bearer "+apiKey)

res, err := http.DefaultClient.Do(req)
if err != nil {
	return err
}
defer res.Body.Close()

var page struct {
	Licenses []struct {
		ID     string `json:"id"`
		Key    string `json:"key"`
		Status string `json:"status"`
	} `json:"licenses"`
	Total      int64   `json:"total"`
	NextCursor *string `json:"next_cursor"`
}
err = json.NewDecoder(res.Body).Decode(&page)
```
{{< /tab >}}
{{< tab name="JavaScript" >}}
```javascript
const params = new URLSearchParams({ key: licenseKey });
const response = await fetch(`https://api.seatify.dev/v1/licenses?${params}`, {
  headers: { Authorization: `Bearer ${apiKey}` },
});
const { licenses, total, next_cursor } = await response.json();
```
{{< /tab >}}
{{< /tabs >}}

The answer:

```json
{
  "licenses": [
    {
      "id": "<license id>",
      "product_id": "<product id>",
      "policy_id": "<policy id>",
      "customer_id": "<customer id>",
      "customer": {
        "id": "<customer id>",
        "external_ref": "usr_000197",
        "email": "delphine.dubois196@halden.example",
        "first_name": "Delphine",
        "last_name": "Dubois"
      },
      "name": "BEACON Enterprise Site #0350",
      "key": "<license key>",
      "status": "active",
      "expires_at": "2029-08-01T23:00:00Z",
      "activated_at": "2026-08-22T05:00:00Z",
      "suspended_at": null,
      "last_validated_at": "2026-09-16T23:00:00Z",
      "expiration_strategy": null,
      "max_devices": null,
      "max_seats": null,
      "max_processes": null,
      "resolved": {
        "duration_seconds": 94608000,
        "grace_period_seconds": 5184000,
        "expiration_basis": "issue",
        "expiration_strategy": "keep_access",
        "binds_device": false,
        "binds_customer": false,
        "max_devices": null,
        "max_seats": null,
        "max_processes": null,
        "requires_heartbeat": false,
        "heartbeat_interval_seconds": null,
        "heartbeat_grace_seconds": null,
        "process_interval_seconds": null,
        "process_grace_seconds": null,
        "offline_validation": false,
        "license_file_ttl_seconds": null,
        "license_file_encrypted": false,
        "entitlements": [
          {
            "id": "<entitlement id>",
            "code": "API_ACCESS",
            "name": "API Access",
            "description": "Exposes the automation and scripting API.",
            "created_at": "2025-09-18T23:00:00Z",
            "updated_at": "2025-09-18T23:00:00Z"
          },
          {
            "id": "<entitlement id>",
            "code": "AUDIT_LOG",
            "name": "Audit Log",
            "description": "Records every action for compliance review.",
            "created_at": "2025-08-12T23:00:00Z",
            "updated_at": "2025-08-12T23:00:00Z"
          },
          {
            "id": "<entitlement id>",
            "code": "COLLAB",
            "name": "Live Collaboration",
            "description": "Multiple editors in one project at the same time.",
            "created_at": "2025-08-08T23:00:00Z",
            "updated_at": "2025-08-08T23:00:00Z"
          }
        ]
      },
      "created_at": "2026-08-02T23:00:00Z",
      "updated_at": "2026-08-02T23:00:00Z"
    }
  ],
  "total": 1,
  "next_cursor": null
}
```

