import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.mjs"; import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.mjs"; import * as core from "../../../../core/index.mjs"; import * as Whop from "../../../index.mjs"; export declare namespace ApiKeysClient { type Options = BaseClientOptions; interface RequestOptions extends BaseRequestOptions { } } /** * An API Key is a programmatic credential owned by an account or app. Each key carries its own permissions policy — explicit permission statements or an inherited system role — and can be restricted with an expiration date and an IP allowlist. * * Use the API Keys API to list an account or app's keys, create a key (the full secret is returned once, on creation), inspect a key's effective grants, update its name or restrictions, rotate its secret, and revoke it. These endpoints require a user session — they cannot be called with an API key. */ export declare class ApiKeysClient { protected readonly _options: NormalizedClientOptionsWithAuth; constructor(options?: ApiKeysClient.Options); /** * Lists the API keys of an account or app, newest first. Responses never include the full secret — only its obfuscated form. * * @param {Whop.ListApiKeysRequest} request * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.apiKeys.list({ * resource_id: "resource_id", * resource_type: "account" * }) */ list(request: Whop.ListApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): Promise>; /** * Creates an API key for an account or app. The response is the only place the full `secret_key` is returned — store it immediately. Requires a user session; API keys cannot manage API keys. * * @param {Whop.CreateApiKeysRequest} request * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.apiKeys.create({ * name: "Shine Time Booking (production)", * permissions: {}, * resource_id: "biz_xxxxxxxxxxxxxx", * resource_type: "account" * }) */ create(request: Whop.CreateApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise; private __create; /** * Lists the catalog of permission actions that can be granted to users, apps, and API keys. Use it to choose the `permissions` for an API key or to build a permission picker. Small and returned in full on one page. * * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.apiKeys.listPermissions() */ listPermissions(requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise; private __listPermissions; /** * Retrieves an API key with its effective permission grants. The full secret is never returned — rotate the key if it was lost. * * @param {Whop.RetrieveApiKeysRequest} request * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.apiKeys.retrieve({ * id: "id" * }) */ retrieve(request: Whop.RetrieveApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise; private __retrieve; /** * Permanently revokes an API key; requests using its secret stop authenticating immediately. Default and agent-backend keys cannot be deleted. * * @param {Whop.DeleteApiKeysRequest} request * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.apiKeys.delete({ * id: "id" * }) */ delete(request: Whop.DeleteApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise; private __delete; /** * Updates an API key's name, permissions, API version, expiration, or IP allowlist. Fields that are omitted keep their current value; default keys cannot be modified. * * @param {Whop.UpdateApiKeysRequest} request * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.BadRequestError} * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.apiKeys.update({ * id: "id" * }) */ update(request: Whop.UpdateApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise; private __update; /** * Rotates the API key's secret, invalidating the previous secret immediately. The response is the only place the new `secret_key` is returned. * * @param {Whop.RotateApiKeysRequest} request * @param {ApiKeysClient.RequestOptions} requestOptions - Request-specific configuration. * * @throws {@link Whop.UnauthorizedError} * @throws {@link Whop.ForbiddenError} * @throws {@link Whop.NotFoundError} * @throws {@link Whop.ConflictError} * @throws {@link errors.WhopError} * @throws {@link errors.WhopTimeoutError} * * @example * await client.apiKeys.rotate({ * id: "id" * }) */ rotate(request: Whop.RotateApiKeysRequest, requestOptions?: ApiKeysClient.RequestOptions): core.HttpResponsePromise; private __rotate; }