@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
28 lines • 1.95 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";
/**
* Get API key by hash
*
* @remarks
* Find out what key this is.
*
* **Required Permissions**
*
* Your root key must have one of the following permissions for basic key information:
* - `api.*.read_key` (to read keys from any API)
* - `api.<api_id>.read_key` (to read keys from a specific API)
*
* If your rootkey lacks permissions but the key exists, we may return a 404 status here to prevent leaking the existance of a key to unauthorized clients. If you believe that a key should exist, but receive a 404, please double check your root key has the correct permissions.
*
* If set, this operation will use {@link Security.rootKey} from the global security.
*/
export declare function keysWhoami(client: UnkeyCore, request: components.V2KeysWhoamiRequestBody, options?: RequestOptions): APIPromise<Result<components.V2KeysWhoamiResponseBody, errors.BadRequestErrorResponse | errors.UnauthorizedErrorResponse | errors.ForbiddenErrorResponse | errors.NotFoundErrorResponse | errors.TooManyRequestsErrorResponse | errors.InternalServerErrorResponse | UnkeyError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>;
//# sourceMappingURL=keysWhoami.d.ts.map