@unkey/api
Version:
Developer-friendly & type-safe Typescript SDK specifically catered to leverage *@unkey/api* API.
32 lines • 1.55 kB
TypeScript
import * as z from "zod/v3";
export type V2KeysSetRolesRequestBody = {
/**
* Specifies which key gets the complete role replacement using the database identifier returned from createKey.
*
* @remarks
* Do not confuse this with the actual API key string that users include in requests.
* This is a wholesale replacement operation that removes all existing roles not included in the request.
* Role changes take effect immediately but may take up to 30 seconds to propagate across all regions.
*/
keyId: string;
/**
* Replaces all existing role assignments with this complete list of roles.
*
* @remarks
* This is a wholesale replacement operation, not an incremental update like add/remove operations.
*
* Providing an empty array removes all direct role assignments from the key.
* All roles must already exist in the workspace - roles cannot be created automatically.
* Invalid role references cause the entire operation to fail atomically, ensuring consistent state.
*/
roles: Array<string>;
};
/** @internal */
export type V2KeysSetRolesRequestBody$Outbound = {
keyId: string;
roles: Array<string>;
};
/** @internal */
export declare const V2KeysSetRolesRequestBody$outboundSchema: z.ZodType<V2KeysSetRolesRequestBody$Outbound, z.ZodTypeDef, V2KeysSetRolesRequestBody>;
export declare function v2KeysSetRolesRequestBodyToJSON(v2KeysSetRolesRequestBody: V2KeysSetRolesRequestBody): string;
//# sourceMappingURL=v2keyssetrolesrequestbody.d.ts.map