Midday / apps /api /src /schemas /api-keys.ts
Jules
Final deployment with all fixes and verified content
c09f67c
import { SCOPES } from "@api/utils/scopes";
import { z } from "@hono/zod-openapi";
export const upsertApiKeySchema = z.object({
id: z.string().optional(),
name: z.string().openapi({
description: "The name of the API key",
example: "API Key 1",
}),
scopes: z.array(z.enum(SCOPES)).openapi({
description: "The scopes of the API key",
example: ["bank-accounts.read", "bank-accounts.write"],
}),
});
export const deleteApiKeySchema = z.object({
id: z.string().openapi({
description: "The ID of the API key",
example: "123",
}),
});