@replicer/sdk 0.1.1 → 0.2.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.
package/dist/index.d.cts CHANGED
@@ -1,548 +1,5 @@
1
- /**
2
- * Request/response types of the Replicer API (`/v1`). Field names are the wire format (snake_case).
3
- */
4
- interface PageParams {
5
- /** 1-based page number (default 1). */
6
- page?: number;
7
- /** Page size, 1..100 (default 20). */
8
- limit?: number;
9
- }
10
- interface Pagination {
11
- page: number;
12
- limit: number;
13
- total: number;
14
- total_pages: number;
15
- }
16
- /** Envelope returned by every list method. */
17
- interface Page<T> {
18
- data: T[];
19
- pagination: Pagination;
20
- }
21
- interface OkResponse {
22
- ok: boolean;
23
- }
24
- /**
25
- * `code` values the API returns in its flat error body `{ error, code }`. Branch on `code`, never on
26
- * the human-readable `error` text. New codes may be added; fall back to the HTTP status.
27
- */
28
- type ApiErrorCode = 'validation_error' | 'bad_request' | 'unauthorized' | 'forbidden' | 'insufficient_scope' | 'not_found' | 'method_not_allowed' | 'conflict' | 'payload_too_large' | 'rate_limited' | 'rate_limit_exceeded' | 'rate_limiter_unavailable' | 'insufficient_balance' | 'quota_exceeded' | 'channel_not_configured' | 'sender_not_supported' | 'media_not_supported' | 'email_provider_not_supported' | 'internal_error' | 'bad_gateway' | 'service_unavailable' | 'gateway_timeout' | 'upstream_timeout' | (string & {});
29
- interface CreatePhoneCallInput {
30
- /** Agent id; must belong to your organization. */
31
- agent_id: string;
32
- /**
33
- * Phone number id (see `phoneNumber.list`). Selects the caller ID. Required unless the agent has a
34
- * default phone number. A number of another organization → 404 `not_found`.
35
- */
36
- from_number_id?: string;
37
- /** Informational only: it does not select the caller ID. Use `from_number_id`. */
38
- from_number?: string;
39
- to_number: string;
40
- /** Sparse override merged on top of the stored agent. */
41
- agent_override?: Record<string, unknown>;
42
- /**
43
- * `{{name}}` substitutions for the prompt, greeting and voicemail message. Up to 100 entries,
44
- * names `[a-zA-Z_][a-zA-Z0-9_]{0,63}`, values up to 5,000 characters; `null` becomes an empty string.
45
- * Wins over `agent_override.dynamicVariables`, which wins over the agent's own variables.
46
- */
47
- dynamic_variables?: Record<string, string | number | boolean | null>;
48
- metadata?: Record<string, unknown>;
49
- /**
50
- * RFC 3339 date-time **with an offset** (`2026-05-01T09:30:00Z` or `+02:00`); the call is scheduled
51
- * instead of dialed immediately. A past time dials immediately; an invalid one → 400.
52
- */
53
- scheduled_at?: string;
54
- customer_name?: string;
55
- /** 0..5 (default 0). Retries repeat the original call (same number, override and metadata). */
56
- max_retries?: number;
57
- /** 5..1440 minutes. */
58
- retry_delay_minutes?: number;
59
- /**
60
- * A retry with the same key (per organization) returns the call already created and never dials
61
- * again. A call that failed to enqueue stays failed: retry with a new key.
62
- */
63
- idempotency_key?: string;
64
- }
65
- interface EnqueueCallResponse {
66
- call_id: string;
67
- /** `pending` or `scheduled` for a new call; a replay of an `idempotency_key` returns the call's current status. */
68
- status: 'pending' | 'scheduled' | (string & {});
69
- }
70
- /**
71
- * `cancel-campaign-pending` first pauses the campaign (RUNNING / SCHEDULED → PAUSED), then cancels its
72
- * pending and queued calls. Resume with `campaign.start`; contacts whose call was cancelled are not redialed.
73
- */
74
- interface CancelCampaignPendingResponse {
75
- ok: boolean;
76
- calls_cancelled: number;
77
- calls_marked: number;
78
- queue_removed: number;
79
- /** Campaign status after the call, e.g. `PAUSED`. */
80
- campaign_status: string | null;
81
- }
82
- /**
83
- * Call statuses. Final states: `analyzed` (the normal end state once post-call analysis is done),
84
- * `completed` (ended, analysis pending), `failed`, `cancelled`, `missed`, `error`.
85
- */
86
- type CallStatus = 'pending' | 'scheduled' | 'queued' | 'retry' | 'in-progress' | 'completed' | 'analyzed' | 'failed' | 'cancelled' | 'missed' | 'error';
87
- interface ListCallsParams extends PageParams {
88
- status?: CallStatus | (string & {});
89
- direction?: string;
90
- /** ISO 8601 lower bound on `started_at`. */
91
- date_from?: string;
92
- /** ISO 8601 upper bound on `started_at`. */
93
- date_to?: string;
94
- }
95
- interface Call {
96
- id: string;
97
- customer_name: string | null;
98
- customer_phone: string | null;
99
- duration: number | null;
100
- status: CallStatus | (string & {});
101
- direction: string | null;
102
- disconnection_reason: string | null;
103
- sentiment: string | null;
104
- summary: string | null;
105
- /** Only returned by `call.get`; list items omit it. */
106
- transcript?: unknown;
107
- recording: string | null;
108
- call_successful: boolean | null;
109
- token_cost: number | null;
110
- agent_id: string | null;
111
- campaign_id: string | null;
112
- started_at: string | null;
113
- ended_at: string | null;
114
- scheduled_at: string | null;
115
- created_at: string | null;
116
- }
117
- interface CreateCampaignInput {
118
- name: string;
119
- description?: string;
120
- user_agent_id: string;
121
- /** Ignored for API keys (the campaign is attributed to your organization's owner). Only trusted internal callers need it. */
122
- user_id?: string;
123
- from_phone_number_id?: string;
124
- from_number_attempts?: string[];
125
- from_number_strategy?: 'rolling' | 'clamp' | 'custom';
126
- contact_attempt_strategy?: 'rolling' | 'clamp' | 'custom';
127
- /** Non-empty; every contact needs `phone_number`. Up to 100,000 (and the 10 MiB body limit). */
128
- contacts: Record<string, unknown>[];
129
- variable_mapping?: Record<string, string>;
130
- /** RFC 3339 with an offset; invalid → 400. */
131
- scheduled_at?: string;
132
- /** 0..5 (default 0). */
133
- max_retries?: number;
134
- /** 5..1440 (default 30). */
135
- retry_delay_minutes?: number;
136
- /** Unique integers 0..6 (0 = Sunday); `[]` = every day. */
137
- calling_days?: number[];
138
- /** `HH:MM`; set both or neither, start before end. */
139
- calling_start_time?: string;
140
- calling_end_time?: string;
141
- /** IANA time zone (default `Europe/Rome`). */
142
- timezone?: string;
143
- /** 1..100 and at most your plan's concurrency. */
144
- max_concurrency?: number | null;
145
- /** 0..50 and at most your plan's concurrency. */
146
- keep_free_for_inbound?: number;
147
- }
148
- interface CreateCampaignResponse {
149
- success: boolean;
150
- campaign: Campaign;
151
- }
152
- interface GetCampaignResponse {
153
- success: boolean;
154
- campaign: Campaign & {
155
- /** Up to 1,000 contacts, in campaign order. */
156
- contacts: Record<string, unknown>[];
157
- /** True when the campaign has more contacts than returned (`contact_count` > `contacts.length`). */
158
- contacts_truncated: boolean;
159
- };
160
- }
161
- interface ListCampaignsParams extends PageParams {
162
- /** DRAFT | SCHEDULED | RUNNING | PAUSED | COMPLETED | CANCELLED (case-insensitive). */
163
- status?: string;
164
- }
165
- /** Campaign as returned by create, get and list (the same field whitelist everywhere). */
166
- interface Campaign {
167
- id: string;
168
- name: string;
169
- description: string | null;
170
- status: string;
171
- agent_id: string;
172
- from_phone_number_id: string | null;
173
- /** E.164 caller ID (the campaign's number). */
174
- from_number: string | null;
175
- /** E.164 caller IDs, in order. */
176
- from_number_attempts: string[] | null;
177
- from_number_strategy: string | null;
178
- contact_attempt_strategy: string | null;
179
- total_contacts: number;
180
- contact_count: number;
181
- variable_mapping: Record<string, string> | null;
182
- max_retries: number;
183
- retry_delay_minutes: number;
184
- max_concurrency: number | null;
185
- keep_free_for_inbound: number;
186
- calling_days: number[] | null;
187
- calling_start_time: string | null;
188
- calling_end_time: string | null;
189
- timezone: string;
190
- calls_started: number;
191
- calls_completed: number;
192
- calls_failed: number;
193
- scheduled_at: string | null;
194
- started_at: string | null;
195
- completed_at: string | null;
196
- created_at: string | null;
197
- updated_at: string | null;
198
- }
199
- /** @deprecated Use `Campaign`. */
200
- type CampaignListItem = Campaign;
201
- interface StartCampaignResponse {
202
- id: string;
203
- status: 'RUNNING';
204
- }
205
- interface ProvisionInboundInput {
206
- /** Phone number id. */
207
- id: string;
208
- label?: string;
209
- from_number: string;
210
- }
211
- interface ProvisionInboundResponse {
212
- inbound_trunk_id: string;
213
- inbound_dispatch_rule_id: string;
214
- }
215
- interface PhoneNumber {
216
- /** Pass as `from_number_id` to `call.createPhoneCall` and as `id` to the inbound routes. */
217
- id: string;
218
- /** E.164. */
219
- phone_number: string;
220
- label: string | null;
221
- country: string | null;
222
- number_type: string | null;
223
- is_active: boolean;
224
- inbound_agent_id: string | null;
225
- inbound_enabled: boolean;
226
- created_at: string;
227
- }
228
- /** `remaining` in the 502 `bad_gateway` body when only part of an inbound deprovision succeeded. */
229
- interface DeprovisionInboundRemaining {
230
- trunk_id?: string;
231
- rule_id?: string;
232
- }
233
- /** Up to 50 per request; `text` non-empty, at most 100 KB (1 MB total per request). */
234
- interface KnowledgeBaseTextSource {
235
- title?: string;
236
- text: string;
237
- }
238
- /** A URL whose host did not resolve: skipped instead of failing the whole request. */
239
- interface KnowledgeBaseRejectedUrl {
240
- url: string;
241
- reason: string;
242
- }
243
- interface KnowledgeBaseCreateInput {
244
- knowledge_base_name?: string;
245
- name?: string;
246
- description?: string;
247
- knowledge_base_urls?: string[];
248
- knowledge_base_texts?: KnowledgeBaseTextSource[];
249
- chunks_to_retrieve?: number;
250
- similarity_threshold?: number;
251
- instruction?: string;
252
- use_llm_extraction?: boolean;
253
- }
254
- interface KnowledgeBaseUpdateInput {
255
- name?: string;
256
- description?: string | null;
257
- chunks_to_retrieve?: number;
258
- similarity_threshold?: number;
259
- instruction?: string | null;
260
- use_llm_extraction?: boolean;
261
- }
262
- interface KnowledgeBaseAddSourcesInput {
263
- knowledge_base_urls?: string[];
264
- knowledge_base_texts?: KnowledgeBaseTextSource[];
265
- }
266
- interface KnowledgeBaseSourceSummary {
267
- source_id: string;
268
- type: string;
269
- title: string;
270
- url?: string | null;
271
- status: string;
272
- error?: string | null;
273
- chunk_count: number;
274
- filename?: string | null;
275
- }
276
- interface KnowledgeBaseResponse {
277
- knowledge_base_id: string;
278
- knowledge_base_name: string;
279
- name: string;
280
- description?: string | null;
281
- status: string;
282
- chunks_to_retrieve: number;
283
- similarity_threshold: number;
284
- instruction?: string | null;
285
- use_llm_extraction: boolean;
286
- source_count: number;
287
- knowledge_base_sources: KnowledgeBaseSourceSummary[];
288
- sources: KnowledgeBaseSourceSummary[];
289
- created_at: string;
290
- updated_at: string;
291
- }
292
- /** Returned by `knowledgeBase.create` and `knowledgeBase.addSources`. */
293
- interface KnowledgeBaseSourcesResponse extends KnowledgeBaseResponse {
294
- rejected_urls: KnowledgeBaseRejectedUrl[];
295
- }
296
- interface KnowledgeBaseListResponse {
297
- knowledge_bases: KnowledgeBaseResponse[];
298
- }
299
- interface PresignFileInput {
300
- filename: string;
301
- mime_type: string;
302
- /** Exact upload size in bytes: the presigned URL signs it, so the PUT body must match. */
303
- size_bytes: number;
304
- title?: string;
305
- }
306
- interface PresignFileResponse {
307
- source_id: string;
308
- upload_url: string;
309
- required_headers: Record<string, string>;
310
- expires_in: number;
311
- storage_key: string;
312
- }
313
- interface FailFileInput {
314
- error?: string;
315
- }
316
- interface UpdateSourceInput {
317
- extracted_markdown?: string;
318
- title?: string;
319
- }
320
- interface UpdateChunkInput {
321
- enabled?: boolean;
322
- relevance_weight?: number;
323
- }
324
- interface KnowledgeBaseChunk {
325
- id: string;
326
- chunk_index: number;
327
- content: string;
328
- enabled: boolean;
329
- relevance_weight: number;
330
- }
331
- interface KnowledgeBaseSourceDetail {
332
- id: string;
333
- knowledge_base_id: string;
334
- type: string;
335
- title: string;
336
- url: string | null;
337
- filename: string | null;
338
- mime_type: string | null;
339
- size_bytes: number | null;
340
- raw_text: string | null;
341
- extracted_markdown: string | null;
342
- status: string;
343
- error: string | null;
344
- chunk_count: number;
345
- chunks: KnowledgeBaseChunk[];
346
- }
347
- interface PresignFileDownloadResponse {
348
- download_url: string;
349
- expires_in: number;
350
- filename: string;
351
- mime_type: string | null;
352
- }
353
- interface ListContactsParams extends PageParams {
354
- /** Case-insensitive match on name, phone, email or company. */
355
- search?: string;
356
- }
357
- interface Contact {
358
- id: string;
359
- first_name: string | null;
360
- last_name: string | null;
361
- company: string | null;
362
- job_title: string | null;
363
- phone_number: string | null;
364
- email: string | null;
365
- street: string | null;
366
- city: string | null;
367
- state: string | null;
368
- postal_code: string | null;
369
- country: string | null;
370
- website: string | null;
371
- birthday: string | null;
372
- notes: string | null;
373
- created_at: string;
374
- updated_at: string;
375
- }
376
- /** At least one of `first_name` / `last_name` is required. */
377
- interface CreateContactInput {
378
- first_name?: string;
379
- last_name?: string;
380
- company?: string;
381
- job_title?: string;
382
- phone_number?: string;
383
- email?: string;
384
- street?: string;
385
- city?: string;
386
- state?: string;
387
- postal_code?: string;
388
- country?: string;
389
- website?: string;
390
- notes?: string;
391
- }
392
- interface ContactIdentityConflict {
393
- type: 'PHONE' | 'EMAIL';
394
- value: string;
395
- /** The contact that already owns this address (it is not reassigned). */
396
- owner_contact_id: string;
397
- }
398
- interface CreateContactResponse {
399
- id: string;
400
- first_name: string;
401
- last_name: string;
402
- /** Usually empty. */
403
- identity_conflicts: ContactIdentityConflict[];
404
- }
405
- interface Agent {
406
- id: string;
407
- agent_name: string;
408
- agent_type: string;
409
- call_direction: string | null;
410
- voice_id: string | null;
411
- language: string | null;
412
- is_active: boolean;
413
- /** The agent's default outbound phone number id, if any. */
414
- phone_number_id: string | null;
415
- created_at: string;
416
- }
417
- type CalendarEventStatus = 'CONFIRMED' | 'CANCELLED' | 'COMPLETED' | 'NO_SHOW';
418
- interface ListCalendarEventsParams extends PageParams {
419
- calendar_id?: string;
420
- status?: CalendarEventStatus;
421
- /** RFC 3339 lower bound on `start_time`; unparseable values are ignored by the API. */
422
- date_from?: string;
423
- /** RFC 3339 upper bound on `start_time`; unparseable values are ignored by the API. */
424
- date_to?: string;
425
- }
426
- interface CalendarEvent {
427
- id: string;
428
- calendar_id: string;
429
- event_type_id: string;
430
- start_time: string;
431
- end_time: string;
432
- timezone: string;
433
- customer_name: string;
434
- customer_phone: string;
435
- customer_email: string | null;
436
- notes: string | null;
437
- title: string | null;
438
- location: string | null;
439
- status: string;
440
- booked_via: string | null;
441
- created_at: string;
442
- }
443
- interface CreateCalendarEventInput {
444
- calendar_id: string;
445
- event_type_id: string;
446
- /** RFC 3339 with an offset, e.g. `2026-04-05T14:00:00Z`. Impossible dates (Feb 30, `T24:00`) → 400. */
447
- start_time: string;
448
- customer_name: string;
449
- customer_phone: string;
450
- customer_email?: string;
451
- notes?: string;
452
- title?: string;
453
- location?: string;
454
- }
455
- interface CreateCalendarEventResponse {
456
- id: string;
457
- start_time: string;
458
- end_time: string;
459
- status: 'CONFIRMED';
460
- }
461
- type MessageChannel = 'sms' | 'whatsapp' | 'email';
462
- interface ListMessagesParams extends PageParams {
463
- channel?: MessageChannel;
464
- }
465
- interface Message {
466
- id: string;
467
- channel: 'SMS' | 'WHATSAPP' | 'EMAIL' | (string & {});
468
- direction: string;
469
- status: string;
470
- from_address: string;
471
- to_address: string;
472
- subject: string | null;
473
- body: string;
474
- external_id: string | null;
475
- error_message: string | null;
476
- created_at: string;
477
- }
478
- interface SendSmsInput {
479
- to: string;
480
- body: string;
481
- /**
482
- * Optional. SMS always goes out from your organization's default approved Sender ID; `from` may only
483
- * name that sender (a phone number or another sender → 422 `sender_not_supported`).
484
- */
485
- from?: string;
486
- }
487
- interface SendWhatsappInput {
488
- to: string;
489
- body: string;
490
- from?: string;
491
- /** Attachments are not supported: a non-empty array → 422 `media_not_supported`. */
492
- media_url?: string[];
493
- }
494
- interface SendEmailInput {
495
- to: string;
496
- subject: string;
497
- body: string;
498
- /** Must be the sender address configured in your SMTP email settings, if given. */
499
- from?: string;
500
- }
501
- /** Returned (HTTP 202) by every send method: the message is queued, not yet delivered. */
502
- interface SendMessageResponse {
503
- task_id: string;
504
- channel: MessageChannel;
505
- status: 'queued';
506
- }
507
- interface CreateTtsInput {
508
- /** Up to 10,000 characters (Unicode code points; an emoji counts as 1). */
509
- text: string;
510
- /** One of the 29 built-in voice names (case-insensitive) or a raw provider voice id. */
511
- voice?: string;
512
- language?: string;
513
- speed?: number;
514
- stability?: number;
515
- similarity_boost?: number;
516
- style?: number;
517
- }
518
- interface CreateTtsResponse {
519
- id: string;
520
- status: 'queued';
521
- character_count: number;
522
- }
523
- interface ListTtsParams extends PageParams {
524
- status?: string;
525
- }
526
- interface TtsGeneration {
527
- id: string;
528
- text: string;
529
- character_count: number;
530
- voice: string;
531
- language: string;
532
- speed: number;
533
- stability: number;
534
- similarity_boost: number;
535
- style: number;
536
- source: string;
537
- call_id: string | null;
538
- status: string;
539
- audio_url: string | null;
540
- audio_duration_seconds: number | null;
541
- token_cost: number | null;
542
- error_message: string | null;
543
- created_at: string;
544
- completed_at: string | null;
545
- }
1
+ import { C as CreatePhoneCallInput, E as EnqueueCallResponse, O as OkResponse, a as CancelCampaignPendingResponse, L as ListCallsParams, P as Page, b as Call, c as CreateCampaignInput, d as Campaign, G as GetCampaignResponse, e as ListCampaignsParams, S as StartCampaignResponse, f as PageParams, g as PhoneNumber, h as ProvisionInboundInput, i as ProvisionInboundResponse, K as KnowledgeBaseCreateInput, j as KnowledgeBaseSourcesResponse, k as KnowledgeBaseResponse, l as KnowledgeBaseListResponse, m as KnowledgeBaseAddSourcesInput, n as KnowledgeBaseUpdateInput, o as PresignFileInput, p as PresignFileResponse, F as FailFileInput, U as UpdateSourceInput, q as UpdateChunkInput, r as KnowledgeBaseSourceDetail, s as PresignFileDownloadResponse, t as ListContactsParams, u as Contact, v as CreateContactInput, w as CreateContactResponse, A as Agent, x as Calendar, y as ListCalendarEventsParams, z as CalendarEvent, B as CreateCalendarEventInput, D as CreateCalendarEventResponse, H as UpdateCalendarEventInput, I as ListMessagesParams, M as Message, J as SendSmsInput, N as SendMessageResponse, Q as SendWhatsappInput, R as SendEmailInput, T as CreateTtsInput, V as CreateTtsResponse, W as ListTtsParams, X as TtsGeneration, Y as CreateWebhookEndpointInput, Z as WebhookEndpointWithSecret, _ as WebhookEndpoint, $ as UpdateWebhookEndpointInput, a0 as TestWebhookEndpointInput, a1 as TestWebhookEndpointResponse, a2 as ListWebhookDeliveriesParams, a3 as WebhookDelivery, a4 as ListWebhookDeliveryAttemptsParams, a5 as WebhookDeliveryAttempt, a6 as ListEventsParams, a7 as WebhookEvent } from './types-CmxwElVc.cjs';
2
+ export { a8 as AgentType, a9 as AnyWebhookEvent, aa as ApiErrorCode, ab as CalendarEventStatus, ac as CalendarType, ad as CallDirection, ae as CallSentiment, af as CallStatus, ag as CampaignListItem, ah as CampaignStatus, ai as CancelCallInput, aj as CancelCampaignPendingInput, ak as ContactIdentityConflict, al as ContactIdentityType, am as Conversation, an as ConversationChannel, ao as ConversationStatus, ap as CreateCampaignResponse, aq as DeleteKnowledgeBaseSourceParams, ar as DeletedResource, as as DeprovisionInboundParams, at as DeprovisionInboundRemaining, au as EventType, av as Int, aw as KnowledgeBaseChunk, ax as KnowledgeBaseRejectedUrl, ay as KnowledgeBaseSourceSummary, az as KnowledgeBaseStatus, aA as KnowledgeBaseTextSource, aB as KnowledgeSourceStatus, aC as KnowledgeSourceType, aD as MessageChannel, aE as MessageDirection, aF as MessageStatus, aG as OptOut, aH as OptOutSource, aI as Pagination, aJ as PhoneNumberType, aK as TtsStatus, aL as WebhookDeliveryErrorClass, aM as WebhookDeliveryStatus, aN as WebhookEndpointCreatedBy, aO as WebhookEndpointDisabledReason, aP as WebhookEventDataMap, aQ as WebhookEventEnvelope, aR as WebhookEventType, aS as WebhookTestData } from './types-CmxwElVc.cjs';
546
3
 
547
4
  declare const DEFAULT_BASE_URL = "https://api.replicer.ai";
548
5
  interface ReplicerOptions {
@@ -566,7 +23,7 @@ declare class Replicer {
566
23
  get: (id: string) => Promise<Call>;
567
24
  };
568
25
  readonly campaign: {
569
- create: (input: CreateCampaignInput) => Promise<CreateCampaignResponse>;
26
+ create: (input: CreateCampaignInput) => Promise<Campaign>;
570
27
  /** Includes up to 1,000 contacts (`contacts_truncated` tells whether there are more). */
571
28
  get: (id: string) => Promise<GetCampaignResponse>;
572
29
  list: (params?: ListCampaignsParams) => Promise<Page<Campaign>>;
@@ -604,11 +61,19 @@ declare class Replicer {
604
61
  list: (params?: PageParams) => Promise<Page<Agent>>;
605
62
  };
606
63
  readonly calendar: {
64
+ /** Active calendars with their active event types: the source of `calendar_id` and `event_type_id`. */
65
+ listCalendars: (params?: PageParams) => Promise<Page<Calendar>>;
607
66
  listEvents: (params?: ListCalendarEventsParams) => Promise<Page<CalendarEvent>>;
608
67
  createEvent: (input: CreateCalendarEventInput) => Promise<CreateCalendarEventResponse>;
68
+ /** Reschedules a confirmed event (`start_time`) and/or edits customer fields, notes and metadata. */
69
+ updateEvent: (id: string, input: UpdateCalendarEventInput) => Promise<CalendarEvent>;
70
+ /** Soft cancel: the event stays listed with status `cancelled`. Cancelling twice is a no-op. */
71
+ cancelEvent: (id: string) => Promise<CalendarEvent>;
609
72
  };
610
73
  readonly message: {
611
74
  list: (params?: ListMessagesParams) => Promise<Page<Message>>;
75
+ /** One message by id (the `id` of a send response), with its current delivery `status`. */
76
+ get: (id: string) => Promise<Message>;
612
77
  sendSms: (input: SendSmsInput) => Promise<SendMessageResponse>;
613
78
  sendWhatsapp: (input: SendWhatsappInput) => Promise<SendMessageResponse>;
614
79
  sendEmail: (input: SendEmailInput) => Promise<SendMessageResponse>;
@@ -618,6 +83,28 @@ declare class Replicer {
618
83
  list: (params?: ListTtsParams) => Promise<Page<TtsGeneration>>;
619
84
  get: (id: string) => Promise<TtsGeneration>;
620
85
  };
86
+ readonly webhookEndpoint: {
87
+ /** Resolves with the signing `secret`, shown only here and in `rotateSecret`. */
88
+ create: (input: CreateWebhookEndpointInput) => Promise<WebhookEndpointWithSecret>;
89
+ list: (params?: PageParams) => Promise<Page<WebhookEndpoint>>;
90
+ get: (id: string) => Promise<WebhookEndpoint>;
91
+ update: (id: string, input: UpdateWebhookEndpointInput) => Promise<WebhookEndpoint>;
92
+ delete: (id: string) => Promise<OkResponse>;
93
+ /** New secret now; the previous one keeps signing deliveries for 24 hours. */
94
+ rotateSecret: (id: string) => Promise<WebhookEndpointWithSecret>;
95
+ /** Sends a test event (`livemode: false`) and waits up to 12 seconds for its first attempt. */
96
+ test: (id: string, input?: TestWebhookEndpointInput) => Promise<TestWebhookEndpointResponse>;
97
+ listDeliveries: (params?: ListWebhookDeliveriesParams) => Promise<Page<WebhookDelivery>>;
98
+ /** HTTP attempts of one delivery, oldest first. */
99
+ listDeliveryAttempts: (params: ListWebhookDeliveryAttemptsParams) => Promise<Page<WebhookDeliveryAttempt>>;
100
+ /** Sends the event of a delivery again (same event id and body) as a new delivery. Events from the last 30 days only. */
101
+ redeliver: (deliveryId: string) => Promise<WebhookDelivery>;
102
+ };
103
+ readonly event: {
104
+ /** Events of the last 30 days as delivered (each item is the parsed envelope). */
105
+ list: (params?: ListEventsParams) => Promise<Page<WebhookEvent<Record<string, unknown>>>>;
106
+ get: (id: string) => Promise<WebhookEvent<Record<string, unknown>>>;
107
+ };
621
108
  private request;
622
109
  }
623
110
 
@@ -654,165 +141,462 @@ declare class ReplicerError extends Error {
654
141
  * `test/contract.test.ts` checks this table against the public route list
655
142
  * (`microservices/internal/apiserver/proxy_routes.json`) so the two cannot drift. `:name` segments
656
143
  * are path params (URL-encoded by the client).
144
+ *
145
+ * Each entry also names its wire types, which `docs-site/scripts/gen.mjs` turns into the OpenAPI
146
+ * request/response schemas (generated from `types.ts`):
147
+ * - `request`: the JSON body type (POST/PATCH/PUT) or the query-parameter type (GET/DELETE), or
148
+ * `'none'` when the route takes neither
149
+ * - `response`: the success body type (`Page<T>` for lists), or `'none'` for an empty body
150
+ * - `status`: the success HTTP status (creates and webhook redelivery 201, asynchronous sends and
151
+ * call placement 202, empty body 204)
152
+ * - `errors`: every error the route can answer, as `[status, code]` pairs (flat `{ error, code }` body):
153
+ * gateway errors (401 unauthorized, 403 insufficient_scope, 429 rate_limit_exceeded) plus what the
154
+ * engine returns for this route. Emitted as the OpenAPI error responses (429 with `Retry-After`).
155
+ * `test/contract.test.ts` checks that every entry has all four, that the types exist and that the
156
+ * errors match the engine sources.
657
157
  */
658
158
  declare const ROUTES: readonly [{
659
159
  readonly method: "POST";
660
160
  readonly path: "/v1/create-phone-call";
661
161
  readonly sdk: "call.createPhoneCall";
162
+ readonly request: "CreatePhoneCallInput";
163
+ readonly response: "EnqueueCallResponse";
164
+ readonly status: 202;
165
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [422, "idempotency_key_reuse"], readonly [429, "rate_limit_exceeded"], readonly [429, "rate_limited"], readonly [502, "bad_gateway"]];
662
166
  }, {
663
167
  readonly method: "POST";
664
168
  readonly path: "/v1/cancel-call";
665
169
  readonly sdk: "call.cancel";
170
+ readonly request: "CancelCallInput";
171
+ readonly response: "OkResponse";
172
+ readonly status: 200;
173
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
666
174
  }, {
667
175
  readonly method: "POST";
668
176
  readonly path: "/v1/cancel-campaign-pending";
669
177
  readonly sdk: "call.cancelCampaignPending";
178
+ readonly request: "CancelCampaignPendingInput";
179
+ readonly response: "CancelCampaignPendingResponse";
180
+ readonly status: 200;
181
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
670
182
  }, {
671
183
  readonly method: "GET";
672
184
  readonly path: "/v1/list-calls";
673
185
  readonly sdk: "call.list";
186
+ readonly request: "ListCallsParams";
187
+ readonly response: "Page<Call>";
188
+ readonly status: 200;
189
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
674
190
  }, {
675
191
  readonly method: "GET";
676
192
  readonly path: "/v1/get-call/:id";
677
193
  readonly sdk: "call.get";
194
+ readonly request: "none";
195
+ readonly response: "Call";
196
+ readonly status: 200;
197
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
678
198
  }, {
679
199
  readonly method: "POST";
680
200
  readonly path: "/v1/campaigns";
681
201
  readonly sdk: "campaign.create";
202
+ readonly request: "CreateCampaignInput";
203
+ readonly response: "CreateCampaignResponse";
204
+ readonly status: 201;
205
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "forbidden"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [422, "idempotency_key_reuse"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"]];
682
206
  }, {
683
207
  readonly method: "GET";
684
208
  readonly path: "/v1/campaigns/:id";
685
209
  readonly sdk: "campaign.get";
210
+ readonly request: "none";
211
+ readonly response: "GetCampaignResponse";
212
+ readonly status: 200;
213
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
686
214
  }, {
687
215
  readonly method: "GET";
688
216
  readonly path: "/v1/list-campaigns";
689
217
  readonly sdk: "campaign.list";
218
+ readonly request: "ListCampaignsParams";
219
+ readonly response: "Page<Campaign>";
220
+ readonly status: 200;
221
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
690
222
  }, {
691
223
  readonly method: "POST";
692
224
  readonly path: "/v1/start-campaign/:id";
693
225
  readonly sdk: "campaign.start";
226
+ readonly request: "none";
227
+ readonly response: "StartCampaignResponse";
228
+ readonly status: 200;
229
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [402, "insufficient_balance"], readonly [403, "forbidden"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
694
230
  }, {
695
231
  readonly method: "GET";
696
232
  readonly path: "/v1/list-phone-numbers";
697
233
  readonly sdk: "phoneNumber.list";
234
+ readonly request: "PageParams";
235
+ readonly response: "Page<PhoneNumber>";
236
+ readonly status: 200;
237
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
698
238
  }, {
699
239
  readonly method: "POST";
700
240
  readonly path: "/v1/phone-numbers/inbound";
701
241
  readonly sdk: "phoneNumber.provisionInbound";
242
+ readonly request: "ProvisionInboundInput";
243
+ readonly response: "ProvisionInboundResponse";
244
+ readonly status: 200;
245
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "test_mode_unsupported"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
702
246
  }, {
703
247
  readonly method: "DELETE";
704
248
  readonly path: "/v1/phone-numbers/inbound/:id";
705
249
  readonly sdk: "phoneNumber.deprovisionInbound";
250
+ readonly request: "DeprovisionInboundParams";
251
+ readonly response: "OkResponse";
252
+ readonly status: 200;
253
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "test_mode_unsupported"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
706
254
  }, {
707
255
  readonly method: "POST";
708
256
  readonly path: "/v1/create-knowledge-base";
709
257
  readonly sdk: "knowledgeBase.create";
258
+ readonly request: "KnowledgeBaseCreateInput";
259
+ readonly response: "KnowledgeBaseSourcesResponse";
260
+ readonly status: 201;
261
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "quota_exceeded"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
710
262
  }, {
711
263
  readonly method: "GET";
712
264
  readonly path: "/v1/get-knowledge-base/:id";
713
265
  readonly sdk: "knowledgeBase.retrieve";
266
+ readonly request: "none";
267
+ readonly response: "KnowledgeBaseResponse";
268
+ readonly status: 200;
269
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
714
270
  }, {
715
271
  readonly method: "GET";
716
272
  readonly path: "/v1/list-knowledge-bases";
717
273
  readonly sdk: "knowledgeBase.list";
274
+ readonly request: "none";
275
+ readonly response: "KnowledgeBaseListResponse";
276
+ readonly status: 200;
277
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
718
278
  }, {
719
279
  readonly method: "DELETE";
720
280
  readonly path: "/v1/delete-knowledge-base/:id";
721
281
  readonly sdk: "knowledgeBase.delete";
282
+ readonly request: "none";
283
+ readonly response: "none";
284
+ readonly status: 204;
285
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
722
286
  }, {
723
287
  readonly method: "POST";
724
288
  readonly path: "/v1/add-knowledge-base-sources/:id";
725
289
  readonly sdk: "knowledgeBase.addSources";
290
+ readonly request: "KnowledgeBaseAddSourcesInput";
291
+ readonly response: "KnowledgeBaseSourcesResponse";
292
+ readonly status: 200;
293
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "quota_exceeded"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
726
294
  }, {
727
295
  readonly method: "DELETE";
728
296
  readonly path: "/v1/delete-knowledge-base-source/:source_id";
729
297
  readonly sdk: "knowledgeBase.deleteSource";
298
+ readonly request: "DeleteKnowledgeBaseSourceParams";
299
+ readonly response: "KnowledgeBaseResponse";
300
+ readonly status: 200;
301
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
730
302
  }, {
731
303
  readonly method: "PATCH";
732
304
  readonly path: "/v1/update-knowledge-base/:id";
733
305
  readonly sdk: "knowledgeBase.update";
306
+ readonly request: "KnowledgeBaseUpdateInput";
307
+ readonly response: "KnowledgeBaseResponse";
308
+ readonly status: 200;
309
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
734
310
  }, {
735
311
  readonly method: "POST";
736
312
  readonly path: "/v1/presign-knowledge-base-file/:id";
737
313
  readonly sdk: "knowledgeBase.presignFile";
314
+ readonly request: "PresignFileInput";
315
+ readonly response: "PresignFileResponse";
316
+ readonly status: 200;
317
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [403, "quota_exceeded"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
738
318
  }, {
739
319
  readonly method: "POST";
740
320
  readonly path: "/v1/complete-knowledge-base-file/:id/:source_id";
741
321
  readonly sdk: "knowledgeBase.completeFile";
322
+ readonly request: "none";
323
+ readonly response: "KnowledgeBaseResponse";
324
+ readonly status: 200;
325
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
742
326
  }, {
743
327
  readonly method: "POST";
744
328
  readonly path: "/v1/fail-knowledge-base-file/:id/:source_id";
745
329
  readonly sdk: "knowledgeBase.failFile";
330
+ readonly request: "FailFileInput";
331
+ readonly response: "KnowledgeBaseResponse";
332
+ readonly status: 200;
333
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
746
334
  }, {
747
335
  readonly method: "PUT";
748
336
  readonly path: "/v1/reindex-knowledge-base/:id";
749
337
  readonly sdk: "knowledgeBase.reindex";
338
+ readonly request: "none";
339
+ readonly response: "KnowledgeBaseResponse";
340
+ readonly status: 200;
341
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
750
342
  }, {
751
343
  readonly method: "PATCH";
752
344
  readonly path: "/v1/update-knowledge-base-source/:id/:source_id";
753
345
  readonly sdk: "knowledgeBase.updateSource";
346
+ readonly request: "UpdateSourceInput";
347
+ readonly response: "KnowledgeBaseResponse";
348
+ readonly status: 200;
349
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
754
350
  }, {
755
351
  readonly method: "PATCH";
756
352
  readonly path: "/v1/update-knowledge-base-chunk/:id/:chunk_id";
757
353
  readonly sdk: "knowledgeBase.updateChunk";
354
+ readonly request: "UpdateChunkInput";
355
+ readonly response: "OkResponse";
356
+ readonly status: 200;
357
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
758
358
  }, {
759
359
  readonly method: "GET";
760
360
  readonly path: "/v1/get-knowledge-base-source/:id/:source_id";
761
361
  readonly sdk: "knowledgeBase.getSource";
362
+ readonly request: "none";
363
+ readonly response: "KnowledgeBaseSourceDetail";
364
+ readonly status: 200;
365
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
762
366
  }, {
763
367
  readonly method: "GET";
764
368
  readonly path: "/v1/presign-knowledge-base-file-download/:id/:source_id";
765
369
  readonly sdk: "knowledgeBase.presignFileDownload";
370
+ readonly request: "none";
371
+ readonly response: "PresignFileDownloadResponse";
372
+ readonly status: 200;
373
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "internal_error"]];
766
374
  }, {
767
375
  readonly method: "GET";
768
376
  readonly path: "/v1/list-contacts";
769
377
  readonly sdk: "contact.list";
378
+ readonly request: "ListContactsParams";
379
+ readonly response: "Page<Contact>";
380
+ readonly status: 200;
381
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
770
382
  }, {
771
383
  readonly method: "POST";
772
384
  readonly path: "/v1/create-contact";
773
385
  readonly sdk: "contact.create";
386
+ readonly request: "CreateContactInput";
387
+ readonly response: "CreateContactResponse";
388
+ readonly status: 201;
389
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
774
390
  }, {
775
391
  readonly method: "GET";
776
392
  readonly path: "/v1/list-agents";
777
393
  readonly sdk: "agent.list";
394
+ readonly request: "PageParams";
395
+ readonly response: "Page<Agent>";
396
+ readonly status: 200;
397
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
398
+ }, {
399
+ readonly method: "GET";
400
+ readonly path: "/v1/list-calendars";
401
+ readonly sdk: "calendar.listCalendars";
402
+ readonly request: "PageParams";
403
+ readonly response: "Page<Calendar>";
404
+ readonly status: 200;
405
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
778
406
  }, {
779
407
  readonly method: "GET";
780
408
  readonly path: "/v1/list-calendar-events";
781
409
  readonly sdk: "calendar.listEvents";
410
+ readonly request: "ListCalendarEventsParams";
411
+ readonly response: "Page<CalendarEvent>";
412
+ readonly status: 200;
413
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
782
414
  }, {
783
415
  readonly method: "POST";
784
416
  readonly path: "/v1/create-calendar-event";
785
417
  readonly sdk: "calendar.createEvent";
418
+ readonly request: "CreateCalendarEventInput";
419
+ readonly response: "CreateCalendarEventResponse";
420
+ readonly status: 201;
421
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"]];
422
+ }, {
423
+ readonly method: "PATCH";
424
+ readonly path: "/v1/update-calendar-event/:id";
425
+ readonly sdk: "calendar.updateEvent";
426
+ readonly request: "UpdateCalendarEventInput";
427
+ readonly response: "CalendarEvent";
428
+ readonly status: 200;
429
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"]];
430
+ }, {
431
+ readonly method: "POST";
432
+ readonly path: "/v1/cancel-calendar-event/:id";
433
+ readonly sdk: "calendar.cancelEvent";
434
+ readonly request: "none";
435
+ readonly response: "CalendarEvent";
436
+ readonly status: 200;
437
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"]];
786
438
  }, {
787
439
  readonly method: "GET";
788
440
  readonly path: "/v1/list-messages";
789
441
  readonly sdk: "message.list";
442
+ readonly request: "ListMessagesParams";
443
+ readonly response: "Page<Message>";
444
+ readonly status: 200;
445
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
446
+ }, {
447
+ readonly method: "GET";
448
+ readonly path: "/v1/get-message/:id";
449
+ readonly sdk: "message.get";
450
+ readonly request: "none";
451
+ readonly response: "Message";
452
+ readonly status: 200;
453
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
790
454
  }, {
791
455
  readonly method: "POST";
792
456
  readonly path: "/v1/send-sms";
793
457
  readonly sdk: "message.sendSms";
458
+ readonly request: "SendSmsInput";
459
+ readonly response: "SendMessageResponse";
460
+ readonly status: 202;
461
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [422, "channel_not_configured"], readonly [422, "idempotency_key_reuse"], readonly [422, "sender_not_supported"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
794
462
  }, {
795
463
  readonly method: "POST";
796
464
  readonly path: "/v1/send-whatsapp";
797
465
  readonly sdk: "message.sendWhatsapp";
466
+ readonly request: "SendWhatsappInput";
467
+ readonly response: "SendMessageResponse";
468
+ readonly status: 202;
469
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [422, "channel_not_configured"], readonly [422, "idempotency_key_reuse"], readonly [422, "media_not_supported"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
798
470
  }, {
799
471
  readonly method: "POST";
800
472
  readonly path: "/v1/send-email";
801
473
  readonly sdk: "message.sendEmail";
474
+ readonly request: "SendEmailInput";
475
+ readonly response: "SendMessageResponse";
476
+ readonly status: 202;
477
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [422, "channel_not_configured"], readonly [422, "email_provider_not_supported"], readonly [422, "idempotency_key_reuse"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"]];
802
478
  }, {
803
479
  readonly method: "POST";
804
480
  readonly path: "/v1/create-tts";
805
481
  readonly sdk: "tts.create";
482
+ readonly request: "CreateTtsInput";
483
+ readonly response: "CreateTtsResponse";
484
+ readonly status: 201;
485
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [422, "idempotency_key_reuse"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [502, "bad_gateway"], readonly [503, "service_unavailable"]];
806
486
  }, {
807
487
  readonly method: "GET";
808
488
  readonly path: "/v1/list-tts";
809
489
  readonly sdk: "tts.list";
490
+ readonly request: "ListTtsParams";
491
+ readonly response: "Page<TtsGeneration>";
492
+ readonly status: 200;
493
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
810
494
  }, {
811
495
  readonly method: "GET";
812
496
  readonly path: "/v1/get-tts/:id";
813
497
  readonly sdk: "tts.get";
498
+ readonly request: "none";
499
+ readonly response: "TtsGeneration";
500
+ readonly status: 200;
501
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
502
+ }, {
503
+ readonly method: "POST";
504
+ readonly path: "/v1/create-webhook-endpoint";
505
+ readonly sdk: "webhookEndpoint.create";
506
+ readonly request: "CreateWebhookEndpointInput";
507
+ readonly response: "WebhookEndpointWithSecret";
508
+ readonly status: 201;
509
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [409, "conflict"], readonly [409, "webhook_endpoint_limit"], readonly [422, "idempotency_key_reuse"], readonly [422, "validation_error"], readonly [429, "rate_limit_exceeded"], readonly [503, "service_unavailable"]];
510
+ }, {
511
+ readonly method: "GET";
512
+ readonly path: "/v1/list-webhook-endpoints";
513
+ readonly sdk: "webhookEndpoint.list";
514
+ readonly request: "PageParams";
515
+ readonly response: "Page<WebhookEndpoint>";
516
+ readonly status: 200;
517
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
518
+ }, {
519
+ readonly method: "GET";
520
+ readonly path: "/v1/get-webhook-endpoint/:id";
521
+ readonly sdk: "webhookEndpoint.get";
522
+ readonly request: "none";
523
+ readonly response: "WebhookEndpoint";
524
+ readonly status: 200;
525
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
526
+ }, {
527
+ readonly method: "PATCH";
528
+ readonly path: "/v1/update-webhook-endpoint/:id";
529
+ readonly sdk: "webhookEndpoint.update";
530
+ readonly request: "UpdateWebhookEndpointInput";
531
+ readonly response: "WebhookEndpoint";
532
+ readonly status: 200;
533
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "webhook_endpoint_key_revoked"], readonly [409, "webhook_endpoint_admin_disabled"], readonly [429, "rate_limit_exceeded"]];
534
+ }, {
535
+ readonly method: "DELETE";
536
+ readonly path: "/v1/delete-webhook-endpoint/:id";
537
+ readonly sdk: "webhookEndpoint.delete";
538
+ readonly request: "none";
539
+ readonly response: "OkResponse";
540
+ readonly status: 200;
541
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
542
+ }, {
543
+ readonly method: "POST";
544
+ readonly path: "/v1/rotate-webhook-endpoint-secret/:id";
545
+ readonly sdk: "webhookEndpoint.rotateSecret";
546
+ readonly request: "none";
547
+ readonly response: "WebhookEndpointWithSecret";
548
+ readonly status: 200;
549
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [503, "service_unavailable"]];
550
+ }, {
551
+ readonly method: "POST";
552
+ readonly path: "/v1/test-webhook-endpoint/:id";
553
+ readonly sdk: "webhookEndpoint.test";
554
+ readonly request: "TestWebhookEndpointInput";
555
+ readonly response: "TestWebhookEndpointResponse";
556
+ readonly status: 200;
557
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [429, "rate_limit_exceeded"], readonly [429, "rate_limited"]];
558
+ }, {
559
+ readonly method: "GET";
560
+ readonly path: "/v1/list-webhook-deliveries";
561
+ readonly sdk: "webhookEndpoint.listDeliveries";
562
+ readonly request: "ListWebhookDeliveriesParams";
563
+ readonly response: "Page<WebhookDelivery>";
564
+ readonly status: 200;
565
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
566
+ }, {
567
+ readonly method: "GET";
568
+ readonly path: "/v1/list-webhook-delivery-attempts";
569
+ readonly sdk: "webhookEndpoint.listDeliveryAttempts";
570
+ readonly request: "ListWebhookDeliveryAttemptsParams";
571
+ readonly response: "Page<WebhookDeliveryAttempt>";
572
+ readonly status: 200;
573
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
574
+ }, {
575
+ readonly method: "POST";
576
+ readonly path: "/v1/redeliver-webhook-delivery/:id";
577
+ readonly sdk: "webhookEndpoint.redeliver";
578
+ readonly request: "none";
579
+ readonly response: "WebhookDelivery";
580
+ readonly status: 201;
581
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [409, "conflict"], readonly [409, "redelivery_limit"], readonly [409, "webhook_endpoint_key_revoked"], readonly [429, "rate_limit_exceeded"]];
582
+ }, {
583
+ readonly method: "GET";
584
+ readonly path: "/v1/list-events";
585
+ readonly sdk: "event.list";
586
+ readonly request: "ListEventsParams";
587
+ readonly response: "Page<WebhookEventEnvelope>";
588
+ readonly status: 200;
589
+ readonly errors: readonly [readonly [400, "validation_error"], readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [429, "rate_limit_exceeded"]];
590
+ }, {
591
+ readonly method: "GET";
592
+ readonly path: "/v1/get-event/:id";
593
+ readonly sdk: "event.get";
594
+ readonly request: "none";
595
+ readonly response: "WebhookEventEnvelope";
596
+ readonly status: 200;
597
+ readonly errors: readonly [readonly [401, "unauthorized"], readonly [403, "insufficient_scope"], readonly [404, "not_found"], readonly [429, "rate_limit_exceeded"]];
814
598
  }];
815
599
  type RouteDef = (typeof ROUTES)[number];
816
600
  type SdkMethodName = RouteDef['sdk'];
817
601
 
818
- export { type Agent, type ApiErrorCode, type CalendarEvent, type CalendarEventStatus, type Call, type CallStatus, type Campaign, type CampaignListItem, type CancelCampaignPendingResponse, type Contact, type ContactIdentityConflict, type CreateCalendarEventInput, type CreateCalendarEventResponse, type CreateCampaignInput, type CreateCampaignResponse, type CreateContactInput, type CreateContactResponse, type CreatePhoneCallInput, type CreateTtsInput, type CreateTtsResponse, DEFAULT_BASE_URL, type DeprovisionInboundRemaining, type EnqueueCallResponse, type FailFileInput, type GetCampaignResponse, type KnowledgeBaseAddSourcesInput, type KnowledgeBaseChunk, type KnowledgeBaseCreateInput, type KnowledgeBaseListResponse, type KnowledgeBaseRejectedUrl, type KnowledgeBaseResponse, type KnowledgeBaseSourceDetail, type KnowledgeBaseSourceSummary, type KnowledgeBaseSourcesResponse, type KnowledgeBaseTextSource, type KnowledgeBaseUpdateInput, type ListCalendarEventsParams, type ListCallsParams, type ListCampaignsParams, type ListContactsParams, type ListMessagesParams, type ListTtsParams, type Message, type MessageChannel, type OkResponse, type Page, type PageParams, type Pagination, type PhoneNumber, type PresignFileDownloadResponse, type PresignFileInput, type PresignFileResponse, type ProvisionInboundInput, type ProvisionInboundResponse, ROUTES, Replicer, ReplicerError, type ReplicerOptions, type RouteDef, type SdkMethodName, type SendEmailInput, type SendMessageResponse, type SendSmsInput, type SendWhatsappInput, type StartCampaignResponse, type TtsGeneration, type UpdateChunkInput, type UpdateSourceInput };
602
+ export { Agent, Calendar, CalendarEvent, Call, Campaign, CancelCampaignPendingResponse, Contact, CreateCalendarEventInput, CreateCalendarEventResponse, CreateCampaignInput, CreateContactInput, CreateContactResponse, CreatePhoneCallInput, CreateTtsInput, CreateTtsResponse, CreateWebhookEndpointInput, DEFAULT_BASE_URL, EnqueueCallResponse, FailFileInput, GetCampaignResponse, KnowledgeBaseAddSourcesInput, KnowledgeBaseCreateInput, KnowledgeBaseListResponse, KnowledgeBaseResponse, KnowledgeBaseSourceDetail, KnowledgeBaseSourcesResponse, KnowledgeBaseUpdateInput, ListCalendarEventsParams, ListCallsParams, ListCampaignsParams, ListContactsParams, ListEventsParams, ListMessagesParams, ListTtsParams, ListWebhookDeliveriesParams, ListWebhookDeliveryAttemptsParams, Message, OkResponse, Page, PageParams, PhoneNumber, PresignFileDownloadResponse, PresignFileInput, PresignFileResponse, ProvisionInboundInput, ProvisionInboundResponse, ROUTES, Replicer, ReplicerError, type ReplicerOptions, type RouteDef, type SdkMethodName, SendEmailInput, SendMessageResponse, SendSmsInput, SendWhatsappInput, StartCampaignResponse, TestWebhookEndpointInput, TestWebhookEndpointResponse, TtsGeneration, UpdateCalendarEventInput, UpdateChunkInput, UpdateSourceInput, UpdateWebhookEndpointInput, WebhookDelivery, WebhookDeliveryAttempt, WebhookEndpoint, WebhookEndpointWithSecret, WebhookEvent };