@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
30 lines • 2.5 kB
TypeScript
import { UnkeyCore } from "../core.js";
import { RequestOptions } from "../lib/sdks.js";
import * as components from "../models/components/index.js";
import { ConnectionError, InvalidRequestError, RequestAbortedError, RequestTimeoutError, UnexpectedClientError } from "../models/errors/httpclienterrors.js";
import * as errors from "../models/errors/index.js";
import { ResponseValidationError } from "../models/errors/responsevalidationerror.js";
import { SDKValidationError } from "../models/errors/sdkvalidationerror.js";
import { UnkeyError } from "../models/errors/unkeyerror.js";
import { APIPromise } from "../types/async.js";
import { Result } from "../types/fp.js";
/**
* Apply multiple rate limit checks
*
* @remarks
* Check and enforce multiple rate limits in a single request for any identifiers (user IDs, IP addresses, API clients, etc.).
*
* Use this to efficiently check multiple rate limits at once. Each rate limit check is independent and returns its own result with a top-level `passed` indicator showing if all checks succeeded.
*
* **Response Codes**: Rate limit checks return HTTP 200 regardless of whether limits are exceeded — check the `passed` field to see if all limits passed, or the `success` field in each individual result. A 429 may be returned if the workspace exceeds its API rate limit. Other 4xx responses indicate auth, namespace existence/deletion, or validation errors (e.g., 410 Gone for deleted namespaces). 5xx responses indicate server errors.
*
* **Required Permissions**
*
* Your root key must have one of the following permissions:
* - `ratelimit.*.limit` (to check limits in any namespace)
* - `ratelimit.<namespace_id>.limit` (to check limits in all specific namespaces being checked)
*
* If set, this operation will use {@link Security.rootKey} from the global security.
*/
export declare function ratelimitMultiLimit(client: UnkeyCore, request: Array<components.V2RatelimitLimitRequestBody>, options?: RequestOptions): APIPromise<Result<components.V2RatelimitMultiLimitResponseBody, errors.BadRequestErrorResponse | errors.UnauthorizedErrorResponse | errors.ForbiddenErrorResponse | errors.NotFoundErrorResponse | errors.GoneErrorResponse | errors.TooManyRequestsErrorResponse | errors.InternalServerErrorResponse | UnkeyError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
//# sourceMappingURL=ratelimitMultiLimit.d.ts.map