{"openapi":"3.1.0","info":{"title":"LicenseManager API","version":"1.0.0","description":"Public API. Authenticate with an organization API key, or with a token scoped to a customer, license or machine on the endpoints that accept one.\n\n## Conventions\n\n- **Errors** answer `{ \"error\": { \"code\", \"message\" } }`. Branch on `code`, which is stable, not on `message`. Each response lists the codes it can return, except `404`, which answers `not_found` unless it says otherwise. Unexpected errors answer `500` with `internal_error`.\n- **Validation** errors answer `422`, not `400`, with the `validation_error` code and an `issues` array giving the `path` and `message` of each invalid value.\n- **Unknown body fields are ignored**, not rejected: sending a field an endpoint doesn't accept, like `policyId` to `updateLicense`, changes nothing and doesn't fail.\n- **Strings** are trimmed before they're validated and stored. Emails are stored lower cased.\n- **Updates** only change the fields that are sent. A field sent as `null` is cleared, when it can be.\n- **Dates** can be sent with any offset, and are always returned in UTC, like `2026-01-15T09:30:00.000Z`. Calendar months and days are counted in UTC.\n- **Ids** are 8 letters and digits, after `test_` for test products and their resources.\n- **Lists** are paginated with `page` and `pageSize`. Items with the same value for the `sort` field are ordered by id, so pages are stable, but items created or deleted between two requests shift the pages. Items without a value for the `sort` field come last in ascending order, and first in descending order, unless the endpoint says otherwise.\n- **Test products** are sandboxes of a live product. Test API keys only reach test products, live API keys only live ones: the others answer `404`, as if they didn't exist. Sessions and tokens reach both."},"externalDocs":{"description":"LicenseManager website","url":"https://licensemanager.dev"},"servers":[{"url":"https://api.licensemanager.dev"}],"security":[{"apiKey":[]},{"session":[]}],"components":{"securitySchemes":{"apiKey":{"type":"apiKey","in":"header","name":"x-api-key","description":"Organization API key. `Authorization: Bearer <key>` is also accepted. Live keys (`pk_…`) only reach live products, test keys (`test_pk_…`) only test products: the others answer `404`."},"token":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"Short-lived token scoped to a customer, license or machine, signed with HS256. Its claims:\n\n- `typ`: `customer`, `license` or `machine`, the type of resource the token is scoped to.\n- `sub`: id of that resource.\n- `scope`: space separated permissions, among `customer:read`, `customer:write`, `license:read`, `license:write`, `machine:read` and `machine:write`. A write permission implies the matching read one. Without `scope`, the token can't do anything.\n- `exp`: expiration time.\n\nOnly the endpoints that say so accept tokens: the others answer `403` with `token_not_allowed`, as do the endpoints that don't accept its type. A token without the endpoint's permission answers `403` with `insufficient_scope`. The token reaches the resource it's scoped to, the ones below it and the ones above it: a license token reaches its customer and machines, but not the customer's other licenses. Resources it doesn't reach answer `404`.\n\nA token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted, which makes it answer `401` with `invalid_token`. Tokens are created by `createCustomerToken`, `createLicenseToken` and `createMachineToken`, with an API key or a session, or with a token for the resources below it: a customer token creates license and machine tokens, a license token machine tokens. Portal links (`createPortalLink`, `requestPortalLink`) hold customer tokens too."},"session":{"type":"apiKey","in":"cookie","name":"better-auth.session_token","description":"Session cookie set by the web app."}},"schemas":{"LicenseToken":{"type":"object","properties":{"license":{"type":"string","description":"JWT signed with the Ed25519 key of the product's organization (`alg: EdDSA`, `kid`: id of the key). Its claims:\n\n- `iss`: name of the organization. It changes when the organization is renamed: check `aud` rather than `iss`.\n- `aud`: id of the product. Test and live products share the organization's key, so check `aud` to refuse the tokens of a test product.\n- `sub`: license key.\n- `fp`: fingerprint of the machine.\n- `mv`: the license's `maxVersion.version`, like `\"2.3\"`, so the application can check the versions it updates to offline. `null` when it allows every version.\n- `iat`: when the token was issued.\n- `nbf`: two hours before `iat`, so machines whose clock is behind accept the token.\n- `exp`: the license's `maxOfflineDurationSeconds` after `iat`, or when the license expires if that's sooner.","example":"eyJhbGciOiJFZERTQSIsInR5cCI6IkpXVCIsImtpZCI6Ims4UjJ2TnFXIn0…"}},"required":["license"]},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"not_found"},"message":{"type":"string","example":"Resource not found"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"example":["name"]},"message":{"type":"string","example":"Too small: expected string to have >=1 characters"}},"required":["path","message"]},"description":"Present on `validation_error` errors."}},"required":["code","message"]}},"required":["error"]},"ValidateKeyError":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","example":"not_found"},"message":{"type":"string","example":"Resource not found"},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"}]},"example":["name"]},"message":{"type":"string","example":"Too small: expected string to have >=1 characters"}},"required":["path","message"]},"description":"Present on `validation_error` errors."},"latestAllowedVersion":{"type":["string","null"],"description":"On `version_not_allowed` errors: version of the latest stable release of the product the license allows, among the ones already released. `null` when it allows none of them.","example":"2.3.1"}},"required":["code","message"]}},"required":["error"]},"ValidateKey":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":255,"description":"License key, compared exactly: keys are case sensitive.","example":"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF"},"fingerprint":{"type":"string","minLength":1,"maxLength":255,"description":"Identifies the machine. Unique within the license. Compared exactly, case included: a different fingerprint is another machine.","example":"4c:32:75:8f:9a:1e"},"version":{"type":"string","minLength":1,"maxLength":100,"description":"Version of the application running on the machine, like `\"1.4.2\"`. Its major and minor numbers are checked against the license's `maxVersion.version`: a `v` prefix and a pre-release are accepted, `\"v2.3.0-beta.1\"` counting as 2.3, and a version that doesn't start with a number is refused when the license has a `maxVersion.version`. It doesn't have to be one of the product's releases.","example":"1.4.2"},"name":{"type":"string","minLength":1,"maxLength":200,"description":"Name of the machine. Replaces the current one when given.","example":"Jane's MacBook"},"platform":{"type":"string","minLength":1,"maxLength":100,"description":"Platform of the machine. Replaces the current one when given.","example":"macOS"}},"required":["key","fingerprint","version"]},"Portal":{"type":"object","properties":{"productId":{"type":"string","example":"x7Kp2QaZ"},"productName":{"type":"string","example":"Acme Pro"},"organizationName":{"type":"string","example":"Acme"},"logoUrl":{"type":["string","null"],"format":"uri","description":"Public URL of the product's logo. `null` without a logo.","example":"https://cdn.example.com/logos/x7Kp2QaZ/k3f9a2LpQ7xw.webp"},"brandColor":{"type":["string","null"],"description":"Background of the side panel, as `#rrggbb`. `null` for the default color.","example":"#1e3a8a"},"accentColor":{"type":["string","null"],"description":"Color of the inputs and buttons, as `#rrggbb`. `null` for the default color.","example":"#2563eb"},"returnUrl":{"type":["string","null"],"description":"Link back to the product's website: the requested `returnUrl` when its domain is allowed, the product's default return link otherwise. `null` for no link.","example":"https://example.com/account"}},"required":["productId","productName","organizationName","logoUrl","brandColor","accentColor","returnUrl"]},"PortalNotFound":{"allOf":[{"$ref":"#/components/schemas/Error"},{"type":"object","properties":{"organizationSlug":{"type":"string","description":"Slug of the product's organization. Present on `portal_disabled` errors.","example":"acme"},"productSlug":{"type":"string","description":"Slug of the product. Present on `portal_disabled` errors.","example":"acme-pro"}}}]},"RequestPortalLink":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","description":"Email of the customer.","example":"jane@example.com"},"returnUrl":{"type":"string","maxLength":2000,"description":"Link back to your website, kept in the emailed link when its domain is one of the product's `returnDomains`.","example":"https://example.com/account"}},"required":["email"]},"AdminOrganization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"ownerEmail":{"type":["string","null"]},"members":{"type":"integer"},"products":{"type":"integer"},"plan":{"type":"string","enum":["free","startup","standard","custom"]},"interval":{"type":["string","null"]},"subscriptionStatus":{"type":["string","null"]},"hasCustomLimits":{"type":"boolean"},"openBreaches":{"type":"integer"},"overLimit":{"type":"boolean"},"blockedAt":{"type":["string","null"],"format":"date-time"}},"required":["id","name","slug","createdAt","ownerEmail","members","products","plan","interval","subscriptionStatus","hasCustomLimits","openBreaches","overLimit","blockedAt"]},"AdminOrganizationDetail":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"createdAt":{"type":"string","format":"date-time"},"stripeCustomerId":{"type":["string","null"]},"stripeDashboardUrl":{"type":["string","null"]},"plan":{"type":"string","enum":["free","startup","standard","custom"]},"interval":{"type":["string","null"]},"limits":{"type":"object","properties":{"products":{"type":["integer","null"],"minimum":0},"activeLicenses":{"type":["integer","null"],"minimum":0},"apiRequests":{"type":["integer","null"],"minimum":0},"seats":{"type":["integer","null"],"minimum":0},"apiKeys":{"type":["integer","null"],"minimum":0}},"required":["products","activeLicenses","apiRequests","seats","apiKeys"]},"usage":{"type":"object","additionalProperties":{"type":"number"}},"subscriptions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"plan":{"type":"string"},"status":{"type":"string"},"billingInterval":{"type":["string","null"]},"stripeSubscriptionId":{"type":["string","null"]},"periodEnd":{"type":["string","null"],"format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"},"stripeScheduleId":{"type":["string","null"]}},"required":["id","plan","status","billingInterval","stripeSubscriptionId","periodEnd","cancelAtPeriodEnd","stripeScheduleId"]}},"scheduledChange":{"type":["object","null"],"properties":{"type":{"type":"string"},"plan":{"type":"string"},"interval":{"type":["string","null"]},"at":{"type":["string","null"],"format":"date-time"}},"required":["type","plan","interval","at"]},"billing":{"type":"object","properties":{"customPriceId":{"type":["string","null"]},"customLimits":{"type":["object","null"],"properties":{"products":{"type":["integer","null"],"minimum":0},"activeLicenses":{"type":["integer","null"],"minimum":0},"apiRequests":{"type":["integer","null"],"minimum":0},"seats":{"type":["integer","null"],"minimum":0},"apiKeys":{"type":["integer","null"],"minimum":0}},"required":["products","activeLicenses","apiRequests","seats","apiKeys"]},"notes":{"type":["string","null"]},"graceOverrideUntil":{"type":["string","null"],"format":"date-time"},"blockedAt":{"type":["string","null"],"format":"date-time"}},"required":["customPriceId","customLimits","notes","graceOverrideUntil","blockedAt"]},"breaches":{"type":"array","items":{"type":"object","properties":{"metric":{"type":"string"},"startedAt":{"type":"string","format":"date-time"},"resolvedAt":{"type":["string","null"],"format":"date-time"},"graceEndsAt":{"type":["string","null"],"format":"date-time"}},"required":["metric","startedAt","resolvedAt","graceEndsAt"]}},"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"}},"required":["userId","name","email","role"]}},"products":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"test":{"type":"boolean"}},"required":["id","name","slug","test"]}},"apiRequests":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"integer"}},"required":["day","count"]}}},"required":["id","name","slug","createdAt","stripeCustomerId","stripeDashboardUrl","plan","interval","limits","usage","subscriptions","scheduledChange","billing","breaches","members","products","apiRequests"]},"ProductList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Product"},"description":"Items of the page, in the requested order. Empty past the last page."},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"Product":{"type":"object","properties":{"id":{"type":"string","example":"x7Kp2QaZ"},"slug":{"type":"string","example":"acme-pro"},"name":{"type":"string","example":"Acme Pro"},"isTestFromProductId":{"type":["string","null"],"description":"For test products, id of the live product they're a sandbox of. `null` for live products.","example":null},"logoUrl":{"type":["string","null"],"format":"uri","description":"Public URL of the product's logo, shown in the web app and the customer portal. `null` without a logo.","example":"https://cdn.example.com/logos/x7Kp2QaZ/k3f9a2LpQ7xw.webp"},"portal":{"$ref":"#/components/schemas/PortalSettings"},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"}},"required":["id","slug","name","isTestFromProductId","logoUrl","portal","createdAt","updatedAt"]},"PortalSettings":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether customers can use the customer portal. When disabled, it answers `404`.","example":true},"brandColor":{"type":["string","null"],"pattern":"^#[0-9a-f]{6}$/i","description":"Background of the portal's side panel, as `#rrggbb`, stored lower cased. `null` for the default color.","example":"#1e3a8a"},"accentColor":{"type":["string","null"],"pattern":"^#[0-9a-f]{6}$/i","description":"Color of the portal's inputs and buttons, as `#rrggbb`, stored lower cased. `null` for the default color.","example":"#2563eb"},"returnUrl":{"type":["string","null"],"maxLength":2000,"format":"uri","description":"Link back to your website shown in the portal, when the portal's URL has no allowed `return_url`. `null` for no link.","example":"https://example.com/account"},"returnDomains":{"type":"array","items":{"type":"string","maxLength":253,"pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$"},"maxItems":20,"description":"Domains the portal's `return_url` query parameter may point to, their subdomains included. Other return URLs are ignored, in favor of `returnUrl`.","example":["example.com"]}},"required":["enabled","brandColor","accentColor","returnUrl","returnDomains"]},"Pagination":{"type":"object","properties":{"page":{"type":"integer","description":"Number of the returned page, as requested. Pages are numbered from 1: `1` is the first page.","example":1},"pageSize":{"type":"integer","description":"Maximum number of items per page, as requested. `data` holds fewer items on the last page, and none past it.","example":20},"total":{"type":"integer","description":"Number of items matching the filters, across all pages. `0` when nothing matches.","example":42},"totalPages":{"type":"integer","description":"Number of pages, which is also the number of the last page. `0` when nothing matches. There's a next page while `page` is lower than `totalPages`.","example":3}},"required":["page","pageSize","total","totalPages"],"description":"Where the returned page stands among all the items matching the filters. Pages are numbered from 1."},"CreateProductWithPolicy":{"allOf":[{"$ref":"#/components/schemas/CreateProduct"},{"type":"object","properties":{"defaultPolicy":{"$ref":"#/components/schemas/PolicySettings"},"isTestFromProductId":{"type":"string","description":"Creates a test product: a sandbox of this live product of the organization, starting with copies of its policies, releases and portal settings.","example":"x7Kp2QaZ"}}}]},"PolicySettings":{"type":"object","properties":{"duration":{"anyOf":[{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":2147483647,"example":86400},"unit":{"type":"string","enum":["seconds"]}},"required":["value","unit"]},{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":12000,"example":12},"unit":{"type":"string","enum":["months"],"description":"Calendar months: a license created on January 31 with a 1 month duration expires on the last day of February."}},"required":["value","unit"]},{"type":"null"}],"description":"Duration of the licenses created with this policy. `null` makes them never expire. Defaults to `null`."},"maxMachines":{"type":["integer","null"],"exclusiveMinimum":0,"maximum":2147483647,"description":"Maximum number of active machines of the licenses created with this policy, copied to each of them. `null` for no limit. Defaults to `null`.","example":3},"maxOfflineDurationSeconds":{"type":"integer","minimum":3600,"maximum":2147483647,"description":"Longest the applications can run offline with the licenses created with this policy, in seconds, copied to each of them. At least one hour (`3600`). Defaults to one week.","example":604800},"maxVersion":{"anyOf":[{"$ref":"#/components/schemas/FixedMaxVersion"},{"$ref":"#/components/schemas/LockMaxVersion"},{"type":"null"}],"description":"Latest version of the product the licenses created with this policy can use. `null` allows every version. Defaults to `null`.\n\n- `fixed`: up to a hard-coded `version`. `\"2\"` allows every 2.y.z version: its minor versions and bug fixes. `\"2.3\"` allows every 2.3.z version: its bug fixes.\n- `lock`: every version released during some time after the license is created, then only the updates of the version reached by then. The major version locks `majorAfter` the creation of the license, then the license only gets the minor versions and bug fixes of its major version. The minor version optionally locks `minorAfter` it, never sooner than the major version, then the license only gets the bug fixes of its minor version. `{ \"type\": \"lock\", \"majorAfter\": { \"value\": 1, \"unit\": \"months\" }, \"minorAfter\": { \"value\": 12, \"unit\": \"months\" } }` allows every version released during the month after the license is created, then the minor versions and bug fixes of the major version reached by then until the end of the first year, then only the bug fixes of the minor version reached by then. `majorAfter` at 0 allows minor versions only, and both at 0 allows bug fixes only: no updates.\n\nBug fixes are never locked: a hard-coded version has no patch number, like `\"2.3.1\"`, and a lock only locks major and minor versions."}}},"FixedMaxVersion":{"type":"object","properties":{"type":{"type":"string","enum":["fixed"]},"version":{"type":"string","pattern":"^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*))?$","description":"`\"2\"` allows every 2.y.z version: the minor versions and bug fixes of version 2. `\"2.3\"` allows every 2.3.z version: the bug fixes of version 2.3. Bug fixes can't be locked, so patch numbers like `\"2.3.1\"` are rejected.","example":"2.3"}},"required":["type","version"],"description":"The licenses can use up to `version`, whenever they're created."},"LockMaxVersion":{"type":"object","properties":{"type":{"type":"string","enum":["lock"]},"majorAfter":{"oneOf":[{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":2147483647,"example":86400},"unit":{"type":"string","enum":["seconds"]}},"required":["value","unit"]},{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":12000,"example":12},"unit":{"type":"string","enum":["months"],"description":"Calendar months: a license created on January 31 with a 1 month duration expires on the last day of February."}},"required":["value","unit"]}],"description":"Time after the creation of a license its major version is locked, in seconds or calendar months: it then only gets the minor versions and bug fixes of the major version released by then. `0` locks it when the license is created."},"minorAfter":{"anyOf":[{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":2147483647,"example":86400},"unit":{"type":"string","enum":["seconds"]}},"required":["value","unit"]},{"type":"object","properties":{"value":{"type":"integer","minimum":0,"maximum":12000,"example":12},"unit":{"type":"string","enum":["months"],"description":"Calendar months: a license created on January 31 with a 1 month duration expires on the last day of February."}},"required":["value","unit"]},{"type":"null"}],"description":"Time after the creation of a license its minor version is locked, in seconds or calendar months: it then only gets the bug fixes of the minor version released by then. Never shorter than `majorAfter`, whatever the length of the months: 1 month is longer than 28 days but may be shorter than 31. `0` locks it when the license is created. `null` to never lock it."}},"required":["type","majorAfter","minorAfter"],"description":"The licenses can use every version released after their creation, until their major version locks `majorAfter` it, then the updates of their major version until their minor version locks `minorAfter` it, if ever. Bug fixes are never locked."},"CreateProduct":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"example":"Acme Pro"},"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(test_)?[a-z0-9]+(-[a-z0-9]+)*$","description":"Unique within the organization. Defaults to the name, lower cased, without accents and special characters. Starts with `test_` in test products, which is added when missing, and removed in live products.","example":"acme-pro"}},"required":["name"]},"UpdateProduct":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"example":"Acme Pro"},"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(test_)?[a-z0-9]+(-[a-z0-9]+)*$","description":"Unique within the organization. Defaults to the name, lower cased, without accents and special characters. Starts with `test_` in test products, which is added when missing, and removed in live products.","example":"acme-pro"},"portal":{"type":"object","properties":{"enabled":{"type":"boolean","description":"Whether customers can use the customer portal. When disabled, it answers `404`.","example":true},"brandColor":{"type":["string","null"],"pattern":"^#[0-9a-f]{6}$/i","description":"Background of the portal's side panel, as `#rrggbb`, stored lower cased. `null` for the default color.","example":"#1e3a8a"},"accentColor":{"type":["string","null"],"pattern":"^#[0-9a-f]{6}$/i","description":"Color of the portal's inputs and buttons, as `#rrggbb`, stored lower cased. `null` for the default color.","example":"#2563eb"},"returnUrl":{"type":["string","null"],"maxLength":2000,"format":"uri","description":"Link back to your website shown in the portal, when the portal's URL has no allowed `return_url`. `null` for no link.","example":"https://example.com/account"},"returnDomains":{"type":"array","items":{"type":"string","maxLength":253,"pattern":"^[a-z0-9]([a-z0-9-]*[a-z0-9])?(\\.[a-z0-9]([a-z0-9-]*[a-z0-9])?)*$"},"maxItems":20,"description":"Domains the portal's `return_url` query parameter may point to, their subdomains included. Other return URLs are ignored, in favor of `returnUrl`.","example":["example.com"]}}}}},"UploadLogo":{"type":"object","properties":{"file":{"type":"string","format":"binary","description":"WebP, PNG, JPEG or SVG image, up to 1 MB."}},"required":["file"]},"ProductStats":{"type":"object","properties":{"licenseCount":{"type":"integer","description":"Number of licenses of the product.","example":120},"activeLicenseCount":{"type":"integer","description":"Number of licenses that haven't expired, and that a machine validated in the last 90 days.","example":87},"newLicenseCount":{"type":"integer","description":"Number of licenses created in the last 30 days, today included, in UTC.","example":14},"expiringLicenseCount":{"type":"integer","description":"Number of licenses expiring in the next 30 days.","example":3},"expiredLicenseCount":{"type":"integer","description":"Number of licenses that expired in the last 30 days.","example":2},"activeMachineCount":{"type":"integer","description":"Number of active machines of the licenses of the product.","example":154},"inUseLicenseCount":{"type":"integer","description":"Number of licenses with at least one active machine.","example":80},"seatCount":{"type":"integer","description":"Sum of the maximum numbers of machines of the licenses that haven't expired. Licenses without a maximum are left out.","example":200},"usedSeatCount":{"type":"integer","description":"Number of active machines of the licenses counted in `seatCount`, at most their maximum number of machines each.","example":130},"fullLicenseCount":{"type":"integer","description":"Number of licenses counted in `seatCount` active on their maximum number of machines.","example":12},"days":{"type":"array","items":{"type":"string","format":"date","example":"2026-10-12"},"description":"The 30 days covered by the daily stats, from the oldest one, in UTC."},"months":{"type":"array","items":{"type":"string","pattern":"^\\d{4}-\\d{2}$","example":"2026-10"},"description":"The 12 months covered by the monthly stats, from the oldest one, in UTC."},"newLicensesByDay":{"type":"array","items":{"type":"integer"},"description":"Number of licenses created each day, aligned on `days`.","example":[0,2,1]},"newLicensesByMonth":{"type":"array","items":{"type":"integer"},"description":"Number of licenses created each month, aligned on `months`.","example":[4,9,12]},"newLicensesByPolicy":{"type":"array","items":{"type":"object","properties":{"policyId":{"type":"string","example":"p4Rt8LmQ"},"byDay":{"type":"array","items":{"type":"number"},"description":"Value each day, aligned on `days`.","example":[0,2,1]},"byMonth":{"type":"array","items":{"type":"number"},"description":"Value each month, aligned on `months`.","example":[4,9,12]}},"required":["policyId","byDay","byMonth"]},"description":"Number of licenses of each policy created each day and each month, for the policies with licenses created over the covered months."},"revenue":{"type":"array","items":{"$ref":"#/components/schemas/Revenue"},"description":"Revenue in each currency licenses were sold in, from the one with the most licenses sold. Amounts aren't converted between currencies."},"activationsByVersion":{"type":"array","items":{"type":"object","properties":{"version":{"type":["string","null"],"description":"`null` for the activations that didn't send a version.","example":"1.10.0"},"counts":{"type":"array","items":{"type":"integer"},"description":"Number of successful activations each day, aligned on `days`.","example":[0,3,1]}},"required":["version","counts"]},"description":"Successful activations of the licenses of the product each day, per version of the application, from the most recent one."},"activeMachinesByVersion":{"type":"array","items":{"type":"object","properties":{"version":{"type":["string","null"],"description":"`null` for the machines that didn't send a version.","example":"1.10.0"},"count":{"type":"integer","example":42}},"required":["version","count"]},"description":"Number of active machines running each version of the application, from the most recent one."},"activeMachinesByPlatform":{"type":"array","items":{"type":"object","properties":{"platform":{"type":["string","null"],"description":"`null` for the machines that didn't send a platform.","example":"macOS"},"count":{"type":"integer","example":42}},"required":["platform","count"]},"description":"Number of active machines on each platform, from the one with the most machines."}},"required":["licenseCount","activeLicenseCount","newLicenseCount","expiringLicenseCount","expiredLicenseCount","activeMachineCount","inUseLicenseCount","seatCount","usedSeatCount","fullLicenseCount","days","months","newLicensesByDay","newLicensesByMonth","newLicensesByPolicy","revenue","activationsByVersion","activeMachinesByVersion","activeMachinesByPlatform"]},"Revenue":{"type":"object","properties":{"currency":{"type":"string","description":"ISO 4217 code of the currency of the revenue.","example":"USD"},"licenseCount":{"type":"integer","description":"Number of licenses sold in the currency, free ones included.","example":42},"total":{"type":"number","description":"Sum of the prices of the licenses sold in the currency, in major units.","example":2099.58},"thisMonth":{"type":"number","description":"Revenue of the current month, in UTC.","example":349.93},"lastMonth":{"type":"number","description":"Revenue of the previous month, in UTC.","example":299.94},"last30Days":{"type":"number","description":"Revenue of the last 30 days, today included, in UTC.","example":399.92},"byDay":{"type":"array","items":{"type":"number"},"description":"Revenue each day, aligned on `days`.","example":[0,49.99,99.98]},"byMonth":{"type":"array","items":{"type":"number"},"description":"Revenue each month, aligned on `months`.","example":[199.96,249.95,349.93]},"byPolicy":{"type":"array","items":{"type":"object","properties":{"policyId":{"type":"string","example":"p4Rt8LmQ"},"byDay":{"type":"array","items":{"type":"number"},"description":"Value each day, aligned on `days`.","example":[0,2,1]},"byMonth":{"type":"array","items":{"type":"number"},"description":"Value each month, aligned on `months`.","example":[4,9,12]}},"required":["policyId","byDay","byMonth"]},"description":"Revenue of the licenses of each policy, for the policies with licenses sold in the currency over the covered months."}},"required":["currency","licenseCount","total","thisMonth","lastMonth","last30Days","byDay","byMonth","byPolicy"],"description":"Revenue of the licenses sold in one currency, each license counting on the day it was created. Licenses without a price are left out."},"PolicyList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Policy"},"description":"Items of the page, in the requested order. Empty past the last page."},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"Policy":{"type":"object","properties":{"id":{"type":"string","example":"p4Rt8LmQ"},"productId":{"type":"string","example":"x7Kp2QaZ"},"slug":{"type":"string","example":"yearly"},"name":{"type":"string","example":"Yearly"},"isDefault":{"type":"boolean","description":"Whether this is the product's default policy. Each product has exactly one.","example":false},"duration":{"anyOf":[{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":2147483647,"example":86400},"unit":{"type":"string","enum":["seconds"]}},"required":["value","unit"]},{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":12000,"example":12},"unit":{"type":"string","enum":["months"],"description":"Calendar months: a license created on January 31 with a 1 month duration expires on the last day of February."}},"required":["value","unit"]},{"type":"null"}],"description":"Duration of the licenses created with this policy. `null` when they never expire."},"maxMachines":{"type":["integer","null"],"description":"Maximum number of active machines of the licenses created with this policy. `null` when there's no limit.","example":3},"maxOfflineDurationSeconds":{"type":"integer","description":"Longest the applications can run offline with the licenses created with this policy, in seconds.","example":604800},"maxVersion":{"anyOf":[{"$ref":"#/components/schemas/FixedMaxVersion"},{"$ref":"#/components/schemas/LockMaxVersion"},{"type":"null"}],"description":"Latest version of the product the licenses created with this policy can use. `null` when they can use every version.\n\n- `fixed`: up to a hard-coded `version`. `\"2\"` allows every 2.y.z version: its minor versions and bug fixes. `\"2.3\"` allows every 2.3.z version: its bug fixes.\n- `lock`: every version released during some time after the license is created, then only the updates of the version reached by then. The major version locks `majorAfter` the creation of the license, then the license only gets the minor versions and bug fixes of its major version. The minor version optionally locks `minorAfter` it, never sooner than the major version, then the license only gets the bug fixes of its minor version. `{ \"type\": \"lock\", \"majorAfter\": { \"value\": 1, \"unit\": \"months\" }, \"minorAfter\": { \"value\": 12, \"unit\": \"months\" } }` allows every version released during the month after the license is created, then the minor versions and bug fixes of the major version reached by then until the end of the first year, then only the bug fixes of the minor version reached by then. `majorAfter` at 0 allows minor versions only, and both at 0 allows bug fixes only: no updates.\n\nBug fixes are never locked: a hard-coded version has no patch number, like `\"2.3.1\"`, and a lock only locks major and minor versions."},"licenseCount":{"type":"integer","description":"Number of licenses following this policy.","example":12},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"}},"required":["id","productId","slug","name","isDefault","duration","maxMachines","maxOfflineDurationSeconds","maxVersion","licenseCount","createdAt","updatedAt"]},"CreatePolicy":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"example":"Yearly"},"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(test_)?[a-z0-9]+(-[a-z0-9]+)*$","description":"Unique within the product. Defaults to the name, lower cased, without accents and special characters. Starts with `test_` in test products, which is added when missing, and removed in live products.","example":"yearly"},"isDefault":{"type":"boolean","description":"`true` makes this policy the product's default, in place of the current one.","example":false},"duration":{"anyOf":[{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":2147483647,"example":86400},"unit":{"type":"string","enum":["seconds"]}},"required":["value","unit"]},{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":12000,"example":12},"unit":{"type":"string","enum":["months"],"description":"Calendar months: a license created on January 31 with a 1 month duration expires on the last day of February."}},"required":["value","unit"]},{"type":"null"}],"description":"Duration of the licenses created with this policy. `null` makes them never expire. Defaults to `null`."},"maxMachines":{"type":["integer","null"],"exclusiveMinimum":0,"maximum":2147483647,"description":"Maximum number of active machines of the licenses created with this policy, copied to each of them. `null` for no limit. Defaults to `null`.","example":3},"maxOfflineDurationSeconds":{"type":"integer","minimum":3600,"maximum":2147483647,"description":"Longest the applications can run offline with the licenses created with this policy, in seconds, copied to each of them. At least one hour (`3600`). Defaults to one week.","example":604800},"maxVersion":{"anyOf":[{"$ref":"#/components/schemas/FixedMaxVersion"},{"$ref":"#/components/schemas/LockMaxVersion"},{"type":"null"}],"description":"Latest version of the product the licenses created with this policy can use. `null` allows every version. Defaults to `null`.\n\n- `fixed`: up to a hard-coded `version`. `\"2\"` allows every 2.y.z version: its minor versions and bug fixes. `\"2.3\"` allows every 2.3.z version: its bug fixes.\n- `lock`: every version released during some time after the license is created, then only the updates of the version reached by then. The major version locks `majorAfter` the creation of the license, then the license only gets the minor versions and bug fixes of its major version. The minor version optionally locks `minorAfter` it, never sooner than the major version, then the license only gets the bug fixes of its minor version. `{ \"type\": \"lock\", \"majorAfter\": { \"value\": 1, \"unit\": \"months\" }, \"minorAfter\": { \"value\": 12, \"unit\": \"months\" } }` allows every version released during the month after the license is created, then the minor versions and bug fixes of the major version reached by then until the end of the first year, then only the bug fixes of the minor version reached by then. `majorAfter` at 0 allows minor versions only, and both at 0 allows bug fixes only: no updates.\n\nBug fixes are never locked: a hard-coded version has no patch number, like `\"2.3.1\"`, and a lock only locks major and minor versions."}},"required":["name"]},"UpdatePolicy":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"example":"Yearly"},"slug":{"type":"string","minLength":1,"maxLength":100,"pattern":"^(test_)?[a-z0-9]+(-[a-z0-9]+)*$","description":"Unique within the product. Defaults to the name, lower cased, without accents and special characters. Starts with `test_` in test products, which is added when missing, and removed in live products.","example":"yearly"},"isDefault":{"type":"boolean","description":"`true` makes this policy the product's default, in place of the current one.","example":false},"duration":{"anyOf":[{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":2147483647,"example":86400},"unit":{"type":"string","enum":["seconds"]}},"required":["value","unit"]},{"type":"object","properties":{"value":{"type":"integer","minimum":1,"maximum":12000,"example":12},"unit":{"type":"string","enum":["months"],"description":"Calendar months: a license created on January 31 with a 1 month duration expires on the last day of February."}},"required":["value","unit"]},{"type":"null"}],"description":"Duration of the licenses created with this policy. `null` makes them never expire. Defaults to `null`."},"maxMachines":{"type":["integer","null"],"exclusiveMinimum":0,"maximum":2147483647,"description":"Maximum number of active machines of the licenses created with this policy, copied to each of them. `null` for no limit. Defaults to `null`.","example":3},"maxOfflineDurationSeconds":{"type":"integer","minimum":3600,"maximum":2147483647,"description":"Longest the applications can run offline with the licenses created with this policy, in seconds, copied to each of them. At least one hour (`3600`). Defaults to one week.","example":604800},"maxVersion":{"anyOf":[{"$ref":"#/components/schemas/FixedMaxVersion"},{"$ref":"#/components/schemas/LockMaxVersion"},{"type":"null"}],"description":"Latest version of the product the licenses created with this policy can use. `null` allows every version. Defaults to `null`.\n\n- `fixed`: up to a hard-coded `version`. `\"2\"` allows every 2.y.z version: its minor versions and bug fixes. `\"2.3\"` allows every 2.3.z version: its bug fixes.\n- `lock`: every version released during some time after the license is created, then only the updates of the version reached by then. The major version locks `majorAfter` the creation of the license, then the license only gets the minor versions and bug fixes of its major version. The minor version optionally locks `minorAfter` it, never sooner than the major version, then the license only gets the bug fixes of its minor version. `{ \"type\": \"lock\", \"majorAfter\": { \"value\": 1, \"unit\": \"months\" }, \"minorAfter\": { \"value\": 12, \"unit\": \"months\" } }` allows every version released during the month after the license is created, then the minor versions and bug fixes of the major version reached by then until the end of the first year, then only the bug fixes of the minor version reached by then. `majorAfter` at 0 allows minor versions only, and both at 0 allows bug fixes only: no updates.\n\nBug fixes are never locked: a hard-coded version has no patch number, like `\"2.3.1\"`, and a lock only locks major and minor versions."}}},"CustomerList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Customer"},"description":"Items of the page, in the requested order. Empty past the last page."},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"Customer":{"type":"object","properties":{"id":{"type":"string","example":"c9Wd3RtE"},"productId":{"type":"string","example":"x7Kp2QaZ"},"email":{"type":"string","format":"email","example":"jane@example.com"},"name":{"type":["string","null"],"description":"Display name of the customer. `null` when unknown.","example":"Jane Doe"},"licenseCount":{"type":"integer","description":"Number of licenses of this customer.","example":3},"stripeCustomerId":{"type":["string","null"],"description":"Id of the Stripe customer, when the customer bought licenses through the Stripe integration as a Stripe customer. `null` otherwise, e.g. for a guest checkout.","example":"cus_NffrFeUfNV2Hib"},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"}},"required":["id","productId","email","name","licenseCount","stripeCustomerId","createdAt"]},"CreateCustomer":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","description":"Unique within the product, regardless of case. Stored lower cased.","example":"jane@example.com"},"name":{"type":["string","null"],"minLength":1,"maxLength":200,"description":"Display name of the customer. `null` when unknown. Defaults to `null`.","example":"Jane Doe"}},"required":["email"]},"UpdateCustomer":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","description":"Unique within the product, regardless of case. Stored lower cased.","example":"jane@example.com"},"name":{"type":["string","null"],"minLength":1,"maxLength":200,"description":"Display name of the customer. `null` when unknown. Defaults to `null`.","example":"Jane Doe"}}},"LicenseList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/License"},"description":"Items of the page, in the requested order. Empty past the last page."},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"License":{"type":"object","properties":{"id":{"type":"string","example":"l3Nv8KwB"},"productId":{"type":"string","example":"x7Kp2QaZ"},"policyId":{"type":"string","example":"p4Rt8LmQ"},"customerId":{"type":"string","example":"c9Wd3RtE"},"key":{"type":"string","description":"Unique within the product. Case sensitive: `validateKey` compares keys exactly.","example":"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF"},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"},"expiresAt":{"type":["string","null"],"format":"date-time","description":"`null` when the license never expires.","example":"2027-01-15T09:30:00.000Z"},"meta":{"type":["object","null"],"additionalProperties":{},"description":"Free-form JSON object.","example":{"seats":5}},"stripePaymentIntentId":{"type":["string","null"],"description":"Id of the Stripe payment intent that paid the license, when it was bought through the Stripe integration. `null` otherwise, or when nothing was paid.","example":"pi_3MtwBwLkdIwHu7ix28a3tqPa"},"maxMachines":{"type":["integer","null"],"description":"Maximum number of active machines the license can be used on. `null` when there's no limit. Can be lower than `activeMachineCount` after it was lowered: machines aren't deactivated to match it.","example":3},"maxOfflineDurationSeconds":{"type":"integer","description":"Longest the applications can run offline with the license: the license tokens returned by `validateKey` expire this long after they're issued, unless the license expires sooner.","example":604800},"activeMachineCount":{"type":"integer","description":"Number of active machines the license is used on.","example":2},"lastActivatedAt":{"type":["string","null"],"format":"date-time","description":"Last time a machine validated the license key. `null` when it was never validated.","example":"2026-03-02T14:05:00.000Z"},"maxVersion":{"$ref":"#/components/schemas/LicenseMaxVersion"},"price":{"$ref":"#/components/schemas/Price"},"status":{"$ref":"#/components/schemas/LicenseStatus"},"updatedAt":{"type":"string","format":"date-time","description":"Last time the license's settings were edited, not when its key was validated.","example":"2026-01-15T09:30:00.000Z"}},"required":["id","productId","policyId","customerId","key","createdAt","expiresAt","meta","stripePaymentIntentId","maxMachines","maxOfflineDurationSeconds","activeMachineCount","lastActivatedAt","maxVersion","price","status","updatedAt"]},"LicenseMaxVersion":{"type":"object","properties":{"version":{"type":["string","null"],"pattern":"^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*))?$","description":"Hard-coded latest version, taking precedence over `lockMajorAt` and `lockMinorAt`. `\"2\"` allows every 2.y.z version: its minor versions and bug fixes. `\"2.3\"` allows every 2.3.z version: its bug fixes. `null` when it's not hard-coded.","example":"2.3"},"lockMajorAt":{"type":["string","null"],"format":"date-time","description":"When the major version of the license locks: it then only gets the minor versions and bug fixes of the major version released by then. Once reached, within the hour, the major version of the latest stable release by then is hard-coded in `version`, unless a version already is, and the lock is cleared. A lock reached before any stable release is cleared without hard-coding anything. `null` when it's never locked.","example":"2026-02-15T09:30:00.000Z"},"lockMinorAt":{"type":["string","null"],"format":"date-time","description":"When the minor version of the license locks: it then only gets the bug fixes of the minor version released by then, within the hard-coded major version when there's one. Never before `lockMajorAt`; without it, the major version locks along with the minor version. Once reached, within the hour, the major and minor version of the latest stable release by then is hard-coded in `version`, unless a minor version already is, and the lock is cleared. A lock reached before any matching stable release is cleared without hard-coding anything. `null` when it's never locked.","example":"2027-01-15T09:30:00.000Z"}},"required":["version","lockMajorAt","lockMinorAt"],"description":"Latest version of the product the license can use: its hard-coded `version`, else the versions released before its locks. All `null` when it can use every version."},"Price":{"type":["object","null"],"properties":{"amount":{"type":"number","description":"Amount in major units of the currency: `49.99` for $49.99, `5000` for ¥5,000. `0` for a free license.","example":49.99},"currency":{"type":"string","description":"ISO 4217 code of the currency, in upper case.","example":"USD"}},"required":["amount","currency"],"description":"Price paid for a license. Licenses have `null` instead when it's unknown, which leaves them out of the revenue stats."},"LicenseStatus":{"type":"string","enum":["active","inactive","expired"],"description":"`expired` when the license has expired, `active` when a machine validated its key in the last 90 days, `inactive` otherwise.","example":"active"},"CreateLicense":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","description":"Email of the customer the license belongs to. The product's customer with this email, compared regardless of case, or a new one when there's none.","example":"jane@example.com"},"key":{"type":"string","minLength":1,"maxLength":255,"description":"Unique within the product. Case sensitive: `validateKey` compares keys exactly. Defaults to a random key of 5 groups of 5 characters separated by dashes, each character an upper case letter or a digit other than `O`, `0`, `I` and `1`, for 125 random bits. Starts with `TEST-` in test products, which is added when missing, and removed in live products.","example":"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF"},"policyId":{"type":"string","description":"Policy of the product the license follows. Defaults to the product's default policy.","example":"p4Rt8LmQ"},"expiresAt":{"type":["string","null"],"format":"date-time","description":"`null` makes the license never expire. Defaults to the creation date plus the duration of the policy, or `null` when the policy has none.","example":"2027-01-15T09:30:00.000Z"},"meta":{"type":["object","null"],"additionalProperties":{},"description":"Free-form JSON object.","example":{"seats":5}},"maxMachines":{"type":["integer","null"],"exclusiveMinimum":0,"maximum":2147483647,"description":"Maximum number of active machines the license can be used on. `null` for no limit. Defaults to the one of the policy.","example":3},"maxOfflineDurationSeconds":{"type":"integer","minimum":3600,"maximum":2147483647,"description":"Longest the applications can run offline with the license, in seconds. At least one hour (`3600`). Defaults to the one of the policy.","example":604800},"price":{"$ref":"#/components/schemas/PriceInput"},"maxVersion":{"$ref":"#/components/schemas/LicenseMaxVersionInput"},"sendKey":{"type":"boolean","description":"`true` emails the key to the customer once the license is created, like `sendLicenseKeys`. Sent in the background: a failed email doesn't fail the creation. In test products, it's only sent when the customer's email is a member's of the organization. Defaults to `false`.","example":true}},"required":["email"]},"PriceInput":{"type":["object","null"],"properties":{"amount":{"type":"number","minimum":0,"maximum":1000000000000,"description":"Amount in major units of the currency: `49.99` for $49.99, `5000` for ¥5,000. `0` for a free license. At most as many decimals as the currency's minor unit: 2 for USD, 0 for JPY.","example":49.99},"currency":{"type":"string","description":"ISO 4217 code of the currency, in upper case.","example":"USD"}},"required":["amount","currency"],"description":"Price paid for a license. Send `null` instead when it's unknown, which leaves the license out of the revenue stats. Left out on creation, it's `null`."},"LicenseMaxVersionInput":{"type":"object","properties":{"version":{"type":["string","null"],"pattern":"^(0|[1-9]\\d*)(\\.(0|[1-9]\\d*))?$","description":"Hard-coded latest version, taking precedence over `lockMajorAt` and `lockMinorAt`. `\"2\"` allows every 2.y.z version: its minor versions and bug fixes. `\"2.3\"` allows every 2.3.z version: its bug fixes. `null` to not hard-code it.","example":"2.3"},"lockMajorAt":{"type":["string","null"],"format":"date-time","description":"When the major version of the license locks: it then only gets the minor versions and bug fixes of the major version released by then. Once reached, within the hour, the major version of the latest stable release by then is hard-coded in `version`, unless a version already is, and the lock is cleared. A lock reached before any stable release is cleared without hard-coding anything. `null` to never lock it.","example":"2026-02-15T09:30:00.000Z"},"lockMinorAt":{"type":["string","null"],"format":"date-time","description":"When the minor version of the license locks: it then only gets the bug fixes of the minor version released by then, within the hard-coded major version when there's one. Never before `lockMajorAt`; without it, the major version locks along with the minor version. Once reached, within the hour, the major and minor version of the latest stable release by then is hard-coded in `version`, unless a minor version already is, and the lock is cleared. A lock reached before any matching stable release is cleared without hard-coding anything. `null` to never lock it.","example":"2027-01-15T09:30:00.000Z"}},"description":"Latest version of the product the license can use. Each value left out defaults to the policy's max version: `version` to its hard-coded version, else `null`, and `lockMajorAt` and `lockMinorAt` to the creation date plus its `majorAfter` and `minorAfter` when it locks, else `null`."},"LicenseStats":{"type":"object","properties":{"from":{"type":"string","format":"date","example":"2026-10-12","description":"First day covered, in UTC."},"to":{"type":"string","format":"date","example":"2026-10-12","description":"Last day covered, in UTC: today."},"days":{"type":"array","items":{"type":"string","format":"date","example":"2026-10-12"},"description":"The 90 days covered, from the oldest one, in UTC."},"activationsByMachine":{"type":"array","items":{"type":"object","properties":{"machineId":{"type":"string","example":"m5Tq9HsJ"},"name":{"type":["string","null"],"example":"Jane's MacBook"},"fingerprint":{"type":"string","example":"4c:32:75:8f:9a:1e"},"counts":{"type":"array","items":{"type":"integer"},"description":"Number of successful activations each day, aligned on `days`.","example":[0,3,1]}},"required":["machineId","name","fingerprint","counts"]},"description":"Machines that activated the license in the period, from the one with the most activations."},"activationsByVersion":{"type":"array","items":{"type":"object","properties":{"version":{"type":"string"},"counts":{"type":"array","items":{"type":"integer"},"description":"Number of successful activations each day, aligned on `days`.","example":[0,3,1]}},"required":["version","counts"]},"description":"Versions of the application that activated the license in the period, from the most recent one."}},"required":["from","to","days","activationsByMachine","activationsByVersion"]},"UpdateLicense":{"type":"object","properties":{"expiresAt":{"type":["string","null"],"format":"date-time","description":"`null` makes the license never expire.","example":"2027-01-15T09:30:00.000Z"},"meta":{"type":["object","null"],"additionalProperties":{},"description":"Free-form JSON object.","example":{"seats":5}},"maxMachines":{"type":["integer","null"],"exclusiveMinimum":0,"maximum":2147483647,"description":"Maximum number of active machines the license can be used on. `null` for no limit.","example":3},"maxOfflineDurationSeconds":{"type":"integer","minimum":3600,"maximum":2147483647,"description":"Longest the applications can run offline with the license, in seconds. At least one hour (`3600`).","example":604800},"maxVersion":{"allOf":[{"$ref":"#/components/schemas/LicenseMaxVersionInput"},{"description":"Latest version of the product the license can use. The values left out are kept."}]},"price":{"$ref":"#/components/schemas/PriceInput"}}},"SendLicenseKeys":{"type":"object","properties":{"ids":{"type":"array","items":{"type":"string"},"minItems":1,"maxItems":100,"description":"Ids of the licenses whose keys to email, up to 100.","example":["l3Nv8KwB"]}},"required":["ids"]},"MachineList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Machine"},"description":"Items of the page, in the requested order. Empty past the last page."},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"Machine":{"type":"object","properties":{"id":{"type":"string","example":"m9Tq3VhD"},"licenseId":{"type":"string","example":"l3Nv8KwB"},"fingerprint":{"type":"string","description":"Identifies the machine. Unique within the license.","example":"4c:32:75:8f:9a:1e"},"platform":{"type":["string","null"],"example":"macOS"},"name":{"type":["string","null"],"example":"Jane's MacBook"},"status":{"type":"string","enum":["active","deactivated"],"description":"Whether the machine counts as using the license.","example":"active"},"version":{"type":["string","null"],"description":"Version of the application last validated on the machine.","example":"1.4.2"},"lastValidatedAt":{"type":["string","null"],"format":"date-time","description":"When the license was last validated on the machine.","example":"2026-01-15T09:30:00.000Z"},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"},"updatedAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"}},"required":["id","licenseId","fingerprint","platform","name","status","version","lastValidatedAt","createdAt","updatedAt"]},"PortalLink":{"type":"object","properties":{"url":{"type":"string","format":"uri","description":"Link to the customer portal, holding the token.","example":"https://app.licensemanager.dev/portal/x7Kp2QaZ?token=eyJhbGciOi…"},"token":{"type":"string","description":"Customer token in the link, with the `customer:read`, `license:read` and `machine:write` permissions.","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…"},"expiresAt":{"type":"string","format":"date-time","description":"When the link stops working.","example":"2026-01-22T09:30:00.000Z"}},"required":["url","token","expiresAt"]},"CreatePortalLink":{"type":"object","properties":{"expiresInSeconds":{"type":"integer","minimum":300,"maximum":31536000,"description":"How long the link works, in seconds, from 300 (5 minutes) to 31536000 (365 days).","example":604800}},"required":["expiresInSeconds"]},"SendPortalLink":{"type":"object","properties":{"token":{"type":"string","minLength":1,"description":"Token of a link created for the customer.","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…"}},"required":["token"]},"ReleaseList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Release"},"description":"Items of the page, in the requested order. Empty past the last page."},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"Release":{"type":"object","properties":{"id":{"type":"string","example":"r4Lm8VwX"},"productId":{"type":"string","example":"x7Kp2QaZ"},"version":{"type":"string","example":"2.3.1"},"releasedAt":{"type":"string","format":"date-time","example":"2026-03-01T12:00:00.000Z"},"createdAt":{"type":"string","format":"date-time","example":"2026-03-01T12:00:00.000Z"},"activeMachineCount":{"type":"integer","description":"Number of active machines of the product's licenses running this version: the ones whose `version` is exactly the release's, so `v2.3.1` doesn't count for `2.3.1`.","example":12}},"required":["id","productId","version","releasedAt","createdAt","activeMachineCount"]},"CreateRelease":{"type":"object","properties":{"version":{"type":"string","maxLength":100,"pattern":"^(0|[1-9]\\d{0,8})\\.(0|[1-9]\\d{0,8})\\.(0|[1-9]\\d{0,8})(-[0-9A-Za-z.-]+)?(\\+[0-9A-Za-z.-]+)?$","description":"Semantic version, like `\"2.3.1\"` or `\"2.4.0-beta.1\"`, without a `v` prefix. Unique within the product. Each number has at most 9 digits.","example":"2.3.1"},"releasedAt":{"type":"string","format":"date-time","description":"When the version is released, which can be in the future. Defaults to now.","example":"2026-03-01T12:00:00.000Z"}},"required":["version"]},"UpdateRelease":{"type":"object","properties":{"version":{"type":"string","maxLength":100,"pattern":"^(0|[1-9]\\d{0,8})\\.(0|[1-9]\\d{0,8})\\.(0|[1-9]\\d{0,8})(-[0-9A-Za-z.-]+)?(\\+[0-9A-Za-z.-]+)?$","description":"Semantic version, like `\"2.3.1\"` or `\"2.4.0-beta.1\"`, without a `v` prefix. Unique within the product. Each number has at most 9 digits.","example":"2.3.1"},"releasedAt":{"type":"string","format":"date-time","description":"When the version is released, which can be in the future. Defaults to now.","example":"2026-03-01T12:00:00.000Z"}}},"SigningKey":{"type":"object","properties":{"id":{"type":"string","description":"Id of the key, in the `kid` header of the tokens it signs.","example":"k8R2vNqW"},"algorithm":{"type":"string","enum":["EdDSA"],"description":"JWT algorithm of the tokens it signs, with an Ed25519 key."},"publicKey":{"type":"string","description":"PEM encoded SPKI public key.","example":"-----BEGIN PUBLIC KEY-----\nMCowBQYDK2VwAyEA…\n-----END PUBLIC KEY-----\n"},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"}},"required":["id","algorithm","publicKey","createdAt"]},"Token":{"type":"object","properties":{"token":{"type":"string","description":"Token to send as `Authorization: Bearer <token>`.","example":"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…"},"type":{"type":"string","enum":["customer","license","machine"],"description":"Type of resource the token is scoped to.","example":"license"},"scope":{"type":"array","items":{"type":"string","enum":["customer:read","customer:write","license:read","license:write","machine:read","machine:write"]},"example":["license:read","machine:write"]},"expiresAt":{"type":"string","format":"date-time","description":"When the token stops working.","example":"2026-01-15T10:30:00.000Z"}},"required":["token","type","scope","expiresAt"]},"CreateToken":{"type":"object","properties":{"scope":{"type":"array","items":{"type":"string","enum":["customer:read","customer:write","license:read","license:write","machine:read","machine:write"]},"minItems":1,"description":"Permissions of the token. A write permission implies the matching read one. A token creating a token can only give the permissions it has.","example":["license:read","machine:write"]},"expiresInSeconds":{"type":"integer","minimum":60,"maximum":31536000,"default":900,"description":"How long the token works, in seconds, from 60 (1 minute) to 31536000 (365 days). Defaults to 900 (15 minutes). A token creating a token can't give it a later expiration than its own: it's shortened to it.","example":3600}},"required":["scope"]},"EventList":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/Event"},"description":"Items of the page, in the requested order. Empty past the last page."},"pagination":{"$ref":"#/components/schemas/Pagination"}},"required":["data","pagination"]},"Event":{"type":"object","properties":{"id":{"type":"string","example":"e6Pw2JcXa"},"type":{"$ref":"#/components/schemas/EventType"},"createdAt":{"type":"string","format":"date-time","example":"2026-01-15T09:30:00.000Z"},"payload":{"type":"object","additionalProperties":{},"description":"Details of the event, depending on its `type`.","example":{"fingerprint":"4c:32:75:8f:9a:1e","version":"1.4.2"}},"policyId":{"type":["string","null"],"example":null},"licenseId":{"type":["string","null"],"example":"l3Nv8KwB"},"machineId":{"type":["string","null"],"example":"m9Tq3VhD"},"machine":{"$ref":"#/components/schemas/EventMachine"},"actor":{"$ref":"#/components/schemas/EventActor"}},"required":["id","type","createdAt","payload","policyId","licenseId","machineId","machine","actor"]},"EventType":{"type":"string","enum":["policy.created","policy.updated","license.created","license.updated","license.validated","license.validation_failed","machine.deactivated"],"description":"- `policy.created`: `payload` holds the policy's settings.\n- `policy.updated`: `payload.changes` maps each changed field to its previous (`from`) and new (`to`) value. Making a policy the default also updates the previous default one.\n- `license.created`: `payload` holds the license's key, `policyId`, `customerId` and settings. Not linked to the policy.\n- `license.updated`: `payload.changes`, like `policy.updated`.\n- `license.validated`: a machine validated the license key. `payload` holds the machine's `fingerprint`, `name` and `version`, and whether the validation created the machine (`machineCreated`) or activated it again (`machineActivated`).\n- `license.validation_failed`: validating the license key failed. `payload` holds the error `code` and `message`, and the `fingerprint`, `name`, `platform` and `version` sent, the name and platform being the machine's when none is sent. Linked to the machine when it exists.\n- `machine.deactivated`: a machine was deactivated, so it no longer counts as using the license. `payload` holds the machine's `fingerprint` and `name`. Linked to the license and the machine.\n\nAn update that changes nothing records no event. Deletions record no events, and customers, products and releases have none.","example":"license.validated"},"EventMachine":{"type":["object","null"],"properties":{"id":{"type":"string","example":"m9Tq3VhD"},"name":{"type":["string","null"],"example":"Jane's MacBook"},"fingerprint":{"type":"string","example":"4c:32:75:8f:9a:1e"}},"required":["id","name","fingerprint"],"description":"The machine the event is about, with its current name. `null` when the event has no machine or it has been deleted."},"EventActor":{"oneOf":[{"type":"object","properties":{"type":{"type":"string","enum":["user"]},"id":{"type":["string","null"],"description":"`null` when the user has been deleted.","example":"u2Hk9PzLq"},"name":{"type":["string","null"],"example":"Jane Doe"},"email":{"type":["string","null"],"example":"jane@licensemanager.dev"},"image":{"type":["string","null"],"description":"URL of the user's profile picture.","example":"https://example.com/jane.png"}},"required":["type","id","name","email","image"]},{"type":"object","properties":{"type":{"type":"string","enum":["apiKey"]},"id":{"type":["string","null"],"description":"`null` when the API key has been deleted.","example":"k5Rt7WmNb"},"name":{"type":["string","null"],"example":"Billing backend"},"start":{"type":["string","null"],"description":"First characters of the key, to recognize it.","example":"lm_Ab3d"}},"required":["type","id","name","start"]},{"type":"object","properties":{"type":{"type":"string","enum":["token"]},"tokenType":{"type":"string","enum":["customer","license","machine"],"description":"Type of resource the token is scoped to."},"subjectId":{"type":"string","description":"Id of the resource the token is scoped to.","example":"m9Tq3VhD"}},"required":["type","tokenType","subjectId"]},{"type":"object","properties":{"type":{"type":"string","enum":["automation"]}},"required":["type"]},{"type":"object","properties":{"type":{"type":"string","enum":["integration"]},"id":{"type":["string","null"],"description":"`null` when the integration has been disconnected.","example":"i8Fz4QnRt"},"provider":{"type":"string","enum":["stripe"],"description":"Service the integration connects to."}},"required":["type","id","provider"]},{"type":"null"}],"description":"Who caused the event: a user of the app, an API key, a token, `automation` for the changes the app makes on its own, like applying the version locks, or `integration` for the changes of an integration, like the licenses a Stripe payment creates. `null` for requests that don't authenticate, like validating a license key."},"StripeIntegration":{"type":"object","properties":{"livemode":{"type":"boolean","description":"Mode of the Stripe connection the product uses: live for live products, test for test products."},"webhookUrlReachable":{"type":"boolean","description":"Whether Stripe can reach the API's webhook URL. A local URL can't be: set `WEBHOOK_URL` on the server, like to a tunnel in development."},"requiredPermissions":{"type":"array","items":{"$ref":"#/components/schemas/StripePermission"},"description":"Permissions the restricted API key needs, and why. Every other permission can stay `None`."},"integration":{"anyOf":[{"$ref":"#/components/schemas/Integration"},{"type":"null"}],"description":"The organization's Stripe connection in this mode, `null` when there's none."},"mappings":{"type":"array","items":{"$ref":"#/components/schemas/IntegrationMapping"},"description":"Stripe prices creating licenses of the product."}},"required":["livemode","webhookUrlReachable","requiredPermissions","integration","mappings"]},"StripePermission":{"type":"object","properties":{"resource":{"type":"string","example":"Prices"},"access":{"type":"string","enum":["Read","Write"]},"reason":{"type":"string","example":"Lists your prices so you can choose which ones create licenses, and checks they can still be paid."}},"required":["resource","access","reason"]},"Integration":{"type":"object","properties":{"id":{"type":"string","example":"i8Fz4QnRt"},"provider":{"type":"string","enum":["stripe"]},"livemode":{"type":"boolean","description":"Whether it's connected in live mode, for the live products, or in test mode, for the test products."},"accountName":{"type":["string","null"],"description":"Name of the Stripe account, `null` when the API key can't read it.","example":"Acme Inc."},"apiKeyHint":{"type":"string","description":"Start and end of the API key, to recognize it.","example":"rk_live_…Ab3d"},"webhookUrl":{"type":"string","description":"URL of the webhook endpoint created on the Stripe account.","example":"https://api.licensemanager.dev/v1/webhooks/stripe/i8Fz4QnRt"},"status":{"$ref":"#/components/schemas/IntegrationStatus"},"statusReason":{"type":["string","null"],"description":"Why the integration isn't `active`, `null` when it is.","example":"The API key can't manage webhook endpoints: give it the Webhook Endpoints: Write permission"},"lastCheckedAt":{"type":["string","null"],"format":"date-time","description":"Last time its health was checked, done every day."},"lastEventAt":{"type":["string","null"],"format":"date-time","description":"Last time it received an event from the provider."},"createdAt":{"type":"string","format":"date-time"}},"required":["id","provider","livemode","accountName","apiKeyHint","webhookUrl","status","statusReason","lastCheckedAt","lastEventAt","createdAt"]},"IntegrationStatus":{"type":"string","enum":["active","error","disconnected"],"description":"`active`: the integration works. `error`: something needs fixing, explained by `statusReason`, like a permission missing from the API key or a mapped price archived. `disconnected`: the API key no longer works, connect a new one."},"IntegrationMapping":{"type":"object","properties":{"id":{"type":"string","example":"g2Lk7RwPa"},"integrationId":{"type":"string","example":"i8Fz4QnRt"},"productId":{"type":"string","example":"x7Kp2QaZ"},"policyId":{"type":"string","example":"p4Rt8LmQ"},"stripeProductId":{"type":"string","example":"prod_NWjs8kKbJWmuuc"},"stripePriceId":{"type":"string","example":"price_1MoBy5LkdIwHu7ix"},"productName":{"type":"string","description":"Name of the Stripe product when it was mapped.","example":"Acme Pro"},"price":{"$ref":"#/components/schemas/Price"},"status":{"type":"string","enum":["active","error"],"description":"`error` when the price can no longer be paid, explained by `statusReason`."},"statusReason":{"type":["string","null"],"example":"The price is archived in Stripe"},"createdAt":{"type":"string","format":"date-time"}},"required":["id","integrationId","productId","policyId","stripeProductId","stripePriceId","productName","price","status","statusReason","createdAt"]},"ConnectStripe":{"type":"object","properties":{"apiKey":{"type":"string","minLength":1,"description":"Restricted API key of the Stripe account (`rk_live_…` for live products, `rk_test_…` for test products), with the `requiredPermissions` of `getStripeIntegration`. A secret key works too, but gives the app more access than it needs.","example":"rk_live_51Nv0FG…"}},"required":["apiKey"]},"StripePrice":{"type":"object","properties":{"id":{"type":"string","example":"price_1MoBy5LkdIwHu7ix"},"productId":{"type":"string","example":"prod_NWjs8kKbJWmuuc"},"productName":{"type":"string","example":"Acme Pro"},"nickname":{"type":["string","null"],"example":"Launch price"},"price":{"$ref":"#/components/schemas/Price"},"mapped":{"type":"boolean","description":"Whether the price already creates licenses of a product."}},"required":["id","productId","productName","nickname","price","mapped"]},"CreateIntegrationMapping":{"type":"object","properties":{"stripePriceId":{"type":"string","minLength":1,"description":"Active one-time price of the Stripe account.","example":"price_1MoBy5LkdIwHu7ix"},"policyId":{"type":"string","minLength":1,"example":"p4Rt8LmQ"}},"required":["stripePriceId","policyId"]},"UpdateIntegrationMapping":{"type":"object","properties":{"policyId":{"type":"string","minLength":1,"example":"p4Rt8LmQ"}},"required":["policyId"]},"Billing":{"type":"object","properties":{"billingEnabled":{"type":"boolean"},"canManage":{"type":"boolean","description":"Whether the user can change the plan: owners and admins."},"plan":{"$ref":"#/components/schemas/PlanId"},"interval":{"$ref":"#/components/schemas/BillingInterval"},"limits":{"$ref":"#/components/schemas/PlanLimits"},"usage":{"$ref":"#/components/schemas/Usage"},"subscription":{"type":["object","null"],"properties":{"status":{"type":"string"},"periodEnd":{"type":["string","null"],"format":"date-time"},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["status","periodEnd","cancelAtPeriodEnd"]},"scheduledChange":{"type":["object","null"],"properties":{"type":{"type":"string","enum":["plan","cancel"]},"plan":{"$ref":"#/components/schemas/PlanId"},"interval":{"$ref":"#/components/schemas/BillingInterval"},"at":{"type":["string","null"],"format":"date-time"}},"required":["type","plan","interval","at"]},"breaches":{"type":"array","items":{"type":"object","properties":{"metric":{"$ref":"#/components/schemas/UsageMetric"},"startedAt":{"type":"string","format":"date-time"},"graceEndsAt":{"type":["string","null"],"format":"date-time"}},"required":["metric","startedAt","graceEndsAt"]}},"blockedAt":{"type":["string","null"],"format":"date-time"},"graceDays":{"type":"integer"},"apiRequestsDays":{"type":"integer"},"plans":{"type":"array","items":{"type":"object","properties":{"id":{"$ref":"#/components/schemas/PlanId"},"name":{"type":"string"},"price":{"type":["object","null"],"properties":{"month":{"type":"number"},"year":{"type":"number"}},"required":["month","year"]},"limits":{"$ref":"#/components/schemas/PlanLimits"}},"required":["id","name","price","limits"]}}},"required":["billingEnabled","canManage","plan","interval","limits","usage","subscription","scheduledChange","breaches","blockedAt","graceDays","apiRequestsDays","plans"]},"PlanId":{"type":"string","enum":["free","startup","standard","custom"]},"BillingInterval":{"type":["string","null"],"enum":["month","year",null]},"PlanLimits":{"type":"object","properties":{"products":{"type":["integer","null"]},"activeLicenses":{"type":["integer","null"]},"apiRequests":{"type":["integer","null"]},"seats":{"type":["integer","null"]},"apiKeys":{"type":["integer","null"]}},"required":["products","activeLicenses","apiRequests","seats","apiKeys"],"description":"Limits of a plan, null when unlimited."},"Usage":{"type":"object","properties":{"products":{"type":"integer"},"activeLicenses":{"type":"integer"},"apiRequests":{"type":"integer"},"seats":{"type":"integer"},"apiKeys":{"type":"integer"}},"required":["products","activeLicenses","apiRequests","seats","apiKeys"]},"UsageMetric":{"type":"string","enum":["products","activeLicenses","apiRequests","seats","apiKeys"]},"ApiRequestsSeries":{"type":"object","properties":{"days":{"type":"array","items":{"type":"string","example":"2026-10-13"}},"products":{"type":"array","items":{"type":"object","properties":{"productId":{"type":["string","null"]},"name":{"type":["string","null"]},"counts":{"type":"array","items":{"type":"integer"}}},"required":["productId","name","counts"]}}},"required":["days","products"]},"BillingRedirect":{"type":"object","properties":{"url":{"type":"string"},"mode":{"type":"string","enum":["checkout","immediate","scheduled","cancel"]}},"required":["url"]}},"parameters":{}},"paths":{"/v1/products/{productId}/validate-key":{"post":{"tags":["Licenses"],"operationId":"validateKey","summary":"Validate a license key","description":"Checks the license key of the product on a machine and returns a token the application can verify offline with the organization's public key. Doesn't need authentication.\n\nThe license must allow the `version`: up to its `maxVersion.version` when it has one, like `\"2.3\"` for every 2.3.z version and older. Its `maxVersion.lockMajorAt` and `maxVersion.lockMinorAt` are enforced once they hard-code `maxVersion.version`, within the hour they're reached. When it doesn't, the error's `latestAllowedVersion` is the latest release of the product the license allows, so the application can offer to install it.\n\nThe machine with the `fingerprint` is created when the license has none, and activated when it's deactivated, unless the license is already active on its maximum number of machines. A machine that's already active is never refused for the maximum number of machines, even when it was lowered below the number of active machines. Its `version`, and its `name` and `platform` when given, are updated: they can't be cleared.\n\nThe checks run in this order, and the first one failing answers: the license has expired, then it doesn't allow the version, then it's on its maximum number of machines. Each failure is recorded as a `license.validation_failed` event, except for keys that don't exist.\n\nChanges to the license, like deactivating the machine or shortening its expiration, don't revoke the tokens already returned: the application only sees them when it validates its key again, at the latest when its token expires.","security":[],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateKey"}}}},"responses":{"200":{"description":"Signed license token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseToken"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`license_expired`: the license has expired. `version_not_allowed`: the license doesn't allow the version, with the `latestAllowedVersion`. `machine_limit_reached`: the license is already active on its maximum number of machines","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ValidateKeyError"}}}},"404":{"description":"`not_found`: the product doesn't exist, or has no license with this key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi();\n\nconst licenseToken = await licenses.validateKey({\n  productId: \"x7Kp2QaZ\",\n  validateKey: {\n    key: \"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF\",\n    fingerprint: \"4c:32:75:8f:9a:1e\",\n    version: \"1.4.2\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.Background()\n\n\tlicenseToken, _, err := client.LicensesAPI.ValidateKey(ctx, \"x7Kp2QaZ\").\n\t\tValidateKey(*licensemanager.NewValidateKey(\"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF\", \"4c:32:75:8f:9a:1e\", \"1.4.2\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(licenseToken)\n}\n"},{"lang":"python","label":"Python SDK","source":"import licensemanager\n\nwith licensemanager.ApiClient() as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    license_token = licenses.validate_key(\n        product_id=\"x7Kp2QaZ\",\n        validate_key=licensemanager.ValidateKey(key=\"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF\", fingerprint=\"4c:32:75:8f:9a:1e\", version=\"1.4.2\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nlicenses = LicenseManager::LicensesApi.new\nlicense_token = licenses.validate_key(\"x7Kp2QaZ\", LicenseManager::ValidateKey.new(key: \"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF\", fingerprint: \"4c:32:75:8f:9a:1e\", version: \"1.4.2\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.LicenseToken;\nimport dev.licensemanager.model.ValidateKey;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        LicensesApi licenses = new LicensesApi();\n\n        ValidateKey validateKey = new ValidateKey()\n            .key(\"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF\")\n            .fingerprint(\"4c:32:75:8f:9a:1e\")\n            .version(\"1.4.2\");\n        LicenseToken licenseToken = licenses.validateKey(\"x7Kp2QaZ\", validateKey).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Model;\n\nvar licenses = new LicensesApi();\n\nvar licenseToken = await licenses.ValidateKeyAsync(\n    \"x7Kp2QaZ\",\n    new ValidateKey(\n        key: \"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF\",\n        fingerprint: \"4c:32:75:8f:9a:1e\",\n        varVersion: \"1.4.2\"\n    )\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Model\\ValidateKey;\n\n$licenses = new LicensesApi();\n\n$licenseToken = $licenses->validateKey(\"x7Kp2QaZ\", new ValidateKey([\n    \"key\" => \"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF\",\n    \"fingerprint\" => \"4c:32:75:8f:9a:1e\",\n    \"version\" => \"1.4.2\",\n]));\n"}]}},"/v1/portal/{productId}":{"get":{"tags":["Portal"],"operationId":"getPortal","summary":"Get the customer portal of a product","description":"Names of the product and of its organization, colors of the customer portal, and link back to the product's website. Answers `404` when the product's customer portal is disabled: with the `portal_disabled` code and the slugs of the product and its organization when signed in as a member of the organization, so they can enable it. Doesn't need authentication.","security":[],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"},{"schema":{"type":"string","description":"Link back to your website to show, used when its domain is one of the product's `returnDomains`.","example":"https://example.com/account"},"required":false,"description":"Link back to your website to show, used when its domain is one of the product's `returnDomains`.","name":"returnUrl","in":"query"}],"responses":{"200":{"description":"Customer portal","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Portal"}}}},"404":{"description":"`not_found`: product not found, or its customer portal is disabled. `portal_disabled`: its customer portal is disabled, for members of its organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalNotFound"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { PortalApi } from \"@licenseman/sdk\";\n\nconst portalApi = new PortalApi();\n\nconst portal = await portalApi.getPortal({ productId: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.Background()\n\n\tportal, _, err := client.PortalAPI.GetPortal(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(portal)\n}\n"},{"lang":"python","label":"Python SDK","source":"import licensemanager\n\nwith licensemanager.ApiClient() as api_client:\n    portal_api = licensemanager.PortalApi(api_client)\n    portal = portal_api.get_portal(product_id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nportal_api = LicenseManager::PortalApi.new\nportal = portal_api.get_portal(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.api.PortalApi;\nimport dev.licensemanager.model.Portal;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        PortalApi portalApi = new PortalApi();\n\n        Portal portal = portalApi.getPortal(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\n\nvar portalApi = new PortalApi();\n\nvar portal = await portalApi.GetPortalAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PortalApi;\n\n$portalApi = new PortalApi();\n\n$portal = $portalApi->getPortal(\"x7Kp2QaZ\");\n"}]}},"/v1/portal/{productId}/request-link":{"post":{"tags":["Portal"],"operationId":"requestPortalLink","summary":"Email a link to the customer portal","description":"Emails the customer of the product with this email a link to the customer portal, working for 1 hour. Answers `404` when the product's customer portal is disabled. Answers the same whether the customer exists or not, so the API doesn't tell which emails are customers. Test products only email the members of the organization: the link isn't sent to other customers, with the same answer. Doesn't need authentication.","security":[],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RequestPortalLink"}}}},"responses":{"204":{"description":"Link emailed, if the customer exists"},"404":{"description":"`not_found`: product not found, or its customer portal is disabled","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"Validation error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { PortalApi } from \"@licenseman/sdk\";\n\nconst portal = new PortalApi();\n\nawait portal.requestPortalLink({\n  productId: \"x7Kp2QaZ\",\n  requestPortalLink: {\n    email: \"jane@example.com\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.Background()\n\n\t_, err := client.PortalAPI.RequestPortalLink(ctx, \"x7Kp2QaZ\").\n\t\tRequestPortalLink(*licensemanager.NewRequestPortalLink(\"jane@example.com\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import licensemanager\n\nwith licensemanager.ApiClient() as api_client:\n    portal = licensemanager.PortalApi(api_client)\n    portal.request_portal_link(\n        product_id=\"x7Kp2QaZ\",\n        request_portal_link=licensemanager.RequestPortalLink(email=\"jane@example.com\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nportal = LicenseManager::PortalApi.new\nportal.request_portal_link(\"x7Kp2QaZ\", LicenseManager::RequestPortalLink.new(email: \"jane@example.com\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.api.PortalApi;\nimport dev.licensemanager.model.RequestPortalLink;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        PortalApi portal = new PortalApi();\n\n        RequestPortalLink requestPortalLink = new RequestPortalLink()\n            .email(\"jane@example.com\");\n        portal.requestPortalLink(\"x7Kp2QaZ\", requestPortalLink).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Model;\n\nvar portal = new PortalApi();\n\nawait portal.RequestPortalLinkAsync(\n    \"x7Kp2QaZ\",\n    new RequestPortalLink(email: \"jane@example.com\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PortalApi;\nuse LicenseManager\\Model\\RequestPortalLink;\n\n$portal = new PortalApi();\n\n$portal->requestPortalLink(\"x7Kp2QaZ\", new RequestPortalLink([\n    \"email\" => \"jane@example.com\",\n]));\n"}]}},"/v1/admin/organizations":{"get":{"tags":["Admin"],"operationId":"adminListOrganizations","summary":"List the organizations (super admins)","security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":false,"name":"search","in":"query"},{"schema":{"type":"string","enum":["free","startup","standard","custom"]},"required":false,"name":"plan","in":"query"},{"schema":{"type":"string","enum":["blocked","over","warning"]},"required":false,"name":"status","in":"query"},{"schema":{"type":"integer","minimum":1,"default":1},"required":false,"name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":50},"required":false,"name":"pageSize","in":"query"}],"responses":{"200":{"description":"Organizations","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/AdminOrganization"}},"total":{"type":"integer"},"planCounts":{"type":"object","additionalProperties":{"type":"integer"}}},"required":["data","total","planCounts"]}}}},"400":{"description":"`billing_disabled`, `no_custom_price`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: the user isn't a super admin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the organization doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/organizations/{id}":{"get":{"tags":["Admin"],"operationId":"adminGetOrganization","summary":"Get an organization's billing details (super admins)","security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdminOrganizationDetail"}}}},"400":{"description":"`billing_disabled`, `no_custom_price`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: the user isn't a super admin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the organization doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/organizations/{id}/billing":{"put":{"tags":["Admin"],"operationId":"adminUpdateOrganizationBilling","summary":"Set an organization's custom plan (super admins)","description":"`customLimits` override the plan's limits, null to use the plan's again. `customPriceId` is the Stripe price of the organization's custom plan, to send it a checkout link. Only the fields sent change.","security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"customPriceId":{"type":["string","null"],"minLength":1},"customLimits":{"type":["object","null"],"properties":{"products":{"type":["integer","null"],"minimum":0},"activeLicenses":{"type":["integer","null"],"minimum":0},"apiRequests":{"type":["integer","null"],"minimum":0},"seats":{"type":["integer","null"],"minimum":0},"apiKeys":{"type":["integer","null"],"minimum":0}},"required":["products","activeLicenses","apiRequests","seats","apiKeys"]},"notes":{"type":["string","null"]}}}}}},"responses":{"204":{"description":"Updated"},"400":{"description":"`billing_disabled`, `no_custom_price`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: the user isn't a super admin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the organization doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/organizations/{id}/grace":{"post":{"tags":["Admin"],"operationId":"adminExtendGrace","summary":"Extend an organization's grace period (super admins)","description":"The organization isn't blocked before `until`, even when over its limits: a blocked organization is unblocked right away. Null goes back to the usual grace period.","security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"until":{"type":["string","null"],"format":"date-time"}},"required":["until"]}}}},"responses":{"204":{"description":"Updated"},"400":{"description":"`billing_disabled`, `no_custom_price`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: the user isn't a super admin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the organization doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/organizations/{id}/recompute":{"post":{"tags":["Admin"],"operationId":"adminRecomputeUsage","summary":"Check an organization's usage now (super admins)","security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Whether the organization is blocked","content":{"application/json":{"schema":{"type":"object","properties":{"blocked":{"type":"boolean"}},"required":["blocked"]}}}},"400":{"description":"`billing_disabled`, `no_custom_price`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: the user isn't a super admin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the organization doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/organizations/{id}/checkout-link":{"post":{"tags":["Admin"],"operationId":"adminCreateCheckoutLink","summary":"Create a checkout link for an organization's custom price (super admins)","description":"Stripe Checkout session subscribing the organization to its `customPriceId`, to send to its owner. Once paid, the subscription shows up as the organization's custom plan. Cancel its previous subscription afterwards, if any.","security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Checkout URL","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"]}}}},"400":{"description":"`billing_disabled`, `no_custom_price`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: the user isn't a super admin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the organization doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/admin/organizations/{id}/cancel-subscription":{"post":{"tags":["Admin"],"operationId":"adminCancelSubscription","summary":"Cancel an organization's subscription (super admins)","security":[{"session":[]}],"parameters":[{"schema":{"type":"string"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"stripeSubscriptionId":{"type":"string"},"atPeriodEnd":{"type":"boolean","default":true}},"required":["stripeSubscriptionId"]}}}},"responses":{"204":{"description":"Canceled"},"400":{"description":"`billing_disabled`, `no_custom_price`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no session","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`forbidden`: the user isn't a super admin","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: the organization doesn't exist","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/products":{"get":{"tags":["Products"],"operationId":"listProducts","summary":"List products","parameters":[{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["name","-name","slug","-slug","createdAt","-createdAt","updatedAt","-updatedAt"],"default":"-createdAt","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","example":"-createdAt"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","name":"sort","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive text the name or slug contains.","example":"pro"},"required":false,"description":"Case-insensitive text the name or slug contains.","name":"search","in":"query"},{"schema":{"type":"string","description":"Only returns the product with this exact slug.","example":"acme-pro"},"required":false,"description":"Only returns the product with this exact slug.","name":"slug","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"Only returns the test products with `true`, the live ones with `false`. API keys only list the products of their own mode.","example":"false"},"required":false,"description":"Only returns the test products with `true`, the live ones with `false`. API keys only list the products of their own mode.","name":"isTest","in":"query"}],"responses":{"200":{"description":"One page of the products of the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst productList = await products.listProducts();\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tproductList, _, err := client.ProductsAPI.ListProducts(ctx).Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(productList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    product_list = products.list_products()\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproduct_list = products.list_products\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\nimport dev.licensemanager.model.ProductList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        ProductList productList = products.listProducts().execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nvar productList = await products.ListProductsAsync();\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$productList = $products->listProducts();\n"}]},"post":{"tags":["Products"],"operationId":"createProduct","summary":"Create a product","description":"Without a `slug`, the product gets one derived from its name: lower cased, without accents and special characters (`Élan Pro 2!` becomes `elan-pro-2`).\nWhen another product of the organization already uses it, a dash and 3 random lowercase letters or digits are appended (`elan-pro-2-k3f`), until the slug is free.\n\nAn explicit `slug` is used as is: the request fails with a `409` when it's taken, it's never changed.\n\nSlug uniqueness is enforced by the database, so when concurrent requests end up with the same slug, only one succeeds and the others get a `409`, even without an explicit `slug`. Retrying such a request without a `slug` derives a new one.\n\nThe product is created with its default policy, named `Default policy` with the `default` slug, whose settings are given by `defaultPolicy`. Omitted settings default to licenses that never expire, on a single machine, offline for one week, for every version of the product. Unlike `createPolicy`, where `maxMachines` defaults to no limit.\n\nWith `isTestFromProductId`, the product is a test product: its id, its slug, and the ids, slugs and license keys of its resources start with `test_` (`TEST-` for license keys), and only test API keys reach it. It starts with copies of the policies, releases and portal settings of the live product, `defaultPolicy` is ignored. Later changes to the live product aren't copied: reset the test product to copy them again. Test API keys can only create test products, live API keys only live ones.\n\n**Required role permission**: `product:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["product:create"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateProductWithPolicy"}}}},"responses":{"201":{"description":"Created product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`api_key_mode`: the API key's mode doesn't match the product's: test keys only create test products, live keys only live ones","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: `isTestFromProductId` isn't a live product of the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`slug_taken`: the explicit slug is already used by another product of the organization, or a concurrent request took the same slug first","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst product = await products.createProduct({\n  createProductWithPolicy: {\n    name: \"Acme Pro\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tproduct, _, err := client.ProductsAPI.CreateProduct(ctx).\n\t\tCreateProductWithPolicy(*licensemanager.NewCreateProductWithPolicy(\"Acme Pro\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(product)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    product = products.create_product(\n        create_product_with_policy=licensemanager.CreateProductWithPolicy(name=\"Acme Pro\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproduct = products.create_product(LicenseManager::CreateProductWithPolicy.new(name: \"Acme Pro\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\nimport dev.licensemanager.model.CreateProductWithPolicy;\nimport dev.licensemanager.model.Product;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        CreateProductWithPolicy createProductWithPolicy = new CreateProductWithPolicy()\n            .name(\"Acme Pro\");\n        Product product = products.createProduct(createProductWithPolicy).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nvar product = await products.CreateProductAsync(\n    new CreateProductWithPolicy(name: \"Acme Pro\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreateProductWithPolicy;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$product = $products->createProduct(new CreateProductWithPolicy([\n    \"name\" => \"Acme Pro\",\n]));\n"}]}},"/v1/products/{id}":{"get":{"tags":["Products"],"operationId":"getProduct","summary":"Get a product","parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst product = await products.getProduct({ id: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tproduct, _, err := client.ProductsAPI.GetProduct(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(product)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    product = products.get_product(id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproduct = products.get_product(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\nimport dev.licensemanager.model.Product;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        Product product = products.getProduct(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nvar product = await products.GetProductAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$product = $products->getProduct(\"x7Kp2QaZ\");\n"}]},"patch":{"tags":["Products"],"operationId":"updateProduct","summary":"Update a product","description":"A product can't be turned into a test product, or back: `isTestFromProductId` can't be changed.\n\n**Required role permission**: `product:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["product:update"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateProduct"}}}},"responses":{"200":{"description":"Updated product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`slug_taken`: slug already used by another product of the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst product = await products.updateProduct({\n  id: \"x7Kp2QaZ\",\n  updateProduct: {\n    name: \"Acme Pro\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tbody := licensemanager.NewUpdateProduct()\n\tbody.SetName(\"Acme Pro\")\n\n\tproduct, _, err := client.ProductsAPI.UpdateProduct(ctx, \"x7Kp2QaZ\").\n\t\tUpdateProduct(*body).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(product)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    product = products.update_product(\n        id=\"x7Kp2QaZ\",\n        update_product=licensemanager.UpdateProduct(name=\"Acme Pro\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproduct = products.update_product(\"x7Kp2QaZ\", LicenseManager::UpdateProduct.new(name: \"Acme Pro\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\nimport dev.licensemanager.model.Product;\nimport dev.licensemanager.model.UpdateProduct;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        UpdateProduct updateProduct = new UpdateProduct()\n            .name(\"Acme Pro\");\n        Product product = products.updateProduct(\"x7Kp2QaZ\", updateProduct).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nvar product = await products.UpdateProductAsync(\n    \"x7Kp2QaZ\",\n    new UpdateProduct(name: \"Acme Pro\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\UpdateProduct;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$product = $products->updateProduct(\"x7Kp2QaZ\", new UpdateProduct([\n    \"name\" => \"Acme Pro\",\n]));\n"}]},"delete":{"tags":["Products"],"operationId":"deleteProduct","summary":"Delete a product","description":"Deletes the product along with its policies, customers and releases, and its test products with everything they hold. A live product that licenses belong to can't be deleted: delete them first. A test product can always be deleted, along with its licenses and machines. The events of the deleted policies and licenses can no longer be listed.\n\n**Required role permission**: `product:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["product:delete"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`product_in_use`: licenses belong to the live product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait products.deleteProduct({ id: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.ProductsAPI.DeleteProduct(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    products.delete_product(id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproducts.delete_product(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        products.deleteProduct(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nawait products.DeleteProductAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$products->deleteProduct(\"x7Kp2QaZ\");\n"}]}},"/v1/products/{id}/reset":{"post":{"tags":["Products"],"operationId":"resetProduct","summary":"Reset a test product","description":"Deletes the customers, licenses, machines, policies and releases of the test product, with their events, then copies the policies, releases and portal settings of its live product again. Its id, name and slug are kept, but the copied policies get new ids. The tokens of its customers, licenses and machines stop working.\n\n**Required role permission**: `product:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["product:update"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Reset product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"400":{"description":"`not_test_product`: the product is a live product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst product = await products.resetProduct({ id: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tproduct, _, err := client.ProductsAPI.ResetProduct(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(product)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    product = products.reset_product(id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproduct = products.reset_product(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\nimport dev.licensemanager.model.Product;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        Product product = products.resetProduct(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nvar product = await products.ResetProductAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$product = $products->resetProduct(\"x7Kp2QaZ\");\n"}]}},"/v1/products/{id}/logo":{"put":{"tags":["Products"],"operationId":"uploadProductLogo","summary":"Upload a product logo","description":"Replaces the logo of the product, shown in the web app and the customer portal. The previous logo is deleted.\n\nAccepts WebP, PNG, JPEG and SVG images up to 1 MB, recognized by their content. Logos are shown in squares: use square images, 256×256 pixels for bitmaps. The web app crops and resizes images to this size, and converts them to WebP, before uploading them.\n\n**Required role permission**: `product:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["product:update"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"multipart/form-data":{"schema":{"$ref":"#/components/schemas/UploadLogo"}}}},"responses":{"200":{"description":"Product with its new logo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"`logo_too_large`: the image is larger than 1 MB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"`unsupported_logo_type`: the file isn't a WebP, PNG, JPEG or SVG image","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { openAsBlob } from \"node:fs\";\nimport { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst product = await products.uploadProductLogo({\n  id: \"x7Kp2QaZ\",\n  file: await openAsBlob(\"logo.png\"),\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tfile, err := os.Open(\"logo.png\")\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tdefer file.Close()\n\n\tproduct, _, err := client.ProductsAPI.UploadProductLogo(ctx, \"x7Kp2QaZ\").\n\t\tFile(file).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(product)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    product = products.upload_product_logo(id=\"x7Kp2QaZ\", file=\"logo.png\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproduct = products.upload_product_logo(\"x7Kp2QaZ\", File.new(\"logo.png\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\nimport dev.licensemanager.model.Product;\nimport java.io.File;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        Product product = products.uploadProductLogo(\"x7Kp2QaZ\", new File(\"logo.png\")).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using System.IO;\nusing LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nvar product = await products.UploadProductLogoAsync(\n    \"x7Kp2QaZ\",\n    new FileParameter(File.OpenRead(\"logo.png\"))\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$product = $products->uploadProductLogo(\"x7Kp2QaZ\", new \\SplFileObject(\"logo.png\"));\n"}]},"delete":{"tags":["Products"],"operationId":"deleteProductLogo","summary":"Delete a product logo","description":"Removes the logo of the product, and deletes its image. Succeeds when the product has no logo.\n\n**Required role permission**: `product:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["product:update"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Product without a logo","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Product"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst product = await products.deleteProductLogo({ id: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tproduct, _, err := client.ProductsAPI.DeleteProductLogo(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(product)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    product = products.delete_product_logo(id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproduct = products.delete_product_logo(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\nimport dev.licensemanager.model.Product;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        Product product = products.deleteProductLogo(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nvar product = await products.DeleteProductLogoAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$product = $products->deleteProductLogo(\"x7Kp2QaZ\");\n"}]}},"/v1/products/{id}/stats":{"get":{"tags":["Products"],"operationId":"getProductStats","summary":"Get the stats of a product","description":"Counts of the licenses and machines of the product, number of licenses created each day over the last 30 days and each month over the last 12 months, overall and per policy, revenue per currency over the same periods, and successful activations each day over the last 30 days. Days and months are in UTC.","parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Stats of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ProductStats"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ProductsApi } from \"@licenseman/sdk\";\n\nconst products = new ProductsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst productStats = await products.getProductStats({ id: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tproductStats, _, err := client.ProductsAPI.GetProductStats(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(productStats)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    products = licensemanager.ProductsApi(api_client)\n    product_stats = products.get_product_stats(id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nproducts = LicenseManager::ProductsApi.new\nproduct_stats = products.get_product_stats(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ProductsApi;\nimport dev.licensemanager.model.ProductStats;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ProductsApi products = new ProductsApi(client);\n\n        ProductStats productStats = products.getProductStats(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar products = new ProductsApi(configuration);\n\nvar productStats = await products.GetProductStatsAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ProductsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$products = new ProductsApi(config: $config);\n\n$productStats = $products->getProductStats(\"x7Kp2QaZ\");\n"}]}},"/v1/products/{productId}/policies":{"get":{"tags":["Policies"],"operationId":"listPolicies","summary":"List the policies of a product","description":"`?isDefault=true` returns the product's default policy alone: a product always has exactly one. Sorting by `duration` counts months for their average length, about 30.4 days.","parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["name","-name","slug","-slug","duration","-duration","maxMachines","-maxMachines","maxOfflineDurationSeconds","-maxOfflineDurationSeconds","licenseCount","-licenseCount","createdAt","-createdAt","updatedAt","-updatedAt"],"default":"name","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `name`.","example":"name"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `name`.","name":"sort","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive text the name or slug contains.","example":"pro"},"required":false,"description":"Case-insensitive text the name or slug contains.","name":"search","in":"query"},{"schema":{"type":"string","description":"Only returns the policy with this exact slug.","example":"yearly"},"required":false,"description":"Only returns the policy with this exact slug.","name":"slug","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` only returns the product's default policy, `false` only the other ones.","example":"true"},"required":false,"description":"`true` only returns the product's default policy, `false` only the other ones.","name":"isDefault","in":"query"},{"schema":{"type":"integer","description":"Only returns the policies followed by exactly this number of licenses.","example":1},"required":false,"description":"Only returns the policies followed by exactly this number of licenses.","name":"licenseCount","in":"query"},{"schema":{"type":"integer","description":"Only returns the policies followed by at least this number of licenses.","example":1},"required":false,"description":"Only returns the policies followed by at least this number of licenses.","name":"licenseCountMin","in":"query"},{"schema":{"type":"integer","description":"Only returns the policies followed by at most this number of licenses.","example":1},"required":false,"description":"Only returns the policies followed by at most this number of licenses.","name":"licenseCountMax","in":"query"}],"responses":{"200":{"description":"One page of the policies of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PolicyList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, PoliciesApi } from \"@licenseman/sdk\";\n\nconst policies = new PoliciesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst policyList = await policies.listPolicies({ productId: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tpolicyList, _, err := client.PoliciesAPI.ListPolicies(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(policyList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    policies = licensemanager.PoliciesApi(api_client)\n    policy_list = policies.list_policies(product_id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\npolicies = LicenseManager::PoliciesApi.new\npolicy_list = policies.list_policies(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.PoliciesApi;\nimport dev.licensemanager.model.PolicyList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        PoliciesApi policies = new PoliciesApi(client);\n\n        PolicyList policyList = policies.listPolicies(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar policies = new PoliciesApi(configuration);\n\nvar policyList = await policies.ListPoliciesAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PoliciesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$policies = new PoliciesApi(config: $config);\n\n$policyList = $policies->listPolicies(\"x7Kp2QaZ\");\n"}]},"post":{"tags":["Policies"],"operationId":"createPolicy","summary":"Create a policy","description":"Without a `slug`, the policy gets one derived from its name, made unique within the product by appending a dash and 3 random lowercase letters or digits when needed. An explicit `slug` is used as is: the request fails with a `409` when it's taken.\n\nWith `isDefault: true`, the new policy replaces the product's current default policy.\n\nA product always has a default policy, so when it has no policies the new one becomes the default: the request fails with a `409` when `isDefault` is `false`.\n\n**Required role permission**: `policy:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["policy:create"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePolicy"}}}},"responses":{"201":{"description":"Created policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`slug_taken`: the explicit slug is already used by another policy of the product, or a concurrent request took the same slug first. `default_required`: `isDefault: false` for the first policy of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, PoliciesApi } from \"@licenseman/sdk\";\n\nconst policies = new PoliciesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst policy = await policies.createPolicy({\n  productId: \"x7Kp2QaZ\",\n  createPolicy: {\n    name: \"Yearly\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tpolicy, _, err := client.PoliciesAPI.CreatePolicy(ctx, \"x7Kp2QaZ\").\n\t\tCreatePolicy(*licensemanager.NewCreatePolicy(\"Yearly\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(policy)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    policies = licensemanager.PoliciesApi(api_client)\n    policy = policies.create_policy(\n        product_id=\"x7Kp2QaZ\",\n        create_policy=licensemanager.CreatePolicy(name=\"Yearly\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\npolicies = LicenseManager::PoliciesApi.new\npolicy = policies.create_policy(\"x7Kp2QaZ\", LicenseManager::CreatePolicy.new(name: \"Yearly\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.PoliciesApi;\nimport dev.licensemanager.model.CreatePolicy;\nimport dev.licensemanager.model.Policy;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        PoliciesApi policies = new PoliciesApi(client);\n\n        CreatePolicy createPolicy = new CreatePolicy()\n            .name(\"Yearly\");\n        Policy policy = policies.createPolicy(\"x7Kp2QaZ\", createPolicy).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar policies = new PoliciesApi(configuration);\n\nvar policy = await policies.CreatePolicyAsync(\"x7Kp2QaZ\", new CreatePolicy(name: \"Yearly\"));\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PoliciesApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreatePolicy;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$policies = new PoliciesApi(config: $config);\n\n$policy = $policies->createPolicy(\"x7Kp2QaZ\", new CreatePolicy([\n    \"name\" => \"Yearly\",\n]));\n"}]}},"/v1/policies/{id}":{"get":{"tags":["Policies"],"operationId":"getPolicy","summary":"Get a policy","parameters":[{"schema":{"type":"string","example":"p4Rt8LmQ"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Policy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, PoliciesApi } from \"@licenseman/sdk\";\n\nconst policies = new PoliciesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst policy = await policies.getPolicy({ id: \"p4Rt8LmQ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tpolicy, _, err := client.PoliciesAPI.GetPolicy(ctx, \"p4Rt8LmQ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(policy)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    policies = licensemanager.PoliciesApi(api_client)\n    policy = policies.get_policy(id=\"p4Rt8LmQ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\npolicies = LicenseManager::PoliciesApi.new\npolicy = policies.get_policy(\"p4Rt8LmQ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.PoliciesApi;\nimport dev.licensemanager.model.Policy;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        PoliciesApi policies = new PoliciesApi(client);\n\n        Policy policy = policies.getPolicy(\"p4Rt8LmQ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar policies = new PoliciesApi(configuration);\n\nvar policy = await policies.GetPolicyAsync(\"p4Rt8LmQ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PoliciesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$policies = new PoliciesApi(config: $config);\n\n$policy = $policies->getPolicy(\"p4Rt8LmQ\");\n"}]},"patch":{"tags":["Policies"],"operationId":"updatePolicy","summary":"Update a policy","description":"`isDefault: true` makes the policy the product's default, in place of the current one. A product always has a default policy, so the default can't be unset with `isDefault: false`: make another policy the default instead.\n\nLicenses copy the settings of their policy when they're created, so changing them only affects the licenses created afterwards: update the existing licenses to change theirs.\n\n**Required role permission**: `policy:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["policy:update"],"parameters":[{"schema":{"type":"string","example":"p4Rt8LmQ"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdatePolicy"}}}},"responses":{"200":{"description":"Updated policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Policy"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Policy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`slug_taken`: slug already used by another policy of the product. `default_required`: `isDefault: false` on the default policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, PoliciesApi } from \"@licenseman/sdk\";\n\nconst policies = new PoliciesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst policy = await policies.updatePolicy({\n  id: \"p4Rt8LmQ\",\n  updatePolicy: {\n    name: \"Yearly\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tbody := licensemanager.NewUpdatePolicy()\n\tbody.SetName(\"Yearly\")\n\n\tpolicy, _, err := client.PoliciesAPI.UpdatePolicy(ctx, \"p4Rt8LmQ\").\n\t\tUpdatePolicy(*body).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(policy)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    policies = licensemanager.PoliciesApi(api_client)\n    policy = policies.update_policy(\n        id=\"p4Rt8LmQ\",\n        update_policy=licensemanager.UpdatePolicy(name=\"Yearly\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\npolicies = LicenseManager::PoliciesApi.new\npolicy = policies.update_policy(\"p4Rt8LmQ\", LicenseManager::UpdatePolicy.new(name: \"Yearly\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.PoliciesApi;\nimport dev.licensemanager.model.Policy;\nimport dev.licensemanager.model.UpdatePolicy;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        PoliciesApi policies = new PoliciesApi(client);\n\n        UpdatePolicy updatePolicy = new UpdatePolicy()\n            .name(\"Yearly\");\n        Policy policy = policies.updatePolicy(\"p4Rt8LmQ\", updatePolicy).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar policies = new PoliciesApi(configuration);\n\nvar policy = await policies.UpdatePolicyAsync(\"p4Rt8LmQ\", new UpdatePolicy(name: \"Yearly\"));\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PoliciesApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\UpdatePolicy;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$policies = new PoliciesApi(config: $config);\n\n$policy = $policies->updatePolicy(\"p4Rt8LmQ\", new UpdatePolicy([\n    \"name\" => \"Yearly\",\n]));\n"}]},"delete":{"tags":["Policies"],"operationId":"deletePolicy","summary":"Delete a policy","description":"Deleting the default policy makes the oldest remaining policy of the product the default. The last policy of a product can't be deleted, nor a policy that licenses follow. Its events can no longer be listed.\n\n**Required role permission**: `policy:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["policy:delete"],"parameters":[{"schema":{"type":"string","example":"p4Rt8LmQ"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Policy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`last_policy`: the policy is the last one of its product. `policy_in_use`: licenses follow it","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, PoliciesApi } from \"@licenseman/sdk\";\n\nconst policies = new PoliciesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait policies.deletePolicy({ id: \"p4Rt8LmQ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.PoliciesAPI.DeletePolicy(ctx, \"p4Rt8LmQ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    policies = licensemanager.PoliciesApi(api_client)\n    policies.delete_policy(id=\"p4Rt8LmQ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\npolicies = LicenseManager::PoliciesApi.new\npolicies.delete_policy(\"p4Rt8LmQ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.PoliciesApi;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        PoliciesApi policies = new PoliciesApi(client);\n\n        policies.deletePolicy(\"p4Rt8LmQ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar policies = new PoliciesApi(configuration);\n\nawait policies.DeletePolicyAsync(\"p4Rt8LmQ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PoliciesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$policies = new PoliciesApi(config: $config);\n\n$policies->deletePolicy(\"p4Rt8LmQ\");\n"}]}},"/v1/products/{productId}/customers":{"get":{"tags":["Customers"],"operationId":"listCustomers","summary":"List the customers of a product","description":"Sorting by `name` puts the customers without a name last in both orders.","parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["name","-name","email","-email","licenseCount","-licenseCount","createdAt","-createdAt"],"default":"-createdAt","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","example":"-createdAt"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","name":"sort","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive text the name or email contains.","example":"example.com"},"required":false,"description":"Case-insensitive text the name or email contains.","name":"search","in":"query"},{"schema":{"type":"string","description":"Only returns the customer with this email, compared regardless of case.","example":"jane@example.com"},"required":false,"description":"Only returns the customer with this email, compared regardless of case.","name":"email","in":"query"}],"responses":{"200":{"description":"One page of the customers of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CustomerList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, CustomersApi } from \"@licenseman/sdk\";\n\nconst customers = new CustomersApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst customerList = await customers.listCustomers({ productId: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tcustomerList, _, err := client.CustomersAPI.ListCustomers(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(customerList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    customers = licensemanager.CustomersApi(api_client)\n    customer_list = customers.list_customers(product_id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\ncustomers = LicenseManager::CustomersApi.new\ncustomer_list = customers.list_customers(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.CustomersApi;\nimport dev.licensemanager.model.CustomerList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        CustomersApi customers = new CustomersApi(client);\n\n        CustomerList customerList = customers.listCustomers(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar customers = new CustomersApi(configuration);\n\nvar customerList = await customers.ListCustomersAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\CustomersApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$customers = new CustomersApi(config: $config);\n\n$customerList = $customers->listCustomers(\"x7Kp2QaZ\");\n"}]},"post":{"tags":["Customers"],"operationId":"createCustomer","summary":"Create a customer","x-required-permissions":["customer:create"],"description":"**Required role permission**: `customer:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateCustomer"}}}},"responses":{"201":{"description":"Created customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`email_taken`: email already used by another customer of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, CustomersApi } from \"@licenseman/sdk\";\n\nconst customers = new CustomersApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst customer = await customers.createCustomer({\n  productId: \"x7Kp2QaZ\",\n  createCustomer: {\n    email: \"jane@example.com\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tcustomer, _, err := client.CustomersAPI.CreateCustomer(ctx, \"x7Kp2QaZ\").\n\t\tCreateCustomer(*licensemanager.NewCreateCustomer(\"jane@example.com\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(customer)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    customers = licensemanager.CustomersApi(api_client)\n    customer = customers.create_customer(\n        product_id=\"x7Kp2QaZ\",\n        create_customer=licensemanager.CreateCustomer(email=\"jane@example.com\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\ncustomers = LicenseManager::CustomersApi.new\ncustomer = customers.create_customer(\"x7Kp2QaZ\", LicenseManager::CreateCustomer.new(email: \"jane@example.com\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.CustomersApi;\nimport dev.licensemanager.model.CreateCustomer;\nimport dev.licensemanager.model.Customer;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        CustomersApi customers = new CustomersApi(client);\n\n        CreateCustomer createCustomer = new CreateCustomer()\n            .email(\"jane@example.com\");\n        Customer customer = customers.createCustomer(\"x7Kp2QaZ\", createCustomer).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar customers = new CustomersApi(configuration);\n\nvar customer = await customers.CreateCustomerAsync(\n    \"x7Kp2QaZ\",\n    new CreateCustomer(email: \"jane@example.com\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\CustomersApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreateCustomer;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$customers = new CustomersApi(config: $config);\n\n$customer = $customers->createCustomer(\"x7Kp2QaZ\", new CreateCustomer([\n    \"email\" => \"jane@example.com\",\n]));\n"}]}},"/v1/customers/{id}":{"get":{"tags":["Customers"],"operationId":"getCustomer","summary":"Get a customer","security":[{"apiKey":[]},{"session":[]},{"token":["customer:read"]}],"description":"**Token access**: customer, license, machine tokens with the `customer:read` permission (or the matching write one). A token reaches the customer it's scoped to, or the customer of its license or machine.","parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, CustomersApi } from \"@licenseman/sdk\";\n\nconst customers = new CustomersApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst customer = await customers.getCustomer({ id: \"c9Wd3RtE\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tcustomer, _, err := client.CustomersAPI.GetCustomer(ctx, \"c9Wd3RtE\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(customer)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    customers = licensemanager.CustomersApi(api_client)\n    customer = customers.get_customer(id=\"c9Wd3RtE\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\ncustomers = LicenseManager::CustomersApi.new\ncustomer = customers.get_customer(\"c9Wd3RtE\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.CustomersApi;\nimport dev.licensemanager.model.Customer;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        CustomersApi customers = new CustomersApi(client);\n\n        Customer customer = customers.getCustomer(\"c9Wd3RtE\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar customers = new CustomersApi(configuration);\n\nvar customer = await customers.GetCustomerAsync(\"c9Wd3RtE\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\CustomersApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$customers = new CustomersApi(config: $config);\n\n$customer = $customers->getCustomer(\"c9Wd3RtE\");\n"}]},"patch":{"tags":["Customers"],"operationId":"updateCustomer","summary":"Update a customer","x-required-permissions":["customer:update"],"description":"**Required role permission**: `customer:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateCustomer"}}}},"responses":{"200":{"description":"Updated customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Customer"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`email_taken`: email already used by another customer of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, CustomersApi } from \"@licenseman/sdk\";\n\nconst customers = new CustomersApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst customer = await customers.updateCustomer({\n  id: \"c9Wd3RtE\",\n  updateCustomer: {\n    email: \"jane@example.com\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tbody := licensemanager.NewUpdateCustomer()\n\tbody.SetEmail(\"jane@example.com\")\n\n\tcustomer, _, err := client.CustomersAPI.UpdateCustomer(ctx, \"c9Wd3RtE\").\n\t\tUpdateCustomer(*body).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(customer)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    customers = licensemanager.CustomersApi(api_client)\n    customer = customers.update_customer(\n        id=\"c9Wd3RtE\",\n        update_customer=licensemanager.UpdateCustomer(email=\"jane@example.com\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\ncustomers = LicenseManager::CustomersApi.new\ncustomer = customers.update_customer(\"c9Wd3RtE\", LicenseManager::UpdateCustomer.new(email: \"jane@example.com\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.CustomersApi;\nimport dev.licensemanager.model.Customer;\nimport dev.licensemanager.model.UpdateCustomer;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        CustomersApi customers = new CustomersApi(client);\n\n        UpdateCustomer updateCustomer = new UpdateCustomer()\n            .email(\"jane@example.com\");\n        Customer customer = customers.updateCustomer(\"c9Wd3RtE\", updateCustomer).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar customers = new CustomersApi(configuration);\n\nvar customer = await customers.UpdateCustomerAsync(\n    \"c9Wd3RtE\",\n    new UpdateCustomer(email: \"jane@example.com\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\CustomersApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\UpdateCustomer;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$customers = new CustomersApi(config: $config);\n\n$customer = $customers->updateCustomer(\"c9Wd3RtE\", new UpdateCustomer([\n    \"email\" => \"jane@example.com\",\n]));\n"}]},"delete":{"tags":["Customers"],"operationId":"deleteCustomer","summary":"Delete a customer","description":"A customer that licenses belong to can't be deleted: delete them first. The customer tokens of the customer, like the ones of its portal links, stop working.\n\n**Required role permission**: `customer:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["customer:delete"],"parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`customer_in_use`: licenses belong to the customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, CustomersApi } from \"@licenseman/sdk\";\n\nconst customers = new CustomersApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait customers.deleteCustomer({ id: \"c9Wd3RtE\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.CustomersAPI.DeleteCustomer(ctx, \"c9Wd3RtE\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    customers = licensemanager.CustomersApi(api_client)\n    customers.delete_customer(id=\"c9Wd3RtE\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\ncustomers = LicenseManager::CustomersApi.new\ncustomers.delete_customer(\"c9Wd3RtE\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.CustomersApi;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        CustomersApi customers = new CustomersApi(client);\n\n        customers.deleteCustomer(\"c9Wd3RtE\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar customers = new CustomersApi(configuration);\n\nawait customers.DeleteCustomerAsync(\"c9Wd3RtE\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\CustomersApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$customers = new CustomersApi(config: $config);\n\n$customers->deleteCustomer(\"c9Wd3RtE\");\n"}]}},"/v1/products/{productId}/licenses":{"get":{"tags":["Licenses"],"operationId":"listLicenses","summary":"List the licenses of a product","description":"Sorting by `lastActivatedAt` puts the licenses never activated last in both orders. Sorting by `price` compares the amounts whatever their currency, and puts the licenses without a price last in both orders.","parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["key","-key","createdAt","-createdAt","expiresAt","-expiresAt","maxMachines","-maxMachines","maxOfflineDurationSeconds","-maxOfflineDurationSeconds","lastActivatedAt","-lastActivatedAt","lockMajorAt","-lockMajorAt","lockMinorAt","-lockMinorAt","updatedAt","-updatedAt","price","-price"],"default":"-createdAt","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","example":"-createdAt"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","name":"sort","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive text the key contains.","example":"X9ZPA"},"required":false,"description":"Case-insensitive text the key contains.","name":"search","in":"query"},{"schema":{"type":"string","description":"Only returns the license with this exact key, case included. Keys of test products start with `TEST-`.","example":"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF"},"required":false,"description":"Only returns the license with this exact key, case included. Keys of test products start with `TEST-`.","name":"key","in":"query"},{"schema":{"type":"string","description":"Only returns the licenses following this policy.","example":"p4Rt8LmQ"},"required":false,"description":"Only returns the licenses following this policy.","name":"policyId","in":"query"},{"schema":{"type":"string","description":"Only returns the licenses of this customer.","example":"c9Wd3RtE"},"required":false,"description":"Only returns the licenses of this customer.","name":"customerId","in":"query"},{"schema":{"type":"string","description":"Only returns the licenses with at least one active machine running this version of the product.","example":"2.3.1"},"required":false,"description":"Only returns the licenses with at least one active machine running this version of the product.","name":"machineVersion","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/LicenseStatus"},{"description":"Only returns the licenses with this status."}]},"required":false,"description":"Only returns the licenses with this status.","name":"status","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses created at or after this date.","example":"2026-01-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses created at or after this date.","name":"createdFrom","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses created at or before this date.","example":"2026-02-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses created at or before this date.","name":"createdTo","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses last activated at or after this date. Licenses never activated are left out.","example":"2026-01-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses last activated at or after this date. Licenses never activated are left out.","name":"lastActivatedFrom","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses last activated at or before this date. Licenses never activated are left out.","example":"2026-02-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses last activated at or before this date. Licenses never activated are left out.","name":"lastActivatedTo","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` only returns the licenses never activated, `false` only the ones activated at least once.","example":"true"},"required":false,"description":"`true` only returns the licenses never activated, `false` only the ones activated at least once.","name":"neverActivated","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses expiring at or after this date. Licenses that never expire are left out.","example":"2026-01-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses expiring at or after this date. Licenses that never expire are left out.","name":"expiresFrom","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses expiring at or before this date. Licenses that never expire are left out.","example":"2026-02-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses expiring at or before this date. Licenses that never expire are left out.","name":"expiresTo","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` only returns the licenses that never expire, `false` only the ones with an expiration date.","example":"true"},"required":false,"description":"`true` only returns the licenses that never expire, `false` only the ones with an expiration date.","name":"neverExpires","in":"query"},{"schema":{"type":"string","description":"Only returns the licenses paid in this currency.","example":"USD"},"required":false,"description":"Only returns the licenses paid in this currency.","name":"currency","in":"query"},{"schema":{"type":"number","description":"Only returns the licenses paid exactly this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","example":49.99},"required":false,"description":"Only returns the licenses paid exactly this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","name":"price","in":"query"},{"schema":{"type":"number","description":"Only returns the licenses paid at least this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","example":49.99},"required":false,"description":"Only returns the licenses paid at least this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","name":"priceMin","in":"query"},{"schema":{"type":"number","description":"Only returns the licenses paid at most this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","example":49.99},"required":false,"description":"Only returns the licenses paid at most this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","name":"priceMax","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` only returns the licenses with a price, `false` only the ones without.","example":"true"},"required":false,"description":"`true` only returns the licenses with a price, `false` only the ones without.","name":"hasPrice","in":"query"}],"responses":{"200":{"description":"One page of the licenses of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst licenseList = await licenses.listLicenses({ productId: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tlicenseList, _, err := client.LicensesAPI.ListLicenses(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(licenseList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    license_list = licenses.list_licenses(product_id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nlicense_list = licenses.list_licenses(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.LicenseList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        LicenseList licenseList = licenses.listLicenses(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nvar licenseList = await licenses.ListLicensesAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$licenseList = $licenses->listLicenses(\"x7Kp2QaZ\");\n"}]},"post":{"tags":["Licenses"],"operationId":"createLicense","summary":"Create a license","description":"Without a `key`, the license gets a random one, like `7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF`: 5 groups of 5 characters separated by dashes, each character an upper case letter or a digit other than `O`, `0`, `I` and `1`. That's 32 possible characters encoding 5 bits each, for 125 random bits.\n\nWithout a `policyId`, the license follows the product's default policy.\n\nWithout an `expiresAt`, the license expires after the duration of its policy, or never when the policy has none. `expiresAt: null` makes it never expire.\n\nWithout a `price`, the price paid for the license is unknown: it's left out of the revenue stats.\n\nThe values of `maxVersion` left out are taken from the max version of the policy: its hard-coded version, or the times after the creation of the license its versions lock.\n\nThe license belongs to the product's customer with the given `email`, which is created when there's none.\n\nWith `sendKey: true`, the key is emailed to the customer once the license is created.\n\nThe license copies the settings of its policy when it's created: later changes to the policy don't affect it. Its key, policy and customer can't be changed afterwards.\n\n**Required role permission**: `license:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["license:create"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateLicense"}}}},"responses":{"201":{"description":"Created license","content":{"application/json":{"schema":{"$ref":"#/components/schemas/License"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: product not found. `policy_not_found`: the product has no policy with this `policyId`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`key_taken`: key already used by another license of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst license = await licenses.createLicense({\n  productId: \"x7Kp2QaZ\",\n  createLicense: {\n    email: \"jane@example.com\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tlicense, _, err := client.LicensesAPI.CreateLicense(ctx, \"x7Kp2QaZ\").\n\t\tCreateLicense(*licensemanager.NewCreateLicense(\"jane@example.com\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(license)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    license = licenses.create_license(\n        product_id=\"x7Kp2QaZ\",\n        create_license=licensemanager.CreateLicense(email=\"jane@example.com\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nlicense = licenses.create_license(\"x7Kp2QaZ\", LicenseManager::CreateLicense.new(email: \"jane@example.com\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.CreateLicense;\nimport dev.licensemanager.model.License;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        CreateLicense createLicense = new CreateLicense()\n            .email(\"jane@example.com\");\n        License license = licenses.createLicense(\"x7Kp2QaZ\", createLicense).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nvar license = await licenses.CreateLicenseAsync(\n    \"x7Kp2QaZ\",\n    new CreateLicense(email: \"jane@example.com\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreateLicense;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$license = $licenses->createLicense(\"x7Kp2QaZ\", new CreateLicense([\n    \"email\" => \"jane@example.com\",\n]));\n"}]}},"/v1/customers/{customerId}/licenses":{"get":{"tags":["Licenses"],"operationId":"listCustomerLicenses","summary":"List the licenses of a customer","description":"Sorting by `lastActivatedAt` puts the licenses never activated last in both orders. Sorting by `price` compares the amounts whatever their currency, and puts the licenses without a price last in both orders.\n\n**Token access**: customer tokens with the `license:read` permission (or the matching write one). A customer token reaches its own licenses.","security":[{"apiKey":[]},{"session":[]},{"token":["license:read"]}],"parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"customerId","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["key","-key","createdAt","-createdAt","expiresAt","-expiresAt","maxMachines","-maxMachines","maxOfflineDurationSeconds","-maxOfflineDurationSeconds","lastActivatedAt","-lastActivatedAt","lockMajorAt","-lockMajorAt","lockMinorAt","-lockMinorAt","updatedAt","-updatedAt","price","-price"],"default":"-createdAt","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","example":"-createdAt"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","name":"sort","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive text the key contains.","example":"X9ZPA"},"required":false,"description":"Case-insensitive text the key contains.","name":"search","in":"query"},{"schema":{"type":"string","description":"Only returns the license with this exact key, case included. Keys of test products start with `TEST-`.","example":"7KQ2M-X9ZPA-H4TRC-WN6EY-B3JDF"},"required":false,"description":"Only returns the license with this exact key, case included. Keys of test products start with `TEST-`.","name":"key","in":"query"},{"schema":{"type":"string","description":"Only returns the licenses following this policy.","example":"p4Rt8LmQ"},"required":false,"description":"Only returns the licenses following this policy.","name":"policyId","in":"query"},{"schema":{"type":"string","description":"Only returns the licenses with at least one active machine running this version of the product.","example":"2.3.1"},"required":false,"description":"Only returns the licenses with at least one active machine running this version of the product.","name":"machineVersion","in":"query"},{"schema":{"allOf":[{"$ref":"#/components/schemas/LicenseStatus"},{"description":"Only returns the licenses with this status."}]},"required":false,"description":"Only returns the licenses with this status.","name":"status","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses created at or after this date.","example":"2026-01-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses created at or after this date.","name":"createdFrom","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses created at or before this date.","example":"2026-02-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses created at or before this date.","name":"createdTo","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses last activated at or after this date. Licenses never activated are left out.","example":"2026-01-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses last activated at or after this date. Licenses never activated are left out.","name":"lastActivatedFrom","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses last activated at or before this date. Licenses never activated are left out.","example":"2026-02-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses last activated at or before this date. Licenses never activated are left out.","name":"lastActivatedTo","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` only returns the licenses never activated, `false` only the ones activated at least once.","example":"true"},"required":false,"description":"`true` only returns the licenses never activated, `false` only the ones activated at least once.","name":"neverActivated","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses expiring at or after this date. Licenses that never expire are left out.","example":"2026-01-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses expiring at or after this date. Licenses that never expire are left out.","name":"expiresFrom","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the licenses expiring at or before this date. Licenses that never expire are left out.","example":"2026-02-01T00:00:00.000Z"},"required":false,"description":"Only returns the licenses expiring at or before this date. Licenses that never expire are left out.","name":"expiresTo","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` only returns the licenses that never expire, `false` only the ones with an expiration date.","example":"true"},"required":false,"description":"`true` only returns the licenses that never expire, `false` only the ones with an expiration date.","name":"neverExpires","in":"query"},{"schema":{"type":"string","description":"Only returns the licenses paid in this currency.","example":"USD"},"required":false,"description":"Only returns the licenses paid in this currency.","name":"currency","in":"query"},{"schema":{"type":"number","description":"Only returns the licenses paid exactly this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","example":49.99},"required":false,"description":"Only returns the licenses paid exactly this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","name":"price","in":"query"},{"schema":{"type":"number","description":"Only returns the licenses paid at least this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","example":49.99},"required":false,"description":"Only returns the licenses paid at least this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","name":"priceMin","in":"query"},{"schema":{"type":"number","description":"Only returns the licenses paid at most this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","example":49.99},"required":false,"description":"Only returns the licenses paid at most this amount, in major units of its currency: combine with `currency` to compare amounts of one currency. Licenses without a price are left out.","name":"priceMax","in":"query"},{"schema":{"type":"string","enum":["true","false"],"description":"`true` only returns the licenses with a price, `false` only the ones without.","example":"true"},"required":false,"description":"`true` only returns the licenses with a price, `false` only the ones without.","name":"hasPrice","in":"query"}],"responses":{"200":{"description":"One page of the licenses of the customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst licenseList = await licenses.listCustomerLicenses({ customerId: \"c9Wd3RtE\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tlicenseList, _, err := client.LicensesAPI.ListCustomerLicenses(ctx, \"c9Wd3RtE\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(licenseList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    license_list = licenses.list_customer_licenses(customer_id=\"c9Wd3RtE\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nlicense_list = licenses.list_customer_licenses(\"c9Wd3RtE\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.LicenseList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        LicenseList licenseList = licenses.listCustomerLicenses(\"c9Wd3RtE\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nvar licenseList = await licenses.ListCustomerLicensesAsync(\"c9Wd3RtE\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$licenseList = $licenses->listCustomerLicenses(\"c9Wd3RtE\");\n"}]}},"/v1/licenses/{id}":{"get":{"tags":["Licenses"],"operationId":"getLicense","summary":"Get a license","security":[{"apiKey":[]},{"session":[]},{"token":["license:read"]}],"description":"**Token access**: customer, license, machine tokens with the `license:read` permission (or the matching write one). A token reaches the license it's scoped to, the licenses of its customer, or the license of its machine.","parameters":[{"schema":{"type":"string","example":"l3Nv8KwB"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"License","content":{"application/json":{"schema":{"$ref":"#/components/schemas/License"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"License not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst license = await licenses.getLicense({ id: \"l3Nv8KwB\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tlicense, _, err := client.LicensesAPI.GetLicense(ctx, \"l3Nv8KwB\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(license)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    license = licenses.get_license(id=\"l3Nv8KwB\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nlicense = licenses.get_license(\"l3Nv8KwB\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.License;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        License license = licenses.getLicense(\"l3Nv8KwB\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nvar license = await licenses.GetLicenseAsync(\"l3Nv8KwB\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$license = $licenses->getLicense(\"l3Nv8KwB\");\n"}]},"patch":{"tags":["Licenses"],"operationId":"updateLicense","summary":"Update a license","description":"The key, policy and customer of a license can't be changed: sending them does nothing.\n\nThe changes apply to the next validations of the key, not to the license tokens `validateKey` already returned, which stay valid until they expire. Lowering `maxMachines` doesn't deactivate machines: the ones already active keep validating, and new ones are refused until enough are deactivated.\n\n**Required role permission**: `license:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["license:update"],"parameters":[{"schema":{"type":"string","example":"l3Nv8KwB"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateLicense"}}}},"responses":{"200":{"description":"Updated license","content":{"application/json":{"schema":{"$ref":"#/components/schemas/License"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"License not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst license = await licenses.updateLicense({\n  id: \"l3Nv8KwB\",\n  updateLicense: {\n    maxMachines: 3,\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tbody := licensemanager.NewUpdateLicense()\n\tbody.SetMaxMachines(3)\n\n\tlicense, _, err := client.LicensesAPI.UpdateLicense(ctx, \"l3Nv8KwB\").\n\t\tUpdateLicense(*body).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(license)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    license = licenses.update_license(\n        id=\"l3Nv8KwB\",\n        update_license=licensemanager.UpdateLicense(max_machines=3),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nlicense = licenses.update_license(\"l3Nv8KwB\", LicenseManager::UpdateLicense.new(max_machines: 3))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.License;\nimport dev.licensemanager.model.UpdateLicense;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        UpdateLicense updateLicense = new UpdateLicense()\n            .maxMachines(3);\n        License license = licenses.updateLicense(\"l3Nv8KwB\", updateLicense).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nvar license = await licenses.UpdateLicenseAsync(\n    \"l3Nv8KwB\",\n    new UpdateLicense(maxMachines: 3)\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\UpdateLicense;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$license = $licenses->updateLicense(\"l3Nv8KwB\", new UpdateLicense([\n    \"max_machines\" => 3,\n]));\n"}]},"delete":{"tags":["Licenses"],"operationId":"deleteLicense","summary":"Delete a license","description":"Deletes the license along with its deactivated machines. A license used on active machines can't be deleted: deactivate them first. The tokens scoped to the license or its machines stop working, but the license tokens `validateKey` already returned stay valid until they expire. Its events can no longer be listed.\n\n**Required role permission**: `license:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["license:delete"],"parameters":[{"schema":{"type":"string","example":"l3Nv8KwB"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"License not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`license_in_use`: the license is used on active machines","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait licenses.deleteLicense({ id: \"l3Nv8KwB\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.LicensesAPI.DeleteLicense(ctx, \"l3Nv8KwB\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    licenses.delete_license(id=\"l3Nv8KwB\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nlicenses.delete_license(\"l3Nv8KwB\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        licenses.deleteLicense(\"l3Nv8KwB\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nawait licenses.DeleteLicenseAsync(\"l3Nv8KwB\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$licenses->deleteLicense(\"l3Nv8KwB\");\n"}]}},"/v1/licenses/{id}/stats":{"get":{"tags":["Licenses"],"operationId":"getLicenseStats","summary":"Get the stats of a license","description":"Daily number of successful activations of the license over the last 90 days, today included, per machine and per version of the application. Days are in UTC.","parameters":[{"schema":{"type":"string","example":"l3Nv8KwB"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Stats of the license","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LicenseStats"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"License not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst licenseStats = await licenses.getLicenseStats({ id: \"l3Nv8KwB\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tlicenseStats, _, err := client.LicensesAPI.GetLicenseStats(ctx, \"l3Nv8KwB\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(licenseStats)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    license_stats = licenses.get_license_stats(id=\"l3Nv8KwB\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nlicense_stats = licenses.get_license_stats(\"l3Nv8KwB\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.LicenseStats;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        LicenseStats licenseStats = licenses.getLicenseStats(\"l3Nv8KwB\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nvar licenseStats = await licenses.GetLicenseStatsAsync(\"l3Nv8KwB\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$licenseStats = $licenses->getLicenseStats(\"l3Nv8KwB\");\n"}]}},"/v1/licenses/send-keys":{"post":{"tags":["Licenses"],"operationId":"sendLicenseKeys","summary":"Email license keys to their customers","description":"Emails each customer the keys of its licenses among `ids`, with their expiration date: one email per customer, whatever their number of licenses. The licenses can belong to different products of the organization.\n\nTest products only email the members of the organization, so testing never emails real customers: nothing is sent when a license of a test product belongs to a customer whose email isn't a member's.\n\n**Required role permission**: `license:send` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["license:send"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendLicenseKeys"}}}},"responses":{"204":{"description":"Keys emailed"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: one of the licenses wasn't found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`test_recipient_not_member`: a license of a test product belongs to a customer whose email isn't a member's of the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait licenses.sendLicenseKeys({\n  sendLicenseKeys: {\n    ids: [\"l3Nv8KwB\"],\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.LicensesAPI.SendLicenseKeys(ctx).\n\t\tSendLicenseKeys(*licensemanager.NewSendLicenseKeys([]string{\"l3Nv8KwB\"})).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    licenses.send_license_keys(\n        send_license_keys=licensemanager.SendLicenseKeys(ids=[\"l3Nv8KwB\"]),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nlicenses.send_license_keys(LicenseManager::SendLicenseKeys.new(ids: [\"l3Nv8KwB\"]))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.SendLicenseKeys;\nimport java.util.Arrays;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        SendLicenseKeys sendLicenseKeys = new SendLicenseKeys()\n            .ids(Arrays.asList(\"l3Nv8KwB\"));\n        licenses.sendLicenseKeys(sendLicenseKeys).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using System.Collections.Generic;\nusing LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nawait licenses.SendLicenseKeysAsync(\n    new SendLicenseKeys(ids: new List<string> { \"l3Nv8KwB\" })\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\SendLicenseKeys;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$licenses->sendLicenseKeys(new SendLicenseKeys([\n    \"ids\" => [\"l3Nv8KwB\"],\n]));\n"}]}},"/v1/licenses/{licenseId}/machines":{"get":{"tags":["Machines"],"operationId":"listMachines","summary":"List the machines of a license","security":[{"apiKey":[]},{"session":[]},{"token":["machine:read"]}],"description":"**Token access**: customer, license tokens with the `machine:read` permission (or the matching write one). A token reaches the license it's scoped to, or the licenses of its customer.","parameters":[{"schema":{"type":"string","example":"l3Nv8KwB"},"required":true,"name":"licenseId","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["name","-name","platform","-platform","createdAt","-createdAt","updatedAt","-updatedAt"],"default":"-createdAt","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","example":"-createdAt"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","name":"sort","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive text the fingerprint or name contains.","example":"macbook"},"required":false,"description":"Case-insensitive text the fingerprint or name contains.","name":"search","in":"query"},{"schema":{"type":"string","description":"Only returns the machine with this exact fingerprint.","example":"4c:32:75:8f:9a:1e"},"required":false,"description":"Only returns the machine with this exact fingerprint.","name":"fingerprint","in":"query"},{"schema":{"type":"string","enum":["active","deactivated"],"description":"Only returns the machines with this status.","example":"active"},"required":false,"description":"Only returns the machines with this status.","name":"status","in":"query"}],"responses":{"200":{"description":"One page of the machines of the license","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MachineList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"License not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, MachinesApi } from \"@licenseman/sdk\";\n\nconst machines = new MachinesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst machineList = await machines.listMachines({ licenseId: \"l3Nv8KwB\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tmachineList, _, err := client.MachinesAPI.ListMachines(ctx, \"l3Nv8KwB\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(machineList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    machines = licensemanager.MachinesApi(api_client)\n    machine_list = machines.list_machines(license_id=\"l3Nv8KwB\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nmachines = LicenseManager::MachinesApi.new\nmachine_list = machines.list_machines(\"l3Nv8KwB\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.MachinesApi;\nimport dev.licensemanager.model.MachineList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        MachinesApi machines = new MachinesApi(client);\n\n        MachineList machineList = machines.listMachines(\"l3Nv8KwB\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar machines = new MachinesApi(configuration);\n\nvar machineList = await machines.ListMachinesAsync(\"l3Nv8KwB\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\MachinesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$machines = new MachinesApi(config: $config);\n\n$machineList = $machines->listMachines(\"l3Nv8KwB\");\n"}]}},"/v1/machines/{id}":{"get":{"tags":["Machines"],"operationId":"getMachine","summary":"Get a machine","security":[{"apiKey":[]},{"session":[]},{"token":["machine:read"]}],"description":"**Token access**: customer, license, machine tokens with the `machine:read` permission (or the matching write one). A token reaches the machine it's scoped to, or the machines of its license or customer.","parameters":[{"schema":{"type":"string","example":"m9Tq3VhD"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Machine","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Machine"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Machine not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, MachinesApi } from \"@licenseman/sdk\";\n\nconst machines = new MachinesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst machine = await machines.getMachine({ id: \"m9Tq3VhD\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tmachine, _, err := client.MachinesAPI.GetMachine(ctx, \"m9Tq3VhD\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(machine)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    machines = licensemanager.MachinesApi(api_client)\n    machine = machines.get_machine(id=\"m9Tq3VhD\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nmachines = LicenseManager::MachinesApi.new\nmachine = machines.get_machine(\"m9Tq3VhD\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.MachinesApi;\nimport dev.licensemanager.model.Machine;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        MachinesApi machines = new MachinesApi(client);\n\n        Machine machine = machines.getMachine(\"m9Tq3VhD\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar machines = new MachinesApi(configuration);\n\nvar machine = await machines.GetMachineAsync(\"m9Tq3VhD\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\MachinesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$machines = new MachinesApi(config: $config);\n\n$machine = $machines->getMachine(\"m9Tq3VhD\");\n"}]}},"/v1/machines/{id}/deactivate":{"post":{"tags":["Machines"],"operationId":"deactivateMachine","summary":"Deactivate a machine","description":"The machine no longer counts as using the license, freeing its place when the license has a maximum number of machines. Validating the license key on the machine activates it again, unless the license is on its maximum number of machines by then. Deactivating a deactivated machine does nothing.\n\nThe license token `validateKey` returned to the machine isn't revoked: the application can keep running offline until it expires. Machines can't be deleted: they're deleted with their license.\n\n**Token access**: customer, license, machine tokens with the `machine:write` permission (or the matching write one). A token reaches the machine it's scoped to, or the machines of its license or customer.\n\n**Required role permission**: `machine:deactivate` when called with a session, granted by the member's role. API keys aren't limited by roles.","security":[{"apiKey":[]},{"session":[]},{"token":["machine:write"]}],"x-required-permissions":["machine:deactivate"],"parameters":[{"schema":{"type":"string","example":"m9Tq3VhD"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Deactivated machine","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Machine"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Machine not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, MachinesApi } from \"@licenseman/sdk\";\n\nconst machines = new MachinesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst machine = await machines.deactivateMachine({ id: \"m9Tq3VhD\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tmachine, _, err := client.MachinesAPI.DeactivateMachine(ctx, \"m9Tq3VhD\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(machine)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    machines = licensemanager.MachinesApi(api_client)\n    machine = machines.deactivate_machine(id=\"m9Tq3VhD\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nmachines = LicenseManager::MachinesApi.new\nmachine = machines.deactivate_machine(\"m9Tq3VhD\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.MachinesApi;\nimport dev.licensemanager.model.Machine;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        MachinesApi machines = new MachinesApi(client);\n\n        Machine machine = machines.deactivateMachine(\"m9Tq3VhD\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar machines = new MachinesApi(configuration);\n\nvar machine = await machines.DeactivateMachineAsync(\"m9Tq3VhD\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\MachinesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$machines = new MachinesApi(config: $config);\n\n$machine = $machines->deactivateMachine(\"m9Tq3VhD\");\n"}]}},"/v1/customers/{id}/portal-links":{"post":{"tags":["Portal"],"operationId":"createPortalLink","summary":"Create a link to the customer portal","description":"Link letting the customer see their licenses and deactivate their machines in the customer portal, without signing in. Anyone with the link can, until it expires or the customer is deleted: it can't be revoked otherwise. The token also works with the API endpoints that accept customer tokens.\n\nLinks can be created while the product's customer portal is disabled, but the portal answers `404` until it's enabled, and `sendPortalLink` refuses to email them.\n\n**Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["portalLink:create"],"parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreatePortalLink"}}}},"responses":{"201":{"description":"Created link","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalLink"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, PortalApi } from \"@licenseman/sdk\";\n\nconst portal = new PortalApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst portalLink = await portal.createPortalLink({\n  id: \"c9Wd3RtE\",\n  createPortalLink: {\n    expiresInSeconds: 604800,\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tportalLink, _, err := client.PortalAPI.CreatePortalLink(ctx, \"c9Wd3RtE\").\n\t\tCreatePortalLink(*licensemanager.NewCreatePortalLink(604800)).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(portalLink)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    portal = licensemanager.PortalApi(api_client)\n    portal_link = portal.create_portal_link(\n        id=\"c9Wd3RtE\",\n        create_portal_link=licensemanager.CreatePortalLink(expires_in_seconds=604800),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nportal = LicenseManager::PortalApi.new\nportal_link = portal.create_portal_link(\"c9Wd3RtE\", LicenseManager::CreatePortalLink.new(expires_in_seconds: 604800))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.PortalApi;\nimport dev.licensemanager.model.CreatePortalLink;\nimport dev.licensemanager.model.PortalLink;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        PortalApi portal = new PortalApi(client);\n\n        CreatePortalLink createPortalLink = new CreatePortalLink()\n            .expiresInSeconds(604800);\n        PortalLink portalLink = portal.createPortalLink(\"c9Wd3RtE\", createPortalLink).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar portal = new PortalApi(configuration);\n\nvar portalLink = await portal.CreatePortalLinkAsync(\n    \"c9Wd3RtE\",\n    new CreatePortalLink(expiresInSeconds: 604800)\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PortalApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreatePortalLink;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$portal = new PortalApi(config: $config);\n\n$portalLink = $portal->createPortalLink(\"c9Wd3RtE\", new CreatePortalLink([\n    \"expires_in_seconds\" => 604800,\n]));\n"}]}},"/v1/customers/{id}/portal-links/send":{"post":{"tags":["Portal"],"operationId":"sendPortalLink","summary":"Email a link to the customer portal to the customer","description":"Emails a link created with `createPortalLink` to the customer's email. Fails while the product's customer portal is disabled, and, in test products, when the customer's email isn't a member's of the organization: test products only email members, so testing never emails real customers.\n\n**Required role permission**: `portalLink:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["portalLink:create"],"parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendPortalLink"}}}},"responses":{"204":{"description":"Link emailed"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`portal_disabled`: the product's customer portal is disabled. `test_recipient_not_member`: the product is a test product, and the customer's email isn't a member's of the organization","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid body. `invalid_token`: the token isn't valid, has expired, or isn't a customer token of this customer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, PortalApi } from \"@licenseman/sdk\";\n\nconst portal = new PortalApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait portal.sendPortalLink({\n  id: \"c9Wd3RtE\",\n  sendPortalLink: {\n    token: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.PortalAPI.SendPortalLink(ctx, \"c9Wd3RtE\").\n\t\tSendPortalLink(*licensemanager.NewSendPortalLink(\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    portal = licensemanager.PortalApi(api_client)\n    portal.send_portal_link(\n        id=\"c9Wd3RtE\",\n        send_portal_link=licensemanager.SendPortalLink(token=\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nportal = LicenseManager::PortalApi.new\nportal.send_portal_link(\"c9Wd3RtE\", LicenseManager::SendPortalLink.new(token: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.PortalApi;\nimport dev.licensemanager.model.SendPortalLink;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        PortalApi portal = new PortalApi(client);\n\n        SendPortalLink sendPortalLink = new SendPortalLink()\n            .token(\"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…\");\n        portal.sendPortalLink(\"c9Wd3RtE\", sendPortalLink).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar portal = new PortalApi(configuration);\n\nawait portal.SendPortalLinkAsync(\n    \"c9Wd3RtE\",\n    new SendPortalLink(token: \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\PortalApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\SendPortalLink;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$portal = new PortalApi(config: $config);\n\n$portal->sendPortalLink(\"c9Wd3RtE\", new SendPortalLink([\n    \"token\" => \"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9…\",\n]));\n"}]}},"/v1/products/{productId}/releases":{"get":{"tags":["Releases"],"operationId":"listReleases","summary":"List the releases of a product","description":"Sorting by `version` compares the major, minor and patch numbers as numbers, then puts a pre-release before its stable release. Pre-releases of the same version compare as text, unlike semantic versioning: `2.0.0-beta.10` comes before `2.0.0-beta.2`. Build metadata is ignored.","parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["version","-version","releasedAt","-releasedAt","createdAt","-createdAt","activeMachineCount","-activeMachineCount"],"default":"-version","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-version`.","example":"-version"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-version`.","name":"sort","in":"query"},{"schema":{"type":"string","minLength":1,"maxLength":200,"description":"Case-insensitive text the version contains.","example":"2.3"},"required":false,"description":"Case-insensitive text the version contains.","name":"search","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the releases released at or after this date.","example":"2026-01-01T00:00:00.000Z"},"required":false,"description":"Only returns the releases released at or after this date.","name":"releasedFrom","in":"query"},{"schema":{"type":"string","format":"date-time","description":"Only returns the releases released at or before this date.","example":"2026-02-01T00:00:00.000Z"},"required":false,"description":"Only returns the releases released at or before this date.","name":"releasedTo","in":"query"},{"schema":{"type":"integer","description":"Only returns the releases running on exactly this number of active machines.","example":1},"required":false,"description":"Only returns the releases running on exactly this number of active machines.","name":"activeMachineCount","in":"query"},{"schema":{"type":"integer","description":"Only returns the releases running on at least this number of active machines.","example":1},"required":false,"description":"Only returns the releases running on at least this number of active machines.","name":"activeMachineCountMin","in":"query"},{"schema":{"type":"integer","description":"Only returns the releases running on at most this number of active machines.","example":1},"required":false,"description":"Only returns the releases running on at most this number of active machines.","name":"activeMachineCountMax","in":"query"}],"responses":{"200":{"description":"One page of the releases of the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReleaseList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ReleasesApi } from \"@licenseman/sdk\";\n\nconst releases = new ReleasesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst releaseList = await releases.listReleases({ productId: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\treleaseList, _, err := client.ReleasesAPI.ListReleases(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(releaseList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    releases = licensemanager.ReleasesApi(api_client)\n    release_list = releases.list_releases(product_id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nreleases = LicenseManager::ReleasesApi.new\nrelease_list = releases.list_releases(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ReleasesApi;\nimport dev.licensemanager.model.ReleaseList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ReleasesApi releases = new ReleasesApi(client);\n\n        ReleaseList releaseList = releases.listReleases(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar releases = new ReleasesApi(configuration);\n\nvar releaseList = await releases.ListReleasesAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ReleasesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$releases = new ReleasesApi(config: $config);\n\n$releaseList = $releases->listReleases(\"x7Kp2QaZ\");\n"}]},"post":{"tags":["Releases"],"operationId":"createRelease","summary":"Create a release","description":"Releases don't restrict which versions `validateKey` accepts: a machine can run a version without a release. They give the `latestAllowedVersion` of its `version_not_allowed` errors, among the stable releases already released, and the number of active machines running each version.\n\n**Required role permission**: `release:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["release:create"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateRelease"}}}},"responses":{"201":{"description":"Created release","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Release"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`version_taken`: version already released for the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ReleasesApi } from \"@licenseman/sdk\";\n\nconst releases = new ReleasesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst release = await releases.createRelease({\n  productId: \"x7Kp2QaZ\",\n  createRelease: {\n    version: \"2.3.1\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\trelease, _, err := client.ReleasesAPI.CreateRelease(ctx, \"x7Kp2QaZ\").\n\t\tCreateRelease(*licensemanager.NewCreateRelease(\"2.3.1\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(release)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    releases = licensemanager.ReleasesApi(api_client)\n    release = releases.create_release(\n        product_id=\"x7Kp2QaZ\",\n        create_release=licensemanager.CreateRelease(version=\"2.3.1\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nreleases = LicenseManager::ReleasesApi.new\nrelease = releases.create_release(\"x7Kp2QaZ\", LicenseManager::CreateRelease.new(version: \"2.3.1\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ReleasesApi;\nimport dev.licensemanager.model.CreateRelease;\nimport dev.licensemanager.model.Release;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ReleasesApi releases = new ReleasesApi(client);\n\n        CreateRelease createRelease = new CreateRelease()\n            .version(\"2.3.1\");\n        Release release = releases.createRelease(\"x7Kp2QaZ\", createRelease).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar releases = new ReleasesApi(configuration);\n\nvar release = await releases.CreateReleaseAsync(\n    \"x7Kp2QaZ\",\n    new CreateRelease(varVersion: \"2.3.1\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ReleasesApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreateRelease;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$releases = new ReleasesApi(config: $config);\n\n$release = $releases->createRelease(\"x7Kp2QaZ\", new CreateRelease([\n    \"version\" => \"2.3.1\",\n]));\n"}]}},"/v1/releases/{id}":{"get":{"tags":["Releases"],"operationId":"getRelease","summary":"Get a release","parameters":[{"schema":{"type":"string","example":"r4Lm8VwX"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Release","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Release"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Release not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ReleasesApi } from \"@licenseman/sdk\";\n\nconst releases = new ReleasesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst release = await releases.getRelease({ id: \"r4Lm8VwX\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\trelease, _, err := client.ReleasesAPI.GetRelease(ctx, \"r4Lm8VwX\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(release)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    releases = licensemanager.ReleasesApi(api_client)\n    release = releases.get_release(id=\"r4Lm8VwX\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nreleases = LicenseManager::ReleasesApi.new\nrelease = releases.get_release(\"r4Lm8VwX\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ReleasesApi;\nimport dev.licensemanager.model.Release;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ReleasesApi releases = new ReleasesApi(client);\n\n        Release release = releases.getRelease(\"r4Lm8VwX\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar releases = new ReleasesApi(configuration);\n\nvar release = await releases.GetReleaseAsync(\"r4Lm8VwX\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ReleasesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$releases = new ReleasesApi(config: $config);\n\n$release = $releases->getRelease(\"r4Lm8VwX\");\n"}]},"patch":{"tags":["Releases"],"operationId":"updateRelease","summary":"Update a release","x-required-permissions":["release:update"],"description":"**Required role permission**: `release:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","parameters":[{"schema":{"type":"string","example":"r4Lm8VwX"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateRelease"}}}},"responses":{"200":{"description":"Updated release","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Release"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Release not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`version_taken`: version already released for the product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ReleasesApi } from \"@licenseman/sdk\";\n\nconst releases = new ReleasesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst release = await releases.updateRelease({\n  id: \"r4Lm8VwX\",\n  updateRelease: {\n    version: \"2.3.1\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tbody := licensemanager.NewUpdateRelease()\n\tbody.SetVersion(\"2.3.1\")\n\n\trelease, _, err := client.ReleasesAPI.UpdateRelease(ctx, \"r4Lm8VwX\").\n\t\tUpdateRelease(*body).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(release)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    releases = licensemanager.ReleasesApi(api_client)\n    release = releases.update_release(\n        id=\"r4Lm8VwX\",\n        update_release=licensemanager.UpdateRelease(version=\"2.3.1\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nreleases = LicenseManager::ReleasesApi.new\nrelease = releases.update_release(\"r4Lm8VwX\", LicenseManager::UpdateRelease.new(version: \"2.3.1\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ReleasesApi;\nimport dev.licensemanager.model.Release;\nimport dev.licensemanager.model.UpdateRelease;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ReleasesApi releases = new ReleasesApi(client);\n\n        UpdateRelease updateRelease = new UpdateRelease()\n            .version(\"2.3.1\");\n        Release release = releases.updateRelease(\"r4Lm8VwX\", updateRelease).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar releases = new ReleasesApi(configuration);\n\nvar release = await releases.UpdateReleaseAsync(\n    \"r4Lm8VwX\",\n    new UpdateRelease(varVersion: \"2.3.1\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ReleasesApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\UpdateRelease;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$releases = new ReleasesApi(config: $config);\n\n$release = $releases->updateRelease(\"r4Lm8VwX\", new UpdateRelease([\n    \"version\" => \"2.3.1\",\n]));\n"}]},"delete":{"tags":["Releases"],"operationId":"deleteRelease","summary":"Delete a release","x-required-permissions":["release:delete"],"description":"**Required role permission**: `release:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.","parameters":[{"schema":{"type":"string","example":"r4Lm8VwX"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Release not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, ReleasesApi } from \"@licenseman/sdk\";\n\nconst releases = new ReleasesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait releases.deleteRelease({ id: \"r4Lm8VwX\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.ReleasesAPI.DeleteRelease(ctx, \"r4Lm8VwX\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    releases = licensemanager.ReleasesApi(api_client)\n    releases.delete_release(id=\"r4Lm8VwX\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nreleases = LicenseManager::ReleasesApi.new\nreleases.delete_release(\"r4Lm8VwX\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.ReleasesApi;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        ReleasesApi releases = new ReleasesApi(client);\n\n        releases.deleteRelease(\"r4Lm8VwX\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar releases = new ReleasesApi(configuration);\n\nawait releases.DeleteReleaseAsync(\"r4Lm8VwX\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\ReleasesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$releases = new ReleasesApi(config: $config);\n\n$releases->deleteRelease(\"r4Lm8VwX\");\n"}]}},"/v1/signing-key":{"get":{"tags":["Licenses"],"operationId":"getSigningKey","summary":"Get the organization's signing key","description":"Public key verifying the license tokens returned by `validateKey`, to embed in applications. Created the first time it's needed, and never rotated. The organization has a single key, signing the tokens of its live and test products alike: check the tokens' `aud` to tell them apart.","responses":{"200":{"description":"Signing key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SigningKey"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, LicensesApi } from \"@licenseman/sdk\";\n\nconst licenses = new LicensesApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst signingKey = await licenses.getSigningKey();\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tsigningKey, _, err := client.LicensesAPI.GetSigningKey(ctx).Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(signingKey)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    licenses = licensemanager.LicensesApi(api_client)\n    signing_key = licenses.get_signing_key()\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nlicenses = LicenseManager::LicensesApi.new\nsigning_key = licenses.get_signing_key\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.LicensesApi;\nimport dev.licensemanager.model.SigningKey;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        LicensesApi licenses = new LicensesApi(client);\n\n        SigningKey signingKey = licenses.getSigningKey().execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar licenses = new LicensesApi(configuration);\n\nvar signingKey = await licenses.GetSigningKeyAsync();\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\LicensesApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$licenses = new LicensesApi(config: $config);\n\n$signingKey = $licenses->getSigningKey();\n"}]}},"/v1/customers/{id}/tokens":{"post":{"tags":["Tokens"],"operationId":"createCustomerToken","summary":"Create a customer token","description":"Creates a token scoped to the customer, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches.\n\nA token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted.\n\n**Required role permission**: `token:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["token:create"],"parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateToken"}}}},"responses":{"201":{"description":"Created token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Customer not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, TokensApi } from \"@licenseman/sdk\";\n\nconst tokens = new TokensApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst token = await tokens.createCustomerToken({\n  id: \"c9Wd3RtE\",\n  createToken: {\n    scope: [\"license:read\", \"machine:write\"],\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\ttoken, _, err := client.TokensAPI.CreateCustomerToken(ctx, \"c9Wd3RtE\").\n\t\tCreateToken(*licensemanager.NewCreateToken([]string{\"license:read\", \"machine:write\"})).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(token)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    tokens = licensemanager.TokensApi(api_client)\n    token = tokens.create_customer_token(\n        id=\"c9Wd3RtE\",\n        create_token=licensemanager.CreateToken(scope=[\"license:read\", \"machine:write\"]),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\ntokens = LicenseManager::TokensApi.new\ntoken = tokens.create_customer_token(\"c9Wd3RtE\", LicenseManager::CreateToken.new(scope: [\"license:read\", \"machine:write\"]))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.TokensApi;\nimport dev.licensemanager.model.CreateToken;\nimport dev.licensemanager.model.Token;\nimport java.util.Arrays;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        TokensApi tokens = new TokensApi(client);\n\n        CreateToken createToken = new CreateToken()\n            .scope(Arrays.asList(CreateToken.ScopeEnum.fromValue(\"license:read\"), CreateToken.ScopeEnum.fromValue(\"machine:write\")));\n        Token token = tokens.createCustomerToken(\"c9Wd3RtE\", createToken).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using System.Collections.Generic;\nusing LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar tokens = new TokensApi(configuration);\n\nvar token = await tokens.CreateCustomerTokenAsync(\n    \"c9Wd3RtE\",\n    new CreateToken(\n        scope: new List<CreateToken.ScopeEnum> { CreateToken.ScopeEnum.Licenseread, CreateToken.ScopeEnum.Machinewrite }\n    )\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\TokensApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreateToken;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$tokens = new TokensApi(config: $config);\n\n$token = $tokens->createCustomerToken(\"c9Wd3RtE\", new CreateToken([\n    \"scope\" => [\"license:read\", \"machine:write\"],\n]));\n"}]}},"/v1/licenses/{id}/tokens":{"post":{"tags":["Tokens"],"operationId":"createLicenseToken","summary":"Create a license token","description":"Creates a token scoped to the license, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches.\n\nA token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted.\n\n**Token access**: customer tokens. A customer token creates tokens for its customer's licenses, with the permissions and at most the expiration it has.\n\n**Required role permission**: `token:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","security":[{"apiKey":[]},{"session":[]},{"token":[]}],"x-required-permissions":["token:create"],"parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateToken"}}}},"responses":{"201":{"description":"Created token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"License not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, TokensApi } from \"@licenseman/sdk\";\n\nconst tokens = new TokensApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst token = await tokens.createLicenseToken({\n  id: \"c9Wd3RtE\",\n  createToken: {\n    scope: [\"license:read\", \"machine:write\"],\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\ttoken, _, err := client.TokensAPI.CreateLicenseToken(ctx, \"c9Wd3RtE\").\n\t\tCreateToken(*licensemanager.NewCreateToken([]string{\"license:read\", \"machine:write\"})).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(token)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    tokens = licensemanager.TokensApi(api_client)\n    token = tokens.create_license_token(\n        id=\"c9Wd3RtE\",\n        create_token=licensemanager.CreateToken(scope=[\"license:read\", \"machine:write\"]),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\ntokens = LicenseManager::TokensApi.new\ntoken = tokens.create_license_token(\"c9Wd3RtE\", LicenseManager::CreateToken.new(scope: [\"license:read\", \"machine:write\"]))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.TokensApi;\nimport dev.licensemanager.model.CreateToken;\nimport dev.licensemanager.model.Token;\nimport java.util.Arrays;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        TokensApi tokens = new TokensApi(client);\n\n        CreateToken createToken = new CreateToken()\n            .scope(Arrays.asList(CreateToken.ScopeEnum.fromValue(\"license:read\"), CreateToken.ScopeEnum.fromValue(\"machine:write\")));\n        Token token = tokens.createLicenseToken(\"c9Wd3RtE\", createToken).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using System.Collections.Generic;\nusing LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar tokens = new TokensApi(configuration);\n\nvar token = await tokens.CreateLicenseTokenAsync(\n    \"c9Wd3RtE\",\n    new CreateToken(\n        scope: new List<CreateToken.ScopeEnum> { CreateToken.ScopeEnum.Licenseread, CreateToken.ScopeEnum.Machinewrite }\n    )\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\TokensApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreateToken;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$tokens = new TokensApi(config: $config);\n\n$token = $tokens->createLicenseToken(\"c9Wd3RtE\", new CreateToken([\n    \"scope\" => [\"license:read\", \"machine:write\"],\n]));\n"}]}},"/v1/machines/{id}/tokens":{"post":{"tags":["Tokens"],"operationId":"createMachineToken","summary":"Create a machine token","description":"Creates a token scoped to the machine, with the permissions of `scope`, to hand to your customers: a page of your website can then call the endpoints accepting tokens directly, without your API key. See the `token` security scheme for what a token reaches.\n\nA token can't be revoked: it works until it expires, unless the resource it's scoped to is deleted.\n\n**Token access**: customer, license tokens. A customer or license token creates tokens for the machines it reaches, with the permissions and at most the expiration it has.\n\n**Required role permission**: `token:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","security":[{"apiKey":[]},{"session":[]},{"token":[]}],"x-required-permissions":["token:create"],"parameters":[{"schema":{"type":"string","example":"c9Wd3RtE"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateToken"}}}},"responses":{"201":{"description":"Created token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Token"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Machine not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, TokensApi } from \"@licenseman/sdk\";\n\nconst tokens = new TokensApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst token = await tokens.createMachineToken({\n  id: \"c9Wd3RtE\",\n  createToken: {\n    scope: [\"license:read\", \"machine:write\"],\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\ttoken, _, err := client.TokensAPI.CreateMachineToken(ctx, \"c9Wd3RtE\").\n\t\tCreateToken(*licensemanager.NewCreateToken([]string{\"license:read\", \"machine:write\"})).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(token)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    tokens = licensemanager.TokensApi(api_client)\n    token = tokens.create_machine_token(\n        id=\"c9Wd3RtE\",\n        create_token=licensemanager.CreateToken(scope=[\"license:read\", \"machine:write\"]),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\ntokens = LicenseManager::TokensApi.new\ntoken = tokens.create_machine_token(\"c9Wd3RtE\", LicenseManager::CreateToken.new(scope: [\"license:read\", \"machine:write\"]))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.TokensApi;\nimport dev.licensemanager.model.CreateToken;\nimport dev.licensemanager.model.Token;\nimport java.util.Arrays;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        TokensApi tokens = new TokensApi(client);\n\n        CreateToken createToken = new CreateToken()\n            .scope(Arrays.asList(CreateToken.ScopeEnum.fromValue(\"license:read\"), CreateToken.ScopeEnum.fromValue(\"machine:write\")));\n        Token token = tokens.createMachineToken(\"c9Wd3RtE\", createToken).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using System.Collections.Generic;\nusing LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar tokens = new TokensApi(configuration);\n\nvar token = await tokens.CreateMachineTokenAsync(\n    \"c9Wd3RtE\",\n    new CreateToken(\n        scope: new List<CreateToken.ScopeEnum> { CreateToken.ScopeEnum.Licenseread, CreateToken.ScopeEnum.Machinewrite }\n    )\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\TokensApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreateToken;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$tokens = new TokensApi(config: $config);\n\n$token = $tokens->createMachineToken(\"c9Wd3RtE\", new CreateToken([\n    \"scope\" => [\"license:read\", \"machine:write\"],\n]));\n"}]}},"/v1/policies/{id}/events":{"get":{"tags":["Events"],"operationId":"listPolicyEvents","summary":"List the events of a policy","description":"Doesn't accept tokens: only API keys and sessions.","parameters":[{"schema":{"type":"string","example":"l3Nv8KwB"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["createdAt","-createdAt"],"default":"-createdAt","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","example":"-createdAt"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","name":"sort","in":"query"},{"schema":{"anyOf":[{"$ref":"#/components/schemas/EventType"},{"type":"array","items":{"$ref":"#/components/schemas/EventType"}}],"description":"Only returns the events of this type. Repeat it to return the events of any of these types."},"required":false,"description":"Only returns the events of this type. Repeat it to return the events of any of these types.","name":"type","in":"query"}],"responses":{"200":{"description":"One page of the events of the policy","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Policy not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, EventsApi } from \"@licenseman/sdk\";\n\nconst events = new EventsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst eventList = await events.listPolicyEvents({ id: \"l3Nv8KwB\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\teventList, _, err := client.EventsAPI.ListPolicyEvents(ctx, \"l3Nv8KwB\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(eventList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    events = licensemanager.EventsApi(api_client)\n    event_list = events.list_policy_events(id=\"l3Nv8KwB\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nevents = LicenseManager::EventsApi.new\nevent_list = events.list_policy_events(\"l3Nv8KwB\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.EventsApi;\nimport dev.licensemanager.model.EventList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        EventsApi events = new EventsApi(client);\n\n        EventList eventList = events.listPolicyEvents(\"l3Nv8KwB\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar events = new EventsApi(configuration);\n\nvar eventList = await events.ListPolicyEventsAsync(\"l3Nv8KwB\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\EventsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$events = new EventsApi(config: $config);\n\n$eventList = $events->listPolicyEvents(\"l3Nv8KwB\");\n"}]}},"/v1/licenses/{id}/events":{"get":{"tags":["Events"],"operationId":"listLicenseEvents","summary":"List the events of a license","description":"Includes the validations of the license on each of its machines. Doesn't accept tokens: only API keys and sessions.","parameters":[{"schema":{"type":"string","example":"l3Nv8KwB"},"required":true,"name":"id","in":"path"},{"schema":{"type":"integer","minimum":1,"default":1,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","example":1},"required":false,"description":"Page to return. Pages are numbered from 1: `1` is the first page. A page past the last one returns an empty `data`, not an error. Defaults to `1`.","name":"page","in":"query"},{"schema":{"type":"integer","minimum":1,"maximum":100,"default":20,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","example":20},"required":false,"description":"Maximum number of items per page, from 1 to 100. Every page holds this many items except the last one, which can hold fewer. Defaults to `20`.","name":"pageSize","in":"query"},{"schema":{"type":"string","enum":["createdAt","-createdAt"],"default":"-createdAt","description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","example":"-createdAt"},"required":false,"description":"Field to sort by, prefixed with `-` for descending order. Defaults to `-createdAt`.","name":"sort","in":"query"},{"schema":{"anyOf":[{"$ref":"#/components/schemas/EventType"},{"type":"array","items":{"$ref":"#/components/schemas/EventType"}}],"description":"Only returns the events of this type. Repeat it to return the events of any of these types."},"required":false,"description":"Only returns the events of this type. Repeat it to return the events of any of these types.","name":"type","in":"query"},{"schema":{"type":"string","description":"Only returns the events of this machine of the license.","example":"m9Tq3VhD"},"required":false,"description":"Only returns the events of this machine of the license.","name":"machineId","in":"query"}],"responses":{"200":{"description":"One page of the events of the license","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EventList"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"License not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, EventsApi } from \"@licenseman/sdk\";\n\nconst events = new EventsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst eventList = await events.listLicenseEvents({ id: \"l3Nv8KwB\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\teventList, _, err := client.EventsAPI.ListLicenseEvents(ctx, \"l3Nv8KwB\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(eventList)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    events = licensemanager.EventsApi(api_client)\n    event_list = events.list_license_events(id=\"l3Nv8KwB\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nevents = LicenseManager::EventsApi.new\nevent_list = events.list_license_events(\"l3Nv8KwB\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.EventsApi;\nimport dev.licensemanager.model.EventList;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        EventsApi events = new EventsApi(client);\n\n        EventList eventList = events.listLicenseEvents(\"l3Nv8KwB\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar events = new EventsApi(configuration);\n\nvar eventList = await events.ListLicenseEventsAsync(\"l3Nv8KwB\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\EventsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$events = new EventsApi(config: $config);\n\n$eventList = $events->listLicenseEvents(\"l3Nv8KwB\");\n"}]}},"/v1/products/{productId}/integrations/stripe":{"get":{"tags":["Integrations"],"operationId":"getStripeIntegration","summary":"Get the Stripe integration of a product","description":"The organization connects one Stripe account for its live products, and one in test mode for its test products. Its mappings tell which Stripe prices create licenses of the product. Doesn't accept tokens: only API keys and sessions.","parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"responses":{"200":{"description":"Stripe integration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeIntegration"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, IntegrationsApi } from \"@licenseman/sdk\";\n\nconst integrations = new IntegrationsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst stripeIntegration = await integrations.getStripeIntegration({ productId: \"x7Kp2QaZ\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tstripeIntegration, _, err := client.IntegrationsAPI.GetStripeIntegration(ctx, \"x7Kp2QaZ\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(stripeIntegration)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    integrations = licensemanager.IntegrationsApi(api_client)\n    stripe_integration = integrations.get_stripe_integration(product_id=\"x7Kp2QaZ\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nintegrations = LicenseManager::IntegrationsApi.new\nstripe_integration = integrations.get_stripe_integration(\"x7Kp2QaZ\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.IntegrationsApi;\nimport dev.licensemanager.model.StripeIntegration;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        IntegrationsApi integrations = new IntegrationsApi(client);\n\n        StripeIntegration stripeIntegration = integrations.getStripeIntegration(\"x7Kp2QaZ\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar integrations = new IntegrationsApi(configuration);\n\nvar stripeIntegration = await integrations.GetStripeIntegrationAsync(\"x7Kp2QaZ\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\IntegrationsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$integrations = new IntegrationsApi(config: $config);\n\n$stripeIntegration = $integrations->getStripeIntegration(\"x7Kp2QaZ\");\n"}]},"put":{"tags":["Integrations"],"operationId":"connectStripe","summary":"Connect Stripe","description":"Connects the Stripe account of the API key for the organization's products of the product's mode, or replaces the key of the existing connection. Checks the key works and has the required permissions, then creates a webhook endpoint on the account, telling the app about payments. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:create` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["integration:create"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConnectStripe"}}}},"responses":{"200":{"description":"Stripe integration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/StripeIntegration"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Product not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`webhook_url_unreachable`: Stripe can't reach the server's webhook URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid body. `invalid_api_key`: not a Stripe secret or restricted key, or Stripe rejected it. `key_mode_mismatch`: a test mode key for a live product, or the opposite. `missing_permission`: the key lacks required permissions, listed in the message","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`provider_unavailable`: Stripe couldn't be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, IntegrationsApi } from \"@licenseman/sdk\";\n\nconst integrations = new IntegrationsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst stripeIntegration = await integrations.connectStripe({\n  productId: \"x7Kp2QaZ\",\n  connectStripe: {\n    apiKey: \"rk_live_51Nv0FG…\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tstripeIntegration, _, err := client.IntegrationsAPI.ConnectStripe(ctx, \"x7Kp2QaZ\").\n\t\tConnectStripe(*licensemanager.NewConnectStripe(\"rk_live_51Nv0FG…\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(stripeIntegration)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    integrations = licensemanager.IntegrationsApi(api_client)\n    stripe_integration = integrations.connect_stripe(\n        product_id=\"x7Kp2QaZ\",\n        connect_stripe=licensemanager.ConnectStripe(api_key=\"rk_live_51Nv0FG…\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nintegrations = LicenseManager::IntegrationsApi.new\nstripe_integration = integrations.connect_stripe(\"x7Kp2QaZ\", LicenseManager::ConnectStripe.new(api_key: \"rk_live_51Nv0FG…\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.IntegrationsApi;\nimport dev.licensemanager.model.ConnectStripe;\nimport dev.licensemanager.model.StripeIntegration;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        IntegrationsApi integrations = new IntegrationsApi(client);\n\n        ConnectStripe connectStripe = new ConnectStripe()\n            .apiKey(\"rk_live_51Nv0FG…\");\n        StripeIntegration stripeIntegration = integrations.connectStripe(\"x7Kp2QaZ\", connectStripe).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar integrations = new IntegrationsApi(configuration);\n\nvar stripeIntegration = await integrations.ConnectStripeAsync(\n    \"x7Kp2QaZ\",\n    new ConnectStripe(apiKey: \"rk_live_51Nv0FG…\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\IntegrationsApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\ConnectStripe;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$integrations = new IntegrationsApi(config: $config);\n\n$stripeIntegration = $integrations->connectStripe(\"x7Kp2QaZ\", new ConnectStripe([\n    \"api_key\" => \"rk_live_51Nv0FG…\",\n]));\n"}]}},"/v1/integrations/{id}":{"delete":{"tags":["Integrations"],"operationId":"disconnectIntegration","summary":"Disconnect an integration","description":"Deletes the webhook endpoint from the Stripe account first, then the integration with its mappings, for every product. The endpoint is skipped when it's already gone or the key no longer works; otherwise, when it can't be deleted, the integration is kept. The licenses it created stay. Revoke the API key in Stripe afterwards. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:delete` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["integration:delete"],"parameters":[{"schema":{"type":"string","example":"i8Fz4QnRt"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Disconnected"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Integration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`missing_permission`: the key can't delete the webhook endpoint","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`provider_unavailable`: Stripe couldn't be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, IntegrationsApi } from \"@licenseman/sdk\";\n\nconst integrations = new IntegrationsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait integrations.disconnectIntegration({ id: \"i8Fz4QnRt\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.IntegrationsAPI.DisconnectIntegration(ctx, \"i8Fz4QnRt\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    integrations = licensemanager.IntegrationsApi(api_client)\n    integrations.disconnect_integration(id=\"i8Fz4QnRt\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nintegrations = LicenseManager::IntegrationsApi.new\nintegrations.disconnect_integration(\"i8Fz4QnRt\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.IntegrationsApi;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        IntegrationsApi integrations = new IntegrationsApi(client);\n\n        integrations.disconnectIntegration(\"i8Fz4QnRt\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar integrations = new IntegrationsApi(configuration);\n\nawait integrations.DisconnectIntegrationAsync(\"i8Fz4QnRt\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\IntegrationsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$integrations = new IntegrationsApi(config: $config);\n\n$integrations->disconnectIntegration(\"i8Fz4QnRt\");\n"}]}},"/v1/integrations/{id}/check":{"post":{"tags":["Integrations"],"operationId":"checkIntegration","summary":"Check an integration","description":"Checks right away, as done every day, that the API key still works and can manage the webhook endpoint, which is pointed at the server's webhook URL again (or created again when it was deleted). Updates the status. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["integration:update"],"parameters":[{"schema":{"type":"string","example":"i8Fz4QnRt"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Checked integration","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Integration"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Integration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`webhook_url_unreachable`: Stripe can't reach the server's webhook URL","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`provider_unavailable`: Stripe couldn't be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, IntegrationsApi } from \"@licenseman/sdk\";\n\nconst integrations = new IntegrationsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst integration = await integrations.checkIntegration({ id: \"i8Fz4QnRt\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tintegration, _, err := client.IntegrationsAPI.CheckIntegration(ctx, \"i8Fz4QnRt\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(integration)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    integrations = licensemanager.IntegrationsApi(api_client)\n    integration = integrations.check_integration(id=\"i8Fz4QnRt\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nintegrations = LicenseManager::IntegrationsApi.new\nintegration = integrations.check_integration(\"i8Fz4QnRt\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.IntegrationsApi;\nimport dev.licensemanager.model.Integration;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        IntegrationsApi integrations = new IntegrationsApi(client);\n\n        Integration integration = integrations.checkIntegration(\"i8Fz4QnRt\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar integrations = new IntegrationsApi(configuration);\n\nvar integration = await integrations.CheckIntegrationAsync(\"i8Fz4QnRt\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\IntegrationsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$integrations = new IntegrationsApi(config: $config);\n\n$integration = $integrations->checkIntegration(\"i8Fz4QnRt\");\n"}]}},"/v1/integrations/{id}/stripe/prices":{"get":{"tags":["Integrations"],"operationId":"listStripePrices","summary":"List the Stripe prices of an integration","description":"Active one-time prices of active products of the Stripe account, the ones that can be mapped, up to 500. Doesn't accept tokens: only API keys and sessions.","parameters":[{"schema":{"type":"string","example":"i8Fz4QnRt"},"required":true,"name":"id","in":"path"}],"responses":{"200":{"description":"Prices","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"$ref":"#/components/schemas/StripePrice"}}},"required":["data"]}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Integration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`provider_unavailable`: Stripe couldn't be reached, or refused the request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, IntegrationsApi } from \"@licenseman/sdk\";\n\nconst integrations = new IntegrationsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst response = await integrations.listStripePrices({ id: \"i8Fz4QnRt\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tresponse, _, err := client.IntegrationsAPI.ListStripePrices(ctx, \"i8Fz4QnRt\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(response)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    integrations = licensemanager.IntegrationsApi(api_client)\n    response = integrations.list_stripe_prices(id=\"i8Fz4QnRt\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nintegrations = LicenseManager::IntegrationsApi.new\nresponse = integrations.list_stripe_prices(\"i8Fz4QnRt\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.IntegrationsApi;\nimport dev.licensemanager.model.ListStripePrices200Response;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        IntegrationsApi integrations = new IntegrationsApi(client);\n\n        ListStripePrices200Response response = integrations.listStripePrices(\"i8Fz4QnRt\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar integrations = new IntegrationsApi(configuration);\n\nvar response = await integrations.ListStripePricesAsync(\"i8Fz4QnRt\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\IntegrationsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$integrations = new IntegrationsApi(config: $config);\n\n$response = $integrations->listStripePrices(\"i8Fz4QnRt\");\n"}]}},"/v1/products/{productId}/integrations/stripe/mappings":{"post":{"tags":["Integrations"],"operationId":"createStripeMapping","summary":"Map a Stripe price to a policy","description":"Paying the price then creates licenses of the product with the policy: one per unit bought. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["integration:update"],"parameters":[{"schema":{"type":"string","example":"x7Kp2QaZ"},"required":true,"name":"productId","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateIntegrationMapping"}}}},"responses":{"201":{"description":"Created mapping","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationMapping"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: product not found. `policy_not_found`: the product has no policy with this `policyId`. `price_not_found`: the Stripe account has no price with this `stripePriceId`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"`not_connected`: Stripe isn't connected in the product's mode. `price_mapped`: the price already creates licenses of a product","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid body. `price_unusable`: the price is archived, or isn't a one-time price","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"`provider_unavailable`: Stripe couldn't be reached","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, IntegrationsApi } from \"@licenseman/sdk\";\n\nconst integrations = new IntegrationsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst integrationMapping = await integrations.createStripeMapping({\n  productId: \"x7Kp2QaZ\",\n  createIntegrationMapping: {\n    stripePriceId: \"price_1MoBy5LkdIwHu7ix\",\n    policyId: \"p4Rt8LmQ\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tintegrationMapping, _, err := client.IntegrationsAPI.CreateStripeMapping(ctx, \"x7Kp2QaZ\").\n\t\tCreateIntegrationMapping(*licensemanager.NewCreateIntegrationMapping(\"price_1MoBy5LkdIwHu7ix\", \"p4Rt8LmQ\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(integrationMapping)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    integrations = licensemanager.IntegrationsApi(api_client)\n    integration_mapping = integrations.create_stripe_mapping(\n        product_id=\"x7Kp2QaZ\",\n        create_integration_mapping=licensemanager.CreateIntegrationMapping(stripe_price_id=\"price_1MoBy5LkdIwHu7ix\", policy_id=\"p4Rt8LmQ\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nintegrations = LicenseManager::IntegrationsApi.new\nintegration_mapping = integrations.create_stripe_mapping(\"x7Kp2QaZ\", LicenseManager::CreateIntegrationMapping.new(stripe_price_id: \"price_1MoBy5LkdIwHu7ix\", policy_id: \"p4Rt8LmQ\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.IntegrationsApi;\nimport dev.licensemanager.model.CreateIntegrationMapping;\nimport dev.licensemanager.model.IntegrationMapping;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        IntegrationsApi integrations = new IntegrationsApi(client);\n\n        CreateIntegrationMapping createIntegrationMapping = new CreateIntegrationMapping()\n            .stripePriceId(\"price_1MoBy5LkdIwHu7ix\")\n            .policyId(\"p4Rt8LmQ\");\n        IntegrationMapping integrationMapping = integrations.createStripeMapping(\"x7Kp2QaZ\", createIntegrationMapping).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar integrations = new IntegrationsApi(configuration);\n\nvar integrationMapping = await integrations.CreateStripeMappingAsync(\n    \"x7Kp2QaZ\",\n    new CreateIntegrationMapping(\n        stripePriceId: \"price_1MoBy5LkdIwHu7ix\",\n        policyId: \"p4Rt8LmQ\"\n    )\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\IntegrationsApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\CreateIntegrationMapping;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$integrations = new IntegrationsApi(config: $config);\n\n$integrationMapping = $integrations->createStripeMapping(\"x7Kp2QaZ\", new CreateIntegrationMapping([\n    \"stripe_price_id\" => \"price_1MoBy5LkdIwHu7ix\",\n    \"policy_id\" => \"p4Rt8LmQ\",\n]));\n"}]}},"/v1/integration-mappings/{id}":{"patch":{"tags":["Integrations"],"operationId":"updateStripeMapping","summary":"Change the policy of a mapping","description":"Only affects the licenses created afterwards. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["integration:update"],"parameters":[{"schema":{"type":"string","example":"i8Fz4QnRt"},"required":true,"name":"id","in":"path"}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/UpdateIntegrationMapping"}}}},"responses":{"200":{"description":"Updated mapping","content":{"application/json":{"schema":{"$ref":"#/components/schemas/IntegrationMapping"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"`not_found`: mapping not found. `policy_not_found`: its product has no policy with this `policyId`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, IntegrationsApi } from \"@licenseman/sdk\";\n\nconst integrations = new IntegrationsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nconst integrationMapping = await integrations.updateStripeMapping({\n  id: \"i8Fz4QnRt\",\n  updateIntegrationMapping: {\n    policyId: \"p4Rt8LmQ\",\n  },\n});\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\tintegrationMapping, _, err := client.IntegrationsAPI.UpdateStripeMapping(ctx, \"i8Fz4QnRt\").\n\t\tUpdateIntegrationMapping(*licensemanager.NewUpdateIntegrationMapping(\"p4Rt8LmQ\")).\n\t\tExecute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n\tlog.Println(integrationMapping)\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    integrations = licensemanager.IntegrationsApi(api_client)\n    integration_mapping = integrations.update_stripe_mapping(\n        id=\"i8Fz4QnRt\",\n        update_integration_mapping=licensemanager.UpdateIntegrationMapping(policy_id=\"p4Rt8LmQ\"),\n    )\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nintegrations = LicenseManager::IntegrationsApi.new\nintegration_mapping = integrations.update_stripe_mapping(\"i8Fz4QnRt\", LicenseManager::UpdateIntegrationMapping.new(policy_id: \"p4Rt8LmQ\"))\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.IntegrationsApi;\nimport dev.licensemanager.model.IntegrationMapping;\nimport dev.licensemanager.model.UpdateIntegrationMapping;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        IntegrationsApi integrations = new IntegrationsApi(client);\n\n        UpdateIntegrationMapping updateIntegrationMapping = new UpdateIntegrationMapping()\n            .policyId(\"p4Rt8LmQ\");\n        IntegrationMapping integrationMapping = integrations.updateStripeMapping(\"i8Fz4QnRt\", updateIntegrationMapping).execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\nusing LicenseManager.Model;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar integrations = new IntegrationsApi(configuration);\n\nvar integrationMapping = await integrations.UpdateStripeMappingAsync(\n    \"i8Fz4QnRt\",\n    new UpdateIntegrationMapping(policyId: \"p4Rt8LmQ\")\n);\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\IntegrationsApi;\nuse LicenseManager\\Configuration;\nuse LicenseManager\\Model\\UpdateIntegrationMapping;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$integrations = new IntegrationsApi(config: $config);\n\n$integrationMapping = $integrations->updateStripeMapping(\"i8Fz4QnRt\", new UpdateIntegrationMapping([\n    \"policy_id\" => \"p4Rt8LmQ\",\n]));\n"}]},"delete":{"tags":["Integrations"],"operationId":"deleteStripeMapping","summary":"Delete a mapping","description":"Paying the price no longer creates licenses. The licenses it created stay. Doesn't accept tokens: only API keys and sessions.\n\n**Required role permission**: `integration:update` when called with a session, granted by the member's role. API keys aren't limited by roles.","x-required-permissions":["integration:update"],"parameters":[{"schema":{"type":"string","example":"i8Fz4QnRt"},"required":true,"name":"id","in":"path"}],"responses":{"204":{"description":"Deleted"},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Mapping not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}},"x-codeSamples":[{"lang":"typescript","label":"TypeScript SDK","source":"import { Configuration, IntegrationsApi } from \"@licenseman/sdk\";\n\nconst integrations = new IntegrationsApi(\n  new Configuration({ apiKey: process.env.LICENSEMANAGER_API_KEY }),\n);\n\nawait integrations.deleteStripeMapping({ id: \"i8Fz4QnRt\" });\n"},{"lang":"go","label":"Go SDK","source":"package main\n\nimport (\n\t\"context\"\n\t\"log\"\n\t\"os\"\n\n\tlicensemanager \"github.com/licenseman/licensemanager-go\"\n)\n\nfunc main() {\n\tclient := licensemanager.NewAPIClient(licensemanager.NewConfiguration())\n\tctx := context.WithValue(context.Background(), licensemanager.ContextAPIKeys, map[string]licensemanager.APIKey{\n\t\t\"apiKey\": {Key: os.Getenv(\"LICENSEMANAGER_API_KEY\")},\n\t})\n\n\t_, err := client.IntegrationsAPI.DeleteStripeMapping(ctx, \"i8Fz4QnRt\").Execute()\n\tif err != nil {\n\t\tlog.Fatal(err)\n\t}\n}\n"},{"lang":"python","label":"Python SDK","source":"import os\n\nimport licensemanager\n\nconfiguration = licensemanager.Configuration(\n    api_key={\"apiKey\": os.environ[\"LICENSEMANAGER_API_KEY\"]},\n)\n\nwith licensemanager.ApiClient(configuration) as api_client:\n    integrations = licensemanager.IntegrationsApi(api_client)\n    integrations.delete_stripe_mapping(id=\"i8Fz4QnRt\")\n"},{"lang":"ruby","label":"Ruby SDK","source":"require \"license_manager\"\n\nLicenseManager.configure do |config|\n  config.api_key[\"x-api-key\"] = ENV.fetch(\"LICENSEMANAGER_API_KEY\")\nend\n\nintegrations = LicenseManager::IntegrationsApi.new\nintegrations.delete_stripe_mapping(\"i8Fz4QnRt\")\n"},{"lang":"java","label":"Java SDK","source":"import dev.licensemanager.ApiClient;\nimport dev.licensemanager.api.IntegrationsApi;\n\npublic class Example {\n    public static void main(String[] args) throws Exception {\n        ApiClient client = new ApiClient();\n        client.setApiKey(System.getenv(\"LICENSEMANAGER_API_KEY\"));\n        IntegrationsApi integrations = new IntegrationsApi(client);\n\n        integrations.deleteStripeMapping(\"i8Fz4QnRt\").execute();\n    }\n}\n"},{"lang":"csharp","label":"C# SDK","source":"using LicenseManager.Api;\nusing LicenseManager.Client;\n\nvar configuration = new Configuration();\nconfiguration.AddApiKey(\"x-api-key\", Environment.GetEnvironmentVariable(\"LICENSEMANAGER_API_KEY\"));\nvar integrations = new IntegrationsApi(configuration);\n\nawait integrations.DeleteStripeMappingAsync(\"i8Fz4QnRt\");\n"},{"lang":"php","label":"PHP SDK","source":"<?php\n\nrequire __DIR__ . \"/vendor/autoload.php\";\n\nuse LicenseManager\\Api\\IntegrationsApi;\nuse LicenseManager\\Configuration;\n\n$config = (new Configuration())\n    ->setApiKey(\"x-api-key\", getenv(\"LICENSEMANAGER_API_KEY\"));\n$integrations = new IntegrationsApi(config: $config);\n\n$integrations->deleteStripeMapping(\"i8Fz4QnRt\");\n"}]}},"/v1/billing":{"get":{"tags":["Billing"],"operationId":"getBilling","summary":"Get the organization's plan and usage","security":[{"session":[]}],"responses":{"200":{"description":"Plan, limits and usage","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Billing"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/api-requests":{"get":{"tags":["Billing"],"operationId":"getApiRequestsSeries","summary":"Get the organization's daily API requests","description":"API requests made with an API key or a token, and license key validations, by product and UTC day. Requests that don't target a product have a null `productId`.","security":[{"session":[]}],"parameters":[{"schema":{"type":"integer","minimum":1,"maximum":90,"default":30},"required":false,"name":"days","in":"query"}],"responses":{"200":{"description":"Daily API requests","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiRequestsSeries"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/change-plan":{"post":{"tags":["Billing"],"operationId":"changePlan","summary":"Change the organization's plan","description":"Upgrades, and switches from monthly to yearly billing, apply right away and are prorated. Downgrades, and switches from yearly to monthly billing, apply at the end of the current period. Choosing the current plan again cancels the change planned at the end of the period.\n\nReturns the URL to send the user to: Stripe Checkout for a first subscription, the Stripe portal to confirm an immediate change or a cancellation, the billing page otherwise. Owners and admins only.","security":[{"session":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["free","startup","standard"]},"interval":{"$ref":"#/components/schemas/BillingInterval"}},"required":["plan"]}}}},"responses":{"200":{"description":"Where to send the user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingRedirect"}}}},"400":{"description":"`billing_disabled`, `custom_plan`, `already_on_plan`, `no_customer`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/billing/portal":{"post":{"tags":["Billing"],"operationId":"createBillingPortal","summary":"Open the Stripe billing portal","description":"Returns the URL of a Stripe portal session, to manage payment methods and download invoices. Owners and admins only.","security":[{"session":[]}],"responses":{"200":{"description":"Where to send the user","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingRedirect"}}}},"400":{"description":"`billing_disabled`, `custom_plan`, `already_on_plan`, `no_customer`, or an error from Stripe","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"`unauthorized`: no credentials. `invalid_api_key`: the API key doesn't exist, was revoked or has expired. `invalid_token`: the token's signature is invalid, it has expired, or the resource it's scoped to was deleted","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"402":{"description":"`plan_limit_exceeded`: the organization stayed over its plan's limits after the grace period, its API is blocked until it upgrades. `plan_limit_reached`: creating the resource would go over the plan's limit","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"`token_not_allowed`: the endpoint doesn't accept tokens, or not of this type. `insufficient_scope`: the token lacks the permission. `no_active_organization` or `forbidden`: the session has no organization, or isn't a member of the one requested","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"`validation_error`: invalid path, query or body, with the `issues`","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"`rate_limited`: the API key made more than 10 requests in the last second. Wait for the `Retry-After` seconds","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"webhooks":{}}