samva 0.0.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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 +1558 -0
  19. package/dist/client/types.gen.d.ts +7917 -0
  20. package/dist/client-BqkU-sFv.js +6049 -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 +2055 -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 +1278 -0
  30. package/dist/effect/contacts.js +39 -0
  31. package/dist/effect/conversations.d.ts +1604 -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 +1022 -0
  36. package/dist/effect/email.js +111 -0
  37. package/dist/effect/generated-metadata.d.ts +54 -0
  38. package/dist/effect/generated.d.ts +32156 -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 +1009 -0
  54. package/dist/effect/scheduled-messages.js +17 -0
  55. package/dist/effect/templates.d.ts +2591 -0
  56. package/dist/effect/templates.js +66 -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-Ccqh_yxb.js +596 -0
  64. package/dist/promises/errors.gen.d.ts +179 -0
  65. package/dist/promises/index.d.ts +153 -0
  66. package/dist/promises/index.js +2 -0
  67. package/dist/promises/types.gen.d.ts +1 -0
  68. package/dist/promises-Dgv8UmCC.js +5911 -0
  69. package/dist/rolldown-runtime-D7D4PA-g.js +13 -0
  70. package/dist/service-map.d.ts +732 -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,1558 @@
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, EmailAdvanceDomainVerificationErrors, EmailAdvanceDomainVerificationResponses, EmailBuildCustomTrackingDomainConnectApplyUrlErrors, EmailBuildCustomTrackingDomainConnectApplyUrlResponses, EmailBuildDomainConnectApplyUrlErrors, EmailBuildDomainConnectApplyUrlResponses, EmailCheckBlockedErrors, EmailCheckBlockedResponses, EmailCheckSenderVerificationErrors, EmailCheckSenderVerificationResponses, EmailClearDomainDefaultSenderErrors, EmailClearDomainDefaultSenderResponses, EmailCompleteCustomTrackingDomainConnectErrors, EmailCompleteCustomTrackingDomainConnectResponses, EmailCompleteDomainConnectErrors, EmailCompleteDomainConnectResponses, EmailCreateForwardingRuleErrors, EmailCreateForwardingRuleResponses, EmailDeleteForwardingRuleErrors, EmailDeleteForwardingRuleResponses, EmailDetectRegistrarErrors, EmailDetectRegistrarResponses, EmailDisableCatchAllErrors, EmailDisableCatchAllResponses, EmailDisableCustomTrackingErrors, EmailDisableCustomTrackingResponses, EmailDomainId, EmailEnableCatchAllErrors, EmailEnableCatchAllResponses, EmailEnableCustomTrackingErrors, EmailEnableCustomTrackingResponses, EmailEnableReceivingErrors, EmailEnableReceivingResponses, EmailForwardingRuleId, EmailGetBlockLogsErrors, EmailGetBlockLogsResponses, EmailGetCatchAllConfigErrors, EmailGetCatchAllConfigResponses, EmailGetCatchAllStatsErrors, EmailGetCatchAllStatsResponses, EmailGetCustomTrackingDomainConnectErrors, EmailGetCustomTrackingDomainConnectResponses, EmailGetCustomTrackingErrors, EmailGetCustomTrackingResponses, EmailGetDomainByIdErrors, EmailGetDomainByIdResponses, EmailGetDomainConnectErrors, EmailGetDomainConnectResponses, EmailGetDomainVerificationErrors, EmailGetDomainVerificationResponses, EmailGetForwardingLogErrors, EmailGetForwardingLogResponses, EmailGetRecipientTrackingPreferenceErrors, EmailGetRecipientTrackingPreferenceResponses, EmailGetStatsErrors, EmailGetStatsResponses, EmailGetTrackingDefaultsErrors, EmailGetTrackingDefaultsResponses, EmailListBlocksErrors, EmailListBlocksResponses, EmailListDomainsErrors, EmailListDomainsResponses, EmailListForwardingRulesErrors, EmailListForwardingRulesResponses, EmailListSendersErrors, EmailListSendersResponses, EmailListSuppressionsErrors, EmailListSuppressionsResponses, 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, 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, TemplateDocumentsBootstrapErrors, TemplateDocumentsBootstrapResponses, TemplateDocumentsGetErrors, TemplateDocumentsGetResponses, TemplateDocumentsPublishErrors, TemplateDocumentsPublishResponses, TemplateDocumentsRenderErrors, TemplateDocumentsRenderResponses, TemplateDocumentsReplaceErrors, TemplateDocumentsReplaceResponses, TemplateDocumentsRestoreErrors, TemplateDocumentsRestoreResponses, TemplateDocumentsSaveErrors, TemplateDocumentsSaveResponses, TemplateDocumentsSendErrors, TemplateDocumentsSendResponses, TemplateDocumentsSpamCheckErrors, TemplateDocumentsSpamCheckResponses, TemplateDocumentsTestSendErrors, TemplateDocumentsTestSendResponses, TemplateDocumentsUnpublishErrors, TemplateDocumentsUnpublishResponses, TemplateDocumentsVersionsErrors, TemplateDocumentsVersionsResponses, TemplateFamilyId, TemplateFromDefault, TemplateId, TemplatePerformance, TemplatesAddFamilyChannelErrors, TemplatesAddFamilyChannelResponses, TemplatesApproveErrors, TemplatesApproveResponses, TemplatesAttachFamilyMemberErrors, TemplatesAttachFamilyMemberResponses, TemplatesCreateErrors, TemplatesCreateFamilyErrors, TemplatesCreateFamilyFromTemplateErrors, TemplatesCreateFamilyFromTemplateResponses, TemplatesCreateFamilyResponses, TemplatesCreateResponses, TemplatesDeleteFamilyErrors, TemplatesDeleteFamilyResponses, TemplatesDetachFamilyMemberErrors, TemplatesDetachFamilyMemberResponses, TemplatesGetByIdErrors, TemplatesGetByIdResponses, TemplatesGetFamilyErrors, TemplatesGetFamilyResponses, TemplatesListDashboardErrors, TemplatesListDashboardResponses, TemplatesListErrors, TemplatesListFamiliesErrors, TemplatesListFamiliesResponses, TemplatesListResponses, TemplateSourceVersionId, TemplatesRemoveErrors, TemplatesRemoveResponses, TemplatesRenameFamilyErrors, TemplatesRenameFamilyResponses, TemplatesUpdateErrors, TemplatesUpdateResponses, 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
+ * Get domain verification
338
+ *
339
+ * Returns the stored DNS and provider lifecycle snapshot without calling a provider or mutating state.
340
+ */
341
+ static getDomainVerification<ThrowOnError extends boolean = false>(parameters: {
342
+ id: EmailDomainId;
343
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetDomainVerificationResponses, EmailGetDomainVerificationErrors, ThrowOnError>;
344
+ /**
345
+ * Advance domain verification
346
+ *
347
+ * Observes the required DNS records and, once they match, idempotently starts provider provisioning for the staged domain.
348
+ */
349
+ static advanceDomainVerification<ThrowOnError extends boolean = false>(parameters: {
350
+ id: EmailDomainId;
351
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailAdvanceDomainVerificationResponses, EmailAdvanceDomainVerificationErrors, ThrowOnError>;
352
+ /**
353
+ * Remove a sending domain
354
+ *
355
+ * Permanently deletes a sending domain from the organization.
356
+ */
357
+ static removeDomain<ThrowOnError extends boolean = false>(parameters: {
358
+ id: EmailDomainId;
359
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailRemoveDomainResponses, EmailRemoveDomainErrors, ThrowOnError>;
360
+ /**
361
+ * Get a sending domain
362
+ *
363
+ * Returns a single sending domain, including its DNS records and verification details.
364
+ */
365
+ static getDomainById<ThrowOnError extends boolean = false>(parameters: {
366
+ id: EmailDomainId;
367
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetDomainByIdResponses, EmailGetDomainByIdErrors, ThrowOnError>;
368
+ /**
369
+ * Detect a domain's registrar
370
+ *
371
+ * Looks up the domain's nameservers to detect its DNS registrar and returns the provider, nameservers, and a link to its setup docs.
372
+ */
373
+ static detectRegistrar<ThrowOnError extends boolean = false>(parameters: {
374
+ id: EmailDomainId;
375
+ domain: string;
376
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailDetectRegistrarResponses, EmailDetectRegistrarErrors, ThrowOnError>;
377
+ /**
378
+ * Check one-click DNS eligibility
379
+ *
380
+ * 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.
381
+ */
382
+ static getDomainConnect<ThrowOnError extends boolean = false>(parameters: {
383
+ id: EmailDomainId;
384
+ mode: "send-only" | "send-and-receive";
385
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetDomainConnectResponses, EmailGetDomainConnectErrors, ThrowOnError>;
386
+ /**
387
+ * Build a one-click DNS apply URL
388
+ *
389
+ * Builds the signed Domain Connect apply URL for the selected sending-only or sending-and-receiving service. Manual DNS remains available for either mode.
390
+ */
391
+ static buildDomainConnectApplyUrl<ThrowOnError extends boolean = false>(parameters: {
392
+ id: EmailDomainId;
393
+ mode: "send-only" | "send-and-receive";
394
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBuildDomainConnectApplyUrlResponses, EmailBuildDomainConnectApplyUrlErrors, ThrowOnError>;
395
+ /**
396
+ * Complete a one-click DNS return
397
+ *
398
+ * 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).
399
+ */
400
+ static completeDomainConnect<ThrowOnError extends boolean = false>(parameters: {
401
+ id: EmailDomainId;
402
+ state: string;
403
+ error?: string | null | undefined;
404
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCompleteDomainConnectResponses, EmailCompleteDomainConnectErrors, ThrowOnError>;
405
+ /**
406
+ * Enable inbound email for a domain
407
+ *
408
+ * 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.
409
+ */
410
+ static enableReceiving<ThrowOnError extends boolean = false>(parameters: {
411
+ id: EmailDomainId;
412
+ domain: string;
413
+ catchAll?: boolean | null | undefined;
414
+ endpointId?: WebhookEndpointId | null | undefined;
415
+ addresses?: Array<string> | null | undefined;
416
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailEnableReceivingResponses, EmailEnableReceivingErrors, ThrowOnError>;
417
+ /**
418
+ * Set the default sending domain
419
+ *
420
+ * 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.
421
+ */
422
+ static setDefaultDomain<ThrowOnError extends boolean = false>(parameters: {
423
+ id: EmailDomainId;
424
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailSetDefaultDomainResponses, EmailSetDefaultDomainErrors, ThrowOnError>;
425
+ /**
426
+ * Clear a domain's default sender
427
+ *
428
+ * Removes the domain's default sender so omitted-`from` sends fall through to the organization default sender.
429
+ */
430
+ static clearDomainDefaultSender<ThrowOnError extends boolean = false>(parameters: {
431
+ id: EmailDomainId;
432
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailClearDomainDefaultSenderResponses, EmailClearDomainDefaultSenderErrors, ThrowOnError>;
433
+ /**
434
+ * Set a domain's default sender
435
+ *
436
+ * Sets the default sender used for omitted-`from` sends from this domain. The sender must belong to the domain and be verified and active.
437
+ */
438
+ static setDomainDefaultSender<ThrowOnError extends boolean = false>(parameters: {
439
+ id: EmailDomainId;
440
+ senderId: EmailSenderId;
441
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailSetDomainDefaultSenderResponses, EmailSetDomainDefaultSenderErrors, ThrowOnError>;
442
+ /**
443
+ * Update a domain's send-settings config
444
+ *
445
+ * 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.
446
+ */
447
+ static updateDomainConfig<ThrowOnError extends boolean = false>(parameters: {
448
+ id: EmailDomainId;
449
+ openTracking?: boolean | null | null | undefined;
450
+ clickTracking?: boolean | null | null | undefined;
451
+ replyTo?: Array<string> | null | null | undefined;
452
+ unsubscribeGroupId?: UnsubscribeId | null | null | undefined;
453
+ footerEnabled?: boolean | null | null | undefined;
454
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateDomainConfigResponses, EmailUpdateDomainConfigErrors, ThrowOnError>;
455
+ /**
456
+ * Disable a custom tracking domain
457
+ *
458
+ * Tears down a domain's custom tracking and its managed resources. Sends immediately revert to the shared tracking host. Existing custom links in already-delivered mail stop working.
459
+ */
460
+ static disableCustomTracking<ThrowOnError extends boolean = false>(parameters: {
461
+ id: EmailDomainId;
462
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailDisableCustomTrackingResponses, EmailDisableCustomTrackingErrors, ThrowOnError>;
463
+ /**
464
+ * Get custom tracking status
465
+ *
466
+ * Returns the custom 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 custom tracking domain is provisioned.
467
+ */
468
+ static getCustomTracking<ThrowOnError extends boolean = false>(parameters: {
469
+ id: EmailDomainId;
470
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetCustomTrackingResponses, EmailGetCustomTrackingErrors, ThrowOnError>;
471
+ /**
472
+ * Enable a custom tracking domain
473
+ *
474
+ * Provisions a custom tracking domain (default label `track`) for a verified sending domain so open/click links redirect through the customer's own subdomain. Requires the custom_tracking_domain entitlement. Returns the resulting state including the two DNS records the customer must create.
475
+ */
476
+ static enableCustomTracking<ThrowOnError extends boolean = false>(parameters: {
477
+ id: EmailDomainId;
478
+ label?: string | null | undefined;
479
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailEnableCustomTrackingResponses, EmailEnableCustomTrackingErrors, ThrowOnError>;
480
+ /**
481
+ * Check automatic Custom Tracking Domain setup eligibility
482
+ *
483
+ * Reports whether the domain's DNS provider supports Domain Connect for its current Custom Tracking Domain. Ineligible is a normal result and the exact manual CNAME records remain available.
484
+ */
485
+ static getCustomTrackingDomainConnect<ThrowOnError extends boolean = false>(parameters: {
486
+ id: EmailDomainId;
487
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetCustomTrackingDomainConnectResponses, EmailGetCustomTrackingDomainConnectErrors, ThrowOnError>;
488
+ /**
489
+ * Build an automatic Custom Tracking Domain apply URL
490
+ *
491
+ * Builds the signed Domain Connect URL for the current customer-selected tracking host. The server derives the host and Cloudflare DCV UUID; exact manual CNAME records remain available.
492
+ */
493
+ static buildCustomTrackingDomainConnectApplyUrl<ThrowOnError extends boolean = false>(parameters: {
494
+ id: EmailDomainId;
495
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailBuildCustomTrackingDomainConnectApplyUrlResponses, EmailBuildCustomTrackingDomainConnectApplyUrlErrors, ThrowOnError>;
496
+ /**
497
+ * Complete an automatic Custom Tracking Domain return
498
+ *
499
+ * Validates the purpose- and revision-bound registrar state, then re-kicks the existing readiness reconciliation. The callback never declares the host ready or changes email tracking selection.
500
+ */
501
+ static completeCustomTrackingDomainConnect<ThrowOnError extends boolean = false>(parameters: {
502
+ id: EmailDomainId;
503
+ state: string;
504
+ error?: string | null | undefined;
505
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCompleteCustomTrackingDomainConnectResponses, EmailCompleteCustomTrackingDomainConnectErrors, ThrowOnError>;
506
+ /**
507
+ * List sender identities
508
+ *
509
+ * Returns a paginated list of sender identities, optionally filtered by verification status, active state, or default flag.
510
+ */
511
+ static listSenders<ThrowOnError extends boolean = false>(parameters?: {
512
+ page?: string | null | undefined;
513
+ limit?: string | null | undefined;
514
+ verificationStatus?: "pending" | "verified" | "failed" | null | undefined;
515
+ isActive?: string | null | undefined;
516
+ isDefault?: string | null | undefined;
517
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListSendersResponses, EmailListSendersErrors, ThrowOnError>;
518
+ /**
519
+ * Add a sender identity
520
+ *
521
+ * Creates a sender identity for an email address and returns it. Responds with 201.
522
+ */
523
+ static addSender<ThrowOnError extends boolean = false>(parameters: {
524
+ email: string;
525
+ domainId?: EmailDomainId | null | undefined;
526
+ name?: string | null | null | undefined;
527
+ replyToEmails?: Array<string> | null | null | undefined;
528
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailAddSenderResponses, EmailAddSenderErrors, ThrowOnError>;
529
+ /**
530
+ * Check sender verification status
531
+ *
532
+ * Returns the current verification status of a sender identity.
533
+ */
534
+ static checkSenderVerification<ThrowOnError extends boolean = false>(parameters: {
535
+ id: EmailSenderId;
536
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCheckSenderVerificationResponses, EmailCheckSenderVerificationErrors, ThrowOnError>;
537
+ /**
538
+ * Remove a sender identity
539
+ *
540
+ * Permanently deletes a sender identity from the organization.
541
+ */
542
+ static removeSender<ThrowOnError extends boolean = false>(parameters: {
543
+ id: EmailSenderId;
544
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailRemoveSenderResponses, EmailRemoveSenderErrors, ThrowOnError>;
545
+ /**
546
+ * Set the organization default sender
547
+ *
548
+ * 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.
549
+ */
550
+ static setDefaultSender<ThrowOnError extends boolean = false>(parameters: {
551
+ id: EmailSenderId;
552
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailSetDefaultSenderResponses, EmailSetDefaultSenderErrors, ThrowOnError>;
553
+ /**
554
+ * Get email statistics
555
+ *
556
+ * Returns aggregate email statistics — sent, delivered, bounced, and complained counts with their rates — optionally scoped to a date range.
557
+ */
558
+ static getStats<ThrowOnError extends boolean = false>(parameters?: {
559
+ startDate?: string | null | undefined;
560
+ endDate?: string | null | undefined;
561
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetStatsResponses, EmailGetStatsErrors, ThrowOnError>;
562
+ /**
563
+ * Enable catch-all receiving
564
+ *
565
+ * 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.
566
+ */
567
+ static enableCatchAll<ThrowOnError extends boolean = false>(parameters: {
568
+ domainId: EmailDomainId;
569
+ endpointId: WebhookEndpointId;
570
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailEnableCatchAllResponses, EmailEnableCatchAllErrors, ThrowOnError>;
571
+ /**
572
+ * Disable catch-all receiving
573
+ *
574
+ * Disables catch-all inbound receiving for a domain.
575
+ */
576
+ static disableCatchAll<ThrowOnError extends boolean = false>(parameters: {
577
+ domainId: EmailDomainId;
578
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailDisableCatchAllResponses, EmailDisableCatchAllErrors, ThrowOnError>;
579
+ /**
580
+ * Get catch-all configuration
581
+ *
582
+ * Returns the catch-all receiving configuration for a domain, including the webhook endpoint that receives its inbound mail and its email counts.
583
+ */
584
+ static getCatchAllConfig<ThrowOnError extends boolean = false>(parameters: {
585
+ domainId: EmailDomainId;
586
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetCatchAllConfigResponses, EmailGetCatchAllConfigErrors, ThrowOnError>;
587
+ /**
588
+ * Update catch-all configuration
589
+ *
590
+ * Updates a domain's catch-all receiving configuration: the webhook endpoint that receives its inbound mail.
591
+ */
592
+ static updateCatchAllConfig<ThrowOnError extends boolean = false>(parameters: {
593
+ domainId: EmailDomainId;
594
+ endpointId?: WebhookEndpointId | null | undefined;
595
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateCatchAllConfigResponses, EmailUpdateCatchAllConfigErrors, ThrowOnError>;
596
+ /**
597
+ * Get catch-all statistics
598
+ *
599
+ * Returns catch-all receiving counters for a domain, adding an aggregated breakdown when a date range is supplied.
600
+ */
601
+ static getCatchAllStats<ThrowOnError extends boolean = false>(parameters: {
602
+ domainId: EmailDomainId;
603
+ startDate?: string | null | undefined;
604
+ endDate?: string | null | undefined;
605
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetCatchAllStatsResponses, EmailGetCatchAllStatsErrors, ThrowOnError>;
606
+ /**
607
+ * List suppressed addresses
608
+ *
609
+ * 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.
610
+ */
611
+ static listSuppressions<ThrowOnError extends boolean = false>(parameters?: {
612
+ type?: "bounce" | "complaint" | "unsubscribe" | "manual" | null | undefined;
613
+ status?: "active" | "expired" | null | undefined;
614
+ search?: string | null | undefined;
615
+ limit?: string | null | undefined;
616
+ offset?: string | null | undefined;
617
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListSuppressionsResponses, EmailListSuppressionsErrors, ThrowOnError>;
618
+ /**
619
+ * Remove a suppressed address
620
+ *
621
+ * 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.
622
+ */
623
+ static removeSuppression<ThrowOnError extends boolean = false>(parameters: {
624
+ id: SuppressionId;
625
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailRemoveSuppressionResponses, EmailRemoveSuppressionErrors, ThrowOnError>;
626
+ /**
627
+ * List block entries
628
+ *
629
+ * Returns block entries, optionally filtered by block type and active state, with limit and offset paging.
630
+ */
631
+ static listBlocks<ThrowOnError extends boolean = false>(parameters?: {
632
+ blockType?: "email" | "domain" | null | undefined;
633
+ isActive?: string | null | undefined;
634
+ limit?: string | null | undefined;
635
+ offset?: string | null | undefined;
636
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListBlocksResponses, EmailListBlocksErrors, ThrowOnError>;
637
+ /**
638
+ * Add a block entry
639
+ *
640
+ * Blocks an email address or domain from inbound receiving and returns the created block entry. Responds with 201.
641
+ */
642
+ static addBlock<ThrowOnError extends boolean = false>(parameters: {
643
+ blockType: "email" | "domain";
644
+ blockValue: string;
645
+ reason: string;
646
+ notes?: string | null | undefined;
647
+ expiresAt?: string | null | undefined;
648
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailAddBlockResponses, EmailAddBlockErrors, ThrowOnError>;
649
+ /**
650
+ * Remove a block entry
651
+ *
652
+ * Permanently deletes a block entry, unblocking the associated address or domain.
653
+ */
654
+ static removeBlock<ThrowOnError extends boolean = false>(parameters: {
655
+ id: BlockedEmailId;
656
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailRemoveBlockResponses, EmailRemoveBlockErrors, ThrowOnError>;
657
+ /**
658
+ * Update a block entry
659
+ *
660
+ * Updates a block entry's reason, notes, active state, or expiry.
661
+ */
662
+ static updateBlock<ThrowOnError extends boolean = false>(parameters: {
663
+ id: BlockedEmailId;
664
+ reason?: string | null | undefined;
665
+ notes?: string | null | undefined;
666
+ isActive?: boolean | null | undefined;
667
+ expiresAt?: string | null | null | undefined;
668
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateBlockResponses, EmailUpdateBlockErrors, ThrowOnError>;
669
+ /**
670
+ * List blocked email logs
671
+ *
672
+ * Returns a log of inbound emails that were blocked, optionally filtered by block entry, sender, or date range.
673
+ */
674
+ static getBlockLogs<ThrowOnError extends boolean = false>(parameters?: {
675
+ blockedEmailId?: BlockedEmailId | null | undefined;
676
+ fromAddress?: string | null | undefined;
677
+ startDate?: string | null | undefined;
678
+ endDate?: string | null | undefined;
679
+ limit?: string | null | undefined;
680
+ offset?: string | null | undefined;
681
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetBlockLogsResponses, EmailGetBlockLogsErrors, ThrowOnError>;
682
+ /**
683
+ * Check whether an address is blocked
684
+ *
685
+ * Checks whether an email address is currently blocked and returns the matching block rule when one applies.
686
+ */
687
+ static checkBlocked<ThrowOnError extends boolean = false>(parameters: {
688
+ emailAddress: string;
689
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCheckBlockedResponses, EmailCheckBlockedErrors, ThrowOnError>;
690
+ /**
691
+ * List forwarding rules
692
+ *
693
+ * Returns inbound email forwarding rules, optionally filtered by domain and active state, with limit and offset paging.
694
+ */
695
+ static listForwardingRules<ThrowOnError extends boolean = false>(parameters?: {
696
+ domainId?: EmailDomainId | null | undefined;
697
+ isActive?: string | null | undefined;
698
+ limit?: string | null | undefined;
699
+ offset?: string | null | undefined;
700
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailListForwardingRulesResponses, EmailListForwardingRulesErrors, ThrowOnError>;
701
+ /**
702
+ * Create a forwarding rule
703
+ *
704
+ * Creates an inbound email forwarding rule and returns it. Responds with 201.
705
+ */
706
+ static createForwardingRule<ThrowOnError extends boolean = false>(parameters: {
707
+ name: string;
708
+ description?: string | null | undefined;
709
+ domainId?: EmailDomainId | null | undefined;
710
+ sourcePattern?: string | null | undefined;
711
+ forwardTo: Array<string>;
712
+ preserveHeaders?: boolean | null | undefined;
713
+ appendNote?: string | null | undefined;
714
+ conditions?: ForwardingConditions | null | undefined;
715
+ priority?: number | null | undefined;
716
+ isActive?: boolean | null | undefined;
717
+ metadata?: {
718
+ [key: string]: JsonValue;
719
+ } | null | null | undefined;
720
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailCreateForwardingRuleResponses, EmailCreateForwardingRuleErrors, ThrowOnError>;
721
+ /**
722
+ * Delete a forwarding rule
723
+ *
724
+ * Permanently deletes an inbound email forwarding rule.
725
+ */
726
+ static deleteForwardingRule<ThrowOnError extends boolean = false>(parameters: {
727
+ id: EmailForwardingRuleId;
728
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailDeleteForwardingRuleResponses, EmailDeleteForwardingRuleErrors, ThrowOnError>;
729
+ /**
730
+ * Update a forwarding rule
731
+ *
732
+ * Updates an inbound email forwarding rule and returns its current summary.
733
+ */
734
+ static updateForwardingRule<ThrowOnError extends boolean = false>(parameters: {
735
+ id: EmailForwardingRuleId;
736
+ name?: string | null | undefined;
737
+ description?: string | null | undefined;
738
+ domainId?: EmailDomainId | null | undefined;
739
+ sourcePattern?: string | null | undefined;
740
+ forwardTo?: Array<string> | null | undefined;
741
+ preserveHeaders?: boolean | null | undefined;
742
+ appendNote?: string | null | undefined;
743
+ conditions?: ForwardingConditions | null | null | undefined;
744
+ priority?: number | null | undefined;
745
+ isActive?: boolean | null | undefined;
746
+ metadata?: {
747
+ [key: string]: JsonValue;
748
+ } | null | null | undefined;
749
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailUpdateForwardingRuleResponses, EmailUpdateForwardingRuleErrors, ThrowOnError>;
750
+ /**
751
+ * List email forwarding logs
752
+ *
753
+ * Returns a log of forwarded inbound emails with their delivery outcomes, optionally filtered by rule, status, or date range.
754
+ */
755
+ static getForwardingLog<ThrowOnError extends boolean = false>(parameters?: {
756
+ forwardingRuleId?: EmailForwardingRuleId | null | undefined;
757
+ status?: "pending" | "forwarded" | "failed" | null | undefined;
758
+ startDate?: string | null | undefined;
759
+ endDate?: string | null | undefined;
760
+ limit?: string | null | undefined;
761
+ offset?: string | null | undefined;
762
+ }, options?: Options<never, ThrowOnError>): RequestResult<EmailGetForwardingLogResponses, EmailGetForwardingLogErrors, ThrowOnError>;
763
+ }
764
+ export declare class Email2 {
765
+ static email: typeof Email;
766
+ }
767
+ export declare class Conversations {
768
+ /**
769
+ * List conversations
770
+ *
771
+ * Returns a paginated list of conversations for the organization, filterable by status, channel, contact, and date range.
772
+ */
773
+ static list<ThrowOnError extends boolean = false>(parameters?: {
774
+ page?: string | null | undefined;
775
+ limit?: string | null | undefined;
776
+ status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
777
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
778
+ contactId?: ContactId | null | undefined;
779
+ startDate?: string | null | undefined;
780
+ endDate?: string | null | undefined;
781
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsListResponses, ConversationsListErrors, ThrowOnError>;
782
+ /**
783
+ * Create a conversation
784
+ *
785
+ * Creates a new conversation with its initial contacts and returns it with a 201 status.
786
+ */
787
+ static create<ThrowOnError extends boolean = false>(parameters: {
788
+ title?: string | null | undefined;
789
+ description?: string | null | undefined;
790
+ externalId?: string | null | undefined;
791
+ parentConversationId?: ConversationId | null | undefined;
792
+ channels: Array<"sms" | "whatsapp" | "email">;
793
+ primaryChannel: "sms" | "whatsapp" | "email";
794
+ status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
795
+ statusReason?: string | null | undefined;
796
+ priority?: number | null | undefined;
797
+ urgency?: "low" | "medium" | "high" | "critical" | null | undefined;
798
+ complexity?: "simple" | "moderate" | "complex" | null | undefined;
799
+ metadata?: ConversationMetadata | null | null | undefined;
800
+ actorTracking?: ActorTracking | null | undefined;
801
+ metrics?: ConversationMetrics | null | undefined;
802
+ context?: ConversationContext | null | null | undefined;
803
+ tags?: Array<string> | null | undefined;
804
+ categories?: Array<string> | null | undefined;
805
+ isTest?: boolean | null | undefined;
806
+ isInternal?: boolean | null | undefined;
807
+ isPrivate?: boolean | null | undefined;
808
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsCreateResponses, ConversationsCreateErrors, ThrowOnError>;
809
+ /**
810
+ * Get a conversation
811
+ *
812
+ * Returns a single conversation by its ID.
813
+ */
814
+ static getById<ThrowOnError extends boolean = false>(parameters: {
815
+ id: ConversationId;
816
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsGetByIdResponses, ConversationsGetByIdErrors, ThrowOnError>;
817
+ /**
818
+ * Update a conversation
819
+ *
820
+ * Updates an existing conversation's fields and returns the updated conversation.
821
+ */
822
+ static update<ThrowOnError extends boolean = false>(parameters: {
823
+ id: ConversationId;
824
+ title?: string | null | undefined;
825
+ description?: string | null | null | undefined;
826
+ externalId?: string | null | null | undefined;
827
+ parentConversationId?: ConversationId | null | null | undefined;
828
+ primaryChannel?: "sms" | "whatsapp" | "email" | null | undefined;
829
+ status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | null | undefined;
830
+ statusReason?: string | null | null | undefined;
831
+ priority?: number | null | undefined;
832
+ urgency?: "low" | "medium" | "high" | "critical" | null | undefined;
833
+ complexity?: "simple" | "moderate" | "complex" | null | undefined;
834
+ context?: ConversationContext | null | null | undefined;
835
+ metadata?: ConversationMetadata | null | null | undefined;
836
+ metrics?: ConversationMetrics | null | undefined;
837
+ actorTracking?: ActorTracking | null | undefined;
838
+ channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
839
+ tags?: Array<string> | null | undefined;
840
+ categories?: Array<string> | null | undefined;
841
+ isTest?: boolean | null | undefined;
842
+ isInternal?: boolean | null | undefined;
843
+ isPrivate?: boolean | null | undefined;
844
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsUpdateResponses, ConversationsUpdateErrors, ThrowOnError>;
845
+ /**
846
+ * List conversation messages
847
+ *
848
+ * Returns the messages in a conversation using the canonical message schema and page-based pagination.
849
+ */
850
+ static listMessages<ThrowOnError extends boolean = false>(parameters: {
851
+ id: ConversationId;
852
+ page?: string | null | undefined;
853
+ limit?: string | null | undefined;
854
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsListMessagesResponses, ConversationsListMessagesErrors, ThrowOnError>;
855
+ /**
856
+ * Remove contacts from a conversation
857
+ *
858
+ * Detaches one or more contacts from a conversation and returns the updated conversation.
859
+ */
860
+ static removeContacts<ThrowOnError extends boolean = false>(parameters: {
861
+ id: ConversationId;
862
+ contactIds: [ContactId, ContactId];
863
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsRemoveContactsResponses, ConversationsRemoveContactsErrors, ThrowOnError>;
864
+ /**
865
+ * Add contacts to a conversation
866
+ *
867
+ * Attaches one or more contacts to a conversation and returns the updated conversation.
868
+ */
869
+ static addContacts<ThrowOnError extends boolean = false>(parameters: {
870
+ id: ConversationId;
871
+ contactIds: [ContactId, ContactId];
872
+ }, options?: Options<never, ThrowOnError>): RequestResult<ConversationsAddContactsResponses, ConversationsAddContactsErrors, ThrowOnError>;
873
+ }
874
+ export declare class Conversations2 {
875
+ static conversations: typeof Conversations;
876
+ }
877
+ export declare class Contacts {
878
+ /**
879
+ * List contacts
880
+ *
881
+ * Returns a paginated list of contacts for the organization, filterable by search term, type, status, and date range.
882
+ */
883
+ static list<ThrowOnError extends boolean = false>(parameters?: {
884
+ page?: string | null | undefined;
885
+ limit?: string | null | undefined;
886
+ search?: string | null | undefined;
887
+ type?: "human" | "system" | null | undefined;
888
+ status?: "active" | "paused" | "blocked" | "archived" | null | undefined;
889
+ startDate?: string | null | undefined;
890
+ endDate?: string | null | undefined;
891
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsListResponses, ContactsListErrors, ThrowOnError>;
892
+ /**
893
+ * Create a contact
894
+ *
895
+ * Creates a new contact and returns it with a 201 status.
896
+ */
897
+ static create<ThrowOnError extends boolean = false>(parameters: {
898
+ type: "human" | "system";
899
+ name: string;
900
+ displayName?: string | null | null | undefined;
901
+ avatar?: string | null | null | undefined;
902
+ identities?: Array<ContactIdentity> | null | undefined;
903
+ humanProfile?: HumanProfile | null | null | undefined;
904
+ capabilities?: Array<string> | null | undefined;
905
+ tags?: Array<string> | null | undefined;
906
+ accessLevel?: "public" | "authenticated" | "vip" | "internal" | null | undefined;
907
+ accessConfig?: ContactAccessConfig | null | null | undefined;
908
+ preferences?: ContactPreferences | null | null | undefined;
909
+ status?: "active" | "paused" | "blocked" | "archived" | null | undefined;
910
+ statusReason?: string | null | null | undefined;
911
+ externalId?: string | null | null | undefined;
912
+ metadata?: JsonObject | null | null | undefined;
913
+ createdBy?: ContactId | null | null | undefined;
914
+ lastModifiedBy?: ContactId | null | null | undefined;
915
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsCreateResponses, ContactsCreateErrors, ThrowOnError>;
916
+ /**
917
+ * Find a contact
918
+ *
919
+ * Looks up a single contact by email, phone, WhatsApp, or external ID, returning null when no contact matches.
920
+ */
921
+ static find<ThrowOnError extends boolean = false>(parameters?: {
922
+ email?: string | null | undefined;
923
+ phone?: string | null | undefined;
924
+ whatsapp?: string | null | undefined;
925
+ externalId?: string | null | undefined;
926
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsFindResponses, ContactsFindErrors, ThrowOnError>;
927
+ /**
928
+ * Find or create a contact
929
+ *
930
+ * Returns an existing contact matching the given identifiers, or creates a new one when none exists.
931
+ */
932
+ static findOrCreate<ThrowOnError extends boolean = false>(parameters?: {
933
+ email?: string | null | undefined;
934
+ phone?: string | null | undefined;
935
+ whatsapp?: string | null | undefined;
936
+ externalId?: string | null | undefined;
937
+ name?: string | null | undefined;
938
+ displayName?: string | null | null | undefined;
939
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsFindOrCreateResponses, ContactsFindOrCreateErrors, ThrowOnError>;
940
+ /**
941
+ * Delete a contact
942
+ *
943
+ * Permanently deletes a contact by its ID.
944
+ */
945
+ static remove<ThrowOnError extends boolean = false>(parameters: {
946
+ id: ContactId;
947
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsRemoveResponses, ContactsRemoveErrors, ThrowOnError>;
948
+ /**
949
+ * Get a contact
950
+ *
951
+ * Returns a single contact by its ID.
952
+ */
953
+ static get<ThrowOnError extends boolean = false>(parameters: {
954
+ id: ContactId;
955
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsGetResponses, ContactsGetErrors, ThrowOnError>;
956
+ /**
957
+ * Update a contact
958
+ *
959
+ * Updates an existing contact's fields and returns the updated contact.
960
+ */
961
+ static update<ThrowOnError extends boolean = false>(parameters: {
962
+ id: ContactId;
963
+ type?: "human" | "system" | null | undefined;
964
+ name?: string | null | undefined;
965
+ displayName?: string | null | null | undefined;
966
+ avatar?: string | null | null | undefined;
967
+ identities?: Array<ContactIdentity> | null | undefined;
968
+ humanProfile?: HumanProfile | null | null | undefined;
969
+ capabilities?: Array<string> | null | undefined;
970
+ tags?: Array<string> | null | undefined;
971
+ accessLevel?: "public" | "authenticated" | "vip" | "internal" | null | undefined;
972
+ accessConfig?: ContactAccessConfig | null | null | undefined;
973
+ preferences?: ContactPreferences | null | null | undefined;
974
+ status?: "active" | "paused" | "blocked" | "archived" | null | undefined;
975
+ statusReason?: string | null | null | undefined;
976
+ externalId?: string | null | null | undefined;
977
+ metadata?: JsonObject | null | null | undefined;
978
+ createdBy?: ContactId | null | null | undefined;
979
+ lastModifiedBy?: ContactId | null | null | undefined;
980
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsUpdateResponses, ContactsUpdateErrors, ThrowOnError>;
981
+ /**
982
+ * Get contact engagement metrics
983
+ *
984
+ * Returns aggregated engagement metrics for a contact, including message counts and active conversation totals.
985
+ */
986
+ static getEngagement<ThrowOnError extends boolean = false>(parameters: {
987
+ id: ContactId;
988
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsGetEngagementResponses, ContactsGetEngagementErrors, ThrowOnError>;
989
+ /**
990
+ * Bulk import contacts
991
+ *
992
+ * Creates or updates contacts in bulk from a list, returning per-entry results with created, updated, skipped, and error counts.
993
+ */
994
+ static bulkImport<ThrowOnError extends boolean = false>(parameters: {
995
+ contacts: Array<{
996
+ name: string;
997
+ email?: string | null | undefined;
998
+ phone?: string | null | undefined;
999
+ tags?: Array<string> | null | undefined;
1000
+ firstName?: string | null | undefined;
1001
+ lastName?: string | null | undefined;
1002
+ company?: string | null | undefined;
1003
+ jobTitle?: string | null | undefined;
1004
+ customFields?: UnknownRecord | null | undefined;
1005
+ }>;
1006
+ upsertByEmail?: boolean | null | undefined;
1007
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsBulkImportResponses, ContactsBulkImportErrors, ThrowOnError>;
1008
+ /**
1009
+ * Bulk delete contacts
1010
+ *
1011
+ * Permanently deletes multiple contacts by ID, returning counts of deleted and failed records.
1012
+ */
1013
+ static bulkDelete<ThrowOnError extends boolean = false>(parameters: {
1014
+ ids: [ContactId, ContactId];
1015
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsBulkDeleteResponses, ContactsBulkDeleteErrors, ThrowOnError>;
1016
+ /**
1017
+ * Bulk update contact tags
1018
+ *
1019
+ * Adds, removes, or replaces tags on multiple contacts in one request, returning counts of updated and failed records.
1020
+ */
1021
+ static bulkUpdateTags<ThrowOnError extends boolean = false>(parameters: {
1022
+ ids: [ContactId, ContactId];
1023
+ operation: "add" | "remove" | "set";
1024
+ tags: [string, string];
1025
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsBulkUpdateTagsResponses, ContactsBulkUpdateTagsErrors, ThrowOnError>;
1026
+ /**
1027
+ * Bulk update contact status
1028
+ *
1029
+ * Sets the status on multiple contacts in one request, returning counts of updated and failed records.
1030
+ */
1031
+ static bulkUpdateStatus<ThrowOnError extends boolean = false>(parameters: {
1032
+ ids: [ContactId, ContactId];
1033
+ status: "active" | "paused" | "blocked" | "archived";
1034
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsBulkUpdateStatusResponses, ContactsBulkUpdateStatusErrors, ThrowOnError>;
1035
+ /**
1036
+ * Export contacts
1037
+ *
1038
+ * Exports contacts as JSON or CSV, returning the serialized data and a count of exported records.
1039
+ */
1040
+ static export<ThrowOnError extends boolean = false>(parameters?: {
1041
+ ids?: Array<ContactId> | null | undefined;
1042
+ format?: "json" | "csv" | null | undefined;
1043
+ filters?: {
1044
+ type?: "human" | "system" | null | undefined;
1045
+ status?: "active" | "paused" | "blocked" | "archived" | null | undefined;
1046
+ tags?: Array<string> | null | undefined;
1047
+ } | null | undefined;
1048
+ fields?: Array<string> | null | undefined;
1049
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsExportResponses, ContactsExportErrors, ThrowOnError>;
1050
+ /**
1051
+ * Get contact activity timeline
1052
+ *
1053
+ * Returns a paginated timeline of a contact's message activity, optionally filtered by channel.
1054
+ */
1055
+ static getActivityTimeline<ThrowOnError extends boolean = false>(parameters: {
1056
+ id: ContactId;
1057
+ page?: string | null | undefined;
1058
+ limit?: string | null | undefined;
1059
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
1060
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsGetActivityTimelineResponses, ContactsGetActivityTimelineErrors, ThrowOnError>;
1061
+ /**
1062
+ * List a contact's group memberships
1063
+ *
1064
+ * Returns the contact groups that a contact currently belongs to.
1065
+ */
1066
+ static getGroupMemberships<ThrowOnError extends boolean = false>(parameters: {
1067
+ id: ContactId;
1068
+ }, options?: Options<never, ThrowOnError>): RequestResult<ContactsGetGroupMembershipsResponses, ContactsGetGroupMembershipsErrors, ThrowOnError>;
1069
+ }
1070
+ export declare class Contacts2 {
1071
+ static contacts: typeof Contacts;
1072
+ }
1073
+ export declare class Templates {
1074
+ /**
1075
+ * List templates
1076
+ *
1077
+ * Returns a paginated list of the organization's templates, filterable by category, channel, status, and search, with configurable sorting.
1078
+ */
1079
+ static list<ThrowOnError extends boolean = false>(parameters?: {
1080
+ page?: string | null | undefined;
1081
+ limit?: string | null | undefined;
1082
+ category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | undefined;
1083
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
1084
+ status?: "draft" | "pending" | "approved" | "published" | "rejected" | "archived" | null | undefined;
1085
+ search?: string | null | undefined;
1086
+ sortBy?: "name" | "createdAt" | "updatedAt" | "usageCount" | "lastUsedAt" | null | undefined;
1087
+ sortOrder?: "asc" | "desc" | null | undefined;
1088
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesListResponses, TemplatesListErrors, ThrowOnError>;
1089
+ /**
1090
+ * Create a template
1091
+ *
1092
+ * Creates a template from SML source; the source's root tag determines the template's channel. Returns the created template with status 201.
1093
+ */
1094
+ static create<ThrowOnError extends boolean = false>(parameters: {
1095
+ name: string;
1096
+ slug?: string | null | undefined;
1097
+ origin?: "dashboard" | "tsx" | null | undefined;
1098
+ description?: string | null | null | undefined;
1099
+ category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | null | undefined;
1100
+ source: string;
1101
+ subject?: string | null | undefined;
1102
+ headers?: {
1103
+ [key: string]: string;
1104
+ } | null | null | undefined;
1105
+ variableSchema?: Array<TemplateVariable> | null | null | undefined;
1106
+ compliance?: TemplateCompliance | null | null | undefined;
1107
+ performance?: TemplatePerformance | null | null | undefined;
1108
+ designOverrides?: Design3 | null | null | undefined;
1109
+ isActive?: boolean | null | undefined;
1110
+ isDefault?: boolean | null | undefined;
1111
+ version?: number | null | undefined;
1112
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesCreateResponses, TemplatesCreateErrors, ThrowOnError>;
1113
+ static listDashboard<ThrowOnError extends boolean = false>(parameters: {
1114
+ page?: string | null | undefined;
1115
+ limit?: string | null | undefined;
1116
+ allowedChannels: "sms" | "whatsapp" | "email" | Array<"sms" | "whatsapp" | "email">;
1117
+ category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | undefined;
1118
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
1119
+ status?: "draft" | "pending" | "approved" | "published" | "rejected" | "archived" | null | undefined;
1120
+ search?: string | null | undefined;
1121
+ sortBy?: "name" | "createdAt" | "updatedAt" | "usageCount" | "lastUsedAt" | null | undefined;
1122
+ sortOrder?: "asc" | "desc" | null | undefined;
1123
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesListDashboardResponses, TemplatesListDashboardErrors, ThrowOnError>;
1124
+ static listFamilies<ThrowOnError extends boolean = false>(parameters?: {
1125
+ page?: string | null | undefined;
1126
+ limit?: string | null | undefined;
1127
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesListFamiliesResponses, TemplatesListFamiliesErrors, ThrowOnError>;
1128
+ static createFamily<ThrowOnError extends boolean = false>(parameters: {
1129
+ name: string;
1130
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesCreateFamilyResponses, TemplatesCreateFamilyErrors, ThrowOnError>;
1131
+ static deleteFamily<ThrowOnError extends boolean = false>(parameters: {
1132
+ familyId: TemplateFamilyId;
1133
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesDeleteFamilyResponses, TemplatesDeleteFamilyErrors, ThrowOnError>;
1134
+ static getFamily<ThrowOnError extends boolean = false>(parameters: {
1135
+ familyId: TemplateFamilyId;
1136
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesGetFamilyResponses, TemplatesGetFamilyErrors, ThrowOnError>;
1137
+ static renameFamily<ThrowOnError extends boolean = false>(parameters: {
1138
+ familyId: TemplateFamilyId;
1139
+ name: string;
1140
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesRenameFamilyResponses, TemplatesRenameFamilyErrors, ThrowOnError>;
1141
+ static createFamilyFromTemplate<ThrowOnError extends boolean = false>(parameters: {
1142
+ templateId: TemplateId;
1143
+ name: string;
1144
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesCreateFamilyFromTemplateResponses, TemplatesCreateFamilyFromTemplateErrors, ThrowOnError>;
1145
+ static detachFamilyMember<ThrowOnError extends boolean = false>(parameters: {
1146
+ familyId: TemplateFamilyId;
1147
+ templateId: TemplateId;
1148
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesDetachFamilyMemberResponses, TemplatesDetachFamilyMemberErrors, ThrowOnError>;
1149
+ static attachFamilyMember<ThrowOnError extends boolean = false>(parameters: {
1150
+ familyId: TemplateFamilyId;
1151
+ templateId: TemplateId;
1152
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesAttachFamilyMemberResponses, TemplatesAttachFamilyMemberErrors, ThrowOnError>;
1153
+ static addFamilyChannel<ThrowOnError extends boolean = false>(parameters: {
1154
+ familyId: TemplateFamilyId;
1155
+ channel: "sms" | "whatsapp" | "email";
1156
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesAddFamilyChannelResponses, TemplatesAddFamilyChannelErrors, ThrowOnError>;
1157
+ /**
1158
+ * Delete a template
1159
+ *
1160
+ * Deletes a template from the organization and returns a success flag.
1161
+ */
1162
+ static remove<ThrowOnError extends boolean = false>(parameters: {
1163
+ id: TemplateId;
1164
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesRemoveResponses, TemplatesRemoveErrors, ThrowOnError>;
1165
+ /**
1166
+ * Get a template
1167
+ *
1168
+ * Returns template metadata and compiled channel content. Read live SML through the template-document API.
1169
+ */
1170
+ static getById<ThrowOnError extends boolean = false>(parameters: {
1171
+ id: TemplateId;
1172
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesGetByIdResponses, TemplatesGetByIdErrors, ThrowOnError>;
1173
+ /**
1174
+ * Update a template
1175
+ *
1176
+ * Updates template metadata. Source changes use the template-document revision API.
1177
+ */
1178
+ static update<ThrowOnError extends boolean = false>(parameters: {
1179
+ id: TemplateId;
1180
+ data: {
1181
+ name?: string | null | undefined;
1182
+ slug?: string | null | undefined;
1183
+ origin?: "dashboard" | "tsx" | null | undefined;
1184
+ description?: string | null | null | undefined;
1185
+ category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | null | undefined;
1186
+ fromDefault?: TemplateFromDefault | null | null | undefined;
1187
+ replyToDefault?: Array<string> | null | null | undefined;
1188
+ variableSchema?: Array<TemplateVariable> | null | null | undefined;
1189
+ compliance?: TemplateCompliance | null | null | undefined;
1190
+ performance?: TemplatePerformance | null | null | undefined;
1191
+ designOverrides?: Design3 | null | null | undefined;
1192
+ isActive?: boolean | null | undefined;
1193
+ isDefault?: boolean | null | undefined;
1194
+ version?: number | null | undefined;
1195
+ };
1196
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesUpdateResponses, TemplatesUpdateErrors, ThrowOnError>;
1197
+ /**
1198
+ * Approve a template
1199
+ *
1200
+ * Records compliance approval for a template with optional notes and moves its status to approved unless it is already published or archived.
1201
+ */
1202
+ static approve<ThrowOnError extends boolean = false>(parameters: {
1203
+ id: TemplateId;
1204
+ data: {
1205
+ notes?: string | null | undefined;
1206
+ };
1207
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplatesApproveResponses, TemplatesApproveErrors, ThrowOnError>;
1208
+ }
1209
+ export declare class Templates2 {
1210
+ static templates: typeof Templates;
1211
+ }
1212
+ export declare class TemplateDocuments {
1213
+ static bootstrap<ThrowOnError extends boolean = false>(parameters: {
1214
+ templateId: TemplateId;
1215
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsBootstrapResponses, TemplateDocumentsBootstrapErrors, ThrowOnError>;
1216
+ static get<ThrowOnError extends boolean = false>(parameters: {
1217
+ templateId: TemplateId;
1218
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsGetResponses, TemplateDocumentsGetErrors, ThrowOnError>;
1219
+ static replace<ThrowOnError extends boolean = false>(parameters: {
1220
+ templateId: TemplateId;
1221
+ expectedRevision: string;
1222
+ source: string;
1223
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsReplaceResponses, TemplateDocumentsReplaceErrors, ThrowOnError>;
1224
+ static save<ThrowOnError extends boolean = false>(parameters: {
1225
+ templateId: TemplateId;
1226
+ revision: string;
1227
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsSaveResponses, TemplateDocumentsSaveErrors, ThrowOnError>;
1228
+ static render<ThrowOnError extends boolean = false>(parameters: {
1229
+ templateId: TemplateId;
1230
+ revision: string;
1231
+ variables?: {
1232
+ [key: string]: JsonValue;
1233
+ } | null | undefined;
1234
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsRenderResponses, TemplateDocumentsRenderErrors, ThrowOnError>;
1235
+ static spamCheck<ThrowOnError extends boolean = false>(parameters: {
1236
+ templateId: TemplateId;
1237
+ revision: string;
1238
+ variables?: {
1239
+ [key: string]: JsonValue;
1240
+ } | null | undefined;
1241
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsSpamCheckResponses, TemplateDocumentsSpamCheckErrors, ThrowOnError>;
1242
+ static testSend<ThrowOnError extends boolean = false>(parameters: {
1243
+ templateId: TemplateId;
1244
+ revision: string;
1245
+ to: string;
1246
+ variables?: {
1247
+ [key: string]: JsonValue;
1248
+ } | null | undefined;
1249
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsTestSendResponses, TemplateDocumentsTestSendErrors, ThrowOnError>;
1250
+ static send<ThrowOnError extends boolean = false>(parameters: {
1251
+ templateId: TemplateId;
1252
+ revision: string;
1253
+ to: Array<{
1254
+ address: string;
1255
+ name?: string | null | undefined;
1256
+ }>;
1257
+ variables?: {
1258
+ [key: string]: JsonValue;
1259
+ } | null | undefined;
1260
+ schedule?: string | null | null | undefined;
1261
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsSendResponses, TemplateDocumentsSendErrors, ThrowOnError>;
1262
+ static versions<ThrowOnError extends boolean = false>(parameters: {
1263
+ templateId: TemplateId;
1264
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsVersionsResponses, TemplateDocumentsVersionsErrors, ThrowOnError>;
1265
+ static publish<ThrowOnError extends boolean = false>(parameters: {
1266
+ templateId: TemplateId;
1267
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsPublishResponses, TemplateDocumentsPublishErrors, ThrowOnError>;
1268
+ static unpublish<ThrowOnError extends boolean = false>(parameters: {
1269
+ templateId: TemplateId;
1270
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsUnpublishResponses, TemplateDocumentsUnpublishErrors, ThrowOnError>;
1271
+ static restore<ThrowOnError extends boolean = false>(parameters: {
1272
+ templateId: TemplateId;
1273
+ versionId: TemplateSourceVersionId;
1274
+ expectedRevision: string;
1275
+ }, options?: Options<never, ThrowOnError>): RequestResult<TemplateDocumentsRestoreResponses, TemplateDocumentsRestoreErrors, ThrowOnError>;
1276
+ }
1277
+ export declare class TemplateDocuments2 {
1278
+ static templateDocuments: typeof TemplateDocuments;
1279
+ }
1280
+ export declare class Design {
1281
+ /**
1282
+ * Get the organization design
1283
+ *
1284
+ * Returns the organization's configured email design kit (theme, assets, footer), or null when none is set.
1285
+ */
1286
+ static get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<DesignGetResponses, DesignGetErrors, ThrowOnError>;
1287
+ /**
1288
+ * Update the organization design
1289
+ *
1290
+ * Validates and saves the organization's email design kit; a null body clears the design back to the base design floor.
1291
+ */
1292
+ static update<ThrowOnError extends boolean = false>(parameters: {
1293
+ design: Design3 | null;
1294
+ }, options?: Options<never, ThrowOnError>): RequestResult<DesignUpdateResponses, DesignUpdateErrors, ThrowOnError>;
1295
+ }
1296
+ export declare class Design2 {
1297
+ static design: typeof Design;
1298
+ }
1299
+ export declare class Webhooks {
1300
+ /**
1301
+ * List webhooks
1302
+ *
1303
+ * Returns a paginated list of the organization's webhook endpoints, optionally filtered by a name search.
1304
+ */
1305
+ static list<ThrowOnError extends boolean = false>(parameters?: {
1306
+ page?: string | null | undefined;
1307
+ limit?: string | null | undefined;
1308
+ search?: string | null | undefined;
1309
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksListResponses, WebhooksListErrors, ThrowOnError>;
1310
+ /**
1311
+ * Create a webhook
1312
+ *
1313
+ * Creates a webhook endpoint subscribed to the given event types and returns it with a 201 response.
1314
+ */
1315
+ static create<ThrowOnError extends boolean = false>(parameters: {
1316
+ name: string;
1317
+ url: string;
1318
+ eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated">;
1319
+ channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
1320
+ headers?: {
1321
+ [key: string]: string;
1322
+ } | null | undefined;
1323
+ status?: "active" | "disabled" | null | undefined;
1324
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksCreateResponses, WebhooksCreateErrors, ThrowOnError>;
1325
+ /**
1326
+ * Delete a webhook
1327
+ *
1328
+ * Deletes a webhook endpoint so it no longer receives event deliveries.
1329
+ */
1330
+ static remove<ThrowOnError extends boolean = false>(parameters: {
1331
+ id: WebhookEndpointId;
1332
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksRemoveResponses, WebhooksRemoveErrors, ThrowOnError>;
1333
+ /**
1334
+ * Get a webhook
1335
+ *
1336
+ * Returns the configuration of the webhook endpoint with the given ID.
1337
+ */
1338
+ static get<ThrowOnError extends boolean = false>(parameters: {
1339
+ id: WebhookEndpointId;
1340
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksGetResponses, WebhooksGetErrors, ThrowOnError>;
1341
+ /**
1342
+ * Update a webhook
1343
+ *
1344
+ * Updates a webhook's name, URL, subscribed events, channels, custom headers, or status and returns the updated endpoint.
1345
+ */
1346
+ static update<ThrowOnError extends boolean = false>(parameters: {
1347
+ id: WebhookEndpointId;
1348
+ name?: string | null | undefined;
1349
+ url?: string | null | undefined;
1350
+ eventTypes?: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "contact.created" | "contact.updated" | "contact.deleted" | "conversation.started" | "conversation.ended" | "conversation.created" | "conversation.updated" | "conversation.archived" | "template.created" | "template.updated" | "template.deleted" | "template.approved" | "template.rejected" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated"> | null | undefined;
1351
+ channels?: Array<"sms" | "whatsapp" | "email"> | null | null | undefined;
1352
+ headers?: {
1353
+ [key: string]: string;
1354
+ } | null | undefined;
1355
+ status?: "active" | "disabled" | null | undefined;
1356
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksUpdateResponses, WebhooksUpdateErrors, ThrowOnError>;
1357
+ /**
1358
+ * Send a test webhook delivery
1359
+ *
1360
+ * Queues a signed webhook.test event through the normal delivery and retry lifecycle.
1361
+ */
1362
+ static test<ThrowOnError extends boolean = false>(parameters: {
1363
+ id: WebhookEndpointId;
1364
+ data?: {
1365
+ [key: string]: JsonValue;
1366
+ } | null | undefined;
1367
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksTestResponses, WebhooksTestErrors, ThrowOnError>;
1368
+ /**
1369
+ * List webhook delivery logs
1370
+ *
1371
+ * Returns recent deliveries and their nested attempt diagnostics for a webhook endpoint.
1372
+ */
1373
+ static getLogs<ThrowOnError extends boolean = false>(parameters: {
1374
+ webhookId: WebhookEndpointId;
1375
+ limit?: string | null | undefined;
1376
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksGetLogsResponses, WebhooksGetLogsErrors, ThrowOnError>;
1377
+ /**
1378
+ * Get webhook delivery statistics
1379
+ *
1380
+ * Returns aggregate pending, delivered, exhausted, and cancelled delivery counts for a webhook endpoint.
1381
+ */
1382
+ static getStats<ThrowOnError extends boolean = false>(parameters: {
1383
+ webhookId: WebhookEndpointId;
1384
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksGetStatsResponses, WebhooksGetStatsErrors, ThrowOnError>;
1385
+ /**
1386
+ * Retry a webhook delivery
1387
+ *
1388
+ * Performs one immediate manual redelivery attempt and returns that attempt's identity and outcome without changing the automatic retry lifecycle.
1389
+ */
1390
+ static retryDelivery<ThrowOnError extends boolean = false>(parameters: {
1391
+ webhookId: WebhookEndpointId;
1392
+ deliveryId: WebhookDeliveryId;
1393
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksRetryDeliveryResponses, WebhooksRetryDeliveryErrors, ThrowOnError>;
1394
+ /**
1395
+ * Rotate a webhook signing secret
1396
+ *
1397
+ * Generates and returns a new signing secret. The previous secret remains valid for a 24-hour rotation overlap.
1398
+ */
1399
+ static regenerateSecret<ThrowOnError extends boolean = false>(parameters: {
1400
+ webhookId: WebhookEndpointId;
1401
+ }, options?: Options<never, ThrowOnError>): RequestResult<WebhooksRegenerateSecretResponses, WebhooksRegenerateSecretErrors, ThrowOnError>;
1402
+ }
1403
+ export declare class Webhooks2 {
1404
+ static webhooks: typeof Webhooks;
1405
+ }
1406
+ export declare class Organizations {
1407
+ /**
1408
+ * Create a workspace
1409
+ *
1410
+ * Creates a new workspace organization under the current billing account and returns it.
1411
+ */
1412
+ static create<ThrowOnError extends boolean = false>(parameters: {
1413
+ name: string;
1414
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsCreateResponses, OrganizationsCreateErrors, ThrowOnError>;
1415
+ /**
1416
+ * Get the current organization
1417
+ *
1418
+ * Returns the organization for the current billing account.
1419
+ */
1420
+ static get<ThrowOnError extends boolean = false>(options?: Options<never, ThrowOnError>): RequestResult<OrganizationsGetResponses, OrganizationsGetErrors, ThrowOnError>;
1421
+ /**
1422
+ * Update the current organization
1423
+ *
1424
+ * Updates the current organization's profile, billing, locale, design, default reply-to, and default unsubscribe-group fields and returns the saved organization.
1425
+ */
1426
+ static update<ThrowOnError extends boolean = false>(parameters?: {
1427
+ name?: string | null | undefined;
1428
+ slug?: string | null | undefined;
1429
+ billingEmail?: string | null | undefined;
1430
+ countryCode?: string | null | undefined;
1431
+ currency?: string | null | undefined;
1432
+ timezone?: string | null | undefined;
1433
+ isActive?: boolean | null | undefined;
1434
+ metadata?: {
1435
+ [key: string]: JsonValue;
1436
+ } | null | undefined;
1437
+ design?: Design3 | null | null | undefined;
1438
+ replyToDefault?: Array<string> | null | null | undefined;
1439
+ defaultUnsubscribeGroupId?: UnsubscribeId | null | null | undefined;
1440
+ emailFooterEnabledDefault?: boolean | null | null | undefined;
1441
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsUpdateResponses, OrganizationsUpdateErrors, ThrowOnError>;
1442
+ /**
1443
+ * Get organization usage
1444
+ *
1445
+ * Returns usage statistics for the current organization over the selected reporting period.
1446
+ */
1447
+ static getUsage<ThrowOnError extends boolean = false>(parameters?: {
1448
+ period?: "current" | "last_30_days" | "last_90_days" | "last_year" | null | undefined;
1449
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsGetUsageResponses, OrganizationsGetUsageErrors, ThrowOnError>;
1450
+ /**
1451
+ * Delete the current workspace
1452
+ *
1453
+ * Accepts owner-authorized durable workspace deletion. Repeating the same request with the same Idempotency-Key returns the existing organization-scoped operation.
1454
+ */
1455
+ static delete<ThrowOnError extends boolean = false>(parameters: {
1456
+ "idempotency-key": string;
1457
+ confirmationName: string;
1458
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsDeleteResponses, OrganizationsDeleteErrors, ThrowOnError>;
1459
+ /**
1460
+ * Create the first workspace
1461
+ *
1462
+ * Creates a replacement first workspace under the signed-in user's billing account when no workspace membership remains.
1463
+ */
1464
+ static bootstrap<ThrowOnError extends boolean = false>(parameters: {
1465
+ name: string;
1466
+ }, options?: Options<never, ThrowOnError>): RequestResult<OrganizationsBootstrapResponses, OrganizationsBootstrapErrors, ThrowOnError>;
1467
+ }
1468
+ export declare class Organizations2 {
1469
+ static organizations: typeof Organizations;
1470
+ }
1471
+ export declare class ApiKeys {
1472
+ /**
1473
+ * List API keys
1474
+ *
1475
+ * Returns a paginated list of the organization's API keys, filterable by status and search term.
1476
+ */
1477
+ static list<ThrowOnError extends boolean = false>(parameters?: {
1478
+ page?: string | null | undefined;
1479
+ limit?: string | null | undefined;
1480
+ status?: "active" | "revoked" | null | undefined;
1481
+ search?: string | null | undefined;
1482
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysListResponses, ApiKeysListErrors, ThrowOnError>;
1483
+ /**
1484
+ * Create an API key
1485
+ *
1486
+ * Creates a new API key for the organization and returns the created key, including the plaintext secret, with a 201 response.
1487
+ */
1488
+ static create<ThrowOnError extends boolean = false>(parameters: {
1489
+ name: string;
1490
+ description?: string | null | undefined;
1491
+ expiresAt?: string | null | undefined;
1492
+ permissions?: ApiKeyPermissions | undefined;
1493
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysCreateResponses, ApiKeysCreateErrors, ThrowOnError>;
1494
+ /**
1495
+ * Revoke an API key
1496
+ *
1497
+ * Deactivates an API key so it can no longer authenticate requests. The key record is retained and remains listable.
1498
+ */
1499
+ static revoke<ThrowOnError extends boolean = false>(parameters: {
1500
+ id: ApiKeyId;
1501
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysRevokeResponses, ApiKeysRevokeErrors, ThrowOnError>;
1502
+ /**
1503
+ * Get an API key
1504
+ *
1505
+ * Returns the API key with the given ID, including its metadata and permissions.
1506
+ */
1507
+ static get<ThrowOnError extends boolean = false>(parameters: {
1508
+ id: ApiKeyId;
1509
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysGetResponses, ApiKeysGetErrors, ThrowOnError>;
1510
+ /**
1511
+ * Update an API key
1512
+ *
1513
+ * Updates the name or description of an API key and returns the updated key.
1514
+ */
1515
+ static update<ThrowOnError extends boolean = false>(parameters: {
1516
+ id: ApiKeyId;
1517
+ name?: string | null | undefined;
1518
+ description?: string | null | undefined;
1519
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysUpdateResponses, ApiKeysUpdateErrors, ThrowOnError>;
1520
+ /**
1521
+ * Rotate an API key
1522
+ *
1523
+ * Deactivates the existing key and issues a replacement with the same name and permissions. Returns the new key, including the plaintext secret.
1524
+ */
1525
+ static rotate<ThrowOnError extends boolean = false>(parameters: {
1526
+ id: ApiKeyId;
1527
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysRotateResponses, ApiKeysRotateErrors, ThrowOnError>;
1528
+ /**
1529
+ * Delete an API key
1530
+ *
1531
+ * Permanently deletes an API key record. Unlike revocation, the key row is removed rather than deactivated.
1532
+ */
1533
+ static remove<ThrowOnError extends boolean = false>(parameters: {
1534
+ id: ApiKeyId;
1535
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysRemoveResponses, ApiKeysRemoveErrors, ThrowOnError>;
1536
+ /**
1537
+ * Get API key send statistics
1538
+ *
1539
+ * Returns aggregate send counts and daily volume attributed to an API key over the selected period of 7, 30, or 90 days.
1540
+ */
1541
+ static getStats<ThrowOnError extends boolean = false>(parameters: {
1542
+ id: ApiKeyId;
1543
+ period?: "7d" | "30d" | "90d" | null | undefined;
1544
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysGetStatsResponses, ApiKeysGetStatsErrors, ThrowOnError>;
1545
+ /**
1546
+ * List API key activity
1547
+ *
1548
+ * Returns a paginated list of recent request activity recorded for an API key.
1549
+ */
1550
+ static getActivity<ThrowOnError extends boolean = false>(parameters: {
1551
+ id: ApiKeyId;
1552
+ page?: string | null | undefined;
1553
+ limit?: string | null | undefined;
1554
+ }, options?: Options<never, ThrowOnError>): RequestResult<ApiKeysGetActivityResponses, ApiKeysGetActivityErrors, ThrowOnError>;
1555
+ }
1556
+ export declare class ApiKeys2 {
1557
+ static apiKeys: typeof ApiKeys;
1558
+ }