@gtmi/ramp-agent-client 0.0.1

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.
@@ -0,0 +1,673 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+
3
+ import type { Client, ClientMeta, Options as Options2, RequestResult, TDataShape } from './client';
4
+ import { client } from './client.gen';
5
+ import type {
6
+ DeleteKillConversationByPhoneNumberData,
7
+ DeleteKillConversationByPhoneNumberErrors,
8
+ DeleteKillConversationByPhoneNumberResponses,
9
+ DeleteLiveNumbersByPhoneNumberData,
10
+ DeleteLiveNumbersByPhoneNumberErrors,
11
+ DeleteLiveNumbersByPhoneNumberResponses,
12
+ DeleteLiveNumbersData,
13
+ DeleteLiveNumbersErrors,
14
+ DeleteLiveNumbersResponses,
15
+ GetActiveConversationsAgentByAgentNumberData,
16
+ GetActiveConversationsAgentByAgentNumberErrors,
17
+ GetActiveConversationsAgentByAgentNumberResponses,
18
+ GetActiveConversationsByCustomerNumberData,
19
+ GetActiveConversationsByCustomerNumberErrors,
20
+ GetActiveConversationsByCustomerNumberResponses,
21
+ GetCountryConfigsData,
22
+ GetCountryConfigsErrors,
23
+ GetCountryConfigsResponses,
24
+ GetDocsOpenapiJsonData,
25
+ GetDocsOpenapiJsonErrors,
26
+ GetDocsOpenapiJsonResponses,
27
+ GetHealthData,
28
+ GetHealthErrors,
29
+ GetHealthResponses,
30
+ GetLiveNumbersData,
31
+ GetLiveNumbersErrors,
32
+ GetLiveNumbersResponses,
33
+ GetOutboundCallByCallSidData,
34
+ GetOutboundCallByCallSidErrors,
35
+ GetOutboundCallByCallSidResponses,
36
+ GetPhoneLogsByPhoneNumberData,
37
+ GetPhoneLogsByPhoneNumberErrors,
38
+ GetPhoneLogsByPhoneNumberResponses,
39
+ GetRecentlyActiveNumbersData,
40
+ GetRecentlyActiveNumbersErrors,
41
+ GetRecentlyActiveNumbersResponses,
42
+ GetStatsData,
43
+ GetStatsErrors,
44
+ GetStatsResponses,
45
+ GetStressTestData,
46
+ GetStressTestErrors,
47
+ GetStressTestResponses,
48
+ PostActiveConversationsAgentClaimData,
49
+ PostActiveConversationsAgentClaimErrors,
50
+ PostActiveConversationsAgentClaimResponses,
51
+ PostAddMessageData,
52
+ PostAddMessageErrors,
53
+ PostAddMessageResponses,
54
+ PostCallData,
55
+ PostCallErrors,
56
+ PostCallResponses,
57
+ PostCintelOperatorsData,
58
+ PostCintelOperatorsErrors,
59
+ PostCintelOperatorsResponses,
60
+ PostCommunicationTextData,
61
+ PostCommunicationTextErrors,
62
+ PostCommunicationTextResponses,
63
+ PostExportLogsData,
64
+ PostExportLogsErrors,
65
+ PostExportLogsResponses,
66
+ PostFlexTranscriptionData,
67
+ PostFlexTranscriptionErrors,
68
+ PostFlexTranscriptionResponses,
69
+ PostLiveAgentData,
70
+ PostLiveAgentErrors,
71
+ PostLiveAgentResponses,
72
+ PostOutboundCallData,
73
+ PostOutboundCallErrors,
74
+ PostOutboundCallResponses,
75
+ PostOutboundCommunicationTextData,
76
+ PostOutboundCommunicationTextErrors,
77
+ PostOutboundCommunicationTextResponses,
78
+ PostRedirectToLiveAgentData,
79
+ PostRedirectToLiveAgentErrors,
80
+ PostRedirectToLiveAgentResponses,
81
+ PostResolvePhoneData,
82
+ PostResolvePhoneErrors,
83
+ PostResolvePhoneResponses,
84
+ PostSendEmailData,
85
+ PostSendEmailErrors,
86
+ PostSendEmailResponses,
87
+ PostStressTestSmsData,
88
+ PostStressTestSmsErrors,
89
+ PostStressTestSmsResponses,
90
+ PostTaskrouterWebhookData,
91
+ PostTaskrouterWebhookErrors,
92
+ PostTaskrouterWebhookResponses,
93
+ PostWebchatSendData,
94
+ PostWebchatSendErrors,
95
+ PostWebchatSendResponses,
96
+ } from './types.gen';
97
+
98
+ export type Options<
99
+ TData extends TDataShape = TDataShape,
100
+ ThrowOnError extends boolean = boolean,
101
+ TResponse = unknown,
102
+ > = Options2<TData, ThrowOnError, TResponse> & {
103
+ /**
104
+ * You can provide a client instance returned by `createClient()` instead of
105
+ * individual options. This might be also useful if you want to implement a
106
+ * custom client.
107
+ */
108
+ client?: Client;
109
+ /**
110
+ * You can pass arbitrary values through the `meta` object. This can be
111
+ * used to access values that aren't defined as part of the SDK function.
112
+ */
113
+ meta?: keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta;
114
+ };
115
+
116
+ /**
117
+ * GET /country-configs
118
+ *
119
+ * Returns the list of available country configurations with their phone numbers
120
+ */
121
+ export const getCountryConfigs = <ThrowOnError extends boolean = false>(
122
+ options?: Options<GetCountryConfigsData, ThrowOnError>,
123
+ ): RequestResult<GetCountryConfigsResponses, GetCountryConfigsErrors, ThrowOnError> =>
124
+ (options?.client ?? client).get<
125
+ GetCountryConfigsResponses,
126
+ GetCountryConfigsErrors,
127
+ ThrowOnError
128
+ >({
129
+ security: [{ scheme: 'bearer', type: 'http' }],
130
+ url: '/country-configs',
131
+ ...options,
132
+ });
133
+
134
+ /**
135
+ * GET /recently-active-numbers
136
+ *
137
+ * Retrieves a list of all phone numbers with recent activity, including both
138
+ * active conversations and recently completed ones
139
+ */
140
+ export const getRecentlyActiveNumbers = <ThrowOnError extends boolean = false>(
141
+ options?: Options<GetRecentlyActiveNumbersData, ThrowOnError>,
142
+ ): RequestResult<GetRecentlyActiveNumbersResponses, GetRecentlyActiveNumbersErrors, ThrowOnError> =>
143
+ (options?.client ?? client).get<
144
+ GetRecentlyActiveNumbersResponses,
145
+ GetRecentlyActiveNumbersErrors,
146
+ ThrowOnError
147
+ >({
148
+ security: [{ scheme: 'bearer', type: 'http' }],
149
+ url: '/recently-active-numbers',
150
+ ...options,
151
+ });
152
+
153
+ /**
154
+ * GET /stats
155
+ *
156
+ * Retrieves server statistics including the number of active calls and deployment timestamp
157
+ */
158
+ export const getStats = <ThrowOnError extends boolean = false>(
159
+ options?: Options<GetStatsData, ThrowOnError>,
160
+ ): RequestResult<GetStatsResponses, GetStatsErrors, ThrowOnError> =>
161
+ (options?.client ?? client).get<GetStatsResponses, GetStatsErrors, ThrowOnError>({
162
+ security: [{ scheme: 'bearer', type: 'http' }],
163
+ url: '/stats',
164
+ ...options,
165
+ });
166
+
167
+ /**
168
+ * GET /phone-logs/:phoneNumber
169
+ *
170
+ * Retrieves complete call logs and conversation history for a specific phone number
171
+ */
172
+ export const getPhoneLogsByPhoneNumber = <ThrowOnError extends boolean = false>(
173
+ options: Options<GetPhoneLogsByPhoneNumberData, ThrowOnError>,
174
+ ): RequestResult<
175
+ GetPhoneLogsByPhoneNumberResponses,
176
+ GetPhoneLogsByPhoneNumberErrors,
177
+ ThrowOnError
178
+ > =>
179
+ (options.client ?? client).get<
180
+ GetPhoneLogsByPhoneNumberResponses,
181
+ GetPhoneLogsByPhoneNumberErrors,
182
+ ThrowOnError
183
+ >({
184
+ security: [{ scheme: 'bearer', type: 'http' }],
185
+ url: '/phone-logs/{phoneNumber}',
186
+ ...options,
187
+ });
188
+
189
+ /**
190
+ * POST /outbound-call
191
+ *
192
+ * Initiates an outbound phone call using Twilio
193
+ */
194
+ export const postOutboundCall = <ThrowOnError extends boolean = false>(
195
+ options: Options<PostOutboundCallData, ThrowOnError>,
196
+ ): RequestResult<PostOutboundCallResponses, PostOutboundCallErrors, ThrowOnError> =>
197
+ (options.client ?? client).post<PostOutboundCallResponses, PostOutboundCallErrors, ThrowOnError>({
198
+ security: [{ scheme: 'bearer', type: 'http' }],
199
+ url: '/outbound-call',
200
+ ...options,
201
+ headers: {
202
+ 'Content-Type': 'application/json',
203
+ ...options.headers,
204
+ },
205
+ });
206
+
207
+ /**
208
+ * GET /outbound-call/:callSid
209
+ *
210
+ * Retrieves the current status and details of a Twilio call by its SID
211
+ */
212
+ export const getOutboundCallByCallSid = <ThrowOnError extends boolean = false>(
213
+ options: Options<GetOutboundCallByCallSidData, ThrowOnError>,
214
+ ): RequestResult<GetOutboundCallByCallSidResponses, GetOutboundCallByCallSidErrors, ThrowOnError> =>
215
+ (options.client ?? client).get<
216
+ GetOutboundCallByCallSidResponses,
217
+ GetOutboundCallByCallSidErrors,
218
+ ThrowOnError
219
+ >({
220
+ security: [{ scheme: 'bearer', type: 'http' }],
221
+ url: '/outbound-call/{callSid}',
222
+ ...options,
223
+ });
224
+
225
+ /**
226
+ * POST /outbound-communication-text
227
+ *
228
+ * Initiates an outbound text message (SMS, RCS, or WhatsApp) to a customer
229
+ */
230
+ export const postOutboundCommunicationText = <ThrowOnError extends boolean = false>(
231
+ options: Options<PostOutboundCommunicationTextData, ThrowOnError>,
232
+ ): RequestResult<
233
+ PostOutboundCommunicationTextResponses,
234
+ PostOutboundCommunicationTextErrors,
235
+ ThrowOnError
236
+ > =>
237
+ (options.client ?? client).post<
238
+ PostOutboundCommunicationTextResponses,
239
+ PostOutboundCommunicationTextErrors,
240
+ ThrowOnError
241
+ >({
242
+ security: [{ scheme: 'bearer', type: 'http' }],
243
+ url: '/outbound-communication-text',
244
+ ...options,
245
+ headers: {
246
+ 'Content-Type': 'application/json',
247
+ ...options.headers,
248
+ },
249
+ });
250
+
251
+ /**
252
+ * POST /export-logs
253
+ */
254
+ export const postExportLogs = <ThrowOnError extends boolean = false>(
255
+ options?: Options<PostExportLogsData, ThrowOnError>,
256
+ ): RequestResult<PostExportLogsResponses, PostExportLogsErrors, ThrowOnError> =>
257
+ (options?.client ?? client).post<PostExportLogsResponses, PostExportLogsErrors, ThrowOnError>({
258
+ security: [{ scheme: 'bearer', type: 'http' }],
259
+ url: '/export-logs',
260
+ ...options,
261
+ });
262
+
263
+ /**
264
+ * DELETE /live-numbers
265
+ *
266
+ * Terminates all active conversations, closes websocket connections, and ends all active calls
267
+ */
268
+ export const deleteLiveNumbers = <ThrowOnError extends boolean = false>(
269
+ options?: Options<DeleteLiveNumbersData, ThrowOnError>,
270
+ ): RequestResult<DeleteLiveNumbersResponses, DeleteLiveNumbersErrors, ThrowOnError> =>
271
+ (options?.client ?? client).delete<
272
+ DeleteLiveNumbersResponses,
273
+ DeleteLiveNumbersErrors,
274
+ ThrowOnError
275
+ >({
276
+ security: [{ scheme: 'bearer', type: 'http' }],
277
+ url: '/live-numbers',
278
+ ...options,
279
+ });
280
+
281
+ /**
282
+ * GET /live-numbers
283
+ *
284
+ * Retrieves a list of all currently active conversations with their phone numbers and metadata
285
+ */
286
+ export const getLiveNumbers = <ThrowOnError extends boolean = false>(
287
+ options?: Options<GetLiveNumbersData, ThrowOnError>,
288
+ ): RequestResult<GetLiveNumbersResponses, GetLiveNumbersErrors, ThrowOnError> =>
289
+ (options?.client ?? client).get<GetLiveNumbersResponses, GetLiveNumbersErrors, ThrowOnError>({
290
+ security: [{ scheme: 'bearer', type: 'http' }],
291
+ url: '/live-numbers',
292
+ ...options,
293
+ });
294
+
295
+ /**
296
+ * DELETE /live-numbers/:phoneNumber
297
+ *
298
+ * Ends an active conversation for a specific phone number by terminating the call,
299
+ * closing the conversation, and removing it from active conversations
300
+ */
301
+ export const deleteLiveNumbersByPhoneNumber = <ThrowOnError extends boolean = false>(
302
+ options: Options<DeleteLiveNumbersByPhoneNumberData, ThrowOnError>,
303
+ ): RequestResult<
304
+ DeleteLiveNumbersByPhoneNumberResponses,
305
+ DeleteLiveNumbersByPhoneNumberErrors,
306
+ ThrowOnError
307
+ > =>
308
+ (options.client ?? client).delete<
309
+ DeleteLiveNumbersByPhoneNumberResponses,
310
+ DeleteLiveNumbersByPhoneNumberErrors,
311
+ ThrowOnError
312
+ >({ url: '/live-numbers/{phoneNumber}', ...options });
313
+
314
+ /**
315
+ * DELETE /kill-conversation/:phoneNumber
316
+ *
317
+ * Removes ALL Twilio conversations associated with a phone number,
318
+ * clears in-memory state, and terminates any active calls
319
+ */
320
+ export const deleteKillConversationByPhoneNumber = <ThrowOnError extends boolean = false>(
321
+ options: Options<DeleteKillConversationByPhoneNumberData, ThrowOnError>,
322
+ ): RequestResult<
323
+ DeleteKillConversationByPhoneNumberResponses,
324
+ DeleteKillConversationByPhoneNumberErrors,
325
+ ThrowOnError
326
+ > =>
327
+ (options.client ?? client).delete<
328
+ DeleteKillConversationByPhoneNumberResponses,
329
+ DeleteKillConversationByPhoneNumberErrors,
330
+ ThrowOnError
331
+ >({
332
+ security: [{ scheme: 'bearer', type: 'http' }],
333
+ url: '/kill-conversation/{phoneNumber}',
334
+ ...options,
335
+ });
336
+
337
+ /**
338
+ * POST /send-email
339
+ *
340
+ * Sends an email via SendGrid using the environment-configured credentials
341
+ */
342
+ export const postSendEmail = <ThrowOnError extends boolean = false>(
343
+ options: Options<PostSendEmailData, ThrowOnError>,
344
+ ): RequestResult<PostSendEmailResponses, PostSendEmailErrors, ThrowOnError> =>
345
+ (options.client ?? client).post<PostSendEmailResponses, PostSendEmailErrors, ThrowOnError>({
346
+ security: [{ scheme: 'bearer', type: 'http' }],
347
+ url: '/send-email',
348
+ ...options,
349
+ headers: {
350
+ 'Content-Type': 'application/json',
351
+ ...options.headers,
352
+ },
353
+ });
354
+
355
+ /**
356
+ * POST /add-message
357
+ *
358
+ * Injects a message directly into an active LLM session and optionally resumes
359
+ * the conversation
360
+ */
361
+ export const postAddMessage = <ThrowOnError extends boolean = false>(
362
+ options: Options<PostAddMessageData, ThrowOnError>,
363
+ ): RequestResult<PostAddMessageResponses, PostAddMessageErrors, ThrowOnError> =>
364
+ (options.client ?? client).post<PostAddMessageResponses, PostAddMessageErrors, ThrowOnError>({
365
+ security: [{ scheme: 'bearer', type: 'http' }],
366
+ url: '/add-message',
367
+ ...options,
368
+ headers: {
369
+ 'Content-Type': 'application/json',
370
+ ...options.headers,
371
+ },
372
+ });
373
+
374
+ /**
375
+ * POST /active-conversations/agent/claim
376
+ */
377
+ export const postActiveConversationsAgentClaim = <ThrowOnError extends boolean = false>(
378
+ options: Options<PostActiveConversationsAgentClaimData, ThrowOnError>,
379
+ ): RequestResult<
380
+ PostActiveConversationsAgentClaimResponses,
381
+ PostActiveConversationsAgentClaimErrors,
382
+ ThrowOnError
383
+ > =>
384
+ (options.client ?? client).post<
385
+ PostActiveConversationsAgentClaimResponses,
386
+ PostActiveConversationsAgentClaimErrors,
387
+ ThrowOnError
388
+ >({
389
+ security: [{ scheme: 'bearer', type: 'http' }],
390
+ url: '/active-conversations/agent/claim',
391
+ ...options,
392
+ headers: {
393
+ 'Content-Type': 'application/json',
394
+ ...options.headers,
395
+ },
396
+ });
397
+
398
+ /**
399
+ * GET /active-conversations/agent/:agentNumber
400
+ */
401
+ export const getActiveConversationsAgentByAgentNumber = <ThrowOnError extends boolean = false>(
402
+ options: Options<GetActiveConversationsAgentByAgentNumberData, ThrowOnError>,
403
+ ): RequestResult<
404
+ GetActiveConversationsAgentByAgentNumberResponses,
405
+ GetActiveConversationsAgentByAgentNumberErrors,
406
+ ThrowOnError
407
+ > =>
408
+ (options.client ?? client).get<
409
+ GetActiveConversationsAgentByAgentNumberResponses,
410
+ GetActiveConversationsAgentByAgentNumberErrors,
411
+ ThrowOnError
412
+ >({
413
+ security: [{ scheme: 'bearer', type: 'http' }],
414
+ url: '/active-conversations/agent/{agentNumber}',
415
+ ...options,
416
+ });
417
+
418
+ /**
419
+ * GET /active-conversations/:customerNumber
420
+ *
421
+ * Retrieves an active conversation by customer phone number
422
+ */
423
+ export const getActiveConversationsByCustomerNumber = <ThrowOnError extends boolean = false>(
424
+ options: Options<GetActiveConversationsByCustomerNumberData, ThrowOnError>,
425
+ ): RequestResult<
426
+ GetActiveConversationsByCustomerNumberResponses,
427
+ GetActiveConversationsByCustomerNumberErrors,
428
+ ThrowOnError
429
+ > =>
430
+ (options.client ?? client).get<
431
+ GetActiveConversationsByCustomerNumberResponses,
432
+ GetActiveConversationsByCustomerNumberErrors,
433
+ ThrowOnError
434
+ >({
435
+ security: [{ scheme: 'bearer', type: 'http' }],
436
+ url: '/active-conversations/{customerNumber}',
437
+ ...options,
438
+ });
439
+
440
+ /**
441
+ * GET /health
442
+ *
443
+ * Health check endpoint for the agent service
444
+ */
445
+ export const getHealth = <ThrowOnError extends boolean = false>(
446
+ options?: Options<GetHealthData, ThrowOnError>,
447
+ ): RequestResult<GetHealthResponses, GetHealthErrors, ThrowOnError> =>
448
+ (options?.client ?? client).get<GetHealthResponses, GetHealthErrors, ThrowOnError>({
449
+ url: '/health',
450
+ ...options,
451
+ });
452
+
453
+ /**
454
+ * POST /call
455
+ *
456
+ * Twilio webhook endpoint that generates TwiML for incoming/outgoing voice calls
457
+ */
458
+ export const postCall = <ThrowOnError extends boolean = false>(
459
+ options: Options<PostCallData, ThrowOnError>,
460
+ ): RequestResult<PostCallResponses, PostCallErrors, ThrowOnError> =>
461
+ (options.client ?? client).post<PostCallResponses, PostCallErrors, ThrowOnError>({
462
+ url: '/call',
463
+ ...options,
464
+ headers: {
465
+ 'Content-Type': 'application/json',
466
+ ...options.headers,
467
+ },
468
+ });
469
+
470
+ /**
471
+ * POST /live-agent
472
+ *
473
+ * Twilio webhook endpoint that generates TwiML for handoff to live agent (Flex or external Flex)
474
+ */
475
+ export const postLiveAgent = <ThrowOnError extends boolean = false>(
476
+ options: Options<PostLiveAgentData, ThrowOnError>,
477
+ ): RequestResult<PostLiveAgentResponses, PostLiveAgentErrors, ThrowOnError> =>
478
+ (options.client ?? client).post<PostLiveAgentResponses, PostLiveAgentErrors, ThrowOnError>({
479
+ url: '/live-agent',
480
+ ...options,
481
+ headers: {
482
+ 'Content-Type': 'application/json',
483
+ ...options.headers,
484
+ },
485
+ });
486
+
487
+ /**
488
+ * POST /redirect-to-live-agent
489
+ *
490
+ * Redirects an active call to the live agent endpoint while gracefully ending the Conversation Relay session
491
+ */
492
+ export const postRedirectToLiveAgent = <ThrowOnError extends boolean = false>(
493
+ options: Options<PostRedirectToLiveAgentData, ThrowOnError>,
494
+ ): RequestResult<PostRedirectToLiveAgentResponses, PostRedirectToLiveAgentErrors, ThrowOnError> =>
495
+ (options.client ?? client).post<
496
+ PostRedirectToLiveAgentResponses,
497
+ PostRedirectToLiveAgentErrors,
498
+ ThrowOnError
499
+ >({
500
+ url: '/redirect-to-live-agent',
501
+ ...options,
502
+ headers: {
503
+ 'Content-Type': 'application/json',
504
+ ...options.headers,
505
+ },
506
+ });
507
+
508
+ /**
509
+ * GET /stress-test
510
+ *
511
+ * Twilio webhook endpoint for stress testing voice calls
512
+ */
513
+ export const getStressTest = <ThrowOnError extends boolean = false>(
514
+ options?: Options<GetStressTestData, ThrowOnError>,
515
+ ): RequestResult<GetStressTestResponses, GetStressTestErrors, ThrowOnError> =>
516
+ (options?.client ?? client).get<GetStressTestResponses, GetStressTestErrors, ThrowOnError>({
517
+ url: '/stress-test',
518
+ ...options,
519
+ });
520
+
521
+ /**
522
+ * POST /stress-test-sms
523
+ *
524
+ * Twilio webhook endpoint for stress testing voice calls
525
+ */
526
+ export const postStressTestSms = <ThrowOnError extends boolean = false>(
527
+ options: Options<PostStressTestSmsData, ThrowOnError>,
528
+ ): RequestResult<PostStressTestSmsResponses, PostStressTestSmsErrors, ThrowOnError> =>
529
+ (options.client ?? client).post<
530
+ PostStressTestSmsResponses,
531
+ PostStressTestSmsErrors,
532
+ ThrowOnError
533
+ >({
534
+ url: '/stress-test-sms',
535
+ ...options,
536
+ headers: {
537
+ 'Content-Type': 'application/json',
538
+ ...options.headers,
539
+ },
540
+ });
541
+
542
+ /**
543
+ * POST /webchat-send
544
+ *
545
+ * Handles an inbound webchat message and returns the agent's reply
546
+ */
547
+ export const postWebchatSend = <ThrowOnError extends boolean = false>(
548
+ options: Options<PostWebchatSendData, ThrowOnError>,
549
+ ): RequestResult<PostWebchatSendResponses, PostWebchatSendErrors, ThrowOnError> =>
550
+ (options.client ?? client).post<PostWebchatSendResponses, PostWebchatSendErrors, ThrowOnError>({
551
+ url: '/webchat-send',
552
+ ...options,
553
+ headers: {
554
+ 'Content-Type': 'application/json',
555
+ ...options.headers,
556
+ },
557
+ });
558
+
559
+ /**
560
+ * POST /cintel-operators
561
+ *
562
+ * Handles incoming CINTEL operator webhook responses from Twilio
563
+ */
564
+ export const postCintelOperators = <ThrowOnError extends boolean = false>(
565
+ options: Options<PostCintelOperatorsData, ThrowOnError>,
566
+ ): RequestResult<PostCintelOperatorsResponses, PostCintelOperatorsErrors, ThrowOnError> =>
567
+ (options.client ?? client).post<
568
+ PostCintelOperatorsResponses,
569
+ PostCintelOperatorsErrors,
570
+ ThrowOnError
571
+ >({
572
+ url: '/cintel-operators',
573
+ ...options,
574
+ headers: {
575
+ 'Content-Type': 'application/json',
576
+ ...options.headers,
577
+ },
578
+ });
579
+
580
+ /**
581
+ * POST /flex-transcription
582
+ */
583
+ export const postFlexTranscription = <ThrowOnError extends boolean = false>(
584
+ options: Options<PostFlexTranscriptionData, ThrowOnError>,
585
+ ): RequestResult<PostFlexTranscriptionResponses, PostFlexTranscriptionErrors, ThrowOnError> =>
586
+ (options.client ?? client).post<
587
+ PostFlexTranscriptionResponses,
588
+ PostFlexTranscriptionErrors,
589
+ ThrowOnError
590
+ >({
591
+ url: '/flex-transcription',
592
+ ...options,
593
+ headers: {
594
+ 'Content-Type': 'application/json',
595
+ ...options.headers,
596
+ },
597
+ });
598
+
599
+ /**
600
+ * POST /taskrouter-webhook
601
+ */
602
+ export const postTaskrouterWebhook = <ThrowOnError extends boolean = false>(
603
+ options: Options<PostTaskrouterWebhookData, ThrowOnError>,
604
+ ): RequestResult<PostTaskrouterWebhookResponses, PostTaskrouterWebhookErrors, ThrowOnError> =>
605
+ (options.client ?? client).post<
606
+ PostTaskrouterWebhookResponses,
607
+ PostTaskrouterWebhookErrors,
608
+ ThrowOnError
609
+ >({
610
+ url: '/taskrouter-webhook',
611
+ ...options,
612
+ headers: {
613
+ 'Content-Type': 'application/json',
614
+ ...options.headers,
615
+ },
616
+ });
617
+
618
+ /**
619
+ * POST /resolve-phone
620
+ *
621
+ * Resolves a phone number from the Segment Profiles API given an email
622
+ */
623
+ export const postResolvePhone = <ThrowOnError extends boolean = false>(
624
+ options: Options<PostResolvePhoneData, ThrowOnError>,
625
+ ): RequestResult<PostResolvePhoneResponses, PostResolvePhoneErrors, ThrowOnError> =>
626
+ (options.client ?? client).post<PostResolvePhoneResponses, PostResolvePhoneErrors, ThrowOnError>({
627
+ url: '/resolve-phone',
628
+ ...options,
629
+ headers: {
630
+ 'Content-Type': 'application/json',
631
+ ...options.headers,
632
+ },
633
+ });
634
+
635
+ /**
636
+ * POST /communication-text
637
+ *
638
+ * Handles inbound text messages (SMS, RCS, WhatsApp) from Twilio
639
+ */
640
+ export const postCommunicationText = <ThrowOnError extends boolean = false>(
641
+ options: Options<PostCommunicationTextData, ThrowOnError>,
642
+ ): RequestResult<PostCommunicationTextResponses, PostCommunicationTextErrors, ThrowOnError> =>
643
+ (options.client ?? client).post<
644
+ PostCommunicationTextResponses,
645
+ PostCommunicationTextErrors,
646
+ ThrowOnError
647
+ >({
648
+ url: '/communication-text',
649
+ ...options,
650
+ headers: {
651
+ 'Content-Type': 'application/json',
652
+ ...options.headers,
653
+ },
654
+ });
655
+
656
+ /**
657
+ * GET /docs/openapi.json
658
+ *
659
+ * docsSpecGet
660
+ * Serves the generated OpenAPI JSON spec
661
+ */
662
+ export const getDocsOpenapiJson = <ThrowOnError extends boolean = false>(
663
+ options?: Options<GetDocsOpenapiJsonData, ThrowOnError>,
664
+ ): RequestResult<GetDocsOpenapiJsonResponses, GetDocsOpenapiJsonErrors, ThrowOnError> =>
665
+ (options?.client ?? client).get<
666
+ GetDocsOpenapiJsonResponses,
667
+ GetDocsOpenapiJsonErrors,
668
+ ThrowOnError
669
+ >({
670
+ security: [{ scheme: 'bearer', type: 'http' }],
671
+ url: '/docs/openapi.json',
672
+ ...options,
673
+ });