export type DeleteApiCrmObjects202603LeadsLeadsIdArgs = {leadsId: string}; export type DeleteApiCrmObjects202603LeadsLeadsIdOptions = {baseUrl?: string | undefined, privateApps?: string | undefined, fetch?: typeof fetch | undefined}; /** * Archive * * DELETE /crm/objects/2026-03/leads/{leadsId} * * Also accepts auth: developer_hapikey */ export const deleteApiCrmObjects202603LeadsLeadsId = async (args: DeleteApiCrmObjects202603LeadsLeadsIdArgs, options?: DeleteApiCrmObjects202603LeadsLeadsIdOptions) => { const {baseUrl = "https://api.hubapi.com", fetch: fetchFn = fetch, privateApps} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (privateApps !== undefined) headers.set('authorization', `Bearer ${privateApps}`) const url = `${baseUrl.replace(/\/+$/, '')}/crm/objects/2026-03/leads/${encodeURIComponent(String(args.leadsId))}${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "DELETE", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };