@sendmux/management 0.0.0-bootstrap.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 (53) hide show
  1. package/README.md +26 -0
  2. package/dist/generated/client/client.gen.d.ts +3 -0
  3. package/dist/generated/client/client.gen.d.ts.map +1 -0
  4. package/dist/generated/client/client.gen.js +216 -0
  5. package/dist/generated/client/index.d.ts +9 -0
  6. package/dist/generated/client/index.d.ts.map +1 -0
  7. package/dist/generated/client/index.js +6 -0
  8. package/dist/generated/client/types.gen.d.ts +121 -0
  9. package/dist/generated/client/types.gen.d.ts.map +1 -0
  10. package/dist/generated/client/types.gen.js +2 -0
  11. package/dist/generated/client/utils.gen.d.ts +38 -0
  12. package/dist/generated/client/utils.gen.d.ts.map +1 -0
  13. package/dist/generated/client/utils.gen.js +228 -0
  14. package/dist/generated/client.gen.d.ts +13 -0
  15. package/dist/generated/client.gen.d.ts.map +1 -0
  16. package/dist/generated/client.gen.js +3 -0
  17. package/dist/generated/core/auth.gen.d.ts +19 -0
  18. package/dist/generated/core/auth.gen.d.ts.map +1 -0
  19. package/dist/generated/core/auth.gen.js +14 -0
  20. package/dist/generated/core/bodySerializer.gen.d.ts +26 -0
  21. package/dist/generated/core/bodySerializer.gen.d.ts.map +1 -0
  22. package/dist/generated/core/bodySerializer.gen.js +57 -0
  23. package/dist/generated/core/params.gen.d.ts +44 -0
  24. package/dist/generated/core/params.gen.d.ts.map +1 -0
  25. package/dist/generated/core/params.gen.js +100 -0
  26. package/dist/generated/core/pathSerializer.gen.d.ts +34 -0
  27. package/dist/generated/core/pathSerializer.gen.d.ts.map +1 -0
  28. package/dist/generated/core/pathSerializer.gen.js +106 -0
  29. package/dist/generated/core/queryKeySerializer.gen.d.ts +19 -0
  30. package/dist/generated/core/queryKeySerializer.gen.d.ts.map +1 -0
  31. package/dist/generated/core/queryKeySerializer.gen.js +92 -0
  32. package/dist/generated/core/serverSentEvents.gen.d.ts +72 -0
  33. package/dist/generated/core/serverSentEvents.gen.d.ts.map +1 -0
  34. package/dist/generated/core/serverSentEvents.gen.js +132 -0
  35. package/dist/generated/core/types.gen.d.ts +79 -0
  36. package/dist/generated/core/types.gen.d.ts.map +1 -0
  37. package/dist/generated/core/types.gen.js +2 -0
  38. package/dist/generated/core/utils.gen.d.ts +20 -0
  39. package/dist/generated/core/utils.gen.d.ts.map +1 -0
  40. package/dist/generated/core/utils.gen.js +87 -0
  41. package/dist/generated/index.d.ts +3 -0
  42. package/dist/generated/index.d.ts.map +1 -0
  43. package/dist/generated/index.js +2 -0
  44. package/dist/generated/sdk.gen.d.ts +340 -0
  45. package/dist/generated/sdk.gen.d.ts.map +1 -0
  46. package/dist/generated/sdk.gen.js +566 -0
  47. package/dist/generated/types.gen.d.ts +2927 -0
  48. package/dist/generated/types.gen.d.ts.map +1 -0
  49. package/dist/generated/types.gen.js +2 -0
  50. package/dist/index.d.ts +7 -0
  51. package/dist/index.d.ts.map +1 -0
  52. package/dist/index.js +9 -0
  53. package/package.json +27 -0
