retell-sdk 5.22.0 → 5.24.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/client.d.mts +10 -10
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +10 -10
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/agent.d.mts +17 -4
  10. package/resources/agent.d.mts.map +1 -1
  11. package/resources/agent.d.ts +17 -4
  12. package/resources/agent.d.ts.map +1 -1
  13. package/resources/agent.js +15 -0
  14. package/resources/agent.js.map +1 -1
  15. package/resources/agent.mjs +15 -0
  16. package/resources/agent.mjs.map +1 -1
  17. package/resources/batch-call.d.mts +2 -2
  18. package/resources/batch-call.d.mts.map +1 -1
  19. package/resources/batch-call.d.ts +2 -2
  20. package/resources/batch-call.d.ts.map +1 -1
  21. package/resources/call.d.mts +1754 -120
  22. package/resources/call.d.mts.map +1 -1
  23. package/resources/call.d.ts +1754 -120
  24. package/resources/call.d.ts.map +1 -1
  25. package/resources/call.js +7 -4
  26. package/resources/call.js.map +1 -1
  27. package/resources/call.mjs +7 -4
  28. package/resources/call.mjs.map +1 -1
  29. package/resources/chat-agent.d.mts +16 -1
  30. package/resources/chat-agent.d.mts.map +1 -1
  31. package/resources/chat-agent.d.ts +16 -1
  32. package/resources/chat-agent.d.ts.map +1 -1
  33. package/resources/chat-agent.js +17 -0
  34. package/resources/chat-agent.js.map +1 -1
  35. package/resources/chat-agent.mjs +17 -0
  36. package/resources/chat-agent.mjs.map +1 -1
  37. package/resources/chat.d.mts +38 -12
  38. package/resources/chat.d.mts.map +1 -1
  39. package/resources/chat.d.ts +38 -12
  40. package/resources/chat.d.ts.map +1 -1
  41. package/resources/chat.js +8 -5
  42. package/resources/chat.js.map +1 -1
  43. package/resources/chat.mjs +8 -5
  44. package/resources/chat.mjs.map +1 -1
  45. package/resources/conversation-flow-component.d.mts +33 -5
  46. package/resources/conversation-flow-component.d.mts.map +1 -1
  47. package/resources/conversation-flow-component.d.ts +33 -5
  48. package/resources/conversation-flow-component.d.ts.map +1 -1
  49. package/resources/conversation-flow-component.js +8 -4
  50. package/resources/conversation-flow-component.js.map +1 -1
  51. package/resources/conversation-flow-component.mjs +8 -4
  52. package/resources/conversation-flow-component.mjs.map +1 -1
  53. package/resources/conversation-flow.d.mts +21 -14
  54. package/resources/conversation-flow.d.mts.map +1 -1
  55. package/resources/conversation-flow.d.ts +21 -14
  56. package/resources/conversation-flow.d.ts.map +1 -1
  57. package/resources/conversation-flow.js +7 -3
  58. package/resources/conversation-flow.js.map +1 -1
  59. package/resources/conversation-flow.mjs +7 -3
  60. package/resources/conversation-flow.mjs.map +1 -1
  61. package/resources/index.d.mts +5 -5
  62. package/resources/index.d.mts.map +1 -1
  63. package/resources/index.d.ts +5 -5
  64. package/resources/index.d.ts.map +1 -1
  65. package/resources/index.js.map +1 -1
  66. package/resources/index.mjs.map +1 -1
  67. package/resources/llm.d.mts +23 -15
  68. package/resources/llm.d.mts.map +1 -1
  69. package/resources/llm.d.ts +23 -15
  70. package/resources/llm.d.ts.map +1 -1
  71. package/resources/llm.js +6 -3
  72. package/resources/llm.js.map +1 -1
  73. package/resources/llm.mjs +6 -3
  74. package/resources/llm.mjs.map +1 -1
  75. package/resources/phone-number.d.mts +32 -5
  76. package/resources/phone-number.d.mts.map +1 -1
  77. package/resources/phone-number.d.ts +32 -5
  78. package/resources/phone-number.d.ts.map +1 -1
  79. package/resources/phone-number.js +7 -4
  80. package/resources/phone-number.js.map +1 -1
  81. package/resources/phone-number.mjs +7 -4
  82. package/resources/phone-number.mjs.map +1 -1
  83. package/resources/tests.d.mts +64 -14
  84. package/resources/tests.d.mts.map +1 -1
  85. package/resources/tests.d.ts +64 -14
  86. package/resources/tests.d.ts.map +1 -1
  87. package/resources/tests.js +7 -13
  88. package/resources/tests.js.map +1 -1
  89. package/resources/tests.mjs +7 -13
  90. package/resources/tests.mjs.map +1 -1
  91. package/src/client.ts +10 -0
  92. package/src/resources/agent.ts +29 -0
  93. package/src/resources/batch-call.ts +3 -1
  94. package/src/resources/call.ts +2207 -118
  95. package/src/resources/chat-agent.ts +25 -0
  96. package/src/resources/chat.ts +42 -17
  97. package/src/resources/conversation-flow-component.ts +42 -5
  98. package/src/resources/conversation-flow.ts +24 -15
  99. package/src/resources/index.ts +5 -0
  100. package/src/resources/llm.ts +26 -16
  101. package/src/resources/phone-number.ts +41 -5
  102. package/src/resources/tests.ts +83 -16
  103. package/src/version.ts +1 -1
  104. package/version.d.mts +1 -1
  105. package/version.d.ts +1 -1
  106. package/version.js +1 -1
  107. package/version.mjs +1 -1
