samva 0.2.0 → 0.3.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 (47) hide show
  1. package/AGENTS.md +1 -1
  2. package/README.md +10 -3
  3. package/dist/client/sdk.gen.d.ts +232 -23
  4. package/dist/client/types.gen.d.ts +693 -352
  5. package/dist/{client-BqkU-sFv.js → client-BOghX8fr.js} +1530 -1532
  6. package/dist/effect/api-keys.d.ts +14 -14
  7. package/dist/effect/api-keys.js +1 -1
  8. package/dist/effect/campaigns.d.ts +134 -853
  9. package/dist/effect/campaigns.js +1 -1
  10. package/dist/effect/categories.d.ts +1 -1
  11. package/dist/effect/client.js +1 -1
  12. package/dist/effect/contacts.d.ts +123 -145
  13. package/dist/effect/contacts.js +1 -1
  14. package/dist/effect/conversations.d.ts +128 -260
  15. package/dist/effect/conversations.js +1 -1
  16. package/dist/effect/design.d.ts +11 -11
  17. package/dist/effect/design.js +1 -1
  18. package/dist/effect/email.d.ts +64 -108
  19. package/dist/effect/email.js +2 -2
  20. package/dist/effect/generated.d.ts +7346 -8748
  21. package/dist/effect/index.d.ts +1 -0
  22. package/dist/effect/index.js +3 -2
  23. package/dist/effect/internal/operation.d.ts +15 -113
  24. package/dist/effect/media.d.ts +80 -0
  25. package/dist/effect/media.js +19 -0
  26. package/dist/effect/messages.d.ts +41 -261
  27. package/dist/effect/messages.js +1 -1
  28. package/dist/effect/operations.d.ts +7 -7
  29. package/dist/effect/operations.js +1 -1
  30. package/dist/effect/organizations.d.ts +23 -41
  31. package/dist/effect/organizations.js +1 -1
  32. package/dist/effect/scheduled-messages.d.ts +43 -454
  33. package/dist/effect/scheduled-messages.js +1 -1
  34. package/dist/effect/templates.d.ts +175 -649
  35. package/dist/effect/templates.js +2 -2
  36. package/dist/effect/webhooks.d.ts +20 -21
  37. package/dist/effect/webhooks.js +2 -2
  38. package/dist/index.js +1 -1
  39. package/dist/{normalize-LkWl4HUF.js → normalize-BKFjbR9t.js} +5 -13
  40. package/dist/normalize.d.ts +3 -33
  41. package/dist/{operation-Ccqh_yxb.js → operation-C2Q4cFJL.js} +21 -3
  42. package/dist/promises/index.d.ts +4 -14
  43. package/dist/promises/index.js +1 -1
  44. package/dist/promises/types.gen.d.ts +1 -1
  45. package/dist/{promises-Dgv8UmCC.js → promises-oiy7mOyu.js} +386 -29
  46. package/dist/service-map.d.ts +26 -0
  47. package/package.json +17 -12
