UNPKG

@unkey/api

Version:

Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.

34 lines 2.41 kB
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"; /** * Update key settings * * @remarks * Update key properties in response to plan changes, subscription updates, or account status changes. * * Use this for user upgrades/downgrades, role modifications, or administrative changes. Supports partial updates - only specify fields you want to change. Set fields to null to clear them. * * **Important**: Permissions and roles are replaced entirely. Use dedicated add/remove endpoints for incremental changes. * * **Required Permissions** * * Your root key must have one of the following permissions: * - `api.*.update_key` (to update keys in any API) * - `api.<api_id>.update_key` (to update keys in a specific API) * * **Side Effects** * * If you specify an `externalId` that doesn't exist, a new identity will be automatically created and linked to the key. Permission updates will auto-create any permissions that don't exist in your workspace. Changes take effect immediately but may take up to 30 seconds to propagate to all edge regions due to cache invalidation. * * If set, this operation will use {@link Security.rootKey} from the global security. */ export declare function keysUpdateKey(client: UnkeyCore, request: components.V2KeysUpdateKeyRequestBody, options?: RequestOptions): APIPromise<Result<components.V2KeysUpdateKeyResponseBody, errors.BadRequestErrorResponse | errors.UnauthorizedErrorResponse | errors.ForbiddenErrorResponse | errors.NotFoundErrorResponse | errors.TooManyRequestsErrorResponse | errors.InternalServerErrorResponse | UnkeyError | ResponseValidationError | ConnectionError | RequestAbortedError | RequestTimeoutError | InvalidRequestError | UnexpectedClientError | SDKValidationError>>; //# sourceMappingURL=keysUpdateKey.d.ts.map