samva 0.0.1 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (79) hide show
  1. package/AGENTS.md +13 -0
  2. package/LICENSE +21 -0
  3. package/README.md +392 -5
  4. package/dist/categories-CsUa8ojo.js +143 -0
  5. package/dist/client/client/client.gen.d.ts +2 -0
  6. package/dist/client/client/index.d.ts +10 -0
  7. package/dist/client/client/types.gen.d.ts +120 -0
  8. package/dist/client/client/utils.gen.d.ts +37 -0
  9. package/dist/client/client.gen.d.ts +12 -0
  10. package/dist/client/core/auth.gen.d.ts +25 -0
  11. package/dist/client/core/bodySerializer.gen.d.ts +25 -0
  12. package/dist/client/core/params.gen.d.ts +43 -0
  13. package/dist/client/core/pathSerializer.gen.d.ts +33 -0
  14. package/dist/client/core/queryKeySerializer.gen.d.ts +18 -0
  15. package/dist/client/core/serverSentEvents.gen.d.ts +71 -0
  16. package/dist/client/core/types.gen.d.ts +83 -0
  17. package/dist/client/core/utils.gen.d.ts +19 -0
  18. package/dist/client/sdk.gen.d.ts +1622 -0
  19. package/dist/client/types.gen.d.ts +7524 -0
  20. package/dist/client-DVALvDUe.js +5688 -0
  21. package/dist/effect/api-keys.d.ts +190 -0
  22. package/dist/effect/api-keys.js +27 -0
  23. package/dist/effect/campaigns.d.ts +1964 -0
  24. package/dist/effect/campaigns.js +33 -0
  25. package/dist/effect/categories.d.ts +65 -0
  26. package/dist/effect/categories.js +2 -0
  27. package/dist/effect/client.d.ts +9 -0
  28. package/dist/effect/client.js +13 -0
  29. package/dist/effect/contacts.d.ts +1356 -0
  30. package/dist/effect/contacts.js +39 -0
  31. package/dist/effect/conversations.d.ts +1589 -0
  32. package/dist/effect/conversations.js +23 -0
  33. package/dist/effect/design.d.ts +209 -0
  34. package/dist/effect/design.js +13 -0
  35. package/dist/effect/email.d.ts +982 -0
  36. package/dist/effect/email.js +109 -0
  37. package/dist/effect/generated-metadata.d.ts +54 -0
  38. package/dist/effect/generated.d.ts +31936 -0
  39. package/dist/effect/index.d.ts +36 -0
  40. package/dist/effect/index.js +17 -0
  41. package/dist/effect/internal/client.d.ts +35 -0
  42. package/dist/effect/internal/operation.d.ts +466 -0
  43. package/dist/effect/messages.d.ts +1047 -0
  44. package/dist/effect/messages.js +23 -0
  45. package/dist/effect/operations.d.ts +97 -0
  46. package/dist/effect/operations.js +15 -0
  47. package/dist/effect/organizations.d.ts +559 -0
  48. package/dist/effect/organizations.js +21 -0
  49. package/dist/effect/pagination.d.ts +37 -0
  50. package/dist/effect/retry.d.ts +60 -0
  51. package/dist/effect/retry.js +112 -0
  52. package/dist/effect/runtime.d.ts +7 -0
  53. package/dist/effect/scheduled-messages.d.ts +1057 -0
  54. package/dist/effect/scheduled-messages.js +17 -0
  55. package/dist/effect/templates.d.ts +3347 -0
  56. package/dist/effect/templates.js +58 -0
  57. package/dist/effect/webhooks.d.ts +228 -0
  58. package/dist/effect/webhooks.js +33 -0
  59. package/dist/index.d.ts +1 -0
  60. package/dist/index.js +2 -0
  61. package/dist/normalize-LkWl4HUF.js +82 -0
  62. package/dist/normalize.d.ts +87 -0
  63. package/dist/operation-UtKNITtG.js +573 -0
  64. package/dist/promises/errors.gen.d.ts +179 -0
  65. package/dist/promises/index.d.ts +151 -0
  66. package/dist/promises/index.js +2 -0
  67. package/dist/promises/types.gen.d.ts +1 -0
  68. package/dist/promises-QxEfMTho.js +5745 -0
  69. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  70. package/dist/service-map.d.ts +706 -0
  71. package/dist/webhooks/effect.d.ts +1 -0
  72. package/dist/webhooks/effect.js +1 -0
  73. package/dist/webhooks/promise.d.ts +1 -0
  74. package/dist/webhooks/promise.js +1 -0
  75. package/package.json +151 -4
  76. package/CLAUDE.md +0 -111
  77. package/bun.lock +0 -29
  78. package/index.ts +0 -1
  79. package/tsconfig.json +0 -29
