export type CrmObjectsSimplePublicObjectId = {id: string}; export type CrmObjectsBatchInputSimplePublicObjectId = {inputs: Array}; export type CreateApiCrmObjects202603TasksBatchArchiveArgs = {body: CrmObjectsBatchInputSimplePublicObjectId}; export type CreateApiCrmObjects202603TasksBatchArchiveOptions = {baseUrl?: string | undefined, privateApps?: string | undefined, fetch?: typeof fetch | undefined}; /** * Archive a batch of tasks by ID * * POST /crm/objects/2026-03/tasks/batch/archive * * Also accepts auth: developer_hapikey */ export const createApiCrmObjects202603TasksBatchArchive = async (args: CreateApiCrmObjects202603TasksBatchArchiveArgs, options?: CreateApiCrmObjects202603TasksBatchArchiveOptions) => { const {baseUrl = "https://api.hubapi.com", fetch: fetchFn = fetch, privateApps} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (privateApps !== undefined) headers.set('authorization', `Bearer ${privateApps}`) const url = `${baseUrl.replace(/\/+$/, '')}/crm/objects/2026-03/tasks/batch/archive${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 };