export type DeleteApiV1WebhookEndpointsEndpointIdArgs = {endpoint_id: string}; export type DeleteApiV1WebhookEndpointsEndpointIdOptions = {baseUrl?: string | undefined, polyApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Delete a webhook endpoint * * DELETE /v1/webhook-endpoints/{endpoint_id} */ export const deleteApiV1WebhookEndpointsEndpointId = async (args: DeleteApiV1WebhookEndpointsEndpointIdArgs, options?: DeleteApiV1WebhookEndpointsEndpointIdOptions) => { const {baseUrl = "https://api.us.poly.ai", fetch: fetchFn = fetch, polyApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (polyApiKey !== undefined) headers.set("X-API-KEY", polyApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/v1/webhook-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 };