@@ -0,0 +1,1622 @@
1
+ import { type Client, type ClientMeta, type Options as Options2, type RequestResult, type TDataShape } from "./client";
2
+ import type { ActorTracking, ApiKeyId, ApiKeyPermissions, ApiKeysCreateErrors, ApiKeysCreateResponses, ApiKeysGetActivityErrors, ApiKeysGetActivityResponses, ApiKeysGetErrors, ApiKeysGetResponses, ApiKeysGetStatsErrors, ApiKeysGetStatsResponses, ApiKeysListErrors, ApiKeysListResponses, ApiKeysRemoveErrors, ApiKeysRemoveResponses, ApiKeysRevokeErrors, ApiKeysRevokeResponses, ApiKeysRotateErrors, ApiKeysRotateResponses, ApiKeysUpdateErrors, ApiKeysUpdateResponses, BlockedEmailId, CampaignAudience, CampaignContentInput, CampaignId, CampaignPolicy, CampaignRunId, CampaignsArchiveErrors, CampaignsArchiveResponses, CampaignsCancelRunErrors, CampaignsCancelRunResponses, CampaignsCreateErrors, CampaignsCreateResponses, CampaignsGetErrors, CampaignsGetResponses, CampaignsGetRunErrors, CampaignsGetRunResponses, CampaignsListErrors, CampaignsListRecipientsErrors, CampaignsListRecipientsResponses, CampaignsListResponses, CampaignsListRunsErrors, CampaignsListRunsResponses, CampaignsPauseRunErrors, CampaignsPauseRunResponses, CampaignsResumeRunErrors, CampaignsResumeRunResponses, CampaignsScheduleRunErrors, CampaignsScheduleRunResponses, CampaignsUpdateErrors, CampaignsUpdateResponses, ContactAccessConfig, ContactId, ContactIdentity, ContactPreferences, ContactsBulkDeleteErrors, ContactsBulkDeleteResponses, ContactsBulkImportErrors, ContactsBulkImportResponses, ContactsBulkUpdateStatusErrors, ContactsBulkUpdateStatusResponses, ContactsBulkUpdateTagsErrors, ContactsBulkUpdateTagsResponses, ContactsCreateErrors, ContactsCreateResponses, ContactsExportErrors, ContactsExportResponses, ContactsFindErrors, ContactsFindOrCreateErrors, ContactsFindOrCreateResponses, ContactsFindResponses, ContactsGetActivityTimelineErrors, ContactsGetActivityTimelineResponses, ContactsGetEngagementErrors, ContactsGetEngagementResponses, ContactsGetErrors, ContactsGetGroupMembershipsErrors, ContactsGetGroupMembershipsResponses, ContactsGetResponses, ContactsListErrors, ContactsListResponses, ContactsRemoveErrors, ContactsRemoveResponses, ContactsUpdateErrors, ContactsUpdateResponses, ConversationContext, ConversationId, ConversationMetadata, ConversationMetrics, ConversationsAddContactsErrors, ConversationsAddContactsResponses, ConversationsCreateErrors, ConversationsCreateResponses, ConversationsGetByIdErrors, ConversationsGetByIdResponses, ConversationsListErrors, ConversationsListMessagesErrors, ConversationsListMessagesResponses, ConversationsListResponses, ConversationsRemoveContactsErrors, ConversationsRemoveContactsResponses, ConversationsUpdateErrors, ConversationsUpdateResponses, Design as Design3, DesignGetErrors, DesignGetResponses, DesignUpdateErrors, DesignUpdateResponses, DispatchSendMessagePayload, EmailAddBlockErrors, EmailAddBlockResponses, EmailAddDomainErrors, EmailAddDomainResponses, EmailAddSenderErrors, EmailAddSenderResponses, EmailBuildDomainConnectApplyUrlErrors, EmailBuildDomainConnectApplyUrlResponses, EmailCheckBlockedErrors, EmailCheckBlockedResponses, EmailCheckDomainVerificationErrors, EmailCheckDomainVerificationResponses, EmailCheckSenderVerificationErrors, EmailCheckSenderVerificationResponses, EmailClearDomainDefaultSenderErrors, EmailClearDomainDefaultSenderResponses, EmailCompleteDomainConnectErrors, EmailCompleteDomainConnectResponses, EmailCreateForwardingRuleErrors, EmailCreateForwardingRuleResponses, EmailDeleteForwardingRuleErrors, EmailDeleteForwardingRuleResponses, EmailDetectRegistrarErrors, EmailDetectRegistrarResponses, EmailDisableBrandedTrackingErrors, EmailDisableBrandedTrackingResponses, EmailDisableCatchAllErrors, EmailDisableCatchAllResponses, EmailDomainId, EmailEnableBrandedTrackingErrors, EmailEnableBrandedTrackingResponses, EmailEnableCatchAllErrors, EmailEnableCatchAllResponses, EmailEnableReceivingErrors, EmailEnableReceivingResponses, EmailForwardingRuleId, EmailGetBlockLogsErrors, EmailGetBlockLogsResponses, EmailGetBrandedTrackingErrors, EmailGetBrandedTrackingResponses, EmailGetCatchAllConfigErrors, EmailGetCatchAllConfigResponses, EmailGetCatchAllStatsErrors, EmailGetCatchAllStatsResponses, EmailGetDomainByIdErrors, EmailGetDomainByIdResponses, EmailGetDomainConnectErrors, EmailGetDomainConnectResponses, EmailGetDomainStatusErrors, EmailGetDomainStatusResponses, EmailGetForwardingLogErrors, EmailGetForwardingLogResponses, EmailGetRecipientTrackingPreferenceErrors, EmailGetRecipientTrackingPreferenceResponses, EmailGetStatsErrors, EmailGetStatsResponses, EmailGetTrackingDefaultsErrors, EmailGetTrackingDefaultsResponses, EmailListBlocksErrors, EmailListBlocksResponses, EmailListDomainsErrors, EmailListDomainsResponses, EmailListForwardingRulesErrors, EmailListForwardingRulesResponses, EmailListSendersErrors, EmailListSendersResponses, EmailListSuppressionsErrors, EmailListSuppressionsResponses, EmailProvisionDomainErrors, EmailProvisionDomainResponses, EmailRemoveBlockErrors, EmailRemoveBlockResponses, EmailRemoveDomainErrors, EmailRemoveDomainResponses, EmailRemoveSenderErrors, EmailRemoveSenderResponses, EmailRemoveSuppressionErrors, EmailRemoveSuppressionResponses, EmailSenderId, EmailSendMessagePayload, EmailSetDefaultDomainErrors, EmailSetDefaultDomainResponses, EmailSetDefaultSenderErrors, EmailSetDefaultSenderResponses, EmailSetDomainDefaultSenderErrors, EmailSetDomainDefaultSenderResponses, EmailUpdateBlockErrors, EmailUpdateBlockResponses, EmailUpdateCatchAllConfigErrors, EmailUpdateCatchAllConfigResponses, EmailUpdateDomainConfigErrors, EmailUpdateDomainConfigResponses, EmailUpdateForwardingRuleErrors, EmailUpdateForwardingRuleResponses, EmailUpdateRecipientTrackingPreferenceErrors, EmailUpdateRecipientTrackingPreferenceResponses, EmailUpdateTrackingDefaultsErrors, EmailUpdateTrackingDefaultsResponses, EmailVerifyDomainErrors, EmailVerifyDomainResponses, ForwardingConditions, HumanProfile, JsonObject, JsonValue, MessageId, MessagesGetEmailErrors, MessagesGetEmailResponses, MessagesGetErrors, MessagesGetEventsErrors, MessagesGetEventsResponses, MessagesGetResponses, MessagesGetStatusErrors, MessagesGetStatusResponses, MessagesListErrors, MessagesListResponses, MessagesRemoveErrors, MessagesRemoveResponses, MessagesSendErrors, MessagesSendResponses, OperationId, OperationsGetErrors, OperationsGetResponses, OperationsListErrors, OperationsListResponses, OperationsRetryErrors, OperationsRetryResponses, OrganizationsBootstrapErrors, OrganizationsBootstrapResponses, OrganizationsCreateErrors, OrganizationsCreateResponses, OrganizationsDeleteErrors, OrganizationsDeleteResponses, OrganizationsGetErrors, OrganizationsGetResponses, OrganizationsGetUsageErrors, OrganizationsGetUsageResponses, OrganizationsUpdateErrors, OrganizationsUpdateResponses, ScheduledMessageId, ScheduledMessagesCancelErrors, ScheduledMessagesCancelResponses, ScheduledMessagesCreateErrors, ScheduledMessagesCreateResponses, ScheduledMessagesGetErrors, ScheduledMessagesGetResponses, ScheduledMessagesListErrors, ScheduledMessagesListResponses, SmsSendMessagePayload, SuppressionId, TemplateCompliance, TemplateFamilyId, TemplateFromDefault, TemplateId, TemplatePerformance, TemplatesAddFamilyChannelErrors, TemplatesAddFamilyChannelResponses, TemplatesApproveErrors, TemplatesApproveResponses, TemplatesAttachFamilyMemberErrors, TemplatesAttachFamilyMemberResponses, TemplatesCreateErrors, TemplatesCreateFamilyErrors, TemplatesCreateFamilyFromTemplateErrors, TemplatesCreateFamilyFromTemplateResponses, TemplatesCreateFamilyResponses, TemplatesCreateResponses, TemplatesDeleteFamilyErrors, TemplatesDeleteFamilyResponses, TemplatesDetachFamilyMemberErrors, TemplatesDetachFamilyMemberResponses, TemplatesDuplicateErrors, TemplatesDuplicateResponses, TemplatesGetByIdErrors, TemplatesGetByIdResponses, TemplatesGetFamilyErrors, TemplatesGetFamilyResponses, TemplatesListDashboardErrors, TemplatesListDashboardResponses, TemplatesListErrors, TemplatesListFamiliesErrors, TemplatesListFamiliesResponses, TemplatesListResponses, TemplateSourceVersionId, TemplatesPublishErrors, TemplatesPublishResponses, TemplatesRemoveErrors, TemplatesRemoveResponses, TemplatesRenameFamilyErrors, TemplatesRenameFamilyResponses, TemplatesRenderErrors, TemplatesRenderResponses, TemplatesRestoreVersionErrors, TemplatesRestoreVersionResponses, TemplatesSpamCheckErrors, TemplatesSpamCheckResponses, TemplatesUnpublishErrors, TemplatesUnpublishResponses, TemplatesUpdateErrors, TemplatesUpdateResponses, TemplatesVersionHistoryErrors, TemplatesVersionHistoryResponses, TemplateVariable, TrackingRecipientEmail, UnknownRecord, UnsubscribeId, WebhookDeliveryId, WebhookEndpointId, WebhooksCreateErrors, WebhooksCreateResponses, WebhooksGetErrors, WebhooksGetLogsErrors, WebhooksGetLogsResponses, WebhooksGetResponses, WebhooksGetStatsErrors, WebhooksGetStatsResponses, WebhooksListErrors, WebhooksListResponses, WebhooksRegenerateSecretErrors, WebhooksRegenerateSecretResponses, WebhooksRemoveErrors, WebhooksRemoveResponses, WebhooksRetryDeliveryErrors, WebhooksRetryDeliveryResponses, WebhooksTestErrors, WebhooksTestResponses, WebhooksUpdateErrors, WebhooksUpdateResponses, WhatsAppSendMessagePayload } from "./types.gen";
3
+ export type Options<TData extends TDataShape = TDataShape, ThrowOnError extends boolean = boolean, TResponse = unknown> = Options2<TData, ThrowOnError, TResponse> & {
4
+ /**
5
+ * You can provide a client instance returned by `createClient()` instead of
6
+ * individual options. This might be also useful if you want to implement a
7
+ * custom client.
8
+ */
9
+ client?: Client | undefined;
10
+ /**
11
+ * You can pass arbitrary values through the `meta` object. This can be
12
+ * used to access values that aren't defined as part of the SDK function.
13
+ */
14
+ meta?: (keyof ClientMeta extends never ? Record<string, unknown> : ClientMeta) | undefined;
15
+ };
16
+ export declare class Messages {
17
+ /**
18
+ * List messages
19
+ *
20
+ * Returns a paginated list of messages across all channels, with optional filters for channel, status, conversation, contact, and date range.
21
+ */
22
+ static list<ThrowOnError extends boolean = false>(parameters?: {
23
+ page?: string | null | undefined;
24
+ limit?: string | null | undefined;
25
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
26
+ status?: "pending" | "scheduled" | "queued" | "processing" | "sent" | "delivered" | "read" | "failed" | "bounced" | "complained" | null | undefined;
27
+ conversationId?: ConversationId | null | undefined;
28
+ contactId?: ContactId | null | undefined;
29
+ startDate?: string | null | undefined;
30
+ endDate?: string | null | undefined;
31
+ }, options?: Options<never, ThrowOnError>): RequestResult<MessagesListResponses, MessagesListErrors, ThrowOnError>;
32
+ /**
33
+ * Send a message
34
+ *
35
+ * Sends a message on the requested channel and returns the created message with a 201 Created status. `channel` selects the payload variant. Email sends today; the SMS and WhatsApp variants are coming soon and answer 403 until the channel launches for your organization, so integrating against them now costs no rewrite later. Repeating an identical request with the same optional `Idempotency-Key` header returns the original message; reusing the key for different content returns a conflict.
36
+ */
37
+ static send<ThrowOnError extends boolean = false>(parameters: {
38
+ "idempotency-key"?: string | null | undefined;
39
+ body: EmailSendMessagePayload | SmsSendMessagePayload | WhatsAppSendMessagePayload;
40
+ }, options?: Options<never, ThrowOnError>): RequestResult<MessagesSendResponses, MessagesSendErrors, ThrowOnError>;
41
+ /**
42
+ * Delete a message
43
+ *
44
+ * Permanently deletes a message by its ID.
45
+ */
46
+ static remove<ThrowOnError extends boolean = false>(parameters: {
47
+ id: MessageId;
48
+ }, options?: Options<never, ThrowOnError>): RequestResult<MessagesRemoveResponses, MessagesRemoveErrors, ThrowOnError>;
49
+ /**
50
+ * Get a message
51
+ *
52
+ * Returns a single message by its ID.
53
+ */
54
+ static get<ThrowOnError extends boolean = false>(parameters: {
55
+ id: MessageId;
56
+ }, options?: Options<never, ThrowOnError>): RequestResult<MessagesGetResponses, MessagesGetErrors, ThrowOnError>;
57
+ /**
58
+ * Get email message details
59
+ *
60
+ * Returns the email projection of a message, optionally including signed S3 URLs for its raw MIME, HTML, and text content.
61
+ */
62
+ static getEmail<ThrowOnError extends boolean = false>(parameters: {
63
+ id: MessageId;
64
+ includeS3Urls?: string | null | undefined;
65
+ urlExpiresIn?: string | null | undefined;
66
+ }, options?: Options<never, ThrowOnError>): RequestResult<MessagesGetEmailResponses, MessagesGetEmailErrors, ThrowOnError>;
67
+ /**
68
+ * Get message delivery status
69
+ *
70
+ * Returns the current delivery status of a message by its ID.
71
+ */
72
+ static getStatus<ThrowOnError extends boolean = false>(parameters: {
73
+ id: MessageId;
74
+ }, options?: Options<never, ThrowOnError>): RequestResult<MessagesGetStatusResponses, MessagesGetStatusErrors, ThrowOnError>;
75
+ /**
76
+ * List message events
77
+ *
78
+ * Returns the list of delivery events recorded for a message.
79
+ */
80
+ static getEvents<ThrowOnError extends boolean = false>(parameters: {
81
+ id: MessageId;
82
+ }, options?: Options<never, ThrowOnError>): RequestResult<MessagesGetEventsResponses, MessagesGetEventsErrors, ThrowOnError>;
83
+ }
84
+ export declare class Messages2 {
85
+ static messages: typeof Messages;
86
+ }
87
+ export declare class Operations {
88
+ /**
89
+ * List asynchronous operations
90
+ *
91
+ * Lists durable asynchronous operation state for the active organization.
92
+ */
93
+ static list<ThrowOnError extends boolean = false>(parameters?: {
94
+ page?: string | null | undefined;
95
+ limit?: string | null | undefined;
96
+ kind?: "email-domain-provisioning" | "organization-deletion" | null | undefined;
97
+ status?: "pending" | "running" | "succeeded" | "failed" | null | undefined;
98
+ }, options?: Options<never, ThrowOnError>): RequestResult<OperationsListResponses, OperationsListErrors, ThrowOnError>;
99
+ /**
100
+ * Get an asynchronous operation
101
+ *
102
+ * Returns one durable asynchronous operation from the active organization.
103
+ */
104
+ static get<ThrowOnError extends boolean = false>(parameters: {
105
+ operationId: OperationId;
106
+ }, options?: Options<never, ThrowOnError>): RequestResult<OperationsGetResponses, OperationsGetErrors, ThrowOnError>;
107
+ /**
108
+ * Retry an asynchronous operation
109
+ *
110
+ * Retries the same durable execution identity when its failure is explicitly retryable. Retrying a workspace deletion additionally requires `organization:delete`.
111
+ */
112
+ static retry<ThrowOnError extends boolean = false>(parameters: {
113
+ operationId: OperationId;
114
+ }, options?: Options<never, ThrowOnError>): RequestResult<OperationsRetryResponses, OperationsRetryErrors, ThrowOnError>;
115
+ }
116
+ export declare class Operations2 {
117
+ static operations: typeof Operations;
118
+ }
119
+ export declare class ScheduledMessages {
120
+ /**
121
+ * List scheduled messages
122
+ *
123
+ * Returns a paginated list of scheduled messages, optionally filtered by status.
124
+ */
125
+ static list<ThrowOnError extends boolean = false>(parameters?: {
126
+ status?: "pending" | "dispatching" | "dispatched" | "cancelled" | "failed" | null | undefined;
127
+ page?: string | null | undefined;
128
+ limit?: string | null | undefined;
129
+ }, options?: Options<never, ThrowOnError>): RequestResult<ScheduledMessagesListResponses, ScheduledMessagesListErrors, ThrowOnError>;
130
+ /**
131
+ * Schedule a message
132
+ *
133
+ * Schedules a message at the absolute ISO-8601 instant in scheduledFor. The send payload is the same channel union the immediate send accepts, with each channel's content checked at schedule time so a send that could never render fails now rather than hours later: email schedules today, and the SMS and WhatsApp variants are coming soon and answer 403 until the channel launches. Optional timezone is validated IANA display metadata only and never changes the execution instant.
134
+ */
135
+ static create<ThrowOnError extends boolean = false>(parameters: {
136
+ send: DispatchSendMessagePayload;
137
+ scheduledFor: string;
138
+ timezone?: string | null | undefined;
139
+ idempotencyKey?: string | null | undefined;
140
+ referenceId?: string | null | undefined;
141
+ }, options?: Options<never, ThrowOnError>): RequestResult<ScheduledMessagesCreateResponses, ScheduledMessagesCreateErrors, ThrowOnError>;
142
+ /**
143
+ * Get a scheduled message
144
+ *
145
+ * Returns a single scheduled message by its ID.
146
+ */
147
+ static get<ThrowOnError extends boolean = false>(parameters: {
148
+ id: ScheduledMessageId;
149
+ }, options?: Options<never, ThrowOnError>): RequestResult<ScheduledMessagesGetResponses, ScheduledMessagesGetErrors, ThrowOnError>;
150
+ /**
151
+ * Cancel a scheduled message
152
+ *
153
+ * Cancels a pending scheduled message so it will not be sent, and returns the updated scheduled message.
154
+ */
155
+ static cancel<ThrowOnError extends boolean = false>(parameters: {
156
+ id: ScheduledMessageId;
157
+ }, options?: Options<never, ThrowOnError>): RequestResult<ScheduledMessagesCancelResponses, ScheduledMessagesCancelErrors, ThrowOnError>;
158
+ }
159
+ export declare class ScheduledMessages2 {
160
+ static scheduledMessages: typeof ScheduledMessages;
161
+ }
162
+ export declare class Campaigns {
163
+ /**
164
+ * List campaigns
165
+ *
166
+ * Returns a paginated list of the organization's campaigns, optionally filtered by status.
167
+ */
168
+ static list<ThrowOnError extends boolean = false>(parameters?: {
169
+ status?: "draft" | "archived" | null | undefined;
170
+ page?: string | null | undefined;
171
+ limit?: string | null | undefined;
172
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsListResponses, CampaignsListErrors, ThrowOnError>;
173
+ /**
174
+ * Create a campaign
175
+ *
176
+ * Creates an email campaign draft for the given audience and content, returning the created campaign.
177
+ */
178
+ static create<ThrowOnError extends boolean = false>(parameters: {
179
+ name: string;
180
+ channel: "sms" | "whatsapp" | "email";
181
+ content: CampaignContentInput;
182
+ audience: CampaignAudience;
183
+ policy?: CampaignPolicy | null | undefined;
184
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsCreateResponses, CampaignsCreateErrors, ThrowOnError>;
185
+ /**
186
+ * Archive a campaign
187
+ *
188
+ * Archives a draft campaign so it can no longer be scheduled, returning the archived campaign.
189
+ */
190
+ static archive<ThrowOnError extends boolean = false>(parameters: {
191
+ id: CampaignId;
192
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsArchiveResponses, CampaignsArchiveErrors, ThrowOnError>;
193
+ /**
194
+ * Get a campaign
195
+ *
196
+ * Returns a single campaign, including its content, audience, and policy, by its identifier.
197
+ */
198
+ static get<ThrowOnError extends boolean = false>(parameters: {
199
+ id: CampaignId;
200
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsGetResponses, CampaignsGetErrors, ThrowOnError>;
201
+ /**
202
+ * Update a campaign
203
+ *
204
+ * Updates the name, content, audience, or policy of a campaign draft.
205
+ */
206
+ static update<ThrowOnError extends boolean = false>(parameters: {
207
+ id: CampaignId;
208
+ name?: string | null | undefined;
209
+ content?: CampaignContentInput | null | undefined;
210
+ audience?: CampaignAudience | null | undefined;
211
+ policy?: CampaignPolicy | null | undefined;
212
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsUpdateResponses, CampaignsUpdateErrors, ThrowOnError>;
213
+ /**
214
+ * List campaign runs
215
+ *
216
+ * Returns a paginated list of runs for a campaign, optionally filtered by status.
217
+ */
218
+ static listRuns<ThrowOnError extends boolean = false>(parameters: {
219
+ id: CampaignId;
220
+ status?: "scheduled" | "resolving" | "dispatching" | "paused" | "completed" | "cancelled" | "failed" | null | undefined;
221
+ page?: string | null | undefined;
222
+ limit?: string | null | undefined;
223
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsListRunsResponses, CampaignsListRunsErrors, ThrowOnError>;
224
+ /**
225
+ * Schedule a campaign run
226
+ *
227
+ * Schedules an email campaign run at the absolute ISO-8601 instant in scheduledFor, or immediately when omitted. The optional idempotencyKey is scoped to the organization and replays return the original run.
228
+ */
229
+ static scheduleRun<ThrowOnError extends boolean = false>(parameters: {
230
+ id: CampaignId;
231
+ scheduledFor?: string | null | undefined;
232
+ idempotencyKey?: string | null | undefined;
233
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsScheduleRunResponses, CampaignsScheduleRunErrors, ThrowOnError>;
234
+ /**
235
+ * Get a campaign run
236
+ *
237
+ * Returns a single run of a campaign by its identifier.
238
+ */
239
+ static getRun<ThrowOnError extends boolean = false>(parameters: {
240
+ id: CampaignId;
241
+ runId: CampaignRunId;
242
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsGetRunResponses, CampaignsGetRunErrors, ThrowOnError>;
243
+ /**
244
+ * Pause a campaign run
245
+ *
246
+ * Pauses an in-progress campaign run and returns the updated run.
247
+ */
248
+ static pauseRun<ThrowOnError extends boolean = false>(parameters: {
249
+ id: CampaignId;
250
+ runId: CampaignRunId;
251
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsPauseRunResponses, CampaignsPauseRunErrors, ThrowOnError>;
252
+ /**
253
+ * Resume a campaign run
254
+ *
255
+ * Resumes a paused campaign run and returns the updated run.
256
+ */
257
+ static resumeRun<ThrowOnError extends boolean = false>(parameters: {
258
+ id: CampaignId;
259
+ runId: CampaignRunId;
260
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsResumeRunResponses, CampaignsResumeRunErrors, ThrowOnError>;
261
+ /**
262
+ * Cancel a campaign run
263
+ *
264
+ * Best-effort cancellation: pending recipients are skipped, while already claimed or provider-submitted deliveries may finish. Returns the updated run.
265
+ */
266
+ static cancelRun<ThrowOnError extends boolean = false>(parameters: {
267
+ id: CampaignId;
268
+ runId: CampaignRunId;
269
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsCancelRunResponses, CampaignsCancelRunErrors, ThrowOnError>;
270
+ /**
271
+ * List campaign recipients
272
+ *
273
+ * Returns a paginated list of recipients for a campaign run, optionally filtered by status.
274
+ */
275
+ static listRecipients<ThrowOnError extends boolean = false>(parameters: {
276
+ id: CampaignId;
277
+ runId: CampaignRunId;
278
+ status?: "pending" | "dispatching" | "dispatched" | "failed" | "skipped" | null | undefined;
279
+ page?: string | null | undefined;
280
+ limit?: string | null | undefined;
281
+ }, options?: Options<never, ThrowOnError>): RequestResult<CampaignsListRecipientsResponses, CampaignsListRecipientsErrors, ThrowOnError>;
282
+ }
283
+ export declare class Campaigns2 {
284
+ static campaigns: typeof Campaigns;
285
+ }
286
+ export declare class Email {
287
+ /**
288
+ * Get email tracking defaults
289
+ *
290
+ * Returns the organization's default open and click tracking policy. Each field is independent and defaults to enabled. Recipient opt-out takes precedence over these defaults.
291
+ */
292
+ static getTrackingDefaults<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<EmailGetTrackingDefaultsResponses, EmailGetTrackingDefaultsErrors, ThrowOnError>;
293
+ /**
294
+ * Update email tracking defaults
295
+ *
296
+ * Updates one or both organization email tracking defaults and returns the complete saved policy. Recipient opt-out still takes precedence.
297
+ */
298
+ static updateTrackingDefaults<ThrowOnError extends boolean = false>(parameters?: {
299
+ opens?: boolean | undefined;
300
+ clicks?: boolean | undefined;
301
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateTrackingDefaultsResponses, EmailUpdateTrackingDefaultsErrors, ThrowOnError>;
302
+ /**
303
+ * Get a recipient tracking preference
304
+ *
305
+ * Returns the organization-scoped tracking opt-out for a normalized recipient email. A missing preference reads as opted in and is not created.
306
+ */
307
+ static getRecipientTrackingPreference<ThrowOnError extends boolean = false>(parameters: {
308
+ email: TrackingRecipientEmail;
309
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetRecipientTrackingPreferenceResponses, EmailGetRecipientTrackingPreferenceErrors, ThrowOnError>;
310
+ /**
311
+ * Update a recipient tracking preference
312
+ *
313
+ * Opts a normalized recipient email in or out of open and click tracking. Opt-out takes precedence over per-send overrides and organization defaults without changing suppression or send eligibility.
314
+ */
315
+ static updateRecipientTrackingPreference<ThrowOnError extends boolean = false>(parameters: {
316
+ email: TrackingRecipientEmail;
317
+ optedOut: boolean;
318
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateRecipientTrackingPreferenceResponses, EmailUpdateRecipientTrackingPreferenceErrors, ThrowOnError>;
319
+ /**
320
+ * List sending domains
321
+ *
322
+ * Returns a paginated list of the organization's sending domains.
323
+ */
324
+ static listDomains<ThrowOnError extends boolean = false>(parameters?: {
325
+ page?: string | null | undefined;
326
+ limit?: string | null | undefined;
327
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListDomainsResponses, EmailListDomainsErrors, ThrowOnError>;
328
+ /**
329
+ * Add a sending domain
330
+ *
331
+ * Registers a domain for sending and returns it with the DNS records required to verify ownership and configure DKIM. Responds with 201.
332
+ */
333
+ static addDomain<ThrowOnError extends boolean = false>(parameters: {
334
+ domain: string;
335
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailAddDomainResponses, EmailAddDomainErrors, ThrowOnError>;
336
+ /**
337
+ * Provision a sending domain
338
+ *
339
+ * Accepts durable provisioning for a sending domain. Repeating an identical request with the same Idempotency-Key returns the same organization-scoped operation.
340
+ */
341
+ static provisionDomain<ThrowOnError extends boolean = false>(parameters: {
342
+ "idempotency-key": string;
343
+ domain: string;
344
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailProvisionDomainResponses, EmailProvisionDomainErrors, ThrowOnError>;
345
+ /**
346
+ * Verify a sending domain
347
+ *
348
+ * Initiates verification of a sending domain with the email provider and stores the DNS records needed to complete it.
349
+ */
350
+ static verifyDomain<ThrowOnError extends boolean = false>(parameters: {
351
+ id: EmailDomainId;
352
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailVerifyDomainResponses, EmailVerifyDomainErrors, ThrowOnError>;
353
+ /**
354
+ * Check domain verification status
355
+ *
356
+ * Re-checks a sending domain's verification live with the email provider and updates the stored status once it is verified.
357
+ */
358
+ static checkDomainVerification<ThrowOnError extends boolean = false>(parameters: {
359
+ id: EmailDomainId;
360
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCheckDomainVerificationResponses, EmailCheckDomainVerificationErrors, ThrowOnError>;
361
+ /**
362
+ * Remove a sending domain
363
+ *
364
+ * Permanently deletes a sending domain from the organization.
365
+ */
366
+ static removeDomain<ThrowOnError extends boolean = false>(parameters: {
367
+ id: EmailDomainId;
368
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailRemoveDomainResponses, EmailRemoveDomainErrors, ThrowOnError>;
369
+ /**
370
+ * Get a sending domain
371
+ *
372
+ * Returns a single sending domain, including its DNS records and verification details.
373
+ */
374
+ static getDomainById<ThrowOnError extends boolean = false>(parameters: {
375
+ id: EmailDomainId;
376
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetDomainByIdResponses, EmailGetDomainByIdErrors, ThrowOnError>;
377
+ /**
378
+ * Detect a domain's registrar
379
+ *
380
+ * Looks up the domain's nameservers to detect its DNS registrar and returns the provider, nameservers, and a link to its setup docs.
381
+ */
382
+ static detectRegistrar<ThrowOnError extends boolean = false>(parameters: {
383
+ id: EmailDomainId;
384
+ domain: string;
385
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailDetectRegistrarResponses, EmailDetectRegistrarErrors, ThrowOnError>;
386
+ /**
387
+ * Check one-click DNS eligibility
388
+ *
389
+ * Reports whether the domain's DNS provider supports Domain Connect one-click setup for Samva, and the provider's name when it does. Ineligible is a normal result — the manual DNS records remain the way to verify.
390
+ */
391
+ static getDomainConnect<ThrowOnError extends boolean = false>(parameters: {
392
+ id: EmailDomainId;
393
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetDomainConnectResponses, EmailGetDomainConnectErrors, ThrowOnError>;
394
+ /**
395
+ * Build a one-click DNS apply URL
396
+ *
397
+ * Builds the signed Domain Connect apply URL that sends the customer to their DNS provider to apply Samva's sending records in one click. Pass inbound to also request the receiving MX records.
398
+ */
399
+ static buildDomainConnectApplyUrl<ThrowOnError extends boolean = false>(parameters: {
400
+ id: EmailDomainId;
401
+ inbound?: boolean | null | undefined;
402
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBuildDomainConnectApplyUrlResponses, EmailBuildDomainConnectApplyUrlErrors, ThrowOnError>;
403
+ /**
404
+ * Complete a one-click DNS return
405
+ *
406
+ * Consumes the Domain Connect provider's redirect. Validates the signed state and, when the records were applied, kicks verification. Returns applied, cancelled (the customer declined), or invalid (state failed validation).
407
+ */
408
+ static completeDomainConnect<ThrowOnError extends boolean = false>(parameters: {
409
+ id: EmailDomainId;
410
+ state: string;
411
+ error?: string | null | undefined;
412
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCompleteDomainConnectResponses, EmailCompleteDomainConnectErrors, ThrowOnError>;
413
+ /**
414
+ * Enable inbound email for a domain
415
+ *
416
+ * Enables inbound receiving for a verified domain by creating a receipt rule, and returns the rule name and its recipient addresses. Set `catchAll` to route every address on the domain; that requires a webhook endpoint, supplied as `endpointId` or already configured on the domain.
417
+ */
418
+ static enableReceiving<ThrowOnError extends boolean = false>(parameters: {
419
+ id: EmailDomainId;
420
+ domain: string;
421
+ catchAll?: boolean | null | undefined;
422
+ endpointId?: WebhookEndpointId | null | undefined;
423
+ addresses?: Array<string> | null | undefined;
424
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailEnableReceivingResponses, EmailEnableReceivingErrors, ThrowOnError>;
425
+ /**
426
+ * Get sending domain status
427
+ *
428
+ * Returns the stored verification status of a sending domain without contacting the email provider.
429
+ */
430
+ static getDomainStatus<ThrowOnError extends boolean = false>(parameters: {
431
+ id: EmailDomainId;
432
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetDomainStatusResponses, EmailGetDomainStatusErrors, ThrowOnError>;
433
+ /**
434
+ * Set the default sending domain
435
+ *
436
+ * Marks a verified domain as the organization's default sending domain, atomically clearing any previous default. Omitted-`from` sends resolve through the default domain's default sender.
437
+ */
438
+ static setDefaultDomain<ThrowOnError extends boolean = false>(parameters: {
439
+ id: EmailDomainId;
440
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailSetDefaultDomainResponses, EmailSetDefaultDomainErrors, ThrowOnError>;
441
+ /**
442
+ * Clear a domain's default sender
443
+ *
444
+ * Removes the domain's default sender so omitted-`from` sends fall through to the organization default sender.
445
+ */
446
+ static clearDomainDefaultSender<ThrowOnError extends boolean = false>(parameters: {
447
+ id: EmailDomainId;
448
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailClearDomainDefaultSenderResponses, EmailClearDomainDefaultSenderErrors, ThrowOnError>;
449
+ /**
450
+ * Set a domain's default sender
451
+ *
452
+ * Sets the default sender used for omitted-`from` sends from this domain. The sender must belong to the domain and be verified and active.
453
+ */
454
+ static setDomainDefaultSender<ThrowOnError extends boolean = false>(parameters: {
455
+ id: EmailDomainId;
456
+ senderId: EmailSenderId;
457
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailSetDomainDefaultSenderResponses, EmailSetDomainDefaultSenderErrors, ThrowOnError>;
458
+ /**
459
+ * Update a domain's send-settings config
460
+ *
461
+ * Overrides the domain's open/click tracking, reply-to, and unsubscribe-group defaults for the settings cascade. An omitted field is left unchanged; null clears it back to the organization default. Returns the saved config.
462
+ */
463
+ static updateDomainConfig<ThrowOnError extends boolean = false>(parameters: {
464
+ id: EmailDomainId;
465
+ openTracking?: boolean | null | null | undefined;
466
+ clickTracking?: boolean | null | null | undefined;
467
+ replyTo?: Array<string> | null | null | undefined;
468
+ unsubscribeGroupId?: UnsubscribeId | null | null | undefined;
469
+ footerEnabled?: boolean | null | null | undefined;
470
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateDomainConfigResponses, EmailUpdateDomainConfigErrors, ThrowOnError>;
471
+ /**
472
+ * Disable a branded tracking domain
473
+ *
474
+ * Tears down a domain's branded tracking and its managed resources. Sends immediately revert to the shared tracking host. Existing branded links in already-delivered mail stop working.
475
+ */
476
+ static disableBrandedTracking<ThrowOnError extends boolean = false>(parameters: {
477
+ id: EmailDomainId;
478
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailDisableBrandedTrackingResponses, EmailDisableBrandedTrackingErrors, ThrowOnError>;
479
+ /**
480
+ * Get branded tracking status
481
+ *
482
+ * Returns the branded tracking state for a sending domain: lifecycle status, the required DNS records, certificate and CAA readiness, and any scheduled teardown. `enabled` is false when no branded tracking domain is provisioned.
483
+ */
484
+ static getBrandedTracking<ThrowOnError extends boolean = false>(parameters: {
485
+ id: EmailDomainId;
486
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetBrandedTrackingResponses, EmailGetBrandedTrackingErrors, ThrowOnError>;
487
+ /**
488
+ * Enable a branded tracking domain
489
+ *
490
+ * Provisions a branded tracking domain (default label `track`) for a verified sending domain so open/click links redirect through the customer's own subdomain. Requires the branded_tracking entitlement. Returns the resulting state including the two DNS records the customer must create.
491
+ */
492
+ static enableBrandedTracking<ThrowOnError extends boolean = false>(parameters: {
493
+ id: EmailDomainId;
494
+ label?: string | null | undefined;
495
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailEnableBrandedTrackingResponses, EmailEnableBrandedTrackingErrors, ThrowOnError>;
496
+ /**
497
+ * List sender identities
498
+ *
499
+ * Returns a paginated list of sender identities, optionally filtered by verification status, active state, or default flag.
500
+ */
501
+ static listSenders<ThrowOnError extends boolean = false>(parameters?: {
502
+ page?: string | null | undefined;
503
+ limit?: string | null | undefined;
504
+ verificationStatus?: "pending" | "verified" | "failed" | null | undefined;
505
+ isActive?: string | null | undefined;
506
+ isDefault?: string | null | undefined;
507
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListSendersResponses, EmailListSendersErrors, ThrowOnError>;
508
+ /**
509
+ * Add a sender identity
510
+ *
511
+ * Creates a sender identity for an email address and returns it. Responds with 201.
512
+ */
513
+ static addSender<ThrowOnError extends boolean = false>(parameters: {
514
+ email: string;
515
+ domainId?: EmailDomainId | null | undefined;
516
+ name?: string | null | null | undefined;
517
+ replyToEmails?: Array<string> | null | null | undefined;
518
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailAddSenderResponses, EmailAddSenderErrors, ThrowOnError>;
519
+ /**
520
+ * Check sender verification status
521
+ *
522
+ * Returns the current verification status of a sender identity.
523
+ */
524
+ static checkSenderVerification<ThrowOnError extends boolean = false>(parameters: {
525
+ id: EmailSenderId;
526
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCheckSenderVerificationResponses, EmailCheckSenderVerificationErrors, ThrowOnError>;
527
+ /**
528
+ * Remove a sender identity
529
+ *
530
+ * Permanently deletes a sender identity from the organization.
531
+ */
532
+ static removeSender<ThrowOnError extends boolean = false>(parameters: {
533
+ id: EmailSenderId;
534
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailRemoveSenderResponses, EmailRemoveSenderErrors, ThrowOnError>;
535
+ /**
536
+ * Set the organization default sender
537
+ *
538
+ * Marks a verified, active sender as the organization default, atomically clearing any previous default. Used for omitted-`from` sends when no default domain sender applies.
539
+ */
540
+ static setDefaultSender<ThrowOnError extends boolean = false>(parameters: {
541
+ id: EmailSenderId;
542
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailSetDefaultSenderResponses, EmailSetDefaultSenderErrors, ThrowOnError>;
543
+ /**
544
+ * Get email statistics
545
+ *
546
+ * Returns aggregate email statistics — sent, delivered, bounced, and complained counts with their rates — optionally scoped to a date range.
547
+ */
548
+ static getStats<ThrowOnError extends boolean = false>(parameters?: {
549
+ startDate?: string | null | undefined;
550
+ endDate?: string | null | undefined;
551
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetStatsResponses, EmailGetStatsErrors, ThrowOnError>;
552
+ /**
553
+ * Enable catch-all receiving
554
+ *
555
+ * Enables catch-all inbound receiving for a domain by creating a receipt rule, and returns the rule name. `endpointId` is one of the organization's webhook endpoints; every address on the domain delivers `message.received` to it. Responds with 201.
556
+ */
557
+ static enableCatchAll<ThrowOnError extends boolean = false>(parameters: {
558
+ domainId: EmailDomainId;
559
+ endpointId: WebhookEndpointId;
560
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailEnableCatchAllResponses, EmailEnableCatchAllErrors, ThrowOnError>;
561
+ /**
562
+ * Disable catch-all receiving
563
+ *
564
+ * Disables catch-all inbound receiving for a domain.
565
+ */
566
+ static disableCatchAll<ThrowOnError extends boolean = false>(parameters: {
567
+ domainId: EmailDomainId;
568
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailDisableCatchAllResponses, EmailDisableCatchAllErrors, ThrowOnError>;
569
+ /**
570
+ * Get catch-all configuration
571
+ *
572
+ * Returns the catch-all receiving configuration for a domain, including the webhook endpoint that receives its inbound mail and its email counts.
573
+ */
574
+ static getCatchAllConfig<ThrowOnError extends boolean = false>(parameters: {
575
+ domainId: EmailDomainId;
576
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetCatchAllConfigResponses, EmailGetCatchAllConfigErrors, ThrowOnError>;
577
+ /**
578
+ * Update catch-all configuration
579
+ *
580
+ * Updates a domain's catch-all receiving configuration: the webhook endpoint that receives its inbound mail.
581
+ */
582
+ static updateCatchAllConfig<ThrowOnError extends boolean = false>(parameters: {
583
+ domainId: EmailDomainId;
584
+ endpointId?: WebhookEndpointId | null | undefined;
585
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateCatchAllConfigResponses, EmailUpdateCatchAllConfigErrors, ThrowOnError>;
586
+ /**
587
+ * Get catch-all statistics
588
+ *
589
+ * Returns catch-all receiving counters for a domain, adding an aggregated breakdown when a date range is supplied.
590
+ */
591
+ static getCatchAllStats<ThrowOnError extends boolean = false>(parameters: {
592
+ domainId: EmailDomainId;
593
+ startDate?: string | null | undefined;
594
+ endDate?: string | null | undefined;
595
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetCatchAllStatsResponses, EmailGetCatchAllStatsErrors, ThrowOnError>;
596
+ /**
597
+ * List suppressed addresses
598
+ *
599
+ * Returns the addresses this workspace will not send to, newest first, optionally filtered by suppression type, active or expired state, and an address substring, with limit and offset paging.
600
+ */
601
+ static listSuppressions<ThrowOnError extends boolean = false>(parameters?: {
602
+ type?: "bounce" | "complaint" | "unsubscribe" | "manual" | null | undefined;
603
+ status?: "active" | "expired" | null | undefined;
604
+ search?: string | null | undefined;
605
+ limit?: string | null | undefined;
606
+ offset?: string | null | undefined;
607
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListSuppressionsResponses, EmailListSuppressionsErrors, ThrowOnError>;
608
+ /**
609
+ * Remove a suppressed address
610
+ *
611
+ * Deletes a suppression so this workspace can send to the address again. When the engine mirrored the address into the sending provider's suppression list, that entry is lifted first, and the deletion fails rather than reporting success if the provider refuses, so the operation stays retryable. The provider entry is left in place when another workspace still reports the same address as bouncing or complaining, because that list is shared with every workspace; the response does not say which case applied. Deliverability caveat: a bounce or complaint suppression records a real delivery failure, and sending to the address again risks the reputation damage the suppression prevented.
612
+ */
613
+ static removeSuppression<ThrowOnError extends boolean = false>(parameters: {
614
+ id: SuppressionId;
615
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailRemoveSuppressionResponses, EmailRemoveSuppressionErrors, ThrowOnError>;
616
+ /**
617
+ * List block entries
618
+ *
619
+ * Returns block entries, optionally filtered by block type and active state, with limit and offset paging.
620
+ */
621
+ static listBlocks<ThrowOnError extends boolean = false>(parameters?: {
622
+ blockType?: "email" | "domain" | null | undefined;
623
+ isActive?: string | null | undefined;
624
+ limit?: string | null | undefined;
625
+ offset?: string | null | undefined;
626
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListBlocksResponses, EmailListBlocksErrors, ThrowOnError>;
627
+ /**
628
+ * Add a block entry
629
+ *
630
+ * Blocks an email address or domain from inbound receiving and returns the created block entry. Responds with 201.
631
+ */
632
+ static addBlock<ThrowOnError extends boolean = false>(parameters: {
633
+ blockType: "email" | "domain";
634
+ blockValue: string;
635
+ reason: string;
636
+ notes?: string | null | undefined;
637
+ expiresAt?: string | null | undefined;
638
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailAddBlockResponses, EmailAddBlockErrors, ThrowOnError>;
639
+ /**
640
+ * Remove a block entry
641
+ *
642
+ * Permanently deletes a block entry, unblocking the associated address or domain.
643
+ */
644
+ static removeBlock<ThrowOnError extends boolean = false>(parameters: {
645
+ id: BlockedEmailId;
646
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailRemoveBlockResponses, EmailRemoveBlockErrors, ThrowOnError>;
647
+ /**
648
+ * Update a block entry
649
+ *
650
+ * Updates a block entry's reason, notes, active state, or expiry.
651
+ */
652
+ static updateBlock<ThrowOnError extends boolean = false>(parameters: {
653
+ id: BlockedEmailId;
654
+ reason?: string | null | undefined;
655
+ notes?: string | null | undefined;
656
+ isActive?: boolean | null | undefined;
657
+ expiresAt?: string | null | null | undefined;
658
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateBlockResponses, EmailUpdateBlockErrors, ThrowOnError>;
659
+ /**
660
+ * List blocked email logs
661
+ *
662
+ * Returns a log of inbound emails that were blocked, optionally filtered by block entry, sender, or date range.
663
+ */
664
+ static getBlockLogs<ThrowOnError extends boolean = false>(parameters?: {
665
+ blockedEmailId?: BlockedEmailId | null | undefined;
666
+ fromAddress?: string | null | undefined;
667
+ startDate?: string | null | undefined;
668
+ endDate?: string | null | undefined;
669
+ limit?: string | null | undefined;
670
+ offset?: string | null | undefined;
671
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetBlockLogsResponses, EmailGetBlockLogsErrors, ThrowOnError>;
672
+ /**
673
+ * Check whether an address is blocked
674
+ *
675
+ * Checks whether an email address is currently blocked and returns the matching block rule when one applies.
676
+ */
677
+ static checkBlocked<ThrowOnError extends boolean = false>(parameters: {
678
+ emailAddress: string;
679
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCheckBlockedResponses, EmailCheckBlockedErrors, ThrowOnError>;
680
+ /**
681
+ * List forwarding rules
682
+ *
683
+ * Returns inbound email forwarding rules, optionally filtered by domain and active state, with limit and offset paging.
684
+ */
685
+ static listForwardingRules<ThrowOnError extends boolean = false>(parameters?: {
686
+ domainId?: EmailDomainId | null | undefined;
687
+ isActive?: string | null | undefined;
688
+ limit?: string | null | undefined;
689
+ offset?: string | null | undefined;
690
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListForwardingRulesResponses, EmailListForwardingRulesErrors, ThrowOnError>;
691
+ /**
692
+ * Create a forwarding rule
693
+ *
694
+ * Creates an inbound email forwarding rule and returns it. Responds with 201.
695
+ */
696
+ static createForwardingRule<ThrowOnError extends boolean = false>(parameters: {
697
+ name: string;
698
+ description?: string | null | undefined;
699
+ domainId?: EmailDomainId | null | undefined;
700
+ sourcePattern?: string | null | undefined;
701
+ forwardTo: Array<string>;
702
+ preserveHeaders?: boolean | null | undefined;
703
+ appendNote?: string | null | undefined;
704
+ conditions?: ForwardingConditions | null | undefined;
705
+ priority?: number | null | undefined;
706
+ isActive?: boolean | null | undefined;
707
+ metadata?: {
708
+ [key: string]: JsonValue;
709
+ } | null | null | undefined;
710
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCreateForwardingRuleResponses, EmailCreateForwardingRuleErrors, ThrowOnError>;
711
+ /**
712
+ * Delete a forwarding rule
713
+ *
714
+ * Permanently deletes an inbound email forwarding rule.
715
+ */
716
+ static deleteForwardingRule<ThrowOnError extends boolean = false>(parameters: {
717
+ id: EmailForwardingRuleId;
718
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailDeleteForwardingRuleResponses, EmailDeleteForwardingRuleErrors, ThrowOnError>;
719
+ /**
720
+ * Update a forwarding rule
721
+ *
722
+ * Updates an inbound email forwarding rule and returns its current summary.
723
+ */
724
+ static updateForwardingRule<ThrowOnError extends boolean = false>(parameters: {
725
+ id: EmailForwardingRuleId;
726
+ name?: string | null | undefined;
727
+ description?: string | null | undefined;
728
+ domainId?: EmailDomainId | null | undefined;
729
+ sourcePattern?: string | null | undefined;
730
+ forwardTo?: Array<string> | null | undefined;
731
+ preserveHeaders?: boolean | null | undefined;
732
+ appendNote?: string | null | undefined;
733
+ conditions?: ForwardingConditions | null | null | undefined;
734
+ priority?: number | null | undefined;
735
+ isActive?: boolean | null | undefined;
736
+ metadata?: {
737
+ [key: string]: JsonValue;
738
+ } | null | null | undefined;
739
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateForwardingRuleResponses, EmailUpdateForwardingRuleErrors, ThrowOnError>;
740
+ /**
741
+ * List email forwarding logs
742
+ *
743
+ * Returns a log of forwarded inbound emails with their delivery outcomes, optionally filtered by rule, status, or date range.
744
+ */
745
+ static getForwardingLog<ThrowOnError extends boolean = false>(parameters?: {
746
+ forwardingRuleId?: EmailForwardingRuleId | null | undefined;
747
+ status?: "pending" | "forwarded" | "failed" | null | undefined;
748
+ startDate?: string | null | undefined;
749
+ endDate?: string | null | undefined;
750
+ limit?: string | null | undefined;
751
+ offset?: string | null | undefined;
752
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetForwardingLogResponses, EmailGetForwardingLogErrors, ThrowOnError>;
753
+ }
754
+ export declare class Email2 {
755
+ static email: typeof Email;
756
+ }
757
+ export declare class Conversations {
758
+ /**
759
+ * List conversations
760
+ *
761
+ * Returns a paginated list of conversations for the organization, filterable by status, channel, contact, and date range.
762
+ */
763
+ static list<ThrowOnError extends boolean = false>(parameters?: {
764
+ page?: string | null | undefined;
765
+ limit?: string | null | undefined;
766
+ status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
767
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
768
+ contactId?: ContactId | null | undefined;
769
+ startDate?: string | null | undefined;
770
+ endDate?: string | null | undefined;
771
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsListResponses, ConversationsListErrors, ThrowOnError>;
772
+ /**
773
+ * Create a conversation
774
+ *
775
+ * Creates a new conversation with its initial contacts and returns it with a 201 status.
776
+ */
777
+ static create<ThrowOnError extends boolean = false>(parameters: {
778
+ title?: string | null | undefined;
779
+ description?: string | null | undefined;
780
+ externalId?: string | null | undefined;
781
+ parentConversationId?: ConversationId | null | undefined;
782
+ channels: Array<"sms" | "whatsapp" | "email">;
783
+ primaryChannel: "sms" | "whatsapp" | "email";
784
+ status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
785
+ statusReason?: string | null | undefined;
786
+ priority?: number | null | undefined;
787
+ urgency?: "low" | "medium" | "high" | "critical" | null | undefined;
788
+ complexity?: "simple" | "moderate" | "complex" | null | undefined;
789
+ metadata?: ConversationMetadata | null | null | undefined;
790
+ actorTracking?: ActorTracking | null | undefined;
791
+ metrics?: ConversationMetrics | null | undefined;
792
+ context?: ConversationContext | null | null | undefined;
793
+ tags?: Array<string> | null | undefined;
794
+ categories?: Array<string> | null | undefined;
795
+ isTest?: boolean | null | undefined;
796
+ isInternal?: boolean | null | undefined;
797
+ isPrivate?: boolean | null | undefined;
798
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsCreateResponses, ConversationsCreateErrors, ThrowOnError>;
799
+ /**
800
+ * Get a conversation
801
+ *
802
+ * Returns a single conversation by its ID.
803
+ */
804
+ static getById<ThrowOnError extends boolean = false>(parameters: {
805
+ id: ConversationId;
806
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsGetByIdResponses, ConversationsGetByIdErrors, ThrowOnError>;
807
+ /**
808
+ * Update a conversation
809
+ *
810
+ * Updates an existing conversation's fields and returns the updated conversation.
811
+ */
812
+ static update<ThrowOnError extends boolean = false>(parameters: {
813
+ id: ConversationId;
814
+ title?: string | null | undefined;
815
+ description?: string | null | null | undefined;
816
+ externalId?: string | null | null | undefined;
817
+ parentConversationId?: ConversationId | null | null | undefined;
818
+ primaryChannel?: "sms" | "whatsapp" | "email" | null | undefined;
819
+ status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
820
+ statusReason?: string | null | null | undefined;
821
+ priority?: number | null | undefined;
822
+ urgency?: "low" | "medium" | "high" | "critical" | null | undefined;
823
+ complexity?: "simple" | "moderate" | "complex" | null | undefined;
824
+ context?: ConversationContext | null | null | undefined;
825
+ metadata?: ConversationMetadata | null | null | undefined;
826
+ metrics?: ConversationMetrics | null | undefined;
827
+ actorTracking?: ActorTracking | null | undefined;
828
+ channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
829
+ tags?: Array<string> | null | undefined;
830
+ categories?: Array<string> | null | undefined;
831
+ isTest?: boolean | null | undefined;
832
+ isInternal?: boolean | null | undefined;
833
+ isPrivate?: boolean | null | undefined;
834
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsUpdateResponses, ConversationsUpdateErrors, ThrowOnError>;
835
+ /**
836
+ * List conversation messages
837
+ *
838
+ * Returns the messages in a conversation using the canonical message schema and page-based pagination.
839
+ */
840
+ static listMessages<ThrowOnError extends boolean = false>(parameters: {
841
+ id: ConversationId;
842
+ page?: string | null | undefined;
843
+ limit?: string | null | undefined;
844
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsListMessagesResponses, ConversationsListMessagesErrors, ThrowOnError>;
845
+ /**
846
+ * Remove contacts from a conversation
847
+ *
848
+ * Detaches one or more contacts from a conversation and returns the updated conversation.
849
+ */
850
+ static removeContacts<ThrowOnError extends boolean = false>(parameters: {
851
+ id: ConversationId;
852
+ contactIds: [ContactId, ContactId];
853
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsRemoveContactsResponses, ConversationsRemoveContactsErrors, ThrowOnError>;
854
+ /**
855
+ * Add contacts to a conversation
856
+ *
857
+ * Attaches one or more contacts to a conversation and returns the updated conversation.
858
+ */
859
+ static addContacts<ThrowOnError extends boolean = false>(parameters: {
860
+ id: ConversationId;
861
+ contactIds: [ContactId, ContactId];
862
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsAddContactsResponses, ConversationsAddContactsErrors, ThrowOnError>;
863
+ }
864
+ export declare class Conversations2 {
865
+ static conversations: typeof Conversations;
866
+ }
867
+ export declare class Contacts {
868
+ /**
869
+ * List contacts
870
+ *
871
+ * Returns a paginated list of contacts for the organization, filterable by search term, type, status, and date range.
872
+ */
873
+ static list<ThrowOnError extends boolean = false>(parameters?: {
874
+ page?: string | null | undefined;
875
+ limit?: string | null | undefined;
876
+ search?: string | null | undefined;
877
+ type?: "human" | "system" | null | undefined;
878
+ status?: "active" | "paused" | "blocked" | "archived" | null | undefined;
879
+ startDate?: string | null | undefined;
880
+ endDate?: string | null | undefined;
881
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsListResponses, ContactsListErrors, ThrowOnError>;
882
+ /**
883
+ * Create a contact
884
+ *
885
+ * Creates a new contact and returns it with a 201 status.
886
+ */
887
+ static create<ThrowOnError extends boolean = false>(parameters: {
888
+ type: "human" | "system";
889
+ name: string;
890
+ displayName?: string | null | null | undefined;
891
+ avatar?: string | null | null | undefined;
892
+ identities?: Array<ContactIdentity> | null | undefined;
893
+ humanProfile?: HumanProfile | null | null | undefined;
894
+ capabilities?: Array<string> | null | undefined;
895
+ tags?: Array<string> | null | undefined;
896
+ engagement?: {
897
+ totalInteractions: number;
898
+ lastActiveAt: string;
899
+ averageResponseTime: number;
900
+ satisfactionScore?: number | null | undefined;
901
+ channels: {
902
+ sms?: {
903
+ sent: number;
904
+ received: number;
905
+ failed: number;
906
+ lastAt?: string | null | undefined;
907
+ } | null | undefined;
908
+ whatsapp?: {
909
+ sent: number;
910
+ received: number;
911
+ failed: number;
912
+ lastAt?: string | null | undefined;
913
+ } | null | undefined;
914
+ email?: {
915
+ sent: number;
916
+ received: number;
917
+ failed: number;
918
+ bounced: number;
919
+ lastAt?: string | null | undefined;
920
+ } | null | undefined;
921
+ };
922
+ performance?: {
923
+ successRate: number;
924
+ escalationRate: number;
925
+ resolutionRate: number;
926
+ averageHandlingTime: number;
927
+ } | null | undefined;
928
+ } | null | undefined;
929
+ accessLevel?: "public" | "authenticated" | "vip" | "internal" | null | undefined;
930
+ accessConfig?: ContactAccessConfig | null | null | undefined;
931
+ preferences?: ContactPreferences | null | null | undefined;
932
+ status?: "active" | "paused" | "blocked" | "archived" | null | undefined;
933
+ statusReason?: string | null | null | undefined;
934
+ externalId?: string | null | null | undefined;
935
+ metadata?: JsonObject | null | null | undefined;
936
+ createdBy?: ContactId | null | null | undefined;
937
+ lastModifiedBy?: ContactId | null | null | undefined;
938
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsCreateResponses, ContactsCreateErrors, ThrowOnError>;
939
+ /**
940
+ * Find a contact
941
+ *
942
+ * Looks up a single contact by email, phone, WhatsApp, or external ID, returning null when no contact matches.
943
+ */
944
+ static find<ThrowOnError extends boolean = false>(parameters?: {
945
+ email?: string | null | undefined;
946
+ phone?: string | null | undefined;
947
+ whatsapp?: string | null | undefined;
948
+ externalId?: string | null | undefined;
949
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsFindResponses, ContactsFindErrors, ThrowOnError>;
950
+ /**
951
+ * Find or create a contact
952
+ *
953
+ * Returns an existing contact matching the given identifiers, or creates a new one when none exists.
954
+ */
955
+ static findOrCreate<ThrowOnError extends boolean = false>(parameters?: {
956
+ email?: string | null | undefined;
957
+ phone?: string | null | undefined;
958
+ whatsapp?: string | null | undefined;
959
+ externalId?: string | null | undefined;
960
+ name?: string | null | undefined;
961
+ displayName?: string | null | null | undefined;
962
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsFindOrCreateResponses, ContactsFindOrCreateErrors, ThrowOnError>;
963
+ /**
964
+ * Delete a contact
965
+ *
966
+ * Permanently deletes a contact by its ID.
967
+ */
968
+ static remove<ThrowOnError extends boolean = false>(parameters: {
969
+ id: ContactId;
970
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsRemoveResponses, ContactsRemoveErrors, ThrowOnError>;
971
+ /**
972
+ * Get a contact
973
+ *
974
+ * Returns a single contact by its ID.
975
+ */
976
+ static get<ThrowOnError extends boolean = false>(parameters: {
977
+ id: ContactId;
978
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsGetResponses, ContactsGetErrors, ThrowOnError>;
979
+ /**
980
+ * Update a contact
981
+ *
982
+ * Updates an existing contact's fields and returns the updated contact.
983
+ */
984
+ static update<ThrowOnError extends boolean = false>(parameters: {
985
+ id: ContactId;
986
+ type?: "human" | "system" | null | undefined;
987
+ name?: string | null | undefined;
988
+ displayName?: string | null | null | undefined;
989
+ avatar?: string | null | null | undefined;
990
+ identities?: Array<ContactIdentity> | null | undefined;
991
+ humanProfile?: HumanProfile | null | null | undefined;
992
+ capabilities?: Array<string> | null | undefined;
993
+ tags?: Array<string> | null | undefined;
994
+ engagement?: {
995
+ totalInteractions: number;
996
+ lastActiveAt: string;
997
+ averageResponseTime: number;
998
+ satisfactionScore?: number | null | undefined;
999
+ channels: {
1000
+ sms?: {
1001
+ sent: number;
1002
+ received: number;
1003
+ failed: number;
1004
+ lastAt?: string | null | undefined;
1005
+ } | null | undefined;
1006
+ whatsapp?: {
1007
+ sent: number;
1008
+ received: number;
1009
+ failed: number;
1010
+ lastAt?: string | null | undefined;
1011
+ } | null | undefined;
1012
+ email?: {
1013
+ sent: number;
1014
+ received: number;
1015
+ failed: number;
1016
+ bounced: number;
1017
+ lastAt?: string | null | undefined;
1018
+ } | null | undefined;
1019
+ };
1020
+ performance?: {
1021
+ successRate: number;
1022
+ escalationRate: number;
1023
+ resolutionRate: number;
1024
+ averageHandlingTime: number;
1025
+ } | null | undefined;
1026
+ } | null | undefined;
1027
+ accessLevel?: "public" | "authenticated" | "vip" | "internal" | null | undefined;
1028
+ accessConfig?: ContactAccessConfig | null | null | undefined;
1029
+ preferences?: ContactPreferences | null | null | undefined;
1030
+ status?: "active" | "paused" | "blocked" | "archived" | null | undefined;
1031
+ statusReason?: string | null | null | undefined;
1032
+ externalId?: string | null | null | undefined;
1033
+ metadata?: JsonObject | null | null | undefined;
1034
+ createdBy?: ContactId | null | null | undefined;
1035
+ lastModifiedBy?: ContactId | null | null | undefined;
1036
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsUpdateResponses, ContactsUpdateErrors, ThrowOnError>;
1037
+ /**
1038
+ * Get contact engagement metrics
1039
+ *
1040
+ * Returns aggregated engagement metrics for a contact, including message counts and active conversation totals.
1041
+ */
1042
+ static getEngagement<ThrowOnError extends boolean = false>(parameters: {
1043
+ id: ContactId;
1044
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsGetEngagementResponses, ContactsGetEngagementErrors, ThrowOnError>;
1045
+ /**
1046
+ * Bulk import contacts
1047
+ *
1048
+ * Creates or updates contacts in bulk from a list, returning per-entry results with created, updated, skipped, and error counts.
1049
+ */
1050
+ static bulkImport<ThrowOnError extends boolean = false>(parameters: {
1051
+ contacts: Array<{
1052
+ name: string;
1053
+ email?: string | null | undefined;
1054
+ phone?: string | null | undefined;
1055
+ tags?: Array<string> | null | undefined;
1056
+ firstName?: string | null | undefined;
1057
+ lastName?: string | null | undefined;
1058
+ company?: string | null | undefined;
1059
+ jobTitle?: string | null | undefined;
1060
+ customFields?: UnknownRecord | null | undefined;
1061
+ }>;
1062
+ upsertByEmail?: boolean | null | undefined;
1063
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsBulkImportResponses, ContactsBulkImportErrors, ThrowOnError>;
1064
+ /**
1065
+ * Bulk delete contacts
1066
+ *
1067
+ * Permanently deletes multiple contacts by ID, returning counts of deleted and failed records.
1068
+ */
1069
+ static bulkDelete<ThrowOnError extends boolean = false>(parameters: {
1070
+ ids: [ContactId, ContactId];
1071
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsBulkDeleteResponses, ContactsBulkDeleteErrors, ThrowOnError>;
1072
+ /**
1073
+ * Bulk update contact tags
1074
+ *
1075
+ * Adds, removes, or replaces tags on multiple contacts in one request, returning counts of updated and failed records.
1076
+ */
1077
+ static bulkUpdateTags<ThrowOnError extends boolean = false>(parameters: {
1078
+ ids: [ContactId, ContactId];
1079
+ operation: "add" | "remove" | "set";
1080
+ tags: [string, string];
1081
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsBulkUpdateTagsResponses, ContactsBulkUpdateTagsErrors, ThrowOnError>;
1082
+ /**
1083
+ * Bulk update contact status
1084
+ *
1085
+ * Sets the status on multiple contacts in one request, returning counts of updated and failed records.
1086
+ */
1087
+ static bulkUpdateStatus<ThrowOnError extends boolean = false>(parameters: {
1088
+ ids: [ContactId, ContactId];
1089
+ status: "active" | "paused" | "blocked" | "archived";
1090
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsBulkUpdateStatusResponses, ContactsBulkUpdateStatusErrors, ThrowOnError>;
1091
+ /**
1092
+ * Export contacts
1093
+ *
1094
+ * Exports contacts as JSON or CSV, returning the serialized data and a count of exported records.
1095
+ */
1096
+ static export<ThrowOnError extends boolean = false>(parameters?: {
1097
+ ids?: Array<ContactId> | null | undefined;
1098
+ format?: "json" | "csv" | null | undefined;
1099
+ filters?: {
1100
+ type?: "human" | "system" | null | undefined;
1101
+ status?: "active" | "paused" | "blocked" | "archived" | null | undefined;
1102
+ tags?: Array<string> | null | undefined;
1103
+ } | null | undefined;
1104
+ fields?: Array<string> | null | undefined;
1105
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsExportResponses, ContactsExportErrors, ThrowOnError>;
1106
+ /**
1107
+ * Get contact activity timeline
1108
+ *
1109
+ * Returns a paginated timeline of a contact's message activity, optionally filtered by channel.
1110
+ */
1111
+ static getActivityTimeline<ThrowOnError extends boolean = false>(parameters: {
1112
+ id: ContactId;
1113
+ page?: string | null | undefined;
1114
+ limit?: string | null | undefined;
1115
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
1116
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsGetActivityTimelineResponses, ContactsGetActivityTimelineErrors, ThrowOnError>;
1117
+ /**
1118
+ * List a contact's group memberships
1119
+ *
1120
+ * Returns the contact groups that a contact currently belongs to.
1121
+ */
1122
+ static getGroupMemberships<ThrowOnError extends boolean = false>(parameters: {
1123
+ id: ContactId;
1124
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsGetGroupMembershipsResponses, ContactsGetGroupMembershipsErrors, ThrowOnError>;
1125
+ }
1126
+ export declare class Contacts2 {
1127
+ static contacts: typeof Contacts;
1128
+ }
1129
+ export declare class Templates {
1130
+ /**
1131
+ * List templates
1132
+ *
1133
+ * Returns a paginated list of the organization's templates, filterable by category, channel, status, and search, with configurable sorting.
1134
+ */
1135
+ static list<ThrowOnError extends boolean = false>(parameters?: {
1136
+ page?: string | null | undefined;
1137
+ limit?: string | null | undefined;
1138
+ category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | undefined;
1139
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
1140
+ status?: "draft" | "pending" | "approved" | "published" | "rejected" | "archived" | null | undefined;
1141
+ search?: string | null | undefined;
1142
+ sortBy?: "name" | "createdAt" | "updatedAt" | "usageCount" | "lastUsedAt" | null | undefined;
1143
+ sortOrder?: "asc" | "desc" | null | undefined;
1144
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesListResponses, TemplatesListErrors, ThrowOnError>;
1145
+ /**
1146
+ * Create a template
1147
+ *
1148
+ * Creates a template from SML source; the source's root tag determines the template's channel. Returns the created template with status 201.
1149
+ */
1150
+ static create<ThrowOnError extends boolean = false>(parameters: {
1151
+ name: string;
1152
+ slug?: string | null | undefined;
1153
+ origin?: "dashboard" | "tsx" | null | undefined;
1154
+ description?: string | null | null | undefined;
1155
+ category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | null | undefined;
1156
+ source: string;
1157
+ subject?: string | null | undefined;
1158
+ headers?: {
1159
+ [key: string]: string;
1160
+ } | null | null | undefined;
1161
+ variableSchema?: Array<TemplateVariable> | null | null | undefined;
1162
+ compliance?: TemplateCompliance | null | null | undefined;
1163
+ performance?: TemplatePerformance | null | null | undefined;
1164
+ designOverrides?: Design3 | null | null | undefined;
1165
+ isActive?: boolean | null | undefined;
1166
+ isDefault?: boolean | null | undefined;
1167
+ version?: number | null | undefined;
1168
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesCreateResponses, TemplatesCreateErrors, ThrowOnError>;
1169
+ static listDashboard<ThrowOnError extends boolean = false>(parameters: {
1170
+ page?: string | null | undefined;
1171
+ limit?: string | null | undefined;
1172
+ allowedChannels: "sms" | "whatsapp" | "email" | Array<"sms" | "whatsapp" | "email">;
1173
+ category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | undefined;
1174
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
1175
+ status?: "draft" | "pending" | "approved" | "published" | "rejected" | "archived" | null | undefined;
1176
+ search?: string | null | undefined;
1177
+ sortBy?: "name" | "createdAt" | "updatedAt" | "usageCount" | "lastUsedAt" | null | undefined;
1178
+ sortOrder?: "asc" | "desc" | null | undefined;
1179
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesListDashboardResponses, TemplatesListDashboardErrors, ThrowOnError>;
1180
+ static listFamilies<ThrowOnError extends boolean = false>(parameters?: {
1181
+ page?: string | null | undefined;
1182
+ limit?: string | null | undefined;
1183
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesListFamiliesResponses, TemplatesListFamiliesErrors, ThrowOnError>;
1184
+ static createFamily<ThrowOnError extends boolean = false>(parameters: {
1185
+ name: string;
1186
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesCreateFamilyResponses, TemplatesCreateFamilyErrors, ThrowOnError>;
1187
+ static deleteFamily<ThrowOnError extends boolean = false>(parameters: {
1188
+ familyId: TemplateFamilyId;
1189
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesDeleteFamilyResponses, TemplatesDeleteFamilyErrors, ThrowOnError>;
1190
+ static getFamily<ThrowOnError extends boolean = false>(parameters: {
1191
+ familyId: TemplateFamilyId;
1192
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesGetFamilyResponses, TemplatesGetFamilyErrors, ThrowOnError>;
1193
+ static renameFamily<ThrowOnError extends boolean = false>(parameters: {
1194
+ familyId: TemplateFamilyId;
1195
+ name: string;
1196
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesRenameFamilyResponses, TemplatesRenameFamilyErrors, ThrowOnError>;
1197
+ static createFamilyFromTemplate<ThrowOnError extends boolean = false>(parameters: {
1198
+ templateId: TemplateId;
1199
+ name: string;
1200
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesCreateFamilyFromTemplateResponses, TemplatesCreateFamilyFromTemplateErrors, ThrowOnError>;
1201
+ static detachFamilyMember<ThrowOnError extends boolean = false>(parameters: {
1202
+ familyId: TemplateFamilyId;
1203
+ templateId: TemplateId;
1204
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesDetachFamilyMemberResponses, TemplatesDetachFamilyMemberErrors, ThrowOnError>;
1205
+ static attachFamilyMember<ThrowOnError extends boolean = false>(parameters: {
1206
+ familyId: TemplateFamilyId;
1207
+ templateId: TemplateId;
1208
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesAttachFamilyMemberResponses, TemplatesAttachFamilyMemberErrors, ThrowOnError>;
1209
+ static addFamilyChannel<ThrowOnError extends boolean = false>(parameters: {
1210
+ familyId: TemplateFamilyId;
1211
+ channel: "sms" | "whatsapp" | "email";
1212
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesAddFamilyChannelResponses, TemplatesAddFamilyChannelErrors, ThrowOnError>;
1213
+ /**
1214
+ * Delete a template
1215
+ *
1216
+ * Deletes a template from the organization and returns a success flag.
1217
+ */
1218
+ static remove<ThrowOnError extends boolean = false>(parameters: {
1219
+ id: TemplateId;
1220
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesRemoveResponses, TemplatesRemoveErrors, ThrowOnError>;
1221
+ /**
1222
+ * Get a template
1223
+ *
1224
+ * Returns a single template by ID, including its SML source and compiled channel content.
1225
+ */
1226
+ static getById<ThrowOnError extends boolean = false>(parameters: {
1227
+ id: TemplateId;
1228
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesGetByIdResponses, TemplatesGetByIdErrors, ThrowOnError>;
1229
+ /**
1230
+ * Update a template
1231
+ *
1232
+ * Updates a template's metadata or SML source; a new source's root tag must match the template's existing channel. Returns the updated template.
1233
+ */
1234
+ static update<ThrowOnError extends boolean = false>(parameters: {
1235
+ id: TemplateId;
1236
+ data: {
1237
+ name?: string | null | undefined;
1238
+ slug?: string | null | undefined;
1239
+ origin?: "dashboard" | "tsx" | null | undefined;
1240
+ description?: string | null | null | undefined;
1241
+ category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | null | undefined;
1242
+ fromDefault?: TemplateFromDefault | null | null | undefined;
1243
+ replyToDefault?: Array<string> | null | null | undefined;
1244
+ source?: string | null | undefined;
1245
+ subject?: string | null | undefined;
1246
+ headers?: {
1247
+ [key: string]: string;
1248
+ } | null | null | undefined;
1249
+ variableSchema?: Array<TemplateVariable> | null | null | undefined;
1250
+ compliance?: TemplateCompliance | null | null | undefined;
1251
+ performance?: TemplatePerformance | null | null | undefined;
1252
+ designOverrides?: Design3 | null | null | undefined;
1253
+ isActive?: boolean | null | undefined;
1254
+ isDefault?: boolean | null | undefined;
1255
+ version?: number | null | undefined;
1256
+ };
1257
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesUpdateResponses, TemplatesUpdateErrors, ThrowOnError>;
1258
+ /**
1259
+ * Approve a template
1260
+ *
1261
+ * Records compliance approval for a template with optional notes and moves its status to approved unless it is already published or archived.
1262
+ */
1263
+ static approve<ThrowOnError extends boolean = false>(parameters: {
1264
+ id: TemplateId;
1265
+ data: {
1266
+ notes?: string | null | undefined;
1267
+ };
1268
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesApproveResponses, TemplatesApproveErrors, ThrowOnError>;
1269
+ /**
1270
+ * Render a template
1271
+ *
1272
+ * Renders a template with the provided variables and returns a channel-specific preview, along with any missing variables and errors. No message is sent.
1273
+ */
1274
+ static render<ThrowOnError extends boolean = false>(parameters: {
1275
+ id: TemplateId;
1276
+ data: {
1277
+ variables?: {
1278
+ [key: string]: string;
1279
+ } | null | undefined;
1280
+ };
1281
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesRenderResponses, TemplatesRenderErrors, ThrowOnError>;
1282
+ /**
1283
+ * Duplicate a template
1284
+ *
1285
+ * Creates a copy of the template as a new draft template with a fresh slug. Returns the new template with status 201.
1286
+ */
1287
+ static duplicate<ThrowOnError extends boolean = false>(parameters: {
1288
+ id: TemplateId;
1289
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesDuplicateResponses, TemplatesDuplicateErrors, ThrowOnError>;
1290
+ /**
1291
+ * Publish a template
1292
+ *
1293
+ * Compiles the template's current source and creates a new published version snapshot, recording the publisher. Returns the updated template.
1294
+ */
1295
+ static publish<ThrowOnError extends boolean = false>(parameters: {
1296
+ id: TemplateId;
1297
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesPublishResponses, TemplatesPublishErrors, ThrowOnError>;
1298
+ /**
1299
+ * Unpublish a template
1300
+ *
1301
+ * Reverts a published template by creating a new draft version from its current source. Returns the updated template.
1302
+ */
1303
+ static unpublish<ThrowOnError extends boolean = false>(parameters: {
1304
+ id: TemplateId;
1305
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesUnpublishResponses, TemplatesUnpublishErrors, ThrowOnError>;
1306
+ /**
1307
+ * List template versions
1308
+ *
1309
+ * Returns the template's version history, listing each source version with its status and publish metadata.
1310
+ */
1311
+ static versionHistory<ThrowOnError extends boolean = false>(parameters: {
1312
+ id: TemplateId;
1313
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesVersionHistoryResponses, TemplatesVersionHistoryErrors, ThrowOnError>;
1314
+ /**
1315
+ * Restore a template version
1316
+ *
1317
+ * Recompiles an older version's source and restores it as a new draft version. Fails if the source no longer compiles or its channel differs.
1318
+ */
1319
+ static restoreVersion<ThrowOnError extends boolean = false>(parameters: {
1320
+ id: TemplateId;
1321
+ versionId: TemplateSourceVersionId;
1322
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesRestoreVersionResponses, TemplatesRestoreVersionErrors, ThrowOnError>;
1323
+ /**
1324
+ * Spam-check a template or email content
1325
+ *
1326
+ * Scores email content for spam risk, from either a stored email template or raw subject, HTML, and text. Returns a score, severity, issues, and recommendations.
1327
+ */
1328
+ static spamCheck<ThrowOnError extends boolean = false>(parameters: {
1329
+ body: {
1330
+ templateId: TemplateId;
1331
+ inputs?: {
1332
+ [key: string]: JsonValue;
1333
+ } | null | undefined;
1334
+ } | {
1335
+ subject: string;
1336
+ html: string;
1337
+ text: string;
1338
+ };
1339
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesSpamCheckResponses, TemplatesSpamCheckErrors, ThrowOnError>;
1340
+ }
1341
+ export declare class Templates2 {
1342
+ static templates: typeof Templates;
1343
+ }
1344
+ export declare class Design {
1345
+ /**
1346
+ * Get the organization design
1347
+ *
1348
+ * Returns the organization's configured email design kit (theme, assets, footer), or null when none is set.
1349
+ */
1350
+ static get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<DesignGetResponses, DesignGetErrors, ThrowOnError>;
1351
+ /**
1352
+ * Update the organization design
1353
+ *
1354
+ * Validates and saves the organization's email design kit; a null body clears the design back to the base design floor.
1355
+ */
1356
+ static update<ThrowOnError extends boolean = false>(parameters: {
1357
+ design: Design3 | null;
1358
+ }, options?: Options<never, ThrowOnError>): RequestResult<DesignUpdateResponses, DesignUpdateErrors, ThrowOnError>;
1359
+ }
1360
+ export declare class Design2 {
1361
+ static design: typeof Design;
1362
+ }
1363
+ export declare class Webhooks {
1364
+ /**
1365
+ * List webhooks
1366
+ *
1367
+ * Returns a paginated list of the organization's webhook endpoints, optionally filtered by a name search.
1368
+ */
1369
+ static list<ThrowOnError extends boolean = false>(parameters?: {
1370
+ page?: string | null | undefined;
1371
+ limit?: string | null | undefined;
1372
+ search?: string | null | undefined;
1373
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksListResponses, WebhooksListErrors, ThrowOnError>;
1374
+ /**
1375
+ * Create a webhook
1376
+ *
1377
+ * Creates a webhook endpoint subscribed to the given event types and returns it with a 201 response.
1378
+ */
1379
+ static create<ThrowOnError extends boolean = false>(parameters: {
1380
+ name: string;
1381
+ url: string;
1382
+ 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">;
1383
+ channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
1384
+ headers?: {
1385
+ [key: string]: string;
1386
+ } | null | undefined;
1387
+ status?: "active" | "disabled" | null | undefined;
1388
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksCreateResponses, WebhooksCreateErrors, ThrowOnError>;
1389
+ /**
1390
+ * Delete a webhook
1391
+ *
1392
+ * Deletes a webhook endpoint so it no longer receives event deliveries.
1393
+ */
1394
+ static remove<ThrowOnError extends boolean = false>(parameters: {
1395
+ id: WebhookEndpointId;
1396
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksRemoveResponses, WebhooksRemoveErrors, ThrowOnError>;
1397
+ /**
1398
+ * Get a webhook
1399
+ *
1400
+ * Returns the configuration of the webhook endpoint with the given ID.
1401
+ */
1402
+ static get<ThrowOnError extends boolean = false>(parameters: {
1403
+ id: WebhookEndpointId;
1404
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksGetResponses, WebhooksGetErrors, ThrowOnError>;
1405
+ /**
1406
+ * Update a webhook
1407
+ *
1408
+ * Updates a webhook's name, URL, subscribed events, channels, custom headers, or status and returns the updated endpoint.
1409
+ */
1410
+ static update<ThrowOnError extends boolean = false>(parameters: {
1411
+ id: WebhookEndpointId;
1412
+ name?: string | null | undefined;
1413
+ url?: string | null | undefined;
1414
+ 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"> | null | undefined;
1415
+ channels?: Array<"sms" | "whatsapp" | "email"> | null | null | undefined;
1416
+ headers?: {
1417
+ [key: string]: string;
1418
+ } | null | undefined;
1419
+ status?: "active" | "disabled" | null | undefined;
1420
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksUpdateResponses, WebhooksUpdateErrors, ThrowOnError>;
1421
+ /**
1422
+ * Send a test webhook delivery
1423
+ *
1424
+ * Queues a signed webhook.test event through the normal delivery and retry lifecycle.
1425
+ */
1426
+ static test<ThrowOnError extends boolean = false>(parameters: {
1427
+ id: WebhookEndpointId;
1428
+ data?: {
1429
+ [key: string]: JsonValue;
1430
+ } | null | undefined;
1431
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksTestResponses, WebhooksTestErrors, ThrowOnError>;
1432
+ /**
1433
+ * List webhook delivery logs
1434
+ *
1435
+ * Returns recent deliveries and their nested attempt diagnostics for a webhook endpoint.
1436
+ */
1437
+ static getLogs<ThrowOnError extends boolean = false>(parameters: {
1438
+ webhookId: WebhookEndpointId;
1439
+ limit?: string | null | undefined;
1440
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksGetLogsResponses, WebhooksGetLogsErrors, ThrowOnError>;
1441
+ /**
1442
+ * Get webhook delivery statistics
1443
+ *
1444
+ * Returns aggregate pending, delivered, exhausted, and cancelled delivery counts for a webhook endpoint.
1445
+ */
1446
+ static getStats<ThrowOnError extends boolean = false>(parameters: {
1447
+ webhookId: WebhookEndpointId;
1448
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksGetStatsResponses, WebhooksGetStatsErrors, ThrowOnError>;
1449
+ /**
1450
+ * Retry a webhook delivery
1451
+ *
1452
+ * Performs one immediate manual redelivery attempt and returns that attempt's identity and outcome without changing the automatic retry lifecycle.
1453
+ */
1454
+ static retryDelivery<ThrowOnError extends boolean = false>(parameters: {
1455
+ webhookId: WebhookEndpointId;
1456
+ deliveryId: WebhookDeliveryId;
1457
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksRetryDeliveryResponses, WebhooksRetryDeliveryErrors, ThrowOnError>;
1458
+ /**
1459
+ * Rotate a webhook signing secret
1460
+ *
1461
+ * Generates and returns a new signing secret. The previous secret remains valid for a 24-hour rotation overlap.
1462
+ */
1463
+ static regenerateSecret<ThrowOnError extends boolean = false>(parameters: {
1464
+ webhookId: WebhookEndpointId;
1465
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksRegenerateSecretResponses, WebhooksRegenerateSecretErrors, ThrowOnError>;
1466
+ }
1467
+ export declare class Webhooks2 {
1468
+ static webhooks: typeof Webhooks;
1469
+ }
1470
+ export declare class Organizations {
1471
+ /**
1472
+ * Create a workspace
1473
+ *
1474
+ * Creates a new workspace organization under the current billing account and returns it.
1475
+ */
1476
+ static create<ThrowOnError extends boolean = false>(parameters: {
1477
+ name: string;
1478
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsCreateResponses, OrganizationsCreateErrors, ThrowOnError>;
1479
+ /**
1480
+ * Get the current organization
1481
+ *
1482
+ * Returns the organization for the current billing account.
1483
+ */
1484
+ static get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<OrganizationsGetResponses, OrganizationsGetErrors, ThrowOnError>;
1485
+ /**
1486
+ * Update the current organization
1487
+ *
1488
+ * Updates the current organization's profile, billing, locale, design, default reply-to, and default unsubscribe-group fields and returns the saved organization.
1489
+ */
1490
+ static update<ThrowOnError extends boolean = false>(parameters?: {
1491
+ name?: string | null | undefined;
1492
+ slug?: string | null | undefined;
1493
+ billingEmail?: string | null | undefined;
1494
+ countryCode?: string | null | undefined;
1495
+ currency?: string | null | undefined;
1496
+ timezone?: string | null | undefined;
1497
+ isActive?: boolean | null | undefined;
1498
+ metadata?: {
1499
+ [key: string]: JsonValue;
1500
+ } | null | undefined;
1501
+ design?: Design3 | null | null | undefined;
1502
+ replyToDefault?: Array<string> | null | null | undefined;
1503
+ defaultUnsubscribeGroupId?: UnsubscribeId | null | null | undefined;
1504
+ emailFooterEnabledDefault?: boolean | null | null | undefined;
1505
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsUpdateResponses, OrganizationsUpdateErrors, ThrowOnError>;
1506
+ /**
1507
+ * Get organization usage
1508
+ *
1509
+ * Returns usage statistics for the current organization over the selected reporting period.
1510
+ */
1511
+ static getUsage<ThrowOnError extends boolean = false>(parameters?: {
1512
+ period?: "current" | "last_30_days" | "last_90_days" | "last_year" | null | undefined;
1513
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsGetUsageResponses, OrganizationsGetUsageErrors, ThrowOnError>;
1514
+ /**
1515
+ * Delete the current workspace
1516
+ *
1517
+ * Accepts owner-authorized durable workspace deletion. Repeating the same request with the same Idempotency-Key returns the existing organization-scoped operation.
1518
+ */
1519
+ static delete<ThrowOnError extends boolean = false>(parameters: {
1520
+ "idempotency-key": string;
1521
+ confirmationName: string;
1522
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsDeleteResponses, OrganizationsDeleteErrors, ThrowOnError>;
1523
+ /**
1524
+ * Create the first workspace
1525
+ *
1526
+ * Creates a replacement first workspace under the signed-in user's billing account when no workspace membership remains.
1527
+ */
1528
+ static bootstrap<ThrowOnError extends boolean = false>(parameters: {
1529
+ name: string;
1530
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsBootstrapResponses, OrganizationsBootstrapErrors, ThrowOnError>;
1531
+ }
1532
+ export declare class Organizations2 {
1533
+ static organizations: typeof Organizations;
1534
+ }
1535
+ export declare class ApiKeys {
1536
+ /**
1537
+ * List API keys
1538
+ *
1539
+ * Returns a paginated list of the organization's API keys, filterable by status and search term.
1540
+ */
1541
+ static list<ThrowOnError extends boolean = false>(parameters?: {
1542
+ page?: string | null | undefined;
1543
+ limit?: string | null | undefined;
1544
+ status?: "active" | "revoked" | null | undefined;
1545
+ search?: string | null | undefined;
1546
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysListResponses, ApiKeysListErrors, ThrowOnError>;
1547
+ /**
1548
+ * Create an API key
1549
+ *
1550
+ * Creates a new API key for the organization and returns the created key, including the plaintext secret, with a 201 response.
1551
+ */
1552
+ static create<ThrowOnError extends boolean = false>(parameters: {
1553
+ name: string;
1554
+ description?: string | null | undefined;
1555
+ expiresAt?: string | null | undefined;
1556
+ permissions?: ApiKeyPermissions | undefined;
1557
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysCreateResponses, ApiKeysCreateErrors, ThrowOnError>;
1558
+ /**
1559
+ * Revoke an API key
1560
+ *
1561
+ * Deactivates an API key so it can no longer authenticate requests. The key record is retained and remains listable.
1562
+ */
1563
+ static revoke<ThrowOnError extends boolean = false>(parameters: {
1564
+ id: ApiKeyId;
1565
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysRevokeResponses, ApiKeysRevokeErrors, ThrowOnError>;
1566
+ /**
1567
+ * Get an API key
1568
+ *
1569
+ * Returns the API key with the given ID, including its metadata and permissions.
1570
+ */
1571
+ static get<ThrowOnError extends boolean = false>(parameters: {
1572
+ id: ApiKeyId;
1573
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysGetResponses, ApiKeysGetErrors, ThrowOnError>;
1574
+ /**
1575
+ * Update an API key
1576
+ *
1577
+ * Updates the name or description of an API key and returns the updated key.
1578
+ */
1579
+ static update<ThrowOnError extends boolean = false>(parameters: {
1580
+ id: ApiKeyId;
1581
+ name?: string | null | undefined;
1582
+ description?: string | null | undefined;
1583
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysUpdateResponses, ApiKeysUpdateErrors, ThrowOnError>;
1584
+ /**
1585
+ * Rotate an API key
1586
+ *
1587
+ * Deactivates the existing key and issues a replacement with the same name and permissions. Returns the new key, including the plaintext secret.
1588
+ */
1589
+ static rotate<ThrowOnError extends boolean = false>(parameters: {
1590
+ id: ApiKeyId;
1591
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysRotateResponses, ApiKeysRotateErrors, ThrowOnError>;
1592
+ /**
1593
+ * Delete an API key
1594
+ *
1595
+ * Permanently deletes an API key record. Unlike revocation, the key row is removed rather than deactivated.
1596
+ */
1597
+ static remove<ThrowOnError extends boolean = false>(parameters: {
1598
+ id: ApiKeyId;
1599
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysRemoveResponses, ApiKeysRemoveErrors, ThrowOnError>;
1600
+ /**
1601
+ * Get API key send statistics
1602
+ *
1603
+ * Returns aggregate send counts and daily volume attributed to an API key over the selected period of 7, 30, or 90 days.
1604
+ */
1605
+ static getStats<ThrowOnError extends boolean = false>(parameters: {
1606
+ id: ApiKeyId;
1607
+ period?: "7d" | "30d" | "90d" | null | undefined;
1608
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysGetStatsResponses, ApiKeysGetStatsErrors, ThrowOnError>;
1609
+ /**
1610
+ * List API key activity
1611
+ *
1612
+ * Returns a paginated list of recent request activity recorded for an API key.
1613
+ */
1614
+ static getActivity<ThrowOnError extends boolean = false>(parameters: {
1615
+ id: ApiKeyId;
1616
+ page?: string | null | undefined;
1617
+ limit?: string | null | undefined;
1618
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysGetActivityResponses, ApiKeysGetActivityErrors, ThrowOnError>;
1619
+ }
1620
+ export declare class ApiKeys2 {
1621
+ static apiKeys: typeof ApiKeys;
1622
+ }