export type CreateApiApiOperationsBackfillApplyCandidatesArgs = {updatedSince?: string | undefined}; export type CreateApiApiOperationsBackfillApplyCandidatesOptions = {baseUrl: string, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Triggers a backfill job to sync the CRM with the Apply candidates. * * POST /api/operations/backfill_apply_candidates */ export const createApiApiOperationsBackfillApplyCandidates = async (args: CreateApiApiOperationsBackfillApplyCandidatesArgs, options: CreateApiApiOperationsBackfillApplyCandidatesOptions) => { const {baseUrl, fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.updatedSince != null) query.append("updatedSince", String(args.updatedSince)) if (apiKey !== undefined) headers.set("Authorization", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/operations/backfill_apply_candidates${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "POST", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };