export type CreateApiLeadsforgeEnrichmentEmailsArgs = {body: {people?: Array | undefined, personIDs?: Array | undefined, saveToList?: boolean | undefined, clientRequestID?: string | undefined, webhookURL?: string | undefined}}; export type CreateApiLeadsforgeEnrichmentEmailsOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Find email addresses for multiple people. Returns a job ID to poll for results. * * POST /leadsforge/enrichment/emails */ export const createApiLeadsforgeEnrichmentEmails = async (args: CreateApiLeadsforgeEnrichmentEmailsArgs, options?: CreateApiLeadsforgeEnrichmentEmailsOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") const url = `${baseUrl.replace(/\/+$/, '')}/leadsforge/enrichment/emails${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 };