export type CreateApiInternalV1AgenticDialBridgeEndedArgs = {body: {conversation_id: string, bridge_duration_seconds: number, call_duration_seconds: number}}; export type CreateApiInternalV1AgenticDialBridgeEndedOptions = {baseUrl?: string | undefined, polyApiKey?: string | undefined, fetch?: typeof fetch | undefined}; /** * Bridge ended notification * * POST /internal/v1/agentic-dial/bridge-ended */ export const createApiInternalV1AgenticDialBridgeEnded = async (args: CreateApiInternalV1AgenticDialBridgeEndedArgs, options?: CreateApiInternalV1AgenticDialBridgeEndedOptions) => { const {baseUrl = "https://api.us.poly.ai", fetch: fetchFn = fetch, polyApiKey} = options ?? {} const query = new URLSearchParams() const headers = new Headers() headers.set('content-type', "application/json") if (polyApiKey !== undefined) headers.set("X-API-KEY", polyApiKey) const url = `${baseUrl.replace(/\/+$/, '')}/internal/v1/agentic-dial/bridge-ended${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 };