@@ -9,7 +9,7 @@ export type MessageContact = {
9
9
  displayName: string | null;
10
10
  type: string;
11
11
  identities: Array<{
12
- channel: "sms" | "whatsapp" | "email";
12
+ channel: "email";
13
13
  identifier: string;
14
14
  verified: boolean;
15
15
  }>;
@@ -26,7 +26,7 @@ export type Message = {
26
26
  actorMetadata: {
27
27
  [key: string]: JsonValue;
28
28
  } | null;
29
- channel: "sms" | "whatsapp" | "email";
29
+ channel: "email";
30
30
  direction: "outbound" | "inbound";
31
31
  content: JsonValue;
32
32
  metadata: {
@@ -67,7 +67,7 @@ export type Message = {
67
67
  id: string;
68
68
  messageId: string;
69
69
  recipientId: string | null;
70
- channel: "sms" | "whatsapp" | "email";
70
+ channel: "email";
71
71
  status: "pending" | "scheduled" | "queued" | "processing" | "sent" | "delivered" | "read" | "failed" | "bounced" | "complained";
72
72
  attemptCount: number;
73
73
  maxAttempts: number;
@@ -124,48 +124,6 @@ export type Message = {
124
124
  createdAt: string;
125
125
  updatedAt: string;
126
126
  }>;
127
- smsDeliveryDetails: Array<{
128
- deliveryId: string;
129
- fromNumber: string;
130
- toNumber: string;
131
- segmentCount: number;
132
- encoding: string;
133
- dltTemplateId: string | null;
134
- dltEntityId: string | null;
135
- dltContentId: string | null;
136
- carrier: string | null;
137
- numSegmentsReported: number | null;
138
- createdAt: string;
139
- updatedAt: string;
140
- }>;
141
- whatsappDeliveryDetails: Array<{
142
- deliveryId: string;
143
- fromNumber: string;
144
- toNumber: string;
145
- messageType: "text" | "image" | "video" | "audio" | "document" | "location" | "contacts" | "template" | "interactive" | "sticker" | "reaction" | "order" | "button" | "system" | "unsupported";
146
- templateName: string | null;
147
- templateLanguage: string | null;
148
- templateCategory: string | null;
149
- templateParams: JsonObject | null;
150
- mediaUrl: string | null;
151
- mediaType: string | null;
152
- mediaS3Key: string | null;
153
- interactiveType: string | null;
154
- contextMessageId: string | null;
155
- conversationType: "marketing" | "utility" | "authentication" | "service" | null;
156
- serviceWindowId: string | null;
157
- freeEntryPointId: string | null;
158
- isBillable: boolean;
159
- pricing: {
160
- messageCost: string;
161
- reason: string;
162
- sentInServiceWindow: boolean;
163
- sentInFreeEntryPoint: boolean;
164
- } | null;
165
- recipientId: string | null;
166
- createdAt: string;
167
- updatedAt: string;
168
- }>;
169
127
  };
170
128
  export type PaginationMeta = {
171
129
  page: number;
@@ -217,13 +175,15 @@ export type EmailSender = {
217
175
  email: string;
218
176
  name?: string | null | undefined;
219
177
  } | null;
220
- export type EmailAttachments = Array<{
178
+ export type MediaId = string;
179
+ export type EmailAttachment = {
221
180
  filename: string;
222
181
  content?: string | null | undefined;
223
- url?: string | null | undefined;
182
+ mediaId?: MediaId | null | undefined;
224
183
  contentType: string;
225
184
  size: number;
226
- }> | null;
185
+ };
186
+ export type EmailAttachments = Array<EmailAttachment> | null;
227
187
  export type TemplateId = string;
228
188
  export type TemplateData = JsonObject | null;
229
189
  export type ReplyToAddresses = Array<string> | null | null;
@@ -268,60 +228,7 @@ export type EmailSendMessagePayload = {
268
228
  from?: EmailSender | undefined;
269
229
  email: EmailContent;
270
230
  };
271
- export type SmsRecipient = {
272
- contactId: ContactId;
273
- } | {
274
- phone: string;
275
- name?: string | null | undefined;
276
- displayName?: string | null | null | undefined;
277
- };
278
- export type SmsRecipients = [SmsRecipient];
279
- export type SmsTemplateData = JsonObject | null;
280
- export type SmsContent = {
281
- text?: string | null | undefined;
282
- templateId?: TemplateId | null | undefined;
283
- templateSlug?: string | null | undefined;
284
- templateData?: SmsTemplateData | undefined;
285
- };
286
- /**
287
- * SMS sending is coming soon. The payload is accepted by the contract today and the endpoint answers 403 until the channel launches for your organization.
288
- */
289
- export type SmsSendMessagePayload = {
290
- conversationId?: ConversationId | null | null | undefined;
291
- metadata?: MessageMetadata | undefined;
292
- channel: "sms";
293
- to: SmsRecipients;
294
- sms: SmsContent;
295
- };
296
- export type WhatsAppRecipient = {
297
- contactId: ContactId;
298
- } | {
299
- whatsapp: string;
300
- name?: string | null | undefined;
301
- displayName?: string | null | null | undefined;
302
- };
303
- export type WhatsAppRecipients = [WhatsAppRecipient];
304
- export type WhatsAppTemplateData = JsonObject | null;
305
- export type WhatsAppContent = {
306
- text?: string | null | undefined;
307
- mediaUrl?: string | null | undefined;
308
- mediaType?: "image" | "video" | "audio" | "document" | null | undefined;
309
- templateId?: TemplateId | null | undefined;
310
- templateSlug?: string | null | undefined;
311
- templateCategory?: "marketing" | "utility" | "authentication" | null | undefined;
312
- templateData?: WhatsAppTemplateData | undefined;
313
- };
314
- /**
315
- * WhatsApp sending is coming soon. The payload is accepted by the contract today and the endpoint answers 403 until the channel launches for your organization.
316
- */
317
- export type WhatsAppSendMessagePayload = {
318
- conversationId?: ConversationId | null | null | undefined;
319
- metadata?: MessageMetadata | undefined;
320
- channel: "whatsapp";
321
- to: WhatsAppRecipients;
322
- whatsapp: WhatsAppContent;
323
- };
324
- export type SendMessagePayload = EmailSendMessagePayload | SmsSendMessagePayload | WhatsAppSendMessagePayload;
231
+ export type SendMessagePayload = EmailSendMessagePayload;
325
232
  export type ConflictError = {
326
233
  _tag: "ConflictError";
327
234
  operation: string;
@@ -431,42 +338,7 @@ export type EmailDispatchSendMessagePayload = {
431
338
  from?: EmailSender | undefined;
432
339
  email: EmailDispatchContent;
433
340
  };
434
- export type SmsDispatchContent = {
435
- text?: string | null | undefined;
436
- templateId?: TemplateId | null | undefined;
437
- templateSlug?: string | null | undefined;
438
- templateData?: SmsTemplateData | undefined;
439
- };
440
- /**
441
- * SMS sending is coming soon. The payload is accepted by the contract today and the endpoint answers 403 until the channel launches for your organization.
442
- */
443
- export type SmsDispatchSendMessagePayload = {
444
- conversationId?: ConversationId | null | null | undefined;
445
- metadata?: MessageMetadata | undefined;
446
- channel: "sms";
447
- to: SmsRecipients;
448
- sms: SmsDispatchContent;
449
- };
450
- export type WhatsAppDispatchContent = {
451
- text?: string | null | undefined;
452
- mediaUrl?: string | null | undefined;
453
- mediaType?: "image" | "video" | "audio" | "document" | null | undefined;
454
- templateId?: TemplateId | null | undefined;
455
- templateSlug?: string | null | undefined;
456
- templateCategory?: "marketing" | "utility" | "authentication" | null | undefined;
457
- templateData?: WhatsAppTemplateData | undefined;
458
- };
459
- /**
460
- * WhatsApp sending is coming soon. The payload is accepted by the contract today and the endpoint answers 403 until the channel launches for your organization.
461
- */
462
- export type WhatsAppDispatchSendMessagePayload = {
463
- conversationId?: ConversationId | null | null | undefined;
464
- metadata?: MessageMetadata | undefined;
465
- channel: "whatsapp";
466
- to: WhatsAppRecipients;
467
- whatsapp: WhatsAppDispatchContent;
468
- };
469
- export type DispatchSendMessagePayload = EmailDispatchSendMessagePayload | SmsDispatchSendMessagePayload | WhatsAppDispatchSendMessagePayload;
341
+ export type DispatchSendMessagePayload = EmailDispatchSendMessagePayload;
470
342
  export type ScheduledMessageId = string;
471
343
  export type ScheduledMessage = {
472
344
  id: ScheduledMessageId;
@@ -479,7 +351,7 @@ export type ScheduledMessage = {
479
351
  referenceId: string | null;
480
352
  failureReason: string | null;
481
353
  attempts: number;
482
- createdBy: string;
354
+ createdBy: string | null;
483
355
  actorEmail: string;
484
356
  memberRole: string;
485
357
  createdAt: string;
@@ -495,19 +367,7 @@ export type EmailCampaignContentInput = {
495
367
  conversationId?: CampaignConversationRef | undefined;
496
368
  metadata?: CampaignContentMetadata | undefined;
497
369
  };
498
- export type SmsCampaignContentInput = {
499
- channel: "sms";
500
- sms: SmsDispatchContent;
501
- conversationId?: CampaignConversationRef | undefined;
502
- metadata?: CampaignContentMetadata | undefined;
503
- };
504
- export type WhatsAppCampaignContentInput = {
505
- channel: "whatsapp";
506
- whatsapp: WhatsAppDispatchContent;
507
- conversationId?: CampaignConversationRef | undefined;
508
- metadata?: CampaignContentMetadata | undefined;
509
- };
510
- export type CampaignContentInput = EmailCampaignContentInput | SmsCampaignContentInput | WhatsAppCampaignContentInput;
370
+ export type CampaignContentInput = EmailCampaignContentInput;
511
371
  export type ContactGroupId = string;
512
372
  export type CampaignAudience = {
513
373
  includeTags?: Array<string> | null | undefined;
@@ -526,19 +386,7 @@ export type EmailCampaignContent = {
526
386
  conversationId?: CampaignConversationRef | undefined;
527
387
  metadata?: CampaignContentMetadata | undefined;
528
388
  };
529
- export type SmsCampaignContent = {
530
- channel: "sms";
531
- sms: SmsContent;
532
- conversationId?: CampaignConversationRef | undefined;
533
- metadata?: CampaignContentMetadata | undefined;
534
- };
535
- export type WhatsAppCampaignContent = {
536
- channel: "whatsapp";
537
- whatsapp: WhatsAppContent;
538
- conversationId?: CampaignConversationRef | undefined;
539
- metadata?: CampaignContentMetadata | undefined;
540
- };
541
- export type CampaignContent = EmailCampaignContent | SmsCampaignContent | WhatsAppCampaignContent;
389
+ export type CampaignContent = EmailCampaignContent;
542
390
  export type CampaignDefinitionSummary = {
543
391
  state: "editable" | "frozen" | "archived";
544
392
  frozenAt: string | null;
@@ -557,13 +405,13 @@ export type CampaignLatestRun = {
557
405
  export type Campaign = {
558
406
  id: CampaignId;
559
407
  name: string;
560
- channel: "sms" | "whatsapp" | "email";
408
+ channel: "email";
561
409
  content: CampaignContent;
562
410
  audience: CampaignAudience;
563
411
  policy: CampaignPolicy;
564
412
  definition: CampaignDefinitionSummary;
565
413
  latestRun: CampaignLatestRun | null;
566
- createdBy: string;
414
+ createdBy: string | null;
567
415
  actorEmail: string;
568
416
  memberRole: string;
569
417
  createdAt: string;
@@ -586,7 +434,7 @@ export type CampaignRun = {
586
434
  skippedCount: number;
587
435
  failureReason: string | null;
588
436
  lastContactId: string | null;
589
- createdBy: string;
437
+ createdBy: string | null;
590
438
  actorEmail: string;
591
439
  memberRole: string;
592
440
  createdAt: string;
@@ -743,8 +591,66 @@ export type ForwardingConditions = {
743
591
  hasAttachments?: boolean | null | undefined;
744
592
  };
745
593
  export type EmailForwardingRuleId = string;
594
+ export type CreateMediaPayload = {
595
+ filename: string;
596
+ contentType: string;
597
+ sizeBytes: number;
598
+ purpose: "attachment" | "avatar";
599
+ checksumSha256?: string | null | undefined;
600
+ };
746
601
  export type OrganizationId = string;
747
- export type Arrays = Array<"sms" | "whatsapp" | "email">;
602
+ export type MediaUploadInstruction = {
603
+ url: string;
604
+ method: "PUT";
605
+ headers: {
606
+ [key: string]: string;
607
+ };
608
+ expiresAt: string;
609
+ };
610
+ export type CreatedMedia = {
611
+ id: MediaId;
612
+ organizationId: OrganizationId;
613
+ status: "pending" | "uploading" | "processing" | "ready" | "failed" | "deleted";
614
+ filename: string;
615
+ contentType: string;
616
+ sizeBytes: number;
617
+ width: number | null;
618
+ height: number | null;
619
+ durationMs: number | null;
620
+ purpose: "attachment" | "avatar";
621
+ checksumSha256: string | null;
622
+ expiresAt: string | null;
623
+ createdAt: string;
624
+ confirmedAt: string | null;
625
+ upload: MediaUploadInstruction;
626
+ };
627
+ export type Media = {
628
+ id: MediaId;
629
+ organizationId: OrganizationId;
630
+ status: "pending" | "uploading" | "processing" | "ready" | "failed" | "deleted";
631
+ filename: string;
632
+ contentType: string;
633
+ sizeBytes: number;
634
+ width: number | null;
635
+ height: number | null;
636
+ durationMs: number | null;
637
+ purpose: "attachment" | "avatar";
638
+ checksumSha256: string | null;
639
+ expiresAt: string | null;
640
+ createdAt: string;
641
+ confirmedAt: string | null;
642
+ };
643
+ export type CompletedMedia = {
644
+ media: Media;
645
+ downloadUrl: string;
646
+ };
647
+ export type SuccessResponse = {
648
+ success: boolean;
649
+ };
650
+ export type MediaDownloadUrl = {
651
+ url: string;
652
+ expiresAt: string;
653
+ };
748
654
  export type UnknownRecord = {
749
655
  [key: string]: JsonValue;
750
656
  };
@@ -753,7 +659,6 @@ export type ConversationMetadata = {
753
659
  tags?: Array<string> | null | undefined;
754
660
  customFields?: UnknownRecord | null | undefined;
755
661
  };
756
- export type Union = ConversationMetadata | null;
757
662
  export type ActorId = string;
758
663
  export type ActorTracking = {
759
664
  allActorIds: Array<ActorId>;
@@ -791,9 +696,6 @@ export type ConversationContext = {
791
696
  workflowData?: UnknownRecord | null | undefined;
792
697
  } | null | undefined;
793
698
  };
794
- export type Union1 = ConversationContext | null;
795
- export type Arrays1 = Array<string>;
796
- export type Arrays2 = Array<string>;
797
699
  export type Conversation = {
798
700
  id: ConversationId;
799
701
  organizationId: OrganizationId;
@@ -801,19 +703,19 @@ export type Conversation = {
801
703
  description: string | null;
802
704
  externalId: string | null;
803
705
  parentConversationId: ConversationId | null;
804
- channels: Arrays;
805
- primaryChannel: "sms" | "whatsapp" | "email";
706
+ channels: Array<"email">;
707
+ primaryChannel: "email";
806
708
  status: "active" | "waiting" | "resolved" | "escalated" | "archived";
807
709
  statusReason: string | null;
808
710
  priority: number;
809
711
  urgency: "low" | "medium" | "high" | "critical";
810
712
  complexity: "simple" | "moderate" | "complex";
811
- metadata: Union;
713
+ metadata: ConversationMetadata | null;
812
714
  actorTracking: ActorTracking;
813
715
  metrics: ConversationMetrics;
814
- context: Union1;
815
- tags: Arrays1;
816
- categories: Arrays2;
716
+ context: ConversationContext | null;
717
+ tags: Array<string>;
718
+ categories: Array<string>;
817
719
  isTest: boolean;
818
720
  isInternal: boolean;
819
721
  isPrivate: boolean;
@@ -841,19 +743,19 @@ export type ConversationDetail = {
841
743
  description: string | null;
842
744
  externalId: string | null;
843
745
  parentConversationId: ConversationId | null;
844
- channels: Arrays;
845
- primaryChannel: "sms" | "whatsapp" | "email";
746
+ channels: Array<"email">;
747
+ primaryChannel: "email";
846
748
  status: "active" | "waiting" | "resolved" | "escalated" | "archived";
847
749
  statusReason: string | null;
848
750
  priority: number;
849
751
  urgency: "low" | "medium" | "high" | "critical";
850
752
  complexity: "simple" | "moderate" | "complex";
851
- metadata: Union;
753
+ metadata: ConversationMetadata | null;
852
754
  actorTracking: ActorTracking;
853
755
  metrics: ConversationMetrics;
854
- context: Union1;
855
- tags: Arrays1;
856
- categories: Arrays2;
756
+ context: ConversationContext | null;
757
+ tags: Array<string>;
758
+ categories: Array<string>;
857
759
  isTest: boolean;
858
760
  isInternal: boolean;
859
761
  isPrivate: boolean;
@@ -874,11 +776,10 @@ export type ConversationContacts = {
874
776
  contactIds: [ContactId, ContactId];
875
777
  };
876
778
  export type ContactIdentity = {
877
- channel: "sms" | "whatsapp" | "email";
779
+ channel: "email";
878
780
  identifier: string;
879
781
  verified: boolean;
880
782
  };
881
- export type Arrays3 = Array<ContactIdentity>;
882
783
  export type HumanProfile = {
883
784
  firstName?: string | null | undefined;
884
785
  lastName?: string | null | undefined;
@@ -896,9 +797,6 @@ export type HumanProfile = {
896
797
  source?: "api" | "import" | "manual" | "form" | null | undefined;
897
798
  sourceDetails?: UnknownRecord | null | undefined;
898
799
  };
899
- export type Union2 = HumanProfile | null;
900
- export type Arrays4 = Array<string>;
901
- export type Arrays5 = Array<string>;
902
800
  export type ContactAccessConfig = {
903
801
  paymentRequired?: {
904
802
  amount: number;
@@ -923,15 +821,12 @@ export type ContactAccessConfig = {
923
821
  outOfOfficeMessage?: string | null | undefined;
924
822
  } | null | undefined;
925
823
  };
926
- export type Union3 = ContactAccessConfig | null;
927
824
  export type ContactPreferences = {
928
- preferredChannels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
825
+ preferredChannels?: Array<"email"> | null | undefined;
929
826
  language?: string | null | undefined;
930
827
  timezone?: string | null | undefined;
931
828
  notifications?: {
932
829
  email?: boolean | null | undefined;
933
- sms?: boolean | null | undefined;
934
- whatsapp?: boolean | null | undefined;
935
830
  quiet_hours?: {
936
831
  start: string;
937
832
  end: string;
@@ -943,8 +838,6 @@ export type ContactPreferences = {
943
838
  maxMessageLength?: number | null | undefined;
944
839
  } | null | undefined;
945
840
  };
946
- export type Union4 = ContactPreferences | null;
947
- export type Union5 = JsonObject | null;
948
841
  export type ContactActivitySummary = {
949
842
  totalInteractions: number;
950
843
  lastActiveAt: string | null;
@@ -956,17 +849,17 @@ export type ContactListItem = {
956
849
  name: string;
957
850
  displayName: string | null;
958
851
  avatar: string | null;
959
- identities: Arrays3;
960
- humanProfile: Union2;
961
- capabilities: Arrays4;
962
- tags: Arrays5;
852
+ identities: Array<ContactIdentity>;
853
+ humanProfile: HumanProfile | null;
854
+ capabilities: Array<string>;
855
+ tags: Array<string>;
963
856
  accessLevel: "public" | "authenticated" | "vip" | "internal";
964
- accessConfig: Union3;
965
- preferences: Union4;
857
+ accessConfig: ContactAccessConfig | null;
858
+ preferences: ContactPreferences | null;
966
859
  status: "active" | "paused" | "blocked" | "archived";
967
860
  statusReason: string | null;
968
861
  externalId: string | null;
969
- metadata: Union5;
862
+ metadata: JsonObject | null;
970
863
  createdAt: string;
971
864
  updatedAt: string;
972
865
  createdBy: ContactId | null;
@@ -980,17 +873,17 @@ export type Contact = {
980
873
  name: string;
981
874
  displayName: string | null;
982
875
  avatar: string | null;
983
- identities: Arrays3;
984
- humanProfile: Union2;
985
- capabilities: Arrays4;
986
- tags: Arrays5;
876
+ identities: Array<ContactIdentity>;
877
+ humanProfile: HumanProfile | null;
878
+ capabilities: Array<string>;
879
+ tags: Array<string>;
987
880
  accessLevel: "public" | "authenticated" | "vip" | "internal";
988
- accessConfig: Union3;
989
- preferences: Union4;
881
+ accessConfig: ContactAccessConfig | null;
882
+ preferences: ContactPreferences | null;
990
883
  status: "active" | "paused" | "blocked" | "archived";
991
884
  statusReason: string | null;
992
885
  externalId: string | null;
993
- metadata: Union5;
886
+ metadata: JsonObject | null;
994
887
  createdAt: string;
995
888
  updatedAt: string;
996
889
  createdBy: ContactId | null;
@@ -1023,12 +916,6 @@ export type TemplateVariable = {
1023
916
  };
1024
917
  export type UserId = string;
1025
918
  export type TemplateCompliance = {
1026
- dltTemplateId?: string | null | undefined;
1027
- dltStatus?: "pending" | "approved" | "rejected" | "expired" | null | undefined;
1028
- dltApprovedAt?: string | null | undefined;
1029
- whatsappTemplateId?: string | null | undefined;
1030
- whatsappStatus?: "draft" | "pending" | "approved" | "published" | "rejected" | "archived" | null | undefined;
1031
- whatsappApprovedAt?: string | null | undefined;
1032
919
  metaStatus?: string | null | undefined;
1033
920
  submittedAt?: string | null | null | undefined;
1034
921
  qualityScore?: string | null | undefined;
@@ -1116,7 +1003,7 @@ export type Template = {
1116
1003
  name: string;
1117
1004
  slug: string;
1118
1005
  familyId: TemplateFamilyId | null;
1119
- channel: "sms" | "whatsapp" | "email";
1006
+ channel: "email";
1120
1007
  origin: "dashboard" | "tsx";
1121
1008
  description: string | null;
1122
1009
  category: string | null;
@@ -1133,66 +1020,6 @@ export type Template = {
1133
1020
  [key: string]: string;
1134
1021
  } | null;
1135
1022
  } | null;
1136
- sms: {
1137
- body: string;
1138
- encoding: string | null;
1139
- estimatedSegments: number | null;
1140
- category: "transactional" | "promotional" | "service_implicit" | null;
1141
- } | null;
1142
- whatsapp: {
1143
- name: string;
1144
- language: string;
1145
- category: "marketing" | "utility" | "authentication" | "service";
1146
- headerType: "text" | "image" | "video" | "document" | "none" | null;
1147
- headerMediaType: string | null;
1148
- headerContent: string | null;
1149
- bodyContent: string;
1150
- footerContent: string | null;
1151
- components: Array<{
1152
- type: "header" | "body" | "footer" | "button";
1153
- format?: "TEXT" | "IMAGE" | "VIDEO" | "DOCUMENT" | null | undefined;
1154
- text?: string | null | undefined;
1155
- example?: {
1156
- header_text?: Array<string> | null | undefined;
1157
- body_text?: Array<Array<string>> | null | undefined;
1158
- } | null | undefined;
1159
- buttons?: Array<{
1160
- type: "QUICK_REPLY" | "URL" | "PHONE_NUMBER" | "COPY_CODE";
1161
- text?: string | null | undefined;
1162
- url?: string | null | undefined;
1163
- phone_number?: string | null | undefined;
1164
- example?: string | null | undefined;
1165
- }> | null | undefined;
1166
- parameters?: Array<{
1167
- type: "text" | "currency" | "date_time" | "image" | "document" | "video";
1168
- text?: string | null | undefined;
1169
- currency?: {
1170
- fallback_value: string;
1171
- code: string;
1172
- amount_1000: number;
1173
- } | null | undefined;
1174
- date_time?: {
1175
- fallback_value: string;
1176
- } | null | undefined;
1177
- image?: {
1178
- link: string;
1179
- } | null | undefined;
1180
- document?: {
1181
- link: string;
1182
- filename?: string | null | undefined;
1183
- } | null | undefined;
1184
- video?: {
1185
- link: string;
1186
- } | null | undefined;
1187
- }> | null | undefined;
1188
- }> | null;
1189
- buttons: Array<{
1190
- [key: string]: JsonValue;
1191
- }> | null;
1192
- examples: {
1193
- [key: string]: JsonValue;
1194
- } | null;
1195
- } | null;
1196
1023
  variableSchema: Array<TemplateVariable> | null;
1197
1024
  compliance: TemplateCompliance | null;
1198
1025
  designOverrides: Design | null;
@@ -1211,7 +1038,7 @@ export type TemplateSummary = {
1211
1038
  id: TemplateId;
1212
1039
  name: string;
1213
1040
  slug: string;
1214
- channel: "sms" | "whatsapp" | "email";
1041
+ channel: "email";
1215
1042
  origin: "dashboard" | "tsx";
1216
1043
  description: string | null;
1217
1044
  category: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null;
@@ -1230,7 +1057,7 @@ export type TemplateFamily = {
1230
1057
  id: TemplateId;
1231
1058
  name: string;
1232
1059
  slug: string;
1233
- channel: "sms" | "whatsapp" | "email";
1060
+ channel: "email";
1234
1061
  variableSchema: Array<TemplateVariable> | null;
1235
1062
  status: "draft" | "pending" | "approved" | "published" | "rejected" | "archived";
1236
1063
  isActive: boolean;
@@ -1244,9 +1071,6 @@ export type TemplateFamily = {
1244
1071
  export type TemplateFamilyName = {
1245
1072
  name: string;
1246
1073
  };
1247
- export type SuccessResponse = {
1248
- success: boolean;
1249
- };
1250
1074
  export type TemplatePerformance = {
1251
1075
  deliveryRate?: number | null | undefined;
1252
1076
  openRate?: number | null | undefined;
@@ -1300,39 +1124,8 @@ export type UpdateTemplatePayload = {
1300
1124
  version?: number | null | undefined;
1301
1125
  };
1302
1126
  };
1303
- export type Objects1 = {
1304
- userId: UserId;
1305
- via: "api" | "mcp" | "agent";
1306
- };
1307
- export type Objects = {
1308
- templateId: TemplateId;
1309
- organizationId: OrganizationId;
1310
- channel: "sms" | "whatsapp" | "email";
1311
- source: string;
1312
- revision: string;
1313
- sourceDigest: string;
1314
- createdAt: string;
1315
- updatedAt: string;
1316
- createdBy: Objects1;
1317
- updatedBy: Objects1;
1318
- };
1319
- export type Objects2 = {
1320
- revision: string;
1321
- variables?: {
1322
- [key: string]: JsonValue;
1323
- } | null | undefined;
1324
- };
1325
- export type Objects3 = {
1326
- channel: "email" | "sms" | "whatsapp";
1327
- subject?: string | null | undefined;
1328
- html?: string | null | undefined;
1329
- text: string;
1330
- missingVariables: Array<string>;
1331
- };
1127
+ export type MailboxExtensionId = string;
1332
1128
  export type TemplateSourceVersionId = string;
1333
- export type Objects4 = {
1334
- versionId: string;
1335
- };
1336
1129
  export type DesignSettings = {
1337
1130
  design: Design | null;
1338
1131
  footerCompleteness: {
@@ -1343,7 +1136,7 @@ export type CreateWebhookPayload = {
1343
1136
  name: string;
1344
1137
  url: string;
1345
1138
  eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated">;
1346
- channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
1139
+ channels?: Array<"email"> | null | undefined;
1347
1140
  headers?: {
1348
1141
  [key: string]: string;
1349
1142
  } | null | undefined;
@@ -1354,7 +1147,7 @@ export type WebhookEndpoint = {
1354
1147
  name: string;
1355
1148
  url: string;
1356
1149
  eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated">;
1357
- channels: Array<"sms" | "whatsapp" | "email"> | null;
1150
+ channels: Array<"email"> | null;
1358
1151
  status: "active" | "disabled";
1359
1152
  hasCustomHeaders: boolean;
1360
1153
  failureStartedAt: string | null;
@@ -1366,7 +1159,7 @@ export type UpdateWebhookPayload = {
1366
1159
  name?: string | null | undefined;
1367
1160
  url?: string | null | undefined;
1368
1161
  eventTypes?: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated"> | null | undefined;
1369
- channels?: Array<"sms" | "whatsapp" | "email"> | null | null | undefined;
1162
+ channels?: Array<"email"> | null | null | undefined;
1370
1163
  headers?: {
1371
1164
  [key: string]: string;
1372
1165
  } | null | undefined;
@@ -1402,10 +1195,6 @@ export type Organization = {
1402
1195
  emailFooterEnabledDefault: boolean | null;
1403
1196
  messagesUsed: number;
1404
1197
  messagesUsedThisMonth: number;
1405
- smsUsed: number;
1406
- smsUsedThisMonth: number;
1407
- whatsappUsed: number;
1408
- whatsappUsedThisMonth: number;
1409
1198
  emailUsed: number;
1410
1199
  emailUsedThisMonth: number;
1411
1200
  contactsUsed: number;
@@ -1452,7 +1241,7 @@ export type MessagesListData = {
1452
1241
  query?: {
1453
1242
  page?: string | null | undefined;
1454
1243
  limit?: string | null | undefined;
1455
- channel?: "sms" | "whatsapp" | "email" | null | undefined;
1244
+ channel?: "email" | null | undefined;
1456
1245
  status?: "pending" | "scheduled" | "queued" | "processing" | "sent" | "delivered" | "read" | "failed" | "bounced" | "complained" | null | undefined;
1457
1246
  conversationId?: ConversationId | null | undefined;
1458
1247
  contactId?: ContactId | null | undefined;
@@ -1487,7 +1276,7 @@ export type MessagesListResponses = {
1487
1276
  };
1488
1277
  export type MessagesListResponse = MessagesListResponses[keyof MessagesListResponses];
1489
1278
  export type MessagesSendData = {
1490
- body: EmailSendMessagePayload | SmsSendMessagePayload | WhatsAppSendMessagePayload;
1279
+ body: EmailSendMessagePayload;
1491
1280
  headers?: {
1492
1281
  "idempotency-key"?: string | null | undefined;
1493
1282
  };
@@ -1507,7 +1296,7 @@ export type MessagesSendErrors = {
1507
1296
  /**
1508
1297
  * ForbiddenError | FlagDisabledError
1509
1298
  */
1510
- 403: ForbiddenError | FlagDisabledError;
1299
+ 403: FlagDisabledError | ForbiddenError;
1511
1300
  /**
1512
1301
  * ResourceNotFoundError
1513
1302
  */
@@ -1651,7 +1440,7 @@ export type MessagesGetEmailResponses = {
1651
1440
  organizationId: string;
1652
1441
  conversationId: ConversationId | null;
1653
1442
  status: "pending" | "scheduled" | "queued" | "processing" | "sent" | "delivered" | "read" | "failed" | "bounced" | "complained";
1654
- channel: "sms" | "whatsapp" | "email";
1443
+ channel: "email";
1655
1444
  direction: "outbound" | "inbound";
1656
1445
  subject: string | null;
1657
1446
  fromEmail: string;
@@ -2086,7 +1875,7 @@ export type CampaignsListResponse = CampaignsListResponses[keyof CampaignsListRe
2086
1875
  export type CampaignsCreateData = {
2087
1876
  body: {
2088
1877
  name: string;
2089
- channel: "sms" | "whatsapp" | "email";
1878
+ channel: "email";
2090
1879
  content: CampaignContentInput;
2091
1880
  audience: CampaignAudience;
2092
1881
  policy?: CampaignPolicy | null | undefined;
@@ -4571,6 +4360,192 @@ export type EmailGetForwardingLogResponses = {
4571
4360
  };
4572
4361
  };
4573
4362
  export type EmailGetForwardingLogResponse = EmailGetForwardingLogResponses[keyof EmailGetForwardingLogResponses];
4363
+ export type MediaCreateData = {
4364
+ body: {
4365
+ filename: string;
4366
+ contentType: string;
4367
+ sizeBytes: number;
4368
+ purpose: "attachment" | "avatar";
4369
+ checksumSha256?: string | null | undefined;
4370
+ };
4371
+ path?: never;
4372
+ query?: never;
4373
+ url: "/v1/media";
4374
+ };
4375
+ export type MediaCreateErrors = {
4376
+ /**
4377
+ * UnauthorizedError
4378
+ */
4379
+ 401: UnauthorizedError;
4380
+ /**
4381
+ * ForbiddenError
4382
+ */
4383
+ 403: ForbiddenError;
4384
+ /**
4385
+ * ValidationError
4386
+ */
4387
+ 422: ValidationError;
4388
+ /**
4389
+ * InternalError
4390
+ */
4391
+ 500: InternalError;
4392
+ };
4393
+ export type MediaCreateError = MediaCreateErrors[keyof MediaCreateErrors];
4394
+ export type MediaCreateResponses = {
4395
+ /**
4396
+ * CreatedMedia
4397
+ */
4398
+ 201: CreatedMedia;
4399
+ };
4400
+ export type MediaCreateResponse = MediaCreateResponses[keyof MediaCreateResponses];
4401
+ export type MediaCompleteData = {
4402
+ body?: never;
4403
+ path: {
4404
+ mediaId: MediaId;
4405
+ };
4406
+ query?: never;
4407
+ url: "/v1/media/{mediaId}/complete";
4408
+ };
4409
+ export type MediaCompleteErrors = {
4410
+ /**
4411
+ * UnauthorizedError
4412
+ */
4413
+ 401: UnauthorizedError;
4414
+ /**
4415
+ * ForbiddenError
4416
+ */
4417
+ 403: ForbiddenError;
4418
+ /**
4419
+ * ResourceNotFoundError
4420
+ */
4421
+ 404: ResourceNotFoundError;
4422
+ /**
4423
+ * ValidationError
4424
+ */
4425
+ 422: ValidationError;
4426
+ /**
4427
+ * InternalError
4428
+ */
4429
+ 500: InternalError;
4430
+ };
4431
+ export type MediaCompleteError = MediaCompleteErrors[keyof MediaCompleteErrors];
4432
+ export type MediaCompleteResponses = {
4433
+ /**
4434
+ * CompletedMedia
4435
+ */
4436
+ 200: CompletedMedia;
4437
+ };
4438
+ export type MediaCompleteResponse = MediaCompleteResponses[keyof MediaCompleteResponses];
4439
+ export type MediaRemoveData = {
4440
+ body?: never;
4441
+ path: {
4442
+ mediaId: MediaId;
4443
+ };
4444
+ query?: never;
4445
+ url: "/v1/media/{mediaId}";
4446
+ };
4447
+ export type MediaRemoveErrors = {
4448
+ /**
4449
+ * UnauthorizedError
4450
+ */
4451
+ 401: UnauthorizedError;
4452
+ /**
4453
+ * ForbiddenError
4454
+ */
4455
+ 403: ForbiddenError;
4456
+ /**
4457
+ * ResourceNotFoundError
4458
+ */
4459
+ 404: ResourceNotFoundError;
4460
+ /**
4461
+ * ValidationError
4462
+ */
4463
+ 422: ValidationError;
4464
+ /**
4465
+ * InternalError
4466
+ */
4467
+ 500: InternalError;
4468
+ };
4469
+ export type MediaRemoveError = MediaRemoveErrors[keyof MediaRemoveErrors];
4470
+ export type MediaRemoveResponses = {
4471
+ /**
4472
+ * SuccessResponse
4473
+ */
4474
+ 200: SuccessResponse;
4475
+ };
4476
+ export type MediaRemoveResponse = MediaRemoveResponses[keyof MediaRemoveResponses];
4477
+ export type MediaGetByIdData = {
4478
+ body?: never;
4479
+ path: {
4480
+ mediaId: MediaId;
4481
+ };
4482
+ query?: never;
4483
+ url: "/v1/media/{mediaId}";
4484
+ };
4485
+ export type MediaGetByIdErrors = {
4486
+ /**
4487
+ * UnauthorizedError
4488
+ */
4489
+ 401: UnauthorizedError;
4490
+ /**
4491
+ * ForbiddenError
4492
+ */
4493
+ 403: ForbiddenError;
4494
+ /**
4495
+ * ResourceNotFoundError
4496
+ */
4497
+ 404: ResourceNotFoundError;
4498
+ /**
4499
+ * InternalError
4500
+ */
4501
+ 500: InternalError;
4502
+ };
4503
+ export type MediaGetByIdError = MediaGetByIdErrors[keyof MediaGetByIdErrors];
4504
+ export type MediaGetByIdResponses = {
4505
+ /**
4506
+ * Media
4507
+ */
4508
+ 200: Media;
4509
+ };
4510
+ export type MediaGetByIdResponse = MediaGetByIdResponses[keyof MediaGetByIdResponses];
4511
+ export type MediaDownloadUrlData = {
4512
+ body?: never;
4513
+ path: {
4514
+ mediaId: MediaId;
4515
+ };
4516
+ query?: never;
4517
+ url: "/v1/media/{mediaId}/url";
4518
+ };
4519
+ export type MediaDownloadUrlErrors = {
4520
+ /**
4521
+ * UnauthorizedError
4522
+ */
4523
+ 401: UnauthorizedError;
4524
+ /**
4525
+ * ForbiddenError
4526
+ */
4527
+ 403: ForbiddenError;
4528
+ /**
4529
+ * ResourceNotFoundError
4530
+ */
4531
+ 404: ResourceNotFoundError;
4532
+ /**
4533
+ * ValidationError
4534
+ */
4535
+ 422: ValidationError;
4536
+ /**
4537
+ * InternalError
4538
+ */
4539
+ 500: InternalError;
4540
+ };
4541
+ export type MediaDownloadUrlError = MediaDownloadUrlErrors[keyof MediaDownloadUrlErrors];
4542
+ export type MediaDownloadUrlResponses = {
4543
+ /**
4544
+ * MediaDownloadUrl
4545
+ */
4546
+ 200: MediaDownloadUrl;
4547
+ };
4548
+ export type MediaDownloadUrlResponse = MediaDownloadUrlResponses[keyof MediaDownloadUrlResponses];
4574
4549
  export type ConversationsListData = {
4575
4550
  body?: never;
4576
4551
  path?: never;
@@ -4578,7 +4553,7 @@ export type ConversationsListData = {
4578
4553
  page?: string | null | undefined;
4579
4554
  limit?: string | null | undefined;
4580
4555
  status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
4581
- channel?: "sms" | "whatsapp" | "email" | null | undefined;
4556
+ channel?: "email" | null | undefined;
4582
4557
  contactId?: ContactId | null | undefined;
4583
4558
  startDate?: string | null | undefined;
4584
4559
  endDate?: string | null | undefined;
@@ -4616,8 +4591,8 @@ export type ConversationsCreateData = {
4616
4591
  description?: string | null | undefined;
4617
4592
  externalId?: string | null | undefined;
4618
4593
  parentConversationId?: ConversationId | null | undefined;
4619
- channels: Array<"sms" | "whatsapp" | "email">;
4620
- primaryChannel: "sms" | "whatsapp" | "email";
4594
+ channels: Array<"email">;
4595
+ primaryChannel: "email";
4621
4596
  status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
4622
4597
  statusReason?: string | null | undefined;
4623
4598
  priority?: number | null | undefined;
@@ -4703,7 +4678,7 @@ export type ConversationsUpdateData = {
4703
4678
  description?: string | null | null | undefined;
4704
4679
  externalId?: string | null | null | undefined;
4705
4680
  parentConversationId?: ConversationId | null | null | undefined;
4706
- primaryChannel?: "sms" | "whatsapp" | "email" | null | undefined;
4681
+ primaryChannel?: "email" | null | undefined;
4707
4682
  status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
4708
4683
  statusReason?: string | null | null | undefined;
4709
4684
  priority?: number | null | undefined;
@@ -4713,7 +4688,7 @@ export type ConversationsUpdateData = {
4713
4688
  metadata?: ConversationMetadata | null | null | undefined;
4714
4689
  metrics?: ConversationMetrics | null | undefined;
4715
4690
  actorTracking?: ActorTracking | null | undefined;
4716
- channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
4691
+ channels?: Array<"email"> | null | undefined;
4717
4692
  tags?: Array<string> | null | undefined;
4718
4693
  categories?: Array<string> | null | undefined;
4719
4694
  isTest?: boolean | null | undefined;
@@ -4977,7 +4952,6 @@ export type ContactsFindData = {
4977
4952
  body: {
4978
4953
  email?: string | null | undefined;
4979
4954
  phone?: string | null | undefined;
4980
- whatsapp?: string | null | undefined;
4981
4955
  externalId?: string | null | undefined;
4982
4956
  };
4983
4957
  path?: never;
@@ -5018,7 +4992,6 @@ export type ContactsFindOrCreateData = {
5018
4992
  body: {
5019
4993
  email?: string | null | undefined;
5020
4994
  phone?: string | null | undefined;
5021
- whatsapp?: string | null | undefined;
5022
4995
  externalId?: string | null | undefined;
5023
4996
  name?: string | null | undefined;
5024
4997
  displayName?: string | null | null | undefined;
@@ -5468,7 +5441,7 @@ export type ContactsGetActivityTimelineData = {
5468
5441
  query?: {
5469
5442
  page?: string | null | undefined;
5470
5443
  limit?: string | null | undefined;
5471
- channel?: "sms" | "whatsapp" | "email" | null | undefined;
5444
+ channel?: "email" | null | undefined;
5472
5445
  };
5473
5446
  url: "/v1/contacts/{id}/activity";
5474
5447
  };
@@ -5559,7 +5532,7 @@ export type TemplatesListData = {
5559
5532
  page?: string | null | undefined;
5560
5533
  limit?: string | null | undefined;
5561
5534
  category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | undefined;
5562
- channel?: "sms" | "whatsapp" | "email" | null | undefined;
5535
+ channel?: "email" | null | undefined;
5563
5536
  status?: "draft" | "pending" | "approved" | "published" | "rejected" | "archived" | null | undefined;
5564
5537
  search?: string | null | undefined;
5565
5538
  sortBy?: "name" | "createdAt" | "updatedAt" | "usageCount" | "lastUsedAt" | null | undefined;
@@ -5652,9 +5625,9 @@ export type TemplatesListDashboardData = {
5652
5625
  query: {
5653
5626
  page?: string | null | undefined;
5654
5627
  limit?: string | null | undefined;
5655
- allowedChannels: "sms" | "whatsapp" | "email" | Array<"sms" | "whatsapp" | "email">;
5628
+ allowedChannels: "email" | Array<"email">;
5656
5629
  category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | undefined;
5657
- channel?: "sms" | "whatsapp" | "email" | null | undefined;
5630
+ channel?: "email" | null | undefined;
5658
5631
  status?: "draft" | "pending" | "approved" | "published" | "rejected" | "archived" | null | undefined;
5659
5632
  search?: string | null | undefined;
5660
5633
  sortBy?: "name" | "createdAt" | "updatedAt" | "usageCount" | "lastUsedAt" | null | undefined;
@@ -6005,7 +5978,7 @@ export type TemplatesAddFamilyChannelData = {
6005
5978
  body?: never;
6006
5979
  path: {
6007
5980
  familyId: TemplateFamilyId;
6008
- channel: "sms" | "whatsapp" | "email";
5981
+ channel: "email";
6009
5982
  };
6010
5983
  query?: never;
6011
5984
  url: "/v1/templates/families/{familyId}/channels/{channel}";
@@ -6248,7 +6221,24 @@ export type TemplateDocumentsBootstrapResponses = {
6248
6221
  /**
6249
6222
  * Success
6250
6223
  */
6251
- 200: Objects;
6224
+ 200: {
6225
+ templateId: TemplateId;
6226
+ organizationId: OrganizationId;
6227
+ channel: "email";
6228
+ source: string;
6229
+ revision: string;
6230
+ sourceDigest: string;
6231
+ createdAt: string;
6232
+ updatedAt: string;
6233
+ createdBy: {
6234
+ userId: UserId;
6235
+ via: "api" | "mcp" | "agent";
6236
+ };
6237
+ updatedBy: {
6238
+ userId: UserId;
6239
+ via: "api" | "mcp" | "agent";
6240
+ };
6241
+ };
6252
6242
  };
6253
6243
  export type TemplateDocumentsBootstrapResponse = TemplateDocumentsBootstrapResponses[keyof TemplateDocumentsBootstrapResponses];
6254
6244
  export type TemplateDocumentsGetData = {
@@ -6290,9 +6280,293 @@ export type TemplateDocumentsGetResponses = {
6290
6280
  /**
6291
6281
  * Success
6292
6282
  */
6293
- 200: Objects;
6283
+ 200: {
6284
+ templateId: TemplateId;
6285
+ organizationId: OrganizationId;
6286
+ channel: "email";
6287
+ source: string;
6288
+ revision: string;
6289
+ sourceDigest: string;
6290
+ createdAt: string;
6291
+ updatedAt: string;
6292
+ createdBy: {
6293
+ userId: UserId;
6294
+ via: "api" | "mcp" | "agent";
6295
+ };
6296
+ updatedBy: {
6297
+ userId: UserId;
6298
+ via: "api" | "mcp" | "agent";
6299
+ };
6300
+ };
6294
6301
  };
6295
6302
  export type TemplateDocumentsGetResponse = TemplateDocumentsGetResponses[keyof TemplateDocumentsGetResponses];
6303
+ export type TemplateDocumentsIssueAgentAdmissionData = {
6304
+ body: {
6305
+ method: "GET" | "HEAD" | "POST";
6306
+ route: "prompt" | "read" | "abort" | "clear";
6307
+ referenceDigest?: string | undefined;
6308
+ research?: {
6309
+ kind: "query";
6310
+ query: string;
6311
+ } | {
6312
+ kind: "url";
6313
+ url: string;
6314
+ } | {
6315
+ kind: "styleguide";
6316
+ domain: string;
6317
+ } | undefined;
6318
+ competitorMessage?: {
6319
+ watchId: MailboxExtensionId;
6320
+ messageId: MessageId;
6321
+ } | undefined;
6322
+ };
6323
+ path: {
6324
+ templateId: TemplateId;
6325
+ };
6326
+ query?: never;
6327
+ url: "/v1/template-documents/{templateId}/agent-admission";
6328
+ };
6329
+ export type TemplateDocumentsIssueAgentAdmissionErrors = {
6330
+ /**
6331
+ * UnauthorizedError
6332
+ */
6333
+ 401: UnauthorizedError;
6334
+ /**
6335
+ * ForbiddenError
6336
+ */
6337
+ 403: ForbiddenError;
6338
+ /**
6339
+ * ResourceNotFoundError
6340
+ */
6341
+ 404: ResourceNotFoundError;
6342
+ /**
6343
+ * ConflictError
6344
+ */
6345
+ 409: ConflictError;
6346
+ /**
6347
+ * ValidationError
6348
+ */
6349
+ 422: ValidationError;
6350
+ /**
6351
+ * InternalError
6352
+ */
6353
+ 500: InternalError;
6354
+ };
6355
+ export type TemplateDocumentsIssueAgentAdmissionError = TemplateDocumentsIssueAgentAdmissionErrors[keyof TemplateDocumentsIssueAgentAdmissionErrors];
6356
+ export type TemplateDocumentsIssueAgentAdmissionResponses = {
6357
+ /**
6358
+ * Success
6359
+ */
6360
+ 200: {
6361
+ token: string;
6362
+ conversationId: string;
6363
+ snapshot: {
6364
+ templateId: TemplateId;
6365
+ organizationId: OrganizationId;
6366
+ channel: "email";
6367
+ source: string;
6368
+ revision: string;
6369
+ sourceDigest: string;
6370
+ };
6371
+ reference?: {
6372
+ version: 1;
6373
+ referenceId: string;
6374
+ name: string;
6375
+ description: string;
6376
+ galleryPath: string;
6377
+ digest: string;
6378
+ citation: {
6379
+ kind: string;
6380
+ digest: string;
6381
+ locator?: string | undefined;
6382
+ };
6383
+ policy: "samva-owned-source";
6384
+ source: string;
6385
+ } | {
6386
+ version: 1;
6387
+ referenceId: string;
6388
+ name: string;
6389
+ description: string;
6390
+ galleryPath: string;
6391
+ digest: string;
6392
+ citation: {
6393
+ kind: string;
6394
+ digest: string;
6395
+ locator?: string | undefined;
6396
+ };
6397
+ policy: "reviewed-public-structure";
6398
+ structure: {
6399
+ nodes: Array<{
6400
+ tag: string;
6401
+ depth: number;
6402
+ childIndex: number;
6403
+ }>;
6404
+ components: Array<{
6405
+ tag: string;
6406
+ count: number;
6407
+ }>;
6408
+ palette: Array<string>;
6409
+ };
6410
+ } | {
6411
+ version: 1;
6412
+ policy: "authorized-message-structure";
6413
+ referenceId: string;
6414
+ name: string;
6415
+ description: string;
6416
+ digest: string;
6417
+ citation: {
6418
+ kind: string;
6419
+ digest: string;
6420
+ locator?: string | undefined;
6421
+ };
6422
+ structure: {
6423
+ sections: number;
6424
+ headings: number;
6425
+ images: number;
6426
+ links: number;
6427
+ buttons: number;
6428
+ textLength: number;
6429
+ subjectLength: number;
6430
+ palette: Array<string>;
6431
+ };
6432
+ } | {
6433
+ version: 1;
6434
+ policy: "public-research";
6435
+ request: {
6436
+ kind: "query";
6437
+ query: string;
6438
+ } | {
6439
+ kind: "url";
6440
+ url: string;
6441
+ } | {
6442
+ kind: "styleguide";
6443
+ domain: string;
6444
+ };
6445
+ digest: string;
6446
+ citations: Array<{
6447
+ title: string;
6448
+ url: string;
6449
+ excerpts: Array<string>;
6450
+ }>;
6451
+ citation: {
6452
+ kind: string;
6453
+ digest: string;
6454
+ locator?: string | undefined;
6455
+ };
6456
+ } | undefined;
6457
+ proposalBinding?: string | undefined;
6458
+ };
6459
+ };
6460
+ export type TemplateDocumentsIssueAgentAdmissionResponse = TemplateDocumentsIssueAgentAdmissionResponses[keyof TemplateDocumentsIssueAgentAdmissionResponses];
6461
+ export type TemplateDocumentsCompleteAgentConversationClearData = {
6462
+ body: {
6463
+ conversationId: string;
6464
+ };
6465
+ path: {
6466
+ templateId: TemplateId;
6467
+ };
6468
+ query?: never;
6469
+ url: "/v1/template-documents/{templateId}/agent-conversation/clear-completion";
6470
+ };
6471
+ export type TemplateDocumentsCompleteAgentConversationClearErrors = {
6472
+ /**
6473
+ * UnauthorizedError
6474
+ */
6475
+ 401: UnauthorizedError;
6476
+ /**
6477
+ * ForbiddenError
6478
+ */
6479
+ 403: ForbiddenError;
6480
+ /**
6481
+ * ResourceNotFoundError
6482
+ */
6483
+ 404: ResourceNotFoundError;
6484
+ /**
6485
+ * ConflictError
6486
+ */
6487
+ 409: ConflictError;
6488
+ /**
6489
+ * InternalError
6490
+ */
6491
+ 500: InternalError;
6492
+ };
6493
+ export type TemplateDocumentsCompleteAgentConversationClearError = TemplateDocumentsCompleteAgentConversationClearErrors[keyof TemplateDocumentsCompleteAgentConversationClearErrors];
6494
+ export type TemplateDocumentsCompleteAgentConversationClearResponses = {
6495
+ /**
6496
+ * <No Content>
6497
+ */
6498
+ 200: unknown;
6499
+ };
6500
+ export type TemplateDocumentsApplyAgentProposalData = {
6501
+ body: {
6502
+ expectedRevision: string;
6503
+ sourceDigest: string;
6504
+ idempotencyKey: string;
6505
+ source: string;
6506
+ references: Array<{
6507
+ kind: string;
6508
+ digest: string;
6509
+ locator?: string | undefined;
6510
+ }>;
6511
+ proposalBinding?: string | undefined;
6512
+ };
6513
+ path: {
6514
+ templateId: TemplateId;
6515
+ };
6516
+ query?: never;
6517
+ url: "/v1/template-documents/{templateId}/agent-proposals/apply";
6518
+ };
6519
+ export type TemplateDocumentsApplyAgentProposalErrors = {
6520
+ /**
6521
+ * UnauthorizedError
6522
+ */
6523
+ 401: UnauthorizedError;
6524
+ /**
6525
+ * ForbiddenError
6526
+ */
6527
+ 403: ForbiddenError;
6528
+ /**
6529
+ * ResourceNotFoundError
6530
+ */
6531
+ 404: ResourceNotFoundError;
6532
+ /**
6533
+ * ConflictError
6534
+ */
6535
+ 409: ConflictError;
6536
+ /**
6537
+ * ValidationError
6538
+ */
6539
+ 422: ValidationError;
6540
+ /**
6541
+ * InternalError
6542
+ */
6543
+ 500: InternalError;
6544
+ };
6545
+ export type TemplateDocumentsApplyAgentProposalError = TemplateDocumentsApplyAgentProposalErrors[keyof TemplateDocumentsApplyAgentProposalErrors];
6546
+ export type TemplateDocumentsApplyAgentProposalResponses = {
6547
+ /**
6548
+ * Success
6549
+ */
6550
+ 200: {
6551
+ templateId: TemplateId;
6552
+ organizationId: OrganizationId;
6553
+ channel: "email";
6554
+ source: string;
6555
+ revision: string;
6556
+ sourceDigest: string;
6557
+ createdAt: string;
6558
+ updatedAt: string;
6559
+ createdBy: {
6560
+ userId: UserId;
6561
+ via: "api" | "mcp" | "agent";
6562
+ };
6563
+ updatedBy: {
6564
+ userId: UserId;
6565
+ via: "api" | "mcp" | "agent";
6566
+ };
6567
+ };
6568
+ };
6569
+ export type TemplateDocumentsApplyAgentProposalResponse = TemplateDocumentsApplyAgentProposalResponses[keyof TemplateDocumentsApplyAgentProposalResponses];
6296
6570
  export type TemplateDocumentsReplaceData = {
6297
6571
  body: {
6298
6572
  expectedRevision: string;
@@ -6335,7 +6609,24 @@ export type TemplateDocumentsReplaceResponses = {
6335
6609
  /**
6336
6610
  * Success
6337
6611
  */
6338
- 200: Objects;
6612
+ 200: {
6613
+ templateId: TemplateId;
6614
+ organizationId: OrganizationId;
6615
+ channel: "email";
6616
+ source: string;
6617
+ revision: string;
6618
+ sourceDigest: string;
6619
+ createdAt: string;
6620
+ updatedAt: string;
6621
+ createdBy: {
6622
+ userId: UserId;
6623
+ via: "api" | "mcp" | "agent";
6624
+ };
6625
+ updatedBy: {
6626
+ userId: UserId;
6627
+ via: "api" | "mcp" | "agent";
6628
+ };
6629
+ };
6339
6630
  };
6340
6631
  export type TemplateDocumentsReplaceResponse = TemplateDocumentsReplaceResponses[keyof TemplateDocumentsReplaceResponses];
6341
6632
  export type TemplateDocumentsSaveData = {
@@ -6434,7 +6725,13 @@ export type TemplateDocumentsRenderResponses = {
6434
6725
  /**
6435
6726
  * Success
6436
6727
  */
6437
- 200: Objects3;
6728
+ 200: {
6729
+ channel: "email";
6730
+ subject?: string | null | undefined;
6731
+ html?: string | null | undefined;
6732
+ text: string;
6733
+ missingVariables: Array<string>;
6734
+ };
6438
6735
  };
6439
6736
  export type TemplateDocumentsRenderResponse = TemplateDocumentsRenderResponses[keyof TemplateDocumentsRenderResponses];
6440
6737
  export type TemplateDocumentsSpamCheckData = {
@@ -6533,6 +6830,10 @@ export type TemplateDocumentsTestSendErrors = {
6533
6830
  * ValidationError
6534
6831
  */
6535
6832
  422: ValidationError;
6833
+ /**
6834
+ * RateLimitedError
6835
+ */
6836
+ 429: RateLimitedError;
6536
6837
  /**
6537
6838
  * InternalError | WebhookEnqueueError
6538
6839
  */
@@ -6550,7 +6851,13 @@ export type TemplateDocumentsTestSendResponses = {
6550
6851
  200: {
6551
6852
  messageId: string;
6552
6853
  status: string;
6553
- rendered: Objects3;
6854
+ rendered: {
6855
+ channel: "email";
6856
+ subject?: string | null | undefined;
6857
+ html?: string | null | undefined;
6858
+ text: string;
6859
+ missingVariables: Array<string>;
6860
+ };
6554
6861
  };
6555
6862
  };
6556
6863
  export type TemplateDocumentsTestSendResponse = TemplateDocumentsTestSendResponses[keyof TemplateDocumentsTestSendResponses];
@@ -6584,7 +6891,7 @@ export type TemplateDocumentsSendErrors = {
6584
6891
  /**
6585
6892
  * ForbiddenError | FlagDisabledError
6586
6893
  */
6587
- 403: ForbiddenError | FlagDisabledError;
6894
+ 403: FlagDisabledError | ForbiddenError;
6588
6895
  /**
6589
6896
  * ResourceNotFoundError
6590
6897
  */
@@ -6721,7 +7028,9 @@ export type TemplateDocumentsPublishResponses = {
6721
7028
  /**
6722
7029
  * Success
6723
7030
  */
6724
- 200: Objects4;
7031
+ 200: {
7032
+ versionId: string;
7033
+ };
6725
7034
  };
6726
7035
  export type TemplateDocumentsPublishResponse = TemplateDocumentsPublishResponses[keyof TemplateDocumentsPublishResponses];
6727
7036
  export type TemplateDocumentsUnpublishData = {
@@ -6763,7 +7072,9 @@ export type TemplateDocumentsUnpublishResponses = {
6763
7072
  /**
6764
7073
  * Success
6765
7074
  */
6766
- 200: Objects4;
7075
+ 200: {
7076
+ versionId: string;
7077
+ };
6767
7078
  };
6768
7079
  export type TemplateDocumentsUnpublishResponse = TemplateDocumentsUnpublishResponses[keyof TemplateDocumentsUnpublishResponses];
6769
7080
  export type TemplateDocumentsRestoreData = {
@@ -6808,7 +7119,24 @@ export type TemplateDocumentsRestoreResponses = {
6808
7119
  /**
6809
7120
  * Success
6810
7121
  */
6811
- 200: Objects;
7122
+ 200: {
7123
+ templateId: TemplateId;
7124
+ organizationId: OrganizationId;
7125
+ channel: "email";
7126
+ source: string;
7127
+ revision: string;
7128
+ sourceDigest: string;
7129
+ createdAt: string;
7130
+ updatedAt: string;
7131
+ createdBy: {
7132
+ userId: UserId;
7133
+ via: "api" | "mcp" | "agent";
7134
+ };
7135
+ updatedBy: {
7136
+ userId: UserId;
7137
+ via: "api" | "mcp" | "agent";
7138
+ };
7139
+ };
6812
7140
  };
6813
7141
  export type TemplateDocumentsRestoreResponse = TemplateDocumentsRestoreResponses[keyof TemplateDocumentsRestoreResponses];
6814
7142
  export type DesignGetData = {
@@ -6913,7 +7241,7 @@ export type WebhooksCreateData = {
6913
7241
  name: string;
6914
7242
  url: string;
6915
7243
  eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated">;
6916
- channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
7244
+ channels?: Array<"email"> | null | undefined;
6917
7245
  headers?: {
6918
7246
  [key: string]: string;
6919
7247
  } | null | undefined;
@@ -6940,6 +7268,10 @@ export type WebhooksCreateErrors = {
6940
7268
  * ConflictError
6941
7269
  */
6942
7270
  409: ConflictError;
7271
+ /**
7272
+ * ValidationError
7273
+ */
7274
+ 422: ValidationError;
6943
7275
  /**
6944
7276
  * InternalError
6945
7277
  */
@@ -7037,7 +7369,7 @@ export type WebhooksUpdateData = {
7037
7369
  name?: string | null | undefined;
7038
7370
  url?: string | null | undefined;
7039
7371
  eventTypes?: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated"> | null | undefined;
7040
- channels?: Array<"sms" | "whatsapp" | "email"> | null | null | undefined;
7372
+ channels?: Array<"email"> | null | null | undefined;
7041
7373
  headers?: {
7042
7374
  [key: string]: string;
7043
7375
  } | null | undefined;
@@ -7066,6 +7398,10 @@ export type WebhooksUpdateErrors = {
7066
7398
  * ConflictError
7067
7399
  */
7068
7400
  409: ConflictError;
7401
+ /**
7402
+ * ValidationError
7403
+ */
7404
+ 422: ValidationError;
7069
7405
  /**
7070
7406
  * InternalError
7071
7407
  */
@@ -7176,7 +7512,6 @@ export type WebhooksGetLogsResponses = {
7176
7512
  responseHeaders: {
7177
7513
  [key: string]: string;
7178
7514
  } | null;
7179
- responseBody: string | null;
7180
7515
  durationMs: number | null;
7181
7516
  errorCode: string | null;
7182
7517
  errorMessage: string | null;
@@ -7467,9 +7802,7 @@ export type OrganizationsGetUsageResponses = {
7467
7802
  usage: {
7468
7803
  periodStart: string;
7469
7804
  periodEnd: string;
7470
- smsCount: number;
7471
7805
  emailCount: number;
7472
- whatsappCount: number;
7473
7806
  totalMessages: number;
7474
7807
  };
7475
7808
  billing: {
@@ -7625,6 +7958,10 @@ export type ApiKeysCreateErrors = {
7625
7958
  * ResourceNotFoundError
7626
7959
  */
7627
7960
  404: ResourceNotFoundError;
7961
+ /**
7962
+ * ValidationError
7963
+ */
7964
+ 422: ValidationError;
7628
7965
  /**
7629
7966
  * InternalError
7630
7967
  */
@@ -7772,6 +8109,10 @@ export type ApiKeysRotateErrors = {
7772
8109
  * ResourceNotFoundError
7773
8110
  */
7774
8111
  404: ResourceNotFoundError;
8112
+ /**
8113
+ * ValidationError
8114
+ */
8115
+ 422: ValidationError;
7775
8116
  /**
7776
8117
  * InternalError
7777
8118
  */