Skip to main content

listLicensees

List

Returns a key's licensees, oldest first, up to 100 per request. The list omits canceled licensees. The key must be enabled for sub-licensing.

Endpoint​

GET /keys/{key}/licensees

See the API reference for this endpoint.

This operation needs a Management Key. Set it as userToken on the client, which sends it in the Authorization header. See setup.

Import​

import { listLicensees } from "@addresszen/sdk";

Path Parameters​

NameTypeRequiredDescription
keystringyesAPI Key The API Key. Begins ak_.

Query Parameters​

NameTypeRequiredDescription
starting_afterstringnoID of the licensee after which to list results. Pass the id of the last licensee on the previous page.
limitnumbernoLimit Specifies the maximum number of records to retrieve. By default the limit is 10. Requesting a larger result set adds latency.
querystringnoFilter results by licensee name. Can be shortened to q=

Response Type​

import type { ListLicenseesResponse } from "@addresszen/sdk";

Errors​

HTTP errors throw an ApiError with the HTTP status and the API error code and message. Network failures and aborts reject with the runtime's native error. Pass throwOnError: false to get { data, error } instead. See error handling.

Example​

list-licensees.tsts
import { createZenClient, listLicensees } from "@addresszen/sdk";

export const example = async () => {
const client = createZenClient({ userToken: "uk_example" });
const { data } = await listLicensees({
client,
path: { key: "ak_test" },
});
return data;
};