export type CreateApiApiKeysRemoveArgs = {body: {id: string, subaccount_id?: string | undefined}}; export type CreateApiApiKeysRemoveOptions = {baseUrl?: string | undefined, sec0?: string | undefined, fetch?: typeof fetch | undefined}; /** * Remove an API key * * POST /api_keys/remove * * Also accepts auth: sec1 */ export const createApiApiKeysRemove = async (args: CreateApiApiKeysRemoveArgs, options?: CreateApiApiKeysRemoveOptions) => { const {baseUrl = "https://api.smtp2go.com/v3", fetch: fetchFn = fetch, sec0} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (sec0 !== undefined) headers.set("X-Smtp2go-Api-Key", sec0) const url = `${baseUrl.replace(/\/+$/, '')}/api_keys/remove${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers, body: JSON.stringify(args.body)}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };