export type DeleteApiWebhooksEndpointsEndpointIdArgs = {endpoint_id: string}; export type DeleteApiWebhooksEndpointsEndpointIdOptions = {baseUrl?: string | undefined, apiKeyAuth?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a webhook endpoint * * DELETE /webhooks/endpoints/{endpoint_id} */ export const deleteApiWebhooksEndpointsEndpointId = async (args: DeleteApiWebhooksEndpointsEndpointIdArgs, options?: DeleteApiWebhooksEndpointsEndpointIdOptions) => { const {baseUrl = "https://api.axilio.ai/api/v1", fetch: fetchFn = fetch, apiKeyAuth} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (apiKeyAuth !== undefined) headers.set("X-Axilio-Api-Key", apiKeyAuth) const url = `${baseUrl.replace(/\/+$/, '')}/webhooks/endpoints/${encodeURIComponent(String(args.endpoint_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 };