export type DeleteApiApiV1ContactsContactContactIdArgs = {contactId: string}; export type DeleteApiApiV1ContactsContactContactIdOptions = {baseUrl?: string | undefined, apiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete contact * * DELETE /api/v1/contacts/contact/{contactId} */ export const deleteApiApiV1ContactsContactContactId = async (args: DeleteApiApiV1ContactsContactContactIdArgs, options?: DeleteApiApiV1ContactsContactContactIdOptions) => { const {baseUrl = "https://api.getprospect.com", fetch: fetchFn = fetch, apiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKey !== undefined) headers.set("apiKey", apiKey) const url = `${baseUrl.replace(/\/+$/, '')}/api/v1/contacts/contact/${encodeURIComponent(String(args.contactId))}${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 };