@@ -0,0 +1,566 @@
1
+ // This file is auto-generated by @hey-api/openapi-ts
2
+ import { client } from './client.gen.js';
3
+ /**
4
+ * Get current balance
5
+ *
6
+ * Returns the current team balance and auto top-up configuration.
7
+ */
8
+ export const managementListBalance = (options) => (options?.client ?? client).get({
9
+ security: [{ scheme: 'bearer', type: 'http' }],
10
+ url: '/billing/balance',
11
+ ...options
12
+ });
13
+ /**
14
+ * Get spend summary
15
+ *
16
+ * Returns a spend summary over a configurable lookback period.
17
+ */
18
+ export const managementGetSpendSummary = (options) => (options?.client ?? client).get({
19
+ security: [{ scheme: 'bearer', type: 'http' }],
20
+ url: '/billing/summary',
21
+ ...options
22
+ });
23
+ /**
24
+ * List transactions
25
+ *
26
+ * Returns paginated credit transaction history with optional type filter. Uses cursor-based pagination ordered by created_at descending — pass `cursor=<next_cursor>` from the previous response to fetch the next page.
27
+ */
28
+ export const managementListTransactions = (options) => (options?.client ?? client).get({
29
+ security: [{ scheme: 'bearer', type: 'http' }],
30
+ url: '/billing/transactions',
31
+ ...options
32
+ });
33
+ /**
34
+ * List mailbox domains
35
+ *
36
+ * Returns a cursor-paginated list of sending domains configured for the team, ordered by `created_at` descending. Each entry includes the DNS records the customer must place, the current verification status, and the SES DKIM state. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
37
+ */
38
+ export const managementListDomains = (options) => (options?.client ?? client).get({
39
+ security: [{ scheme: 'bearer', type: 'http' }],
40
+ url: '/domains',
41
+ ...options
42
+ });
43
+ /**
44
+ * Add a mailbox domain
45
+ *
46
+ * Creates a new sending domain and returns the DNS records the customer must place before verification can succeed. Provisioning touches both our mail platform and Amazon SES — on any failure the partial state is automatically rolled back.
47
+ *
48
+ * Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
49
+ */
50
+ export const managementCreateDomain = (options) => (options?.client ?? client).post({
51
+ security: [{ scheme: 'bearer', type: 'http' }],
52
+ url: '/domains',
53
+ ...options,
54
+ headers: {
55
+ 'Content-Type': 'application/json',
56
+ ...options?.headers
57
+ }
58
+ });
59
+ /**
60
+ * Delete a mailbox domain
61
+ *
62
+ * Removes a domain from our mail platform, Amazon SES, and Sendmux. Blocked if any active mailbox still uses the domain — delete those mailboxes first.
63
+ */
64
+ export const managementDeleteDomain = (options) => (options.client ?? client).delete({
65
+ security: [{ scheme: 'bearer', type: 'http' }],
66
+ url: '/domains/{public_id}',
67
+ ...options
68
+ });
69
+ /**
70
+ * Get a mailbox domain
71
+ *
72
+ * Returns a single domain including its DNS records and latest verification state. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed.
73
+ */
74
+ export const managementGetDomain = (options) => (options.client ?? client).get({
75
+ security: [{ scheme: 'bearer', type: 'http' }],
76
+ url: '/domains/{public_id}',
77
+ ...options
78
+ });
79
+ /**
80
+ * Get domain-wide sender filters
81
+ *
82
+ * Returns the current sender-filter mode and rule set applied to every mailbox under this domain. Per-mailbox rules take precedence at match time.
83
+ *
84
+ * Responses carry a weak `ETag` — send it as `If-None-Match` to skip the body when the filter set has not changed (returns `304 Not Modified`). The same ETag is the value to use in `If-Match` on the corresponding PUT for optimistic concurrency.
85
+ */
86
+ export const managementGetDomainFilters = (options) => (options.client ?? client).get({
87
+ security: [{ scheme: 'bearer', type: 'http' }],
88
+ url: '/domains/{public_id}/filters',
89
+ ...options
90
+ });
91
+ /**
92
+ * Replace domain-wide sender filters
93
+ *
94
+ * Atomically replaces the sender-filter mode and rule set for an entire domain. Applies to every mailbox under the domain unless that mailbox has its own per-mailbox rules (which take precedence). Maximum 1000 rules per request.
95
+ *
96
+ * For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
97
+ */
98
+ export const managementSetDomainFilters = (options) => (options.client ?? client).put({
99
+ security: [{ scheme: 'bearer', type: 'http' }],
100
+ url: '/domains/{public_id}/filters',
101
+ ...options,
102
+ headers: {
103
+ 'Content-Type': 'application/json',
104
+ ...options.headers
105
+ }
106
+ });
107
+ /**
108
+ * Verify a mailbox domain
109
+ *
110
+ * Runs an immediate DNS-over-HTTPS check of the domain's MX, SPF, DMARC and ownership TXT records, then asks SES for the latest DKIM status. If every check passes the domain is marked verified. Domains automatically re-verify every 6 hours — this endpoint is only needed to trigger a check on demand.
111
+ */
112
+ export const managementVerifyDomain = (options) => (options.client ?? client).post({
113
+ security: [{ scheme: 'bearer', type: 'http' }],
114
+ url: '/domains/{public_id}/verify',
115
+ ...options
116
+ });
117
+ /**
118
+ * Download a domain as a zone file
119
+ *
120
+ * Returns the domain's DNS records formatted as a BIND-style zone file fragment. Suitable for direct paste into a DNS provider that accepts zone-file imports.
121
+ */
122
+ export const managementGetDomainZoneFile = (options) => (options.client ?? client).get({
123
+ security: [{ scheme: 'bearer', type: 'http' }],
124
+ url: '/domains/{public_id}/zone-file',
125
+ ...options
126
+ });
127
+ /**
128
+ * List delivery logs
129
+ *
130
+ * Returns paginated delivery logs with cursor-based pagination and filters.
131
+ */
132
+ export const managementListEmailLogs = (options) => (options?.client ?? client).get({
133
+ security: [{ scheme: 'bearer', type: 'http' }],
134
+ url: '/emails/logs',
135
+ ...options
136
+ });
137
+ /**
138
+ * Get delivery log
139
+ *
140
+ * Returns a single delivery log by its public ID. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the log has not changed. Logs in a terminal status (sent/failed/rejected) stop changing, so 304 replay is a real bandwidth win on repeated polls.
141
+ */
142
+ export const managementGetEmailLog = (options) => (options.client ?? client).get({
143
+ security: [{ scheme: 'bearer', type: 'http' }],
144
+ url: '/emails/logs/{public_id}',
145
+ ...options
146
+ });
147
+ /**
148
+ * Get email metrics
149
+ *
150
+ * Returns aggregated email delivery counts with flexible time windowing and comparison period.
151
+ */
152
+ export const managementGetEmailMetrics = (options) => (options?.client ?? client).get({
153
+ security: [{ scheme: 'bearer', type: 'http' }],
154
+ url: '/emails/metrics',
155
+ ...options
156
+ });
157
+ /**
158
+ * List incoming logs
159
+ *
160
+ * Returns paginated incoming message logs for billing accountability.
161
+ */
162
+ export const managementListInboxLogs = (options) => (options?.client ?? client).get({
163
+ security: [{ scheme: 'bearer', type: 'http' }],
164
+ url: '/inboxes/logs',
165
+ ...options
166
+ });
167
+ /**
168
+ * Get incoming log
169
+ *
170
+ * Returns one incoming message log by public ID.
171
+ */
172
+ export const managementGetInboxLog = (options) => (options.client ?? client).get({
173
+ security: [{ scheme: 'bearer', type: 'http' }],
174
+ url: '/inboxes/logs/{public_id}',
175
+ ...options
176
+ });
177
+ /**
178
+ * List mailboxes
179
+ *
180
+ * Returns a cursor-paginated list of mailboxes configured for the team, ordered by `created_at` descending. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
181
+ */
182
+ export const managementListMailboxes = (options) => (options?.client ?? client).get({
183
+ security: [{ scheme: 'bearer', type: 'http' }],
184
+ url: '/mailboxes',
185
+ ...options
186
+ });
187
+ /**
188
+ * Create a mailbox
189
+ *
190
+ * Provisions a new mailbox plus an initial bearer token and matching IMAP/SMTP mailbox password. The domain portion of the email must already be verified via POST /domains. If supplied, `quota_bytes` must be one of the current storage tiers: 1073741824 (1 GB), 5368709120 (5 GB), or 53687091200 (50 GB). Creation provisions resources on our mail platform and, for `@myagent.mx` addresses, on Amazon SES — any failure rolls the partial state back automatically.
191
+ *
192
+ * Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
193
+ */
194
+ export const managementCreateMailbox = (options) => (options?.client ?? client).post({
195
+ security: [{ scheme: 'bearer', type: 'http' }],
196
+ url: '/mailboxes',
197
+ ...options,
198
+ headers: {
199
+ 'Content-Type': 'application/json',
200
+ ...options?.headers
201
+ }
202
+ });
203
+ /**
204
+ * Delete a mailbox
205
+ *
206
+ * Removes a mailbox from our mail platform, Amazon SES (for `@myagent.mx` addresses), and Sendmux. All associated API keys are revoked.
207
+ */
208
+ export const managementDeleteMailbox = (options) => (options.client ?? client).delete({
209
+ security: [{ scheme: 'bearer', type: 'http' }],
210
+ url: '/mailboxes/{public_id}',
211
+ ...options
212
+ });
213
+ /**
214
+ * Get a mailbox
215
+ *
216
+ * Returns a single mailbox, tenant-scoped to the caller's team. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed. The same ETag is the value to use in `If-Match` on PATCH for optimistic concurrency.
217
+ */
218
+ export const managementGetMailbox = (options) => (options.client ?? client).get({
219
+ security: [{ scheme: 'bearer', type: 'http' }],
220
+ url: '/mailboxes/{public_id}',
221
+ ...options
222
+ });
223
+ /**
224
+ * Update a mailbox
225
+ *
226
+ * Updates any combination of display_name, quota_bytes, and send_scope on a mailbox. The display_name and send_scope changes land in a single transaction; quota_bytes is applied afterwards because it also updates external state on our mail platform. Quota can only be set to 1073741824 (1 GB), 5368709120 (5 GB), or 53687091200 (50 GB), and cannot be shrunk below the mailbox's current usage.
227
+ *
228
+ * For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
229
+ */
230
+ export const managementUpdateMailbox = (options) => (options.client ?? client).patch({
231
+ security: [{ scheme: 'bearer', type: 'http' }],
232
+ url: '/mailboxes/{public_id}',
233
+ ...options,
234
+ headers: {
235
+ 'Content-Type': 'application/json',
236
+ ...options.headers
237
+ }
238
+ });
239
+ /**
240
+ * Get mailbox sender filters
241
+ *
242
+ * Returns the current sender-filter mode and rule set for a mailbox. Mailbox-scoped rules override any domain-wide rules set on the parent domain.
243
+ *
244
+ * Responses carry a weak `ETag` — send it as `If-None-Match` to skip the body when the filter set has not changed (returns `304 Not Modified`). The same ETag is the value to use in `If-Match` on the corresponding PUT for optimistic concurrency.
245
+ */
246
+ export const managementGetMailboxFilters = (options) => (options.client ?? client).get({
247
+ security: [{ scheme: 'bearer', type: 'http' }],
248
+ url: '/mailboxes/{public_id}/filters',
249
+ ...options
250
+ });
251
+ /**
252
+ * Replace mailbox sender filters
253
+ *
254
+ * Atomically replaces the sender-filter mode and rule set for a mailbox. The entire rule set is swapped in a single operation — there is no intermediate state where the mailbox has a partial ruleset. A maximum of 1000 rules per request is enforced.
255
+ *
256
+ * For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
257
+ */
258
+ export const managementSetMailboxFilters = (options) => (options.client ?? client).put({
259
+ security: [{ scheme: 'bearer', type: 'http' }],
260
+ url: '/mailboxes/{public_id}/filters',
261
+ ...options,
262
+ headers: {
263
+ 'Content-Type': 'application/json',
264
+ ...options.headers
265
+ }
266
+ });
267
+ /**
268
+ * Create a mailbox API key
269
+ *
270
+ * Mints an additional bearer token plus IMAP/SMTP mailbox password for an existing mailbox. The plaintext key and password are shown exactly once — store them immediately.
271
+ *
272
+ * Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
273
+ */
274
+ export const managementCreateMailboxKey = (options) => (options.client ?? client).post({
275
+ security: [{ scheme: 'bearer', type: 'http' }],
276
+ url: '/mailboxes/{public_id}/keys',
277
+ ...options,
278
+ headers: {
279
+ 'Content-Type': 'application/json',
280
+ ...options.headers
281
+ }
282
+ });
283
+ /**
284
+ * Revoke a mailbox API key
285
+ *
286
+ * Revokes a specific bearer token + matching mailbox password. Idempotent on already-revoked keys.
287
+ */
288
+ export const managementDeleteMailboxKey = (options) => (options.client ?? client).delete({
289
+ security: [{ scheme: 'bearer', type: 'http' }],
290
+ url: '/mailboxes/{public_id}/keys/{key_id}',
291
+ ...options
292
+ });
293
+ /**
294
+ * Resume a mailbox
295
+ *
296
+ * Restores a suspended mailbox so it can authenticate, receive mail, and send from the mailbox address again. The operation is idempotent and accepts `Idempotency-Key` for safe retries.
297
+ */
298
+ export const managementResumeMailbox = (options) => (options.client ?? client).post({
299
+ security: [{ scheme: 'bearer', type: 'http' }],
300
+ url: '/mailboxes/{public_id}/resume',
301
+ ...options
302
+ });
303
+ /**
304
+ * Suspend a mailbox
305
+ *
306
+ * Suspends a mailbox without deleting messages, credentials, or settings. Suspended mailboxes cannot receive mail, authenticate to mailbox protocols, or send from the mailbox address. The operation is idempotent and accepts `Idempotency-Key` for safe retries.
307
+ */
308
+ export const managementSuspendMailbox = (options) => (options.client ?? client).post({
309
+ security: [{ scheme: 'bearer', type: 'http' }],
310
+ url: '/mailboxes/{public_id}/suspend',
311
+ ...options
312
+ });
313
+ /**
314
+ * List sending accounts
315
+ *
316
+ * Returns a cursor-paginated list of sending accounts. Credentials are never returned. The shared Amazon SES account is included and marked with `is_shared: true`.
317
+ */
318
+ export const managementListProviders = (options) => (options?.client ?? client).get({
319
+ security: [{ scheme: 'bearer', type: 'http' }],
320
+ url: '/providers',
321
+ ...options
322
+ });
323
+ /**
324
+ * Create an SMTP sending account
325
+ *
326
+ * Creates a custom SMTP sending account. Supply an `Idempotency-Key` header to safely retry on network errors. The SMTP password is stored securely and is never returned.
327
+ */
328
+ export const managementCreateProvider = (options) => (options?.client ?? client).post({
329
+ security: [{ scheme: 'bearer', type: 'http' }],
330
+ url: '/providers',
331
+ ...options,
332
+ headers: {
333
+ 'Content-Type': 'application/json',
334
+ ...options?.headers
335
+ }
336
+ });
337
+ /**
338
+ * Delete a sending account
339
+ *
340
+ * Deletes a custom or connected sending account. The shared Amazon SES account cannot be deleted.
341
+ */
342
+ export const managementDeleteProvider = (options) => (options.client ?? client).delete({
343
+ security: [{ scheme: 'bearer', type: 'http' }],
344
+ url: '/providers/{public_id}',
345
+ ...options
346
+ });
347
+ /**
348
+ * Get a sending account
349
+ *
350
+ * Returns one sending account. Responses include an ETag for conditional GET and optimistic PATCH.
351
+ */
352
+ export const managementGetProvider = (options) => (options.client ?? client).get({
353
+ security: [{ scheme: 'bearer', type: 'http' }],
354
+ url: '/providers/{public_id}',
355
+ ...options
356
+ });
357
+ /**
358
+ * Update a sending account
359
+ *
360
+ * Updates a custom sending account. The shared Amazon SES account cannot be edited here; use activate/deactivate and the limit-request endpoint for the allowed shared-account actions.
361
+ */
362
+ export const managementUpdateProvider = (options) => (options.client ?? client).patch({
363
+ security: [{ scheme: 'bearer', type: 'http' }],
364
+ url: '/providers/{public_id}',
365
+ ...options,
366
+ headers: {
367
+ 'Content-Type': 'application/json',
368
+ ...options.headers
369
+ }
370
+ });
371
+ /**
372
+ * Activate a sending account
373
+ *
374
+ * Enables a sending account. OAuth accounts without an active connection are moved to pending until reconnected in the dashboard. The shared Amazon SES account can be activated.
375
+ */
376
+ export const managementActivateProvider = (options) => (options.client ?? client).post({
377
+ security: [{ scheme: 'bearer', type: 'http' }],
378
+ url: '/providers/{public_id}/activate',
379
+ ...options
380
+ });
381
+ /**
382
+ * Deactivate a sending account
383
+ *
384
+ * Disables a sending account. The shared Amazon SES account can be deactivated.
385
+ */
386
+ export const managementDeactivateProvider = (options) => (options.client ?? client).post({
387
+ security: [{ scheme: 'bearer', type: 'http' }],
388
+ url: '/providers/{public_id}/deactivate',
389
+ ...options
390
+ });
391
+ /**
392
+ * Test an SMTP sending account
393
+ *
394
+ * Runs a connection test for a custom SMTP account. The shared Amazon SES account and OAuth accounts cannot be tested through this endpoint.
395
+ */
396
+ export const managementTestProvider = (options) => (options.client ?? client).post({
397
+ security: [{ scheme: 'bearer', type: 'http' }],
398
+ url: '/providers/{public_id}/test',
399
+ ...options
400
+ });
401
+ /**
402
+ * Get sending account limits
403
+ *
404
+ * Returns custom-account capacity and shared Amazon SES daily sending limit state.
405
+ */
406
+ export const managementGetProviderLimits = (options) => (options?.client ?? client).get({
407
+ security: [{ scheme: 'bearer', type: 'http' }],
408
+ url: '/providers/limits',
409
+ ...options
410
+ });
411
+ /**
412
+ * Request a sending account limit increase
413
+ *
414
+ * Creates a request to increase the number of custom or connected sending accounts allowed for the team.
415
+ */
416
+ export const managementRequestSendingAccountLimitIncrease = (options) => (options?.client ?? client).post({
417
+ security: [{ scheme: 'bearer', type: 'http' }],
418
+ url: '/providers/limits/sending-accounts/request-increase',
419
+ ...options
420
+ });
421
+ /**
422
+ * Get shared Amazon SES limit request state
423
+ *
424
+ * Returns the shared Amazon SES daily limit state and any pending increase request.
425
+ */
426
+ export const managementGetSharedAmazonSesLimitRequest = (options) => (options?.client ?? client).get({
427
+ security: [{ scheme: 'bearer', type: 'http' }],
428
+ url: '/providers/shared-amazon-ses-limit-request',
429
+ ...options
430
+ });
431
+ /**
432
+ * Request a shared Amazon SES daily limit increase
433
+ *
434
+ * Creates a review request for the shared Amazon SES daily sending limit. This does not modify the limit directly.
435
+ */
436
+ export const managementCreateSharedAmazonSesLimitRequest = (options) => (options?.client ?? client).post({
437
+ security: [{ scheme: 'bearer', type: 'http' }],
438
+ url: '/providers/shared-amazon-ses-limit-request',
439
+ ...options
440
+ });
441
+ /**
442
+ * Get sending account statistics
443
+ *
444
+ * Returns aggregate counts of configured sending accounts with breakdowns by type and status.
445
+ */
446
+ export const managementGetProviderStats = (options) => (options?.client ?? client).get({
447
+ security: [{ scheme: 'bearer', type: 'http' }],
448
+ url: '/providers/stats',
449
+ ...options
450
+ });
451
+ /**
452
+ * Get sending account usage
453
+ *
454
+ * Returns per-account delivery-log counts for today and the trailing 7-day window.
455
+ */
456
+ export const managementGetProviderUsage = (options) => (options?.client ?? client).get({
457
+ security: [{ scheme: 'bearer', type: 'http' }],
458
+ url: '/providers/usage',
459
+ ...options
460
+ });
461
+ /**
462
+ * List webhook subscriptions
463
+ *
464
+ * Returns a cursor-paginated list of webhook subscriptions configured for the team, ordered by `created_at` descending. The signing secret is never included. Pass `cursor=<next_cursor>` from the previous response to fetch the next page.
465
+ */
466
+ export const managementListWebhooks = (options) => (options?.client ?? client).get({
467
+ security: [{ scheme: 'bearer', type: 'http' }],
468
+ url: '/webhooks',
469
+ ...options
470
+ });
471
+ /**
472
+ * Create a webhook subscription
473
+ *
474
+ * Creates a new webhook subscription and returns the signing secret ONCE in the response body. Store it securely — it cannot be retrieved later. Use `POST /webhooks/{id}/rotate-secret` to issue a new one.
475
+ *
476
+ * Supply an `Idempotency-Key` header (any unique string, max 255 chars) to safely retry on network errors. Replays with the same key return the original response; replays with a different body return `409 idempotency_conflict`.
477
+ */
478
+ export const managementCreateWebhook = (options) => (options?.client ?? client).post({
479
+ security: [{ scheme: 'bearer', type: 'http' }],
480
+ url: '/webhooks',
481
+ ...options,
482
+ headers: {
483
+ 'Content-Type': 'application/json',
484
+ ...options?.headers
485
+ }
486
+ });
487
+ /**
488
+ * Delete a webhook subscription
489
+ *
490
+ * Permanently removes the subscription. In-flight retries are dropped.
491
+ */
492
+ export const managementDeleteWebhook = (options) => (options.client ?? client).delete({
493
+ security: [{ scheme: 'bearer', type: 'http' }],
494
+ url: '/webhooks/{public_id}',
495
+ ...options
496
+ });
497
+ /**
498
+ * Get a webhook subscription
499
+ *
500
+ * Returns a single webhook subscription. The signing secret is never included. Responses carry a weak `ETag` header — send it back as `If-None-Match` on the next request and the server will return `304 Not Modified` (no body) when the resource has not changed. The same ETag is the value to use in `If-Match` on PATCH for optimistic concurrency.
501
+ */
502
+ export const managementGetWebhook = (options) => (options.client ?? client).get({
503
+ security: [{ scheme: 'bearer', type: 'http' }],
504
+ url: '/webhooks/{public_id}',
505
+ ...options
506
+ });
507
+ /**
508
+ * Update a webhook subscription
509
+ *
510
+ * Updates the URL, event types, or enabled flag. Any field omitted from the request body is left unchanged. The signing secret is unaffected — use `POST /webhooks/{id}/rotate-secret` to rotate it.
511
+ *
512
+ * For optimistic concurrency, send `If-Match: <etag>` using the ETag from a prior GET. A mismatched `If-Match` returns `409 conflict` (the server's ETag is echoed back so you can decide whether to re-fetch). Responses carry the new ETag so chained edits can pipeline without a re-GET.
513
+ */
514
+ export const managementUpdateWebhook = (options) => (options.client ?? client).patch({
515
+ security: [{ scheme: 'bearer', type: 'http' }],
516
+ url: '/webhooks/{public_id}',
517
+ ...options,
518
+ headers: {
519
+ 'Content-Type': 'application/json',
520
+ ...options.headers
521
+ }
522
+ });
523
+ /**
524
+ * List webhook delivery attempts
525
+ *
526
+ * Returns recent delivery attempts for one webhook subscription, ordered by `created_at` descending. Delivery metadata is retained for 7 days. Use the payload endpoint while `payload_available` is true to inspect the exact JSON request body that was delivered.
527
+ */
528
+ export const managementListDelivery = (options) => (options.client ?? client).get({
529
+ security: [{ scheme: 'bearer', type: 'http' }],
530
+ url: '/webhooks/{public_id}/deliveries',
531
+ ...options
532
+ });
533
+ /**
534
+ * Get a webhook delivery payload
535
+ *
536
+ * Returns the retained JSON request body for one delivery attempt. Payloads are retained for 7 days and may no longer be available after `payload_expires_at`.
537
+ */
538
+ export const managementGetDeliveryPayload = (options) => (options.client ?? client).get({
539
+ security: [{ scheme: 'bearer', type: 'http' }],
540
+ url: '/webhooks/{public_id}/deliveries/{delivery_id}/payload',
541
+ ...options
542
+ });
543
+ /**
544
+ * Rotate the signing secret
545
+ *
546
+ * Generates a fresh signing secret and returns it ONCE. The old secret is immediately invalidated — the next event delivery is signed with the new secret. Store the new value securely; it cannot be retrieved later.
547
+ *
548
+ * Supply an `Idempotency-Key` header to safely retry on network errors — replays under the same key return the original rotation response rather than minting a fresh secret. Replays against a different `public_id` under the same key return `409 idempotency_conflict`.
549
+ */
550
+ export const managementRotateWebhookSecret = (options) => (options.client ?? client).post({
551
+ security: [{ scheme: 'bearer', type: 'http' }],
552
+ url: '/webhooks/{public_id}/rotate-secret',
553
+ ...options
554
+ });
555
+ /**
556
+ * Send a synthetic test event
557
+ *
558
+ * Publishes a synthetic `sendmux.test` event to this webhook subscription. The subscription must include `"sendmux.test"` in `event_types`, and mailbox filters do not block the test delivery. Returns the generated `event_id` so you can correlate the `X-Sendmux-Event-Id` header on your endpoint.
559
+ *
560
+ * Supply an `Idempotency-Key` header to safely retry on network errors — replays under the same key return the original `event_id` rather than publishing a second test event.
561
+ */
562
+ export const managementTestWebhook = (options) => (options.client ?? client).post({
563
+ security: [{ scheme: 'bearer', type: 'http' }],
564
+ url: '/webhooks/{public_id}/test',
565
+ ...options
566
+ });