export type DeleteApiAccountsSelfAiCustomFieldsFieldIdArgs = {field_id: string}; export type DeleteApiAccountsSelfAiCustomFieldsFieldIdOptions = {baseUrl?: string | undefined, oauth2?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete AI custom field definition * * DELETE /accounts/self/ai/custom-fields/{field_id} * * Also accepts auth: personal_access_token */ export const deleteApiAccountsSelfAiCustomFieldsFieldId = async (args: DeleteApiAccountsSelfAiCustomFieldsFieldIdArgs, options?: DeleteApiAccountsSelfAiCustomFieldsFieldIdOptions) => { const {baseUrl = "https://restapi.fax.plus/v3", fetch: fetchFn = fetch, oauth2} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (oauth2 !== undefined) headers.set('authorization', `Bearer ${oauth2}`) const url = `${baseUrl.replace(/\/+$/, '')}/accounts/self/ai/custom-fields/${encodeURIComponent(String(args.field_id))}${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 };