@@ -32,11 +32,14 @@ export declare class Call extends APIResource {
32
32
  */
33
33
  update(callID: string, body: CallUpdateParams, options?: RequestOptions): APIPromise<CallResponse>;
34
34
  /**
35
- * Retrieve call details
35
+ * List calls with unified cursor pagination response.
36
36
  *
37
- * @deprecated
37
+ * @example
38
+ * ```ts
39
+ * const calls = await client.call.list();
40
+ * ```
38
41
  */
39
- list(body: CallListParams, options?: RequestOptions): APIPromise<CallListResponse>;
42
+ list(body?: CallListParams | null | undefined, options?: RequestOptions): APIPromise<CallListResponse>;
40
43
  /**
41
44
  * Delete a specific call and its associated data
42
45
  *
@@ -1826,171 +1829,1802 @@ export declare namespace WebCallResponse {
1826
1829
  role: 'dtmf';
1827
1830
  }
1828
1831
  }
1829
- export type CallListResponse = Array<CallResponse>;
1830
- export interface CallUpdateParams {
1831
- /**
1832
- * Custom attributes for the call
1833
- */
1834
- custom_attributes?: {
1835
- [key: string]: string | number | boolean;
1836
- };
1837
- /**
1838
- * Data storage setting for this call. Overrides the agent's default setting.
1839
- * "everything" stores all data, "everything_except_pii" excludes PII when
1840
- * possible, "basic_attributes_only" stores only metadata. Cannot be downgraded
1841
- * from more restrictive to less restrictive settings.
1842
- */
1843
- data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only';
1844
- /**
1845
- * An arbitrary object for storage purpose only. You can put anything here like
1846
- * your internal customer id associated with the call. Not used for processing. You
1847
- * can later get this field from the call object. Size limited to 50kB max.
1848
- */
1849
- metadata?: unknown;
1850
- /**
1851
- * Override dynamic varaibles represented as key-value pairs of strings. Setting
1852
- * this will override or add the dynamic variables set in the agent during the
1853
- * call. Only need to set the delta where you want to override, no need to set the
1854
- * entire dynamic variables object. Setting this to null will remove any existing
1855
- * override.
1856
- */
1857
- override_dynamic_variables?: {
1858
- [key: string]: string;
1859
- } | null;
1860
- }
1861
- export interface CallListParams {
1862
- /**
1863
- * Filter criteria for the calls to retrieve.
1864
- */
1865
- filter_criteria?: CallListParams.FilterCriteria;
1832
+ export interface CallListResponse {
1866
1833
  /**
1867
- * Limit the number of calls returned. Default 50, Max 1000. To retrieve more than
1868
- * 1000, use pagination_key to continue fetching the next page.
1834
+ * Whether more results are available.
1869
1835
  */
1870
- limit?: number;
1836
+ has_more?: boolean;
1837
+ items?: Array<CallListResponse.V3WebCallResponse | CallListResponse.V3PhoneCallResponse>;
1871
1838
  /**
1872
- * The pagination key to continue fetching the next page of calls. Pagination key
1873
- * is represented by a call id here, and it's exclusive (not included in the
1874
- * fetched calls). The last call id from the list calls is usually used as
1875
- * pagination key here. If not set, will start from the beginning.
1839
+ * Pagination key for the next page.
1876
1840
  */
1877
1841
  pagination_key?: string;
1878
- /**
1879
- * The calls will be sorted by `start_timestamp`, whether to return the calls in
1880
- * ascending or descending order.
1881
- */
1882
- sort_order?: 'ascending' | 'descending';
1883
1842
  }
1884
- export declare namespace CallListParams {
1885
- /**
1886
- * Filter criteria for the calls to retrieve.
1887
- */
1888
- interface FilterCriteria {
1843
+ export declare namespace CallListResponse {
1844
+ interface V3WebCallResponse {
1845
+ /**
1846
+ * Access token to enter the web call room. This needs to be passed to your
1847
+ * frontend to join the call.
1848
+ */
1849
+ access_token: string;
1889
1850
  /**
1890
- * Only retrieve calls that are made with specific agent(s).
1851
+ * Corresponding agent id of this call.
1891
1852
  */
1892
- agent_id?: Array<string>;
1853
+ agent_id: string;
1893
1854
  /**
1894
- * Only retrieve calls with specific batch call id(s).
1855
+ * The version of the agent.
1895
1856
  */
1896
- batch_call_id?: Array<string>;
1857
+ agent_version: number;
1897
1858
  /**
1898
- * Only retrieve calls with specific call id(s).
1859
+ * Unique id of the call. Used to identify the call in the LLM websocket and used
1860
+ * to authenticate in the audio websocket.
1899
1861
  */
1900
- call_id?: Array<string>;
1862
+ call_id: string;
1901
1863
  /**
1902
- * Only retrieve calls with specific call status(es).
1864
+ * Status of call.
1865
+ *
1866
+ * - `registered`: Call id issued, starting to make a call using this id.
1867
+ * - `ongoing`: Call connected and ongoing.
1868
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
1869
+ * hung up, or call transferred.
1870
+ * - `error`: Call encountered error.
1903
1871
  */
1904
- call_status?: Array<'not_connected' | 'ongoing' | 'ended' | 'error'>;
1872
+ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error';
1905
1873
  /**
1906
- * Only retrieve calls with specific call successful(s).
1874
+ * Type of the call. Used to distinguish between web call and phone call.
1907
1875
  */
1908
- call_successful?: Array<boolean>;
1876
+ call_type: 'web_call';
1909
1877
  /**
1910
- * Only retrieve calls with specific call type(s).
1878
+ * Name of the agent.
1911
1879
  */
1912
- call_type?: Array<'web_call' | 'phone_call'>;
1880
+ agent_name?: string;
1913
1881
  /**
1914
- * Only retrieve calls with specific direction(s).
1882
+ * Post call analysis that includes information such as sentiment, status, summary,
1883
+ * and custom defined data to extract. Available after call ends. Subscribe to
1884
+ * `call_analyzed` webhook event type to receive it once ready.
1915
1885
  */
1916
- direction?: Array<'inbound' | 'outbound'>;
1886
+ call_analysis?: V3WebCallResponse.CallAnalysis;
1917
1887
  /**
1918
- * Only retrieve calls with specific disconnection reason(s).
1888
+ * Cost of the call, including all the products and their costs and discount.
1919
1889
  */
1920
- disconnection_reason?: Array<'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped'>;
1890
+ call_cost?: V3WebCallResponse.CallCost;
1921
1891
  /**
1922
- * Only retrieve calls with specific range of duration(s).
1892
+ * Dynamic variables collected from the call. Only available after the call ends.
1923
1893
  */
1924
- duration_ms?: FilterCriteria.DurationMs;
1894
+ collected_dynamic_variables?: {
1895
+ [key: string]: unknown;
1896
+ };
1925
1897
  /**
1926
- * Filter by dynamic variables using dot notation (e.g., `dynamic_variables.name`).
1927
- * Values are matched exactly as strings.
1898
+ * Custom SIP headers to be added to the call.
1928
1899
  */
1929
- dynamic_variables?: {
1930
- [key: string]: Array<string>;
1900
+ custom_sip_headers?: {
1901
+ [key: string]: string;
1931
1902
  };
1932
- e2e_latency_p50?: FilterCriteria.E2ELatencyP50;
1933
1903
  /**
1934
- * Only retrieve calls with specific range of end timestamp(s).
1904
+ * Data storage setting for this call's agent. "everything" stores all data,
1905
+ * "everything_except_pii" excludes PII when possible, "basic_attributes_only"
1906
+ * stores only metadata.
1907
+ */
1908
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
1909
+ /**
1910
+ * The reason for the disconnection of the call. Read detailed description about
1911
+ * reasons listed here at
1912
+ * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons).
1913
+ */
1914
+ disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped';
1915
+ /**
1916
+ * Duration of the call in milliseconds. Available after call ends.
1917
+ */
1918
+ duration_ms?: number;
1919
+ /**
1920
+ * End timestamp (milliseconds since epoch) of the call. Available after call ends.
1921
+ */
1922
+ end_timestamp?: number;
1923
+ /**
1924
+ * URL to the knowledge base retrieved contents of the call. Available after call
1925
+ * ends if the call utilizes knowledge base feature. It consists of the respond id
1926
+ * and the retrieved contents related to that response. It's already rendered in
1927
+ * call history tab of dashboard, and you can also manually download and check
1928
+ * against the transcript to view the knowledge base retrieval results.
1929
+ */
1930
+ knowledge_base_retrieved_contents_url?: string;
1931
+ /**
1932
+ * Latency tracking of the call, available after call ends. Not all fields here
1933
+ * will be available, as it depends on the type of call and feature used.
1934
+ */
1935
+ latency?: V3WebCallResponse.Latency;
1936
+ /**
1937
+ * LLM token usage of the call, available after call ends. Not populated if using
1938
+ * custom LLM, realtime API, or no LLM call is made.
1939
+ */
1940
+ llm_token_usage?: V3WebCallResponse.LlmTokenUsage;
1941
+ /**
1942
+ * An arbitrary object for storage purpose only. You can put anything here like
1943
+ * your internal customer id associated with the call. Not used for processing. You
1944
+ * can later get this field from the call object.
1945
+ */
1946
+ metadata?: unknown;
1947
+ /**
1948
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
1949
+ * enabled, the generated URLs will include security signatures that restrict
1950
+ * access and automatically expire after 24 hours.
1951
+ */
1952
+ opt_in_signed_url?: boolean;
1953
+ /**
1954
+ * Public log of the call, containing details about all the requests and responses
1955
+ * received in LLM WebSocket, latency tracking for each turntaking, helpful for
1956
+ * debugging and tracing. Available after call ends.
1935
1957
  */
1936
- end_timestamp?: FilterCriteria.EndTimestamp;
1958
+ public_log_url?: string;
1937
1959
  /**
1938
- * Only retrieve calls with specific from number(s).
1960
+ * Recording of the call, with each party's audio stored in a separate channel.
1961
+ * Available after the call ends.
1939
1962
  */
1940
- from_number?: Array<string>;
1963
+ recording_multi_channel_url?: string;
1941
1964
  /**
1942
- * Only retrieve calls that are in voicemail or not in voicemail.
1965
+ * Recording of the call. Available after call ends.
1943
1966
  */
1944
- in_voicemail?: Array<boolean>;
1967
+ recording_url?: string;
1945
1968
  /**
1946
- * Filter by metadata fields using dot notation (e.g., `metadata.customer_id`).
1947
- * Values are matched exactly as strings.
1969
+ * Add optional dynamic variables in key value pairs of string that injects into
1970
+ * your Response Engine prompt and tool description. Only applicable for Response
1971
+ * Engine.
1948
1972
  */
1949
- metadata?: {
1950
- [key: string]: Array<string>;
1973
+ retell_llm_dynamic_variables?: {
1974
+ [key: string]: unknown;
1951
1975
  };
1952
1976
  /**
1953
- * Only retrieve calls with specific range of start timestamp(s).
1977
+ * Recording of the call without PII, with each party's audio stored in a separate
1978
+ * channel. Available after the call ends.
1979
+ */
1980
+ scrubbed_recording_multi_channel_url?: string;
1981
+ /**
1982
+ * Recording of the call without PII. Available after call ends.
1954
1983
  */
1955
- start_timestamp?: FilterCriteria.StartTimestamp;
1984
+ scrubbed_recording_url?: string;
1956
1985
  /**
1957
- * Only retrieve calls with specific to number(s).
1986
+ * Begin timestamp (milliseconds since epoch) of the call. Available after call
1987
+ * starts.
1958
1988
  */
1959
- to_number?: Array<string>;
1989
+ start_timestamp?: number;
1960
1990
  /**
1961
- * Only retrieve calls with specific user sentiment(s).
1991
+ * The destination number or identifier where the call was transferred to. Only
1992
+ * populated when the disconnection reason was `call_transfer`. Can be a phone
1993
+ * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a
1994
+ * ";transport=..." portion (if transport is known) where the transport type can be
1995
+ * "tls", "tcp" or "udp".
1962
1996
  */
1963
- user_sentiment?: Array<'Negative' | 'Positive' | 'Neutral' | 'Unknown'>;
1997
+ transfer_destination?: string | null;
1964
1998
  /**
1965
- * The version of the agent to use for the call.
1999
+ * Transfer end timestamp (milliseconds since epoch) of the call. Available after
2000
+ * transfer call ends.
1966
2001
  */
1967
- version?: Array<number>;
2002
+ transfer_end_timestamp?: number;
1968
2003
  }
1969
- namespace FilterCriteria {
2004
+ namespace V3WebCallResponse {
2005
+ /**
2006
+ * Post call analysis that includes information such as sentiment, status, summary,
2007
+ * and custom defined data to extract. Available after call ends. Subscribe to
2008
+ * `call_analyzed` webhook event type to receive it once ready.
2009
+ */
2010
+ interface CallAnalysis {
2011
+ /**
2012
+ * Whether the agent seems to have a successful call with the user, where the agent
2013
+ * finishes the task, and the call was complete without being cutoff.
2014
+ */
2015
+ call_successful?: boolean;
2016
+ /**
2017
+ * A high level summary of the call.
2018
+ */
2019
+ call_summary?: string;
2020
+ /**
2021
+ * Custom analysis data that was extracted based on the schema defined in agent
2022
+ * post call analysis data. Can be empty if nothing is specified.
2023
+ */
2024
+ custom_analysis_data?: unknown;
2025
+ /**
2026
+ * Whether the call is entered voicemail.
2027
+ */
2028
+ in_voicemail?: boolean;
2029
+ /**
2030
+ * Sentiment of the user in the call.
2031
+ */
2032
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
2033
+ }
1970
2034
  /**
1971
- * Only retrieve calls with specific range of duration(s).
2035
+ * Cost of the call, including all the products and their costs and discount.
1972
2036
  */
1973
- interface DurationMs {
1974
- lower_threshold?: number;
1975
- upper_threshold?: number;
2037
+ interface CallCost {
2038
+ /**
2039
+ * Combined cost of all individual costs in cents
2040
+ */
2041
+ combined_cost: number;
2042
+ /**
2043
+ * List of products with their unit prices and costs in cents
2044
+ */
2045
+ product_costs: Array<CallCost.ProductCost>;
2046
+ /**
2047
+ * Total duration of the call in seconds
2048
+ */
2049
+ total_duration_seconds: number;
2050
+ /**
2051
+ * Total unit duration price of all products in cents per second
2052
+ */
2053
+ total_duration_unit_price: number;
1976
2054
  }
1977
- interface E2ELatencyP50 {
1978
- lower_threshold?: number;
1979
- upper_threshold?: number;
2055
+ namespace CallCost {
2056
+ interface ProductCost {
2057
+ /**
2058
+ * Cost for the product in cents for the duration of the call.
2059
+ */
2060
+ cost: number;
2061
+ /**
2062
+ * Product name that has a cost associated with it.
2063
+ */
2064
+ product: string;
2065
+ /**
2066
+ * True if this cost item is for a transfer segment.
2067
+ */
2068
+ is_transfer_leg_cost?: boolean;
2069
+ /**
2070
+ * Unit price of the product in cents per second.
2071
+ */
2072
+ unit_price?: number;
2073
+ }
1980
2074
  }
1981
2075
  /**
1982
- * Only retrieve calls with specific range of end timestamp(s).
2076
+ * Latency tracking of the call, available after call ends. Not all fields here
2077
+ * will be available, as it depends on the type of call and feature used.
1983
2078
  */
1984
- interface EndTimestamp {
1985
- lower_threshold?: number;
1986
- upper_threshold?: number;
2079
+ interface Latency {
2080
+ /**
2081
+ * Transcription latency (diff between the duration of the chunks streamed and the
2082
+ * durations of the transcribed part) tracking of the call.
2083
+ */
2084
+ asr?: Latency.Asr;
2085
+ /**
2086
+ * End to end latency (from user stops talking to agent start talking) tracking of
2087
+ * the call. This latency does not account for the network trip time from Retell
2088
+ * server to user frontend. The latency is tracked every time turn change between
2089
+ * user and agent.
2090
+ */
2091
+ e2e?: Latency.E2E;
2092
+ /**
2093
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
2094
+ * relevant context received) tracking of the call. Only populated when using
2095
+ * knowledge base feature for the agent of the call.
2096
+ */
2097
+ knowledge_base?: Latency.KnowledgeBase;
2098
+ /**
2099
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
2100
+ * of the call. When using custom LLM. this latency includes LLM websocket
2101
+ * roundtrip time between user server and Retell server.
2102
+ */
2103
+ llm?: Latency.Llm;
2104
+ /**
2105
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
2106
+ * of the call. Only populated for calls using custom LLM.
2107
+ */
2108
+ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt;
2109
+ /**
2110
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
2111
+ * received) tracking of the call. Only populated for calls that uses S2S model
2112
+ * like Realtime API.
2113
+ */
2114
+ s2s?: Latency.S2s;
2115
+ /**
2116
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
2117
+ * tracking of the call.
2118
+ */
2119
+ tts?: Latency.Tts;
2120
+ }
2121
+ namespace Latency {
2122
+ /**
2123
+ * Transcription latency (diff between the duration of the chunks streamed and the
2124
+ * durations of the transcribed part) tracking of the call.
2125
+ */
2126
+ interface Asr {
2127
+ /**
2128
+ * Maximum latency in the call, measured in milliseconds.
2129
+ */
2130
+ max?: number;
2131
+ /**
2132
+ * Minimum latency in the call, measured in milliseconds.
2133
+ */
2134
+ min?: number;
2135
+ /**
2136
+ * Number of data points (number of times latency is tracked).
2137
+ */
2138
+ num?: number;
2139
+ /**
2140
+ * 50 percentile of latency, measured in milliseconds.
2141
+ */
2142
+ p50?: number;
2143
+ /**
2144
+ * 90 percentile of latency, measured in milliseconds.
2145
+ */
2146
+ p90?: number;
2147
+ /**
2148
+ * 95 percentile of latency, measured in milliseconds.
2149
+ */
2150
+ p95?: number;
2151
+ /**
2152
+ * 99 percentile of latency, measured in milliseconds.
2153
+ */
2154
+ p99?: number;
2155
+ /**
2156
+ * All the latency data points in the call, measured in milliseconds.
2157
+ */
2158
+ values?: Array<number>;
2159
+ }
2160
+ /**
2161
+ * End to end latency (from user stops talking to agent start talking) tracking of
2162
+ * the call. This latency does not account for the network trip time from Retell
2163
+ * server to user frontend. The latency is tracked every time turn change between
2164
+ * user and agent.
2165
+ */
2166
+ interface E2E {
2167
+ /**
2168
+ * Maximum latency in the call, measured in milliseconds.
2169
+ */
2170
+ max?: number;
2171
+ /**
2172
+ * Minimum latency in the call, measured in milliseconds.
2173
+ */
2174
+ min?: number;
2175
+ /**
2176
+ * Number of data points (number of times latency is tracked).
2177
+ */
2178
+ num?: number;
2179
+ /**
2180
+ * 50 percentile of latency, measured in milliseconds.
2181
+ */
2182
+ p50?: number;
2183
+ /**
2184
+ * 90 percentile of latency, measured in milliseconds.
2185
+ */
2186
+ p90?: number;
2187
+ /**
2188
+ * 95 percentile of latency, measured in milliseconds.
2189
+ */
2190
+ p95?: number;
2191
+ /**
2192
+ * 99 percentile of latency, measured in milliseconds.
2193
+ */
2194
+ p99?: number;
2195
+ /**
2196
+ * All the latency data points in the call, measured in milliseconds.
2197
+ */
2198
+ values?: Array<number>;
2199
+ }
2200
+ /**
2201
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
2202
+ * relevant context received) tracking of the call. Only populated when using
2203
+ * knowledge base feature for the agent of the call.
2204
+ */
2205
+ interface KnowledgeBase {
2206
+ /**
2207
+ * Maximum latency in the call, measured in milliseconds.
2208
+ */
2209
+ max?: number;
2210
+ /**
2211
+ * Minimum latency in the call, measured in milliseconds.
2212
+ */
2213
+ min?: number;
2214
+ /**
2215
+ * Number of data points (number of times latency is tracked).
2216
+ */
2217
+ num?: number;
2218
+ /**
2219
+ * 50 percentile of latency, measured in milliseconds.
2220
+ */
2221
+ p50?: number;
2222
+ /**
2223
+ * 90 percentile of latency, measured in milliseconds.
2224
+ */
2225
+ p90?: number;
2226
+ /**
2227
+ * 95 percentile of latency, measured in milliseconds.
2228
+ */
2229
+ p95?: number;
2230
+ /**
2231
+ * 99 percentile of latency, measured in milliseconds.
2232
+ */
2233
+ p99?: number;
2234
+ /**
2235
+ * All the latency data points in the call, measured in milliseconds.
2236
+ */
2237
+ values?: Array<number>;
2238
+ }
2239
+ /**
2240
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
2241
+ * of the call. When using custom LLM. this latency includes LLM websocket
2242
+ * roundtrip time between user server and Retell server.
2243
+ */
2244
+ interface Llm {
2245
+ /**
2246
+ * Maximum latency in the call, measured in milliseconds.
2247
+ */
2248
+ max?: number;
2249
+ /**
2250
+ * Minimum latency in the call, measured in milliseconds.
2251
+ */
2252
+ min?: number;
2253
+ /**
2254
+ * Number of data points (number of times latency is tracked).
2255
+ */
2256
+ num?: number;
2257
+ /**
2258
+ * 50 percentile of latency, measured in milliseconds.
2259
+ */
2260
+ p50?: number;
2261
+ /**
2262
+ * 90 percentile of latency, measured in milliseconds.
2263
+ */
2264
+ p90?: number;
2265
+ /**
2266
+ * 95 percentile of latency, measured in milliseconds.
2267
+ */
2268
+ p95?: number;
2269
+ /**
2270
+ * 99 percentile of latency, measured in milliseconds.
2271
+ */
2272
+ p99?: number;
2273
+ /**
2274
+ * All the latency data points in the call, measured in milliseconds.
2275
+ */
2276
+ values?: Array<number>;
2277
+ }
2278
+ /**
2279
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
2280
+ * of the call. Only populated for calls using custom LLM.
2281
+ */
2282
+ interface LlmWebsocketNetworkRtt {
2283
+ /**
2284
+ * Maximum latency in the call, measured in milliseconds.
2285
+ */
2286
+ max?: number;
2287
+ /**
2288
+ * Minimum latency in the call, measured in milliseconds.
2289
+ */
2290
+ min?: number;
2291
+ /**
2292
+ * Number of data points (number of times latency is tracked).
2293
+ */
2294
+ num?: number;
2295
+ /**
2296
+ * 50 percentile of latency, measured in milliseconds.
2297
+ */
2298
+ p50?: number;
2299
+ /**
2300
+ * 90 percentile of latency, measured in milliseconds.
2301
+ */
2302
+ p90?: number;
2303
+ /**
2304
+ * 95 percentile of latency, measured in milliseconds.
2305
+ */
2306
+ p95?: number;
2307
+ /**
2308
+ * 99 percentile of latency, measured in milliseconds.
2309
+ */
2310
+ p99?: number;
2311
+ /**
2312
+ * All the latency data points in the call, measured in milliseconds.
2313
+ */
2314
+ values?: Array<number>;
2315
+ }
2316
+ /**
2317
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
2318
+ * received) tracking of the call. Only populated for calls that uses S2S model
2319
+ * like Realtime API.
2320
+ */
2321
+ interface S2s {
2322
+ /**
2323
+ * Maximum latency in the call, measured in milliseconds.
2324
+ */
2325
+ max?: number;
2326
+ /**
2327
+ * Minimum latency in the call, measured in milliseconds.
2328
+ */
2329
+ min?: number;
2330
+ /**
2331
+ * Number of data points (number of times latency is tracked).
2332
+ */
2333
+ num?: number;
2334
+ /**
2335
+ * 50 percentile of latency, measured in milliseconds.
2336
+ */
2337
+ p50?: number;
2338
+ /**
2339
+ * 90 percentile of latency, measured in milliseconds.
2340
+ */
2341
+ p90?: number;
2342
+ /**
2343
+ * 95 percentile of latency, measured in milliseconds.
2344
+ */
2345
+ p95?: number;
2346
+ /**
2347
+ * 99 percentile of latency, measured in milliseconds.
2348
+ */
2349
+ p99?: number;
2350
+ /**
2351
+ * All the latency data points in the call, measured in milliseconds.
2352
+ */
2353
+ values?: Array<number>;
2354
+ }
2355
+ /**
2356
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
2357
+ * tracking of the call.
2358
+ */
2359
+ interface Tts {
2360
+ /**
2361
+ * Maximum latency in the call, measured in milliseconds.
2362
+ */
2363
+ max?: number;
2364
+ /**
2365
+ * Minimum latency in the call, measured in milliseconds.
2366
+ */
2367
+ min?: number;
2368
+ /**
2369
+ * Number of data points (number of times latency is tracked).
2370
+ */
2371
+ num?: number;
2372
+ /**
2373
+ * 50 percentile of latency, measured in milliseconds.
2374
+ */
2375
+ p50?: number;
2376
+ /**
2377
+ * 90 percentile of latency, measured in milliseconds.
2378
+ */
2379
+ p90?: number;
2380
+ /**
2381
+ * 95 percentile of latency, measured in milliseconds.
2382
+ */
2383
+ p95?: number;
2384
+ /**
2385
+ * 99 percentile of latency, measured in milliseconds.
2386
+ */
2387
+ p99?: number;
2388
+ /**
2389
+ * All the latency data points in the call, measured in milliseconds.
2390
+ */
2391
+ values?: Array<number>;
2392
+ }
1987
2393
  }
1988
2394
  /**
1989
- * Only retrieve calls with specific range of start timestamp(s).
2395
+ * LLM token usage of the call, available after call ends. Not populated if using
2396
+ * custom LLM, realtime API, or no LLM call is made.
1990
2397
  */
1991
- interface StartTimestamp {
1992
- lower_threshold?: number;
1993
- upper_threshold?: number;
2398
+ interface LlmTokenUsage {
2399
+ /**
2400
+ * Average token count of the call.
2401
+ */
2402
+ average: number;
2403
+ /**
2404
+ * Number of requests made to the LLM.
2405
+ */
2406
+ num_requests: number;
2407
+ /**
2408
+ * All the token count values in the call.
2409
+ */
2410
+ values: Array<number>;
2411
+ }
2412
+ }
2413
+ interface V3PhoneCallResponse {
2414
+ /**
2415
+ * Corresponding agent id of this call.
2416
+ */
2417
+ agent_id: string;
2418
+ /**
2419
+ * The version of the agent.
2420
+ */
2421
+ agent_version: number;
2422
+ /**
2423
+ * Unique id of the call. Used to identify the call in the LLM websocket and used
2424
+ * to authenticate in the audio websocket.
2425
+ */
2426
+ call_id: string;
2427
+ /**
2428
+ * Status of call.
2429
+ *
2430
+ * - `registered`: Call id issued, starting to make a call using this id.
2431
+ * - `ongoing`: Call connected and ongoing.
2432
+ * - `ended`: The underlying websocket has ended for the call. Either user or agent
2433
+ * hung up, or call transferred.
2434
+ * - `error`: Call encountered error.
2435
+ */
2436
+ call_status: 'registered' | 'not_connected' | 'ongoing' | 'ended' | 'error';
2437
+ /**
2438
+ * Type of the call. Used to distinguish between web call and phone call.
2439
+ */
2440
+ call_type: 'phone_call';
2441
+ /**
2442
+ * Direction of the phone call.
2443
+ */
2444
+ direction: 'inbound' | 'outbound';
2445
+ /**
2446
+ * The caller number.
2447
+ */
2448
+ from_number: string;
2449
+ /**
2450
+ * The callee number.
2451
+ */
2452
+ to_number: string;
2453
+ /**
2454
+ * Name of the agent.
2455
+ */
2456
+ agent_name?: string;
2457
+ /**
2458
+ * Post call analysis that includes information such as sentiment, status, summary,
2459
+ * and custom defined data to extract. Available after call ends. Subscribe to
2460
+ * `call_analyzed` webhook event type to receive it once ready.
2461
+ */
2462
+ call_analysis?: V3PhoneCallResponse.CallAnalysis;
2463
+ /**
2464
+ * Cost of the call, including all the products and their costs and discount.
2465
+ */
2466
+ call_cost?: V3PhoneCallResponse.CallCost;
2467
+ /**
2468
+ * Dynamic variables collected from the call. Only available after the call ends.
2469
+ */
2470
+ collected_dynamic_variables?: {
2471
+ [key: string]: unknown;
2472
+ };
2473
+ /**
2474
+ * Custom SIP headers to be added to the call.
2475
+ */
2476
+ custom_sip_headers?: {
2477
+ [key: string]: string;
2478
+ };
2479
+ /**
2480
+ * Data storage setting for this call's agent. "everything" stores all data,
2481
+ * "everything_except_pii" excludes PII when possible, "basic_attributes_only"
2482
+ * stores only metadata.
2483
+ */
2484
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only' | null;
2485
+ /**
2486
+ * The reason for the disconnection of the call. Read detailed description about
2487
+ * reasons listed here at
2488
+ * [Disconnection Reason Doc](/reliability/debug-call-disconnect#understanding-disconnection-reasons).
2489
+ */
2490
+ disconnection_reason?: 'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped';
2491
+ /**
2492
+ * Duration of the call in milliseconds. Available after call ends.
2493
+ */
2494
+ duration_ms?: number;
2495
+ /**
2496
+ * End timestamp (milliseconds since epoch) of the call. Available after call ends.
2497
+ */
2498
+ end_timestamp?: number;
2499
+ /**
2500
+ * URL to the knowledge base retrieved contents of the call. Available after call
2501
+ * ends if the call utilizes knowledge base feature. It consists of the respond id
2502
+ * and the retrieved contents related to that response. It's already rendered in
2503
+ * call history tab of dashboard, and you can also manually download and check
2504
+ * against the transcript to view the knowledge base retrieval results.
2505
+ */
2506
+ knowledge_base_retrieved_contents_url?: string;
2507
+ /**
2508
+ * Latency tracking of the call, available after call ends. Not all fields here
2509
+ * will be available, as it depends on the type of call and feature used.
2510
+ */
2511
+ latency?: V3PhoneCallResponse.Latency;
2512
+ /**
2513
+ * LLM token usage of the call, available after call ends. Not populated if using
2514
+ * custom LLM, realtime API, or no LLM call is made.
2515
+ */
2516
+ llm_token_usage?: V3PhoneCallResponse.LlmTokenUsage;
2517
+ /**
2518
+ * An arbitrary object for storage purpose only. You can put anything here like
2519
+ * your internal customer id associated with the call. Not used for processing. You
2520
+ * can later get this field from the call object.
2521
+ */
2522
+ metadata?: unknown;
2523
+ /**
2524
+ * Whether this agent opts in for signed URLs for public logs and recordings. When
2525
+ * enabled, the generated URLs will include security signatures that restrict
2526
+ * access and automatically expire after 24 hours.
2527
+ */
2528
+ opt_in_signed_url?: boolean;
2529
+ /**
2530
+ * Public log of the call, containing details about all the requests and responses
2531
+ * received in LLM WebSocket, latency tracking for each turntaking, helpful for
2532
+ * debugging and tracing. Available after call ends.
2533
+ */
2534
+ public_log_url?: string;
2535
+ /**
2536
+ * Recording of the call, with each party's audio stored in a separate channel.
2537
+ * Available after the call ends.
2538
+ */
2539
+ recording_multi_channel_url?: string;
2540
+ /**
2541
+ * Recording of the call. Available after call ends.
2542
+ */
2543
+ recording_url?: string;
2544
+ /**
2545
+ * Add optional dynamic variables in key value pairs of string that injects into
2546
+ * your Response Engine prompt and tool description. Only applicable for Response
2547
+ * Engine.
2548
+ */
2549
+ retell_llm_dynamic_variables?: {
2550
+ [key: string]: unknown;
2551
+ };
2552
+ /**
2553
+ * Recording of the call without PII, with each party's audio stored in a separate
2554
+ * channel. Available after the call ends.
2555
+ */
2556
+ scrubbed_recording_multi_channel_url?: string;
2557
+ /**
2558
+ * Recording of the call without PII. Available after call ends.
2559
+ */
2560
+ scrubbed_recording_url?: string;
2561
+ /**
2562
+ * Begin timestamp (milliseconds since epoch) of the call. Available after call
2563
+ * starts.
2564
+ */
2565
+ start_timestamp?: number;
2566
+ /**
2567
+ * Telephony identifier of the call, populated when available. Tracking purposes
2568
+ * only.
2569
+ */
2570
+ telephony_identifier?: V3PhoneCallResponse.TelephonyIdentifier;
2571
+ /**
2572
+ * The destination number or identifier where the call was transferred to. Only
2573
+ * populated when the disconnection reason was `call_transfer`. Can be a phone
2574
+ * number or a SIP URI. SIP URIs are prefixed with "sip:" and may include a
2575
+ * ";transport=..." portion (if transport is known) where the transport type can be
2576
+ * "tls", "tcp" or "udp".
2577
+ */
2578
+ transfer_destination?: string | null;
2579
+ /**
2580
+ * Transfer end timestamp (milliseconds since epoch) of the call. Available after
2581
+ * transfer call ends.
2582
+ */
2583
+ transfer_end_timestamp?: number;
2584
+ }
2585
+ namespace V3PhoneCallResponse {
2586
+ /**
2587
+ * Post call analysis that includes information such as sentiment, status, summary,
2588
+ * and custom defined data to extract. Available after call ends. Subscribe to
2589
+ * `call_analyzed` webhook event type to receive it once ready.
2590
+ */
2591
+ interface CallAnalysis {
2592
+ /**
2593
+ * Whether the agent seems to have a successful call with the user, where the agent
2594
+ * finishes the task, and the call was complete without being cutoff.
2595
+ */
2596
+ call_successful?: boolean;
2597
+ /**
2598
+ * A high level summary of the call.
2599
+ */
2600
+ call_summary?: string;
2601
+ /**
2602
+ * Custom analysis data that was extracted based on the schema defined in agent
2603
+ * post call analysis data. Can be empty if nothing is specified.
2604
+ */
2605
+ custom_analysis_data?: unknown;
2606
+ /**
2607
+ * Whether the call is entered voicemail.
2608
+ */
2609
+ in_voicemail?: boolean;
2610
+ /**
2611
+ * Sentiment of the user in the call.
2612
+ */
2613
+ user_sentiment?: 'Negative' | 'Positive' | 'Neutral' | 'Unknown';
2614
+ }
2615
+ /**
2616
+ * Cost of the call, including all the products and their costs and discount.
2617
+ */
2618
+ interface CallCost {
2619
+ /**
2620
+ * Combined cost of all individual costs in cents
2621
+ */
2622
+ combined_cost: number;
2623
+ /**
2624
+ * List of products with their unit prices and costs in cents
2625
+ */
2626
+ product_costs: Array<CallCost.ProductCost>;
2627
+ /**
2628
+ * Total duration of the call in seconds
2629
+ */
2630
+ total_duration_seconds: number;
2631
+ /**
2632
+ * Total unit duration price of all products in cents per second
2633
+ */
2634
+ total_duration_unit_price: number;
2635
+ }
2636
+ namespace CallCost {
2637
+ interface ProductCost {
2638
+ /**
2639
+ * Cost for the product in cents for the duration of the call.
2640
+ */
2641
+ cost: number;
2642
+ /**
2643
+ * Product name that has a cost associated with it.
2644
+ */
2645
+ product: string;
2646
+ /**
2647
+ * True if this cost item is for a transfer segment.
2648
+ */
2649
+ is_transfer_leg_cost?: boolean;
2650
+ /**
2651
+ * Unit price of the product in cents per second.
2652
+ */
2653
+ unit_price?: number;
2654
+ }
2655
+ }
2656
+ /**
2657
+ * Latency tracking of the call, available after call ends. Not all fields here
2658
+ * will be available, as it depends on the type of call and feature used.
2659
+ */
2660
+ interface Latency {
2661
+ /**
2662
+ * Transcription latency (diff between the duration of the chunks streamed and the
2663
+ * durations of the transcribed part) tracking of the call.
2664
+ */
2665
+ asr?: Latency.Asr;
2666
+ /**
2667
+ * End to end latency (from user stops talking to agent start talking) tracking of
2668
+ * the call. This latency does not account for the network trip time from Retell
2669
+ * server to user frontend. The latency is tracked every time turn change between
2670
+ * user and agent.
2671
+ */
2672
+ e2e?: Latency.E2E;
2673
+ /**
2674
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
2675
+ * relevant context received) tracking of the call. Only populated when using
2676
+ * knowledge base feature for the agent of the call.
2677
+ */
2678
+ knowledge_base?: Latency.KnowledgeBase;
2679
+ /**
2680
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
2681
+ * of the call. When using custom LLM. this latency includes LLM websocket
2682
+ * roundtrip time between user server and Retell server.
2683
+ */
2684
+ llm?: Latency.Llm;
2685
+ /**
2686
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
2687
+ * of the call. Only populated for calls using custom LLM.
2688
+ */
2689
+ llm_websocket_network_rtt?: Latency.LlmWebsocketNetworkRtt;
2690
+ /**
2691
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
2692
+ * received) tracking of the call. Only populated for calls that uses S2S model
2693
+ * like Realtime API.
2694
+ */
2695
+ s2s?: Latency.S2s;
2696
+ /**
2697
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
2698
+ * tracking of the call.
2699
+ */
2700
+ tts?: Latency.Tts;
2701
+ }
2702
+ namespace Latency {
2703
+ /**
2704
+ * Transcription latency (diff between the duration of the chunks streamed and the
2705
+ * durations of the transcribed part) tracking of the call.
2706
+ */
2707
+ interface Asr {
2708
+ /**
2709
+ * Maximum latency in the call, measured in milliseconds.
2710
+ */
2711
+ max?: number;
2712
+ /**
2713
+ * Minimum latency in the call, measured in milliseconds.
2714
+ */
2715
+ min?: number;
2716
+ /**
2717
+ * Number of data points (number of times latency is tracked).
2718
+ */
2719
+ num?: number;
2720
+ /**
2721
+ * 50 percentile of latency, measured in milliseconds.
2722
+ */
2723
+ p50?: number;
2724
+ /**
2725
+ * 90 percentile of latency, measured in milliseconds.
2726
+ */
2727
+ p90?: number;
2728
+ /**
2729
+ * 95 percentile of latency, measured in milliseconds.
2730
+ */
2731
+ p95?: number;
2732
+ /**
2733
+ * 99 percentile of latency, measured in milliseconds.
2734
+ */
2735
+ p99?: number;
2736
+ /**
2737
+ * All the latency data points in the call, measured in milliseconds.
2738
+ */
2739
+ values?: Array<number>;
2740
+ }
2741
+ /**
2742
+ * End to end latency (from user stops talking to agent start talking) tracking of
2743
+ * the call. This latency does not account for the network trip time from Retell
2744
+ * server to user frontend. The latency is tracked every time turn change between
2745
+ * user and agent.
2746
+ */
2747
+ interface E2E {
2748
+ /**
2749
+ * Maximum latency in the call, measured in milliseconds.
2750
+ */
2751
+ max?: number;
2752
+ /**
2753
+ * Minimum latency in the call, measured in milliseconds.
2754
+ */
2755
+ min?: number;
2756
+ /**
2757
+ * Number of data points (number of times latency is tracked).
2758
+ */
2759
+ num?: number;
2760
+ /**
2761
+ * 50 percentile of latency, measured in milliseconds.
2762
+ */
2763
+ p50?: number;
2764
+ /**
2765
+ * 90 percentile of latency, measured in milliseconds.
2766
+ */
2767
+ p90?: number;
2768
+ /**
2769
+ * 95 percentile of latency, measured in milliseconds.
2770
+ */
2771
+ p95?: number;
2772
+ /**
2773
+ * 99 percentile of latency, measured in milliseconds.
2774
+ */
2775
+ p99?: number;
2776
+ /**
2777
+ * All the latency data points in the call, measured in milliseconds.
2778
+ */
2779
+ values?: Array<number>;
2780
+ }
2781
+ /**
2782
+ * Knowledge base latency (from the triggering of knowledge base retrival to all
2783
+ * relevant context received) tracking of the call. Only populated when using
2784
+ * knowledge base feature for the agent of the call.
2785
+ */
2786
+ interface KnowledgeBase {
2787
+ /**
2788
+ * Maximum latency in the call, measured in milliseconds.
2789
+ */
2790
+ max?: number;
2791
+ /**
2792
+ * Minimum latency in the call, measured in milliseconds.
2793
+ */
2794
+ min?: number;
2795
+ /**
2796
+ * Number of data points (number of times latency is tracked).
2797
+ */
2798
+ num?: number;
2799
+ /**
2800
+ * 50 percentile of latency, measured in milliseconds.
2801
+ */
2802
+ p50?: number;
2803
+ /**
2804
+ * 90 percentile of latency, measured in milliseconds.
2805
+ */
2806
+ p90?: number;
2807
+ /**
2808
+ * 95 percentile of latency, measured in milliseconds.
2809
+ */
2810
+ p95?: number;
2811
+ /**
2812
+ * 99 percentile of latency, measured in milliseconds.
2813
+ */
2814
+ p99?: number;
2815
+ /**
2816
+ * All the latency data points in the call, measured in milliseconds.
2817
+ */
2818
+ values?: Array<number>;
2819
+ }
2820
+ /**
2821
+ * LLM latency (from issue of LLM call to first speakable chunk received) tracking
2822
+ * of the call. When using custom LLM. this latency includes LLM websocket
2823
+ * roundtrip time between user server and Retell server.
2824
+ */
2825
+ interface Llm {
2826
+ /**
2827
+ * Maximum latency in the call, measured in milliseconds.
2828
+ */
2829
+ max?: number;
2830
+ /**
2831
+ * Minimum latency in the call, measured in milliseconds.
2832
+ */
2833
+ min?: number;
2834
+ /**
2835
+ * Number of data points (number of times latency is tracked).
2836
+ */
2837
+ num?: number;
2838
+ /**
2839
+ * 50 percentile of latency, measured in milliseconds.
2840
+ */
2841
+ p50?: number;
2842
+ /**
2843
+ * 90 percentile of latency, measured in milliseconds.
2844
+ */
2845
+ p90?: number;
2846
+ /**
2847
+ * 95 percentile of latency, measured in milliseconds.
2848
+ */
2849
+ p95?: number;
2850
+ /**
2851
+ * 99 percentile of latency, measured in milliseconds.
2852
+ */
2853
+ p99?: number;
2854
+ /**
2855
+ * All the latency data points in the call, measured in milliseconds.
2856
+ */
2857
+ values?: Array<number>;
2858
+ }
2859
+ /**
2860
+ * LLM websocket roundtrip latency (between user server and Retell server) tracking
2861
+ * of the call. Only populated for calls using custom LLM.
2862
+ */
2863
+ interface LlmWebsocketNetworkRtt {
2864
+ /**
2865
+ * Maximum latency in the call, measured in milliseconds.
2866
+ */
2867
+ max?: number;
2868
+ /**
2869
+ * Minimum latency in the call, measured in milliseconds.
2870
+ */
2871
+ min?: number;
2872
+ /**
2873
+ * Number of data points (number of times latency is tracked).
2874
+ */
2875
+ num?: number;
2876
+ /**
2877
+ * 50 percentile of latency, measured in milliseconds.
2878
+ */
2879
+ p50?: number;
2880
+ /**
2881
+ * 90 percentile of latency, measured in milliseconds.
2882
+ */
2883
+ p90?: number;
2884
+ /**
2885
+ * 95 percentile of latency, measured in milliseconds.
2886
+ */
2887
+ p95?: number;
2888
+ /**
2889
+ * 99 percentile of latency, measured in milliseconds.
2890
+ */
2891
+ p99?: number;
2892
+ /**
2893
+ * All the latency data points in the call, measured in milliseconds.
2894
+ */
2895
+ values?: Array<number>;
2896
+ }
2897
+ /**
2898
+ * Speech-to-speech latency (from requesting responses of a S2S model to first byte
2899
+ * received) tracking of the call. Only populated for calls that uses S2S model
2900
+ * like Realtime API.
2901
+ */
2902
+ interface S2s {
2903
+ /**
2904
+ * Maximum latency in the call, measured in milliseconds.
2905
+ */
2906
+ max?: number;
2907
+ /**
2908
+ * Minimum latency in the call, measured in milliseconds.
2909
+ */
2910
+ min?: number;
2911
+ /**
2912
+ * Number of data points (number of times latency is tracked).
2913
+ */
2914
+ num?: number;
2915
+ /**
2916
+ * 50 percentile of latency, measured in milliseconds.
2917
+ */
2918
+ p50?: number;
2919
+ /**
2920
+ * 90 percentile of latency, measured in milliseconds.
2921
+ */
2922
+ p90?: number;
2923
+ /**
2924
+ * 95 percentile of latency, measured in milliseconds.
2925
+ */
2926
+ p95?: number;
2927
+ /**
2928
+ * 99 percentile of latency, measured in milliseconds.
2929
+ */
2930
+ p99?: number;
2931
+ /**
2932
+ * All the latency data points in the call, measured in milliseconds.
2933
+ */
2934
+ values?: Array<number>;
2935
+ }
2936
+ /**
2937
+ * Text-to-speech latency (from the triggering of TTS to first byte received)
2938
+ * tracking of the call.
2939
+ */
2940
+ interface Tts {
2941
+ /**
2942
+ * Maximum latency in the call, measured in milliseconds.
2943
+ */
2944
+ max?: number;
2945
+ /**
2946
+ * Minimum latency in the call, measured in milliseconds.
2947
+ */
2948
+ min?: number;
2949
+ /**
2950
+ * Number of data points (number of times latency is tracked).
2951
+ */
2952
+ num?: number;
2953
+ /**
2954
+ * 50 percentile of latency, measured in milliseconds.
2955
+ */
2956
+ p50?: number;
2957
+ /**
2958
+ * 90 percentile of latency, measured in milliseconds.
2959
+ */
2960
+ p90?: number;
2961
+ /**
2962
+ * 95 percentile of latency, measured in milliseconds.
2963
+ */
2964
+ p95?: number;
2965
+ /**
2966
+ * 99 percentile of latency, measured in milliseconds.
2967
+ */
2968
+ p99?: number;
2969
+ /**
2970
+ * All the latency data points in the call, measured in milliseconds.
2971
+ */
2972
+ values?: Array<number>;
2973
+ }
2974
+ }
2975
+ /**
2976
+ * LLM token usage of the call, available after call ends. Not populated if using
2977
+ * custom LLM, realtime API, or no LLM call is made.
2978
+ */
2979
+ interface LlmTokenUsage {
2980
+ /**
2981
+ * Average token count of the call.
2982
+ */
2983
+ average: number;
2984
+ /**
2985
+ * Number of requests made to the LLM.
2986
+ */
2987
+ num_requests: number;
2988
+ /**
2989
+ * All the token count values in the call.
2990
+ */
2991
+ values: Array<number>;
2992
+ }
2993
+ /**
2994
+ * Telephony identifier of the call, populated when available. Tracking purposes
2995
+ * only.
2996
+ */
2997
+ interface TelephonyIdentifier {
2998
+ /**
2999
+ * Twilio call sid.
3000
+ */
3001
+ twilio_call_sid?: string;
3002
+ }
3003
+ }
3004
+ }
3005
+ export interface CallUpdateParams {
3006
+ /**
3007
+ * Custom attributes for the call
3008
+ */
3009
+ custom_attributes?: {
3010
+ [key: string]: string | number | boolean;
3011
+ };
3012
+ /**
3013
+ * Data storage setting for this call. Overrides the agent's default setting.
3014
+ * "everything" stores all data, "everything_except_pii" excludes PII when
3015
+ * possible, "basic_attributes_only" stores only metadata. Cannot be downgraded
3016
+ * from more restrictive to less restrictive settings.
3017
+ */
3018
+ data_storage_setting?: 'everything' | 'everything_except_pii' | 'basic_attributes_only';
3019
+ /**
3020
+ * An arbitrary object for storage purpose only. You can put anything here like
3021
+ * your internal customer id associated with the call. Not used for processing. You
3022
+ * can later get this field from the call object. Size limited to 50kB max.
3023
+ */
3024
+ metadata?: unknown;
3025
+ /**
3026
+ * Override dynamic varaibles represented as key-value pairs of strings. Setting
3027
+ * this will override or add the dynamic variables set in the agent during the
3028
+ * call. Only need to set the delta where you want to override, no need to set the
3029
+ * entire dynamic variables object. Setting this to null will remove any existing
3030
+ * override.
3031
+ */
3032
+ override_dynamic_variables?: {
3033
+ [key: string]: string;
3034
+ } | null;
3035
+ }
3036
+ export interface CallListParams {
3037
+ /**
3038
+ * Filter criteria for calls. All conditions are implicitly connected with AND.
3039
+ */
3040
+ filter_criteria?: CallListParams.FilterCriteria;
3041
+ /**
3042
+ * Maximum number of calls to return.
3043
+ */
3044
+ limit?: number;
3045
+ /**
3046
+ * Opaque pagination cursor from a previous response.
3047
+ */
3048
+ pagination_key?: string;
3049
+ /**
3050
+ * Number of records to skip for pagination.
3051
+ */
3052
+ skip?: number;
3053
+ /**
3054
+ * Sort calls by `start_timestamp` in ascending or descending order.
3055
+ */
3056
+ sort_order?: 'ascending' | 'descending';
3057
+ }
3058
+ export declare namespace CallListParams {
3059
+ /**
3060
+ * Filter criteria for calls. All conditions are implicitly connected with AND.
3061
+ */
3062
+ interface FilterCriteria {
3063
+ /**
3064
+ * Filter by agent(s). Agent filters are connected by OR.
3065
+ */
3066
+ agent?: Array<FilterCriteria.Agent>;
3067
+ /**
3068
+ * Filter by batch call ID.
3069
+ */
3070
+ batch_call_id?: FilterCriteria.BatchCallID;
3071
+ /**
3072
+ * Filter by call ID.
3073
+ */
3074
+ call_id?: FilterCriteria.CallID;
3075
+ call_status?: FilterCriteria.CallStatus;
3076
+ /**
3077
+ * Filter by whether the call was successful.
3078
+ */
3079
+ call_successful?: FilterCriteria.CallSuccessful;
3080
+ call_type?: FilterCriteria.CallType;
3081
+ /**
3082
+ * Filter by combined cost of the call.
3083
+ */
3084
+ combined_cost?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter;
3085
+ /**
3086
+ * Filter by custom analysis data fields.
3087
+ */
3088
+ custom_analysis_data?: Array<FilterCriteria.StringFilter | FilterCriteria.NumberFilter | FilterCriteria.BooleanFilter | FilterCriteria.RangeFilter | FilterCriteria.EnumFilter | FilterCriteria.PresentFilter>;
3089
+ /**
3090
+ * Filter by custom attributes fields.
3091
+ */
3092
+ custom_attributes?: Array<FilterCriteria.StringFilter | FilterCriteria.NumberFilter | FilterCriteria.BooleanFilter | FilterCriteria.RangeFilter | FilterCriteria.EnumFilter | FilterCriteria.PresentFilter>;
3093
+ data_storage_setting?: FilterCriteria.DataStorageSetting;
3094
+ direction?: FilterCriteria.Direction;
3095
+ disconnection_reason?: FilterCriteria.DisconnectionReason;
3096
+ /**
3097
+ * Filter by call duration in milliseconds.
3098
+ */
3099
+ duration_ms?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter;
3100
+ /**
3101
+ * Filter by dynamic variables.
3102
+ */
3103
+ dynamic_variables?: Array<FilterCriteria.DynamicVariable>;
3104
+ /**
3105
+ * Filter by end-to-end latency p50.
3106
+ */
3107
+ e2e_latency_p50?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter;
3108
+ /**
3109
+ * Filter by call end timestamp (epoch ms).
3110
+ */
3111
+ end_timestamp?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter;
3112
+ /**
3113
+ * Filter by from number.
3114
+ */
3115
+ from_number?: FilterCriteria.FromNumber;
3116
+ /**
3117
+ * Filter by whether the call is in voicemail.
3118
+ */
3119
+ in_voicemail?: FilterCriteria.InVoicemail;
3120
+ /**
3121
+ * Filter by metadata fields.
3122
+ */
3123
+ metadata?: Array<FilterCriteria.StringFilter | FilterCriteria.NumberFilter | FilterCriteria.BooleanFilter | FilterCriteria.RangeFilter | FilterCriteria.EnumFilter | FilterCriteria.PresentFilter>;
3124
+ /**
3125
+ * Filter by call start timestamp (epoch ms).
3126
+ */
3127
+ start_timestamp?: FilterCriteria.NumberFilter | FilterCriteria.RangeFilter;
3128
+ /**
3129
+ * Filter by to number.
3130
+ */
3131
+ to_number?: FilterCriteria.ToNumber;
3132
+ /**
3133
+ * Filter by tool call criteria. Tool call filters are connected by AND.
3134
+ */
3135
+ tool_calls?: Array<FilterCriteria.ToolCall>;
3136
+ user_sentiment?: FilterCriteria.UserSentiment;
3137
+ }
3138
+ namespace FilterCriteria {
3139
+ interface Agent {
3140
+ /**
3141
+ * The agent ID to filter on.
3142
+ */
3143
+ agent_id: string;
3144
+ /**
3145
+ * Specific versions to filter on. If not provided, all versions are included.
3146
+ */
3147
+ version?: Array<number>;
3148
+ }
3149
+ /**
3150
+ * Filter by batch call ID.
3151
+ */
3152
+ interface BatchCallID {
3153
+ /**
3154
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
3155
+ */
3156
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
3157
+ type: 'string';
3158
+ value: string;
3159
+ }
3160
+ /**
3161
+ * Filter by call ID.
3162
+ */
3163
+ interface CallID {
3164
+ /**
3165
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
3166
+ */
3167
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
3168
+ type: 'string';
3169
+ value: string;
3170
+ }
3171
+ interface CallStatus {
3172
+ /**
3173
+ * in: value is one of the listed values
3174
+ */
3175
+ op: 'in';
3176
+ type: 'enum';
3177
+ value: Array<'not_connected' | 'ongoing' | 'ended' | 'error'>;
3178
+ }
3179
+ /**
3180
+ * Filter by whether the call was successful.
3181
+ */
3182
+ interface CallSuccessful {
3183
+ op: 'eq';
3184
+ type: 'boolean';
3185
+ value: boolean;
3186
+ }
3187
+ interface CallType {
3188
+ /**
3189
+ * in: value is one of the listed values
3190
+ */
3191
+ op: 'in';
3192
+ type: 'enum';
3193
+ value: Array<'web_call' | 'phone_call'>;
3194
+ }
3195
+ interface NumberFilter {
3196
+ /**
3197
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3198
+ * than, le: less than or equal
3199
+ */
3200
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3201
+ type: 'number';
3202
+ value: number;
3203
+ }
3204
+ interface RangeFilter {
3205
+ /**
3206
+ * bt: between
3207
+ */
3208
+ op: 'bt';
3209
+ type: 'range';
3210
+ /**
3211
+ * [lower_bound, upper_bound]
3212
+ */
3213
+ value: Array<number>;
3214
+ }
3215
+ interface StringFilter {
3216
+ /**
3217
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
3218
+ */
3219
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
3220
+ type: 'string';
3221
+ value: string;
3222
+ /**
3223
+ * The field name to filter on.
3224
+ */
3225
+ key?: string;
3226
+ }
3227
+ interface NumberFilter {
3228
+ /**
3229
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3230
+ * than, le: less than or equal
3231
+ */
3232
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3233
+ type: 'number';
3234
+ value: number;
3235
+ /**
3236
+ * The field name to filter on.
3237
+ */
3238
+ key?: string;
3239
+ }
3240
+ interface BooleanFilter {
3241
+ op: 'eq';
3242
+ type: 'boolean';
3243
+ value: boolean;
3244
+ /**
3245
+ * The field name to filter on.
3246
+ */
3247
+ key?: string;
3248
+ }
3249
+ interface RangeFilter {
3250
+ /**
3251
+ * bt: between
3252
+ */
3253
+ op: 'bt';
3254
+ type: 'range';
3255
+ /**
3256
+ * [lower_bound, upper_bound]
3257
+ */
3258
+ value: Array<number>;
3259
+ /**
3260
+ * The field name to filter on.
3261
+ */
3262
+ key?: string;
3263
+ }
3264
+ interface EnumFilter {
3265
+ /**
3266
+ * in: value is one of the listed values
3267
+ */
3268
+ op: 'in';
3269
+ type: 'enum';
3270
+ value: Array<string>;
3271
+ /**
3272
+ * The field name to filter on.
3273
+ */
3274
+ key?: string;
3275
+ }
3276
+ interface PresentFilter {
3277
+ /**
3278
+ * pr: present (has value), np: not present
3279
+ */
3280
+ op: 'pr' | 'np';
3281
+ type: 'present';
3282
+ /**
3283
+ * The field name to filter on.
3284
+ */
3285
+ key?: string;
3286
+ }
3287
+ interface StringFilter {
3288
+ /**
3289
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
3290
+ */
3291
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
3292
+ type: 'string';
3293
+ value: string;
3294
+ /**
3295
+ * The field name to filter on.
3296
+ */
3297
+ key?: string;
3298
+ }
3299
+ interface NumberFilter {
3300
+ /**
3301
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3302
+ * than, le: less than or equal
3303
+ */
3304
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3305
+ type: 'number';
3306
+ value: number;
3307
+ /**
3308
+ * The field name to filter on.
3309
+ */
3310
+ key?: string;
3311
+ }
3312
+ interface BooleanFilter {
3313
+ op: 'eq';
3314
+ type: 'boolean';
3315
+ value: boolean;
3316
+ /**
3317
+ * The field name to filter on.
3318
+ */
3319
+ key?: string;
3320
+ }
3321
+ interface RangeFilter {
3322
+ /**
3323
+ * bt: between
3324
+ */
3325
+ op: 'bt';
3326
+ type: 'range';
3327
+ /**
3328
+ * [lower_bound, upper_bound]
3329
+ */
3330
+ value: Array<number>;
3331
+ /**
3332
+ * The field name to filter on.
3333
+ */
3334
+ key?: string;
3335
+ }
3336
+ interface EnumFilter {
3337
+ /**
3338
+ * in: value is one of the listed values
3339
+ */
3340
+ op: 'in';
3341
+ type: 'enum';
3342
+ value: Array<string>;
3343
+ /**
3344
+ * The field name to filter on.
3345
+ */
3346
+ key?: string;
3347
+ }
3348
+ interface PresentFilter {
3349
+ /**
3350
+ * pr: present (has value), np: not present
3351
+ */
3352
+ op: 'pr' | 'np';
3353
+ type: 'present';
3354
+ /**
3355
+ * The field name to filter on.
3356
+ */
3357
+ key?: string;
3358
+ }
3359
+ interface DataStorageSetting {
3360
+ /**
3361
+ * in: value is one of the listed values
3362
+ */
3363
+ op: 'in';
3364
+ type: 'enum';
3365
+ value: Array<'everything' | 'everything_except_pii' | 'basic_attributes_only'>;
3366
+ }
3367
+ interface Direction {
3368
+ /**
3369
+ * in: value is one of the listed values
3370
+ */
3371
+ op: 'in';
3372
+ type: 'enum';
3373
+ value: Array<'inbound' | 'outbound'>;
3374
+ }
3375
+ interface DisconnectionReason {
3376
+ /**
3377
+ * in: value is one of the listed values
3378
+ */
3379
+ op: 'in';
3380
+ type: 'enum';
3381
+ value: Array<'user_hangup' | 'agent_hangup' | 'call_transfer' | 'voicemail_reached' | 'ivr_reached' | 'inactivity' | 'max_duration_reached' | 'concurrency_limit_reached' | 'no_valid_payment' | 'scam_detected' | 'dial_busy' | 'dial_failed' | 'dial_no_answer' | 'invalid_destination' | 'telephony_provider_permission_denied' | 'telephony_provider_unavailable' | 'sip_routing_error' | 'marked_as_spam' | 'user_declined' | 'error_llm_websocket_open' | 'error_llm_websocket_lost_connection' | 'error_llm_websocket_runtime' | 'error_llm_websocket_corrupt_payload' | 'error_no_audio_received' | 'error_asr' | 'error_retell' | 'error_unknown' | 'error_user_not_joined' | 'registered_call_timeout' | 'transfer_bridged' | 'transfer_cancelled' | 'manual_stopped'>;
3382
+ }
3383
+ interface NumberFilter {
3384
+ /**
3385
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3386
+ * than, le: less than or equal
3387
+ */
3388
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3389
+ type: 'number';
3390
+ value: number;
3391
+ }
3392
+ interface RangeFilter {
3393
+ /**
3394
+ * bt: between
3395
+ */
3396
+ op: 'bt';
3397
+ type: 'range';
3398
+ /**
3399
+ * [lower_bound, upper_bound]
3400
+ */
3401
+ value: Array<number>;
3402
+ }
3403
+ interface DynamicVariable {
3404
+ /**
3405
+ * The dynamic variable name to filter on.
3406
+ */
3407
+ key: string;
3408
+ /**
3409
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
3410
+ */
3411
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
3412
+ type: 'string';
3413
+ value: string;
3414
+ }
3415
+ interface NumberFilter {
3416
+ /**
3417
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3418
+ * than, le: less than or equal
3419
+ */
3420
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3421
+ type: 'number';
3422
+ value: number;
3423
+ }
3424
+ interface RangeFilter {
3425
+ /**
3426
+ * bt: between
3427
+ */
3428
+ op: 'bt';
3429
+ type: 'range';
3430
+ /**
3431
+ * [lower_bound, upper_bound]
3432
+ */
3433
+ value: Array<number>;
3434
+ }
3435
+ interface NumberFilter {
3436
+ /**
3437
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3438
+ * than, le: less than or equal
3439
+ */
3440
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3441
+ type: 'number';
3442
+ value: number;
3443
+ }
3444
+ interface RangeFilter {
3445
+ /**
3446
+ * bt: between
3447
+ */
3448
+ op: 'bt';
3449
+ type: 'range';
3450
+ /**
3451
+ * [lower_bound, upper_bound]
3452
+ */
3453
+ value: Array<number>;
3454
+ }
3455
+ /**
3456
+ * Filter by from number.
3457
+ */
3458
+ interface FromNumber {
3459
+ /**
3460
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
3461
+ */
3462
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
3463
+ type: 'string';
3464
+ value: string;
3465
+ }
3466
+ /**
3467
+ * Filter by whether the call is in voicemail.
3468
+ */
3469
+ interface InVoicemail {
3470
+ op: 'eq';
3471
+ type: 'boolean';
3472
+ value: boolean;
3473
+ }
3474
+ interface StringFilter {
3475
+ /**
3476
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
3477
+ */
3478
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
3479
+ type: 'string';
3480
+ value: string;
3481
+ /**
3482
+ * The field name to filter on.
3483
+ */
3484
+ key?: string;
3485
+ }
3486
+ interface NumberFilter {
3487
+ /**
3488
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3489
+ * than, le: less than or equal
3490
+ */
3491
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3492
+ type: 'number';
3493
+ value: number;
3494
+ /**
3495
+ * The field name to filter on.
3496
+ */
3497
+ key?: string;
3498
+ }
3499
+ interface BooleanFilter {
3500
+ op: 'eq';
3501
+ type: 'boolean';
3502
+ value: boolean;
3503
+ /**
3504
+ * The field name to filter on.
3505
+ */
3506
+ key?: string;
3507
+ }
3508
+ interface RangeFilter {
3509
+ /**
3510
+ * bt: between
3511
+ */
3512
+ op: 'bt';
3513
+ type: 'range';
3514
+ /**
3515
+ * [lower_bound, upper_bound]
3516
+ */
3517
+ value: Array<number>;
3518
+ /**
3519
+ * The field name to filter on.
3520
+ */
3521
+ key?: string;
3522
+ }
3523
+ interface EnumFilter {
3524
+ /**
3525
+ * in: value is one of the listed values
3526
+ */
3527
+ op: 'in';
3528
+ type: 'enum';
3529
+ value: Array<string>;
3530
+ /**
3531
+ * The field name to filter on.
3532
+ */
3533
+ key?: string;
3534
+ }
3535
+ interface PresentFilter {
3536
+ /**
3537
+ * pr: present (has value), np: not present
3538
+ */
3539
+ op: 'pr' | 'np';
3540
+ type: 'present';
3541
+ /**
3542
+ * The field name to filter on.
3543
+ */
3544
+ key?: string;
3545
+ }
3546
+ interface NumberFilter {
3547
+ /**
3548
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3549
+ * than, le: less than or equal
3550
+ */
3551
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3552
+ type: 'number';
3553
+ value: number;
3554
+ }
3555
+ interface RangeFilter {
3556
+ /**
3557
+ * bt: between
3558
+ */
3559
+ op: 'bt';
3560
+ type: 'range';
3561
+ /**
3562
+ * [lower_bound, upper_bound]
3563
+ */
3564
+ value: Array<number>;
3565
+ }
3566
+ /**
3567
+ * Filter by to number.
3568
+ */
3569
+ interface ToNumber {
3570
+ /**
3571
+ * eq: equal, ne: not equal, sw: starts with, ew: ends with, co: contains
3572
+ */
3573
+ op: 'eq' | 'ne' | 'sw' | 'ew' | 'co';
3574
+ type: 'string';
3575
+ value: string;
3576
+ }
3577
+ interface ToolCall {
3578
+ /**
3579
+ * The tool call name to filter on.
3580
+ */
3581
+ name: string;
3582
+ /**
3583
+ * Filter by tool call latency in milliseconds.
3584
+ */
3585
+ latency_ms?: ToolCall.NumberFilter | ToolCall.RangeFilter;
3586
+ /**
3587
+ * Filter by tool call success status.
3588
+ */
3589
+ success?: ToolCall.Success;
3590
+ }
3591
+ namespace ToolCall {
3592
+ interface NumberFilter {
3593
+ /**
3594
+ * eq: equal, ne: not equal, gt: greater than, ge: greater than or equal, lt: less
3595
+ * than, le: less than or equal
3596
+ */
3597
+ op: 'eq' | 'ne' | 'gt' | 'ge' | 'lt' | 'le';
3598
+ type: 'number';
3599
+ value: number;
3600
+ }
3601
+ interface RangeFilter {
3602
+ /**
3603
+ * bt: between
3604
+ */
3605
+ op: 'bt';
3606
+ type: 'range';
3607
+ /**
3608
+ * [lower_bound, upper_bound]
3609
+ */
3610
+ value: Array<number>;
3611
+ }
3612
+ /**
3613
+ * Filter by tool call success status.
3614
+ */
3615
+ interface Success {
3616
+ op: 'eq';
3617
+ type: 'boolean';
3618
+ value: boolean;
3619
+ }
3620
+ }
3621
+ interface UserSentiment {
3622
+ /**
3623
+ * in: value is one of the listed values
3624
+ */
3625
+ op: 'in';
3626
+ type: 'enum';
3627
+ value: Array<'Negative' | 'Positive' | 'Neutral' | 'Unknown'>;
1994
3628
  }
1995
3629
  }
1996
3630
  }
@@ -2380,7 +4014,7 @@ export declare namespace CallCreatePhoneCallParams {
2380
4014
  * available voice models. Set to null to remove voice model selection, and default
2381
4015
  * ones will apply. Check out dashboard for more details of each voice model.
2382
4016
  */
2383
- voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | null;
4017
+ voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | null;
2384
4018
  /**
2385
4019
  * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
2386
4020
  * speech, while higher value means faster speech rate. If unset, default value 1
@@ -2927,7 +4561,7 @@ export declare namespace CallCreatePhoneCallParams {
2927
4561
  * Select the underlying speech to speech model. Can only set this or model, not
2928
4562
  * both.
2929
4563
  */
2930
- s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
4564
+ s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
2931
4565
  /**
2932
4566
  * The speaker who starts the conversation. Required. Must be either 'user' or
2933
4567
  * 'agent'.
@@ -3329,7 +4963,7 @@ export declare namespace CallCreateWebCallParams {
3329
4963
  * available voice models. Set to null to remove voice model selection, and default
3330
4964
  * ones will apply. Check out dashboard for more details of each voice model.
3331
4965
  */
3332
- voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | null;
4966
+ voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | null;
3333
4967
  /**
3334
4968
  * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
3335
4969
  * speech, while higher value means faster speech rate. If unset, default value 1
@@ -3876,7 +5510,7 @@ export declare namespace CallCreateWebCallParams {
3876
5510
  * Select the underlying speech to speech model. Can only set this or model, not
3877
5511
  * both.
3878
5512
  */
3879
- s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
5513
+ s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
3880
5514
  /**
3881
5515
  * The speaker who starts the conversation. Required. Must be either 'user' or
3882
5516
  * 'agent'.
@@ -4277,7 +5911,7 @@ export declare namespace CallRegisterPhoneCallParams {
4277
5911
  * available voice models. Set to null to remove voice model selection, and default
4278
5912
  * ones will apply. Check out dashboard for more details of each voice model.
4279
5913
  */
4280
- voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | null;
5914
+ voice_model?: 'eleven_turbo_v2' | 'eleven_flash_v2' | 'eleven_turbo_v2_5' | 'eleven_flash_v2_5' | 'eleven_multilingual_v2' | 'eleven_v3' | 'sonic-3' | 'sonic-3-latest' | 'sonic-3.5' | 'tts-1' | 'gpt-4o-mini-tts' | 'speech-02-turbo' | 'speech-2.8-turbo' | 's1' | 's2-pro' | 's2.1-pro' | null;
4281
5915
  /**
4282
5916
  * Controls speed of voice. Value ranging from [0.5,2]. Lower value means slower
4283
5917
  * speech, while higher value means faster speech rate. If unset, default value 1
@@ -4824,7 +6458,7 @@ export declare namespace CallRegisterPhoneCallParams {
4824
6458
  * Select the underlying speech to speech model. Can only set this or model, not
4825
6459
  * both.
4826
6460
  */
4827
- s2s_model?: 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
6461
+ s2s_model?: 'gpt-realtime-2' | 'gpt-realtime-1.5' | 'gpt-realtime' | 'gpt-realtime-mini' | null;
4828
6462
  /**
4829
6463
  * The speaker who starts the conversation. Required. Must be either 'user' or
4830
6464
  * 'agent'.