samva 0.35.0 → 0.36.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 (70) hide show
  1. package/AGENTS.md +17 -0
  2. package/README.md +1 -0
  3. package/dist/client/sdk.gen.d.ts +102 -82
  4. package/dist/client/sdk.gen.js +322 -244
  5. package/dist/client/types.gen.d.ts +600 -378
  6. package/dist/effect/agents.d.ts +194 -4
  7. package/dist/effect/agents.js +3 -1
  8. package/dist/effect/analytics.d.ts +6 -0
  9. package/dist/effect/api-keys.d.ts +3 -6
  10. package/dist/effect/campaigns.d.ts +216 -216
  11. package/dist/effect/conversations.d.ts +6 -0
  12. package/dist/effect/errors.d.ts +1 -1
  13. package/dist/effect/errors.js +2 -2
  14. package/dist/effect/extension-installations.d.ts +53 -1
  15. package/dist/effect/generated/agents.d.ts +1803 -81
  16. package/dist/effect/generated/agents.js +92 -26
  17. package/dist/effect/generated/analytics.d.ts +19 -1
  18. package/dist/effect/generated/analytics.js +8 -2
  19. package/dist/effect/generated/api-keys.d.ts +4 -29
  20. package/dist/effect/generated/api-keys.js +5 -6
  21. package/dist/effect/generated/campaigns.d.ts +22 -0
  22. package/dist/effect/generated/campaigns.js +3 -1
  23. package/dist/effect/generated/conversations.d.ts +104 -3
  24. package/dist/effect/generated/conversations.js +12 -2
  25. package/dist/effect/generated/extension-installations.d.ts +845 -68
  26. package/dist/effect/generated/extension-installations.js +22 -26
  27. package/dist/effect/generated/index.d.ts +3 -1
  28. package/dist/effect/generated/mailboxes.d.ts +3423 -1446
  29. package/dist/effect/generated/mailboxes.js +226 -220
  30. package/dist/effect/generated/namespaces.d.ts +7 -31
  31. package/dist/effect/generated/namespaces.js +4 -4
  32. package/dist/effect/generated/policies.d.ts +953 -0
  33. package/dist/effect/generated/policies.js +116 -0
  34. package/dist/effect/generated/scheduled-messages.d.ts +45 -4
  35. package/dist/effect/generated/scheduled-messages.js +8 -3
  36. package/dist/effect/generated/shared.d.ts +893 -224
  37. package/dist/effect/generated/shared.js +194 -60
  38. package/dist/effect/generated/templates.d.ts +474 -668
  39. package/dist/effect/generated/templates.js +65 -45
  40. package/dist/effect/generated/webhooks.d.ts +22 -19
  41. package/dist/effect/generated/webhooks.js +10 -1
  42. package/dist/effect/generated/whoami.d.ts +0 -4
  43. package/dist/effect/generated-metadata.d.ts +36 -32
  44. package/dist/effect/generated-metadata.js +127 -105
  45. package/dist/effect/index.d.ts +1 -0
  46. package/dist/effect/index.js +3 -2
  47. package/dist/effect/internal/operation.js +5 -32
  48. package/dist/effect/journeys.d.ts +146 -146
  49. package/dist/effect/mailboxes.d.ts +575 -129
  50. package/dist/effect/mailboxes.js +1 -11
  51. package/dist/effect/policies.d.ts +65 -0
  52. package/dist/effect/policies.js +16 -0
  53. package/dist/effect/scheduled-messages.d.ts +6 -0
  54. package/dist/effect/templates.d.ts +6 -8
  55. package/dist/effect/templates.js +5 -3
  56. package/dist/effect/topics.d.ts +2 -2
  57. package/dist/effect/webhooks.d.ts +7 -4
  58. package/dist/index.js +2 -2
  59. package/dist/mailbox/test.js +11 -4
  60. package/dist/mailbox/types.d.ts +39 -3
  61. package/dist/package.js +1 -1
  62. package/dist/promises/client.d.ts +3 -1
  63. package/dist/promises/client.js +5 -3
  64. package/dist/promises/errors.gen.d.ts +18 -2
  65. package/dist/promises/errors.gen.js +335 -33
  66. package/dist/promises/index.js +2 -2
  67. package/dist/promises/types.gen.d.ts +1 -1
  68. package/dist/service-map.d.ts +30 -28
  69. package/dist/service-map.js +219 -786
  70. package/package.json +6 -2
@@ -80,7 +80,7 @@ export type ExtensionInstallation = {
80
80
  createdAt: string;
81
81
  events: Array<"mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded">;
82
82
  permissions: Array<"read" | "update" | "send" | "quarantine.read">;
83
- sendMode: "send" | "approval";
83
+ policy: PolicyConfiguration;
84
84
  scope: {
85
85
  mailboxIds: Array<MailboxId> | null;
86
86
  namespaceId: NamespaceId | null;
@@ -95,6 +95,43 @@ export type ExtensionInstallation = {
95
95
  export type WebhookEndpointId = string;
96
96
  export type NamespaceId = string;
97
97
  export type MailboxId = string;
98
+ export type PolicyRule = {
99
+ match: PolicyRuleMatch;
100
+ note?: string | null | undefined;
101
+ decide: PolicyRequirement;
102
+ atLeast?: never | null | undefined;
103
+ } | {
104
+ match: PolicyRuleMatch;
105
+ note?: string | null | undefined;
106
+ decide?: never | null | undefined;
107
+ atLeast: PolicyRequirement;
108
+ };
109
+ export type PolicyRequirement = "run" | "model" | "person" | "never";
110
+ export type PolicyRuleMatch = {
111
+ kind?: "send" | "reply" | "toolCall" | "handoff" | null | undefined;
112
+ effect?: PolicyEffect | null | undefined;
113
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
114
+ integration?: string | null | undefined;
115
+ tool?: string | null | undefined;
116
+ subject?: "agent" | "apiKey" | "member" | "extension" | PolicySubject | null | undefined;
117
+ };
118
+ export type PolicySubject = {
119
+ kind: "agent";
120
+ id: AgentId;
121
+ } | {
122
+ kind: "apiKey";
123
+ id: ApiKeyId;
124
+ } | {
125
+ kind: "member";
126
+ userId: UserId;
127
+ } | {
128
+ kind: "extension";
129
+ id: ExtensionInstallationId;
130
+ };
131
+ export type UserId = string;
132
+ export type ApiKeyId = string;
133
+ export type AgentId = string;
134
+ export type PolicyEffect = "read" | "write" | "final";
98
135
  export type ExtensionVersionRef = {
99
136
  id: ExtensionVersionId;
100
137
  version: string;
@@ -120,7 +157,6 @@ export type ExtensionVersionChange = {
120
157
  changedBy: UserId;
121
158
  changedAt: string;
122
159
  };
123
- export type UserId = string;
124
160
  export type ExtensionPermissionDiff = {
125
161
  added: Array<"permission:read" | "permission:update" | "permission:send" | "permission:quarantine.read" | "event:mailbox.message.received" | "event:mailbox.message.sent" | "event:mailbox.action.pending_approval" | "event:mailbox.action.resolved" | "event:mailbox.message.quarantined" | "event:mailbox.message.released" | "event:mailbox.message.discarded">;
126
162
  removed: Array<"permission:read" | "permission:update" | "permission:send" | "permission:quarantine.read" | "event:mailbox.message.received" | "event:mailbox.message.sent" | "event:mailbox.action.pending_approval" | "event:mailbox.action.resolved" | "event:mailbox.message.quarantined" | "event:mailbox.message.released" | "event:mailbox.message.discarded">;
@@ -147,7 +183,7 @@ export type InstallExtensionPayload = {
147
183
  mailboxIds?: Array<MailboxId> | null | undefined;
148
184
  namespaceId?: NamespaceId | null | undefined;
149
185
  permissions?: Array<"read" | "update" | "send" | "quarantine.read"> | null | undefined;
150
- sendMode?: "send" | "approval" | null | undefined;
186
+ policy?: PolicyConfiguration | null | undefined;
151
187
  webhookUrl?: string | null | undefined;
152
188
  };
153
189
  export type ExtensionInstallationPage = {
@@ -234,6 +270,11 @@ export type NamespaceUsage = {
234
270
  whatsappCount: number;
235
271
  totalMessages: number;
236
272
  };
273
+ export type FlagDisabledError = {
274
+ _tag: "FlagDisabledError";
275
+ flag: string;
276
+ message: string;
277
+ };
237
278
  export type NamespaceResource = {
238
279
  type: NamespaceResourceType;
239
280
  id: string;
@@ -285,6 +326,19 @@ export type NamespaceSummary = {
285
326
  name: string;
286
327
  createdAt: string;
287
328
  };
329
+ export type PolicySnapshot = {
330
+ presets: Array<string>;
331
+ rules: Array<PolicyRule>;
332
+ instructions?: string | null | undefined;
333
+ version: PolicyVersion;
334
+ };
335
+ export type PolicyVersion = number;
336
+ export type PolicyReplacement = {
337
+ presets: Array<string>;
338
+ rules: Array<PolicyRule>;
339
+ instructions?: string | null | undefined;
340
+ ifVersion: PolicyVersion;
341
+ };
288
342
  export type MailboxEventPage = {
289
343
  items: Array<MailboxEvent>;
290
344
  nextCursor: string | null;
@@ -333,13 +387,44 @@ export type MailboxSendReceipt = {
333
387
  updatedAt: string;
334
388
  };
335
389
  export type MailboxActionDecision = {
336
- outcome: "allow" | "requireApproval" | "deny";
337
- reason: string | null;
338
- policyId: MailboxPolicyId | null;
339
- source: "grant" | "installation" | "policy" | null;
340
- decidedAt: string;
390
+ id: PolicyDecisionId;
391
+ reviewRound: PolicyReviewRound;
392
+ requirement: PolicyRequirement;
393
+ decider: PolicyDecider;
394
+ outcome: "allow" | "hold" | "refuse";
395
+ reason: string;
396
+ scopes: Array<{
397
+ kind: "organization" | "mailbox" | "agent" | "apiKey";
398
+ id: string;
399
+ }>;
400
+ rule?: {
401
+ scope: {
402
+ kind: "organization" | "mailbox" | "agent" | "apiKey";
403
+ id: string;
404
+ };
405
+ index: number;
406
+ } | null | undefined;
407
+ guard?: string | null | undefined;
408
+ guardReason?: string | null | undefined;
409
+ resolution?: {
410
+ by: UserId;
411
+ at: string;
412
+ as: "approved" | "edited" | "denied" | "alwaysAllowed";
413
+ diff?: {
414
+ text?: {
415
+ before: string | null;
416
+ after: string | null;
417
+ } | null | undefined;
418
+ html?: {
419
+ before: string | null;
420
+ after: string | null;
421
+ } | null | undefined;
422
+ } | null | undefined;
423
+ } | null | undefined;
341
424
  };
342
- export type MailboxPolicyId = string;
425
+ export type PolicyDecider = "rule" | "model" | "person" | "agent";
426
+ export type PolicyReviewRound = number;
427
+ export type PolicyDecisionId = string;
343
428
  export type MailboxSendOutcome = {
344
429
  code: string;
345
430
  message: string;
@@ -409,7 +494,7 @@ export type MailboxNonSendAction = {
409
494
  resolution: MailboxActionResolution | null;
410
495
  createdAt: string;
411
496
  updatedAt: string;
412
- type: "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall";
497
+ type: "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall" | "handoff";
413
498
  state: "proposed" | "allowed" | "approvalRequired" | "policyDenied" | "approved" | "approvalDenied" | "executing" | "executed" | "failed";
414
499
  /**
415
500
  * The tool a `toolCall` runs, with its arguments and their hash; an approval covers exactly this call. Null for every other action type.
@@ -530,6 +615,7 @@ export type EmailAttachment = {
530
615
  };
531
616
  export type MediaId = string;
532
617
  export type DenyMailboxActionPayload = {
618
+ reviewRound: PolicyReviewRound;
533
619
  reason: string;
534
620
  };
535
621
  export type BillingProviderError = {
@@ -573,12 +659,15 @@ export type MailboxSendRefusedError = {
573
659
  message: string;
574
660
  receipt: MailboxSendReceipt;
575
661
  };
576
- export type FlagDisabledError = {
577
- _tag: "FlagDisabledError";
578
- flag: string;
579
- message: string;
580
- };
581
662
  export type MailboxPendingAction = MailboxSendAction | MailboxNonSendAction;
663
+ export type ApproveMailboxActionPayload = {
664
+ reviewRound: PolicyReviewRound;
665
+ always?: boolean | null | undefined;
666
+ edits?: {
667
+ text?: string | null | undefined;
668
+ html?: string | null | undefined;
669
+ } | null | undefined;
670
+ };
582
671
  export type MailboxPendingSendReceipt = {
583
672
  actionId: MailboxActionId;
584
673
  draftId: MailboxDraftId | null;
@@ -1073,13 +1162,17 @@ export type MailboxNeedsYou = {
1073
1162
  * All items this caller may decide, independent of the current page.
1074
1163
  */
1075
1164
  counts: {
1076
- heldSends: number;
1165
+ heldActions: number;
1077
1166
  quarantinedMessages: number;
1078
1167
  total: number;
1079
1168
  };
1080
1169
  };
1081
1170
  export type MailboxNeedsYouItem = {
1082
- type: "heldSend";
1171
+ type: "heldAction";
1172
+ actionType: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall" | "handoff";
1173
+ decision: PolicyDecision;
1174
+ tool: MailboxToolCall | null;
1175
+ intent: MailboxSendSnapshot | null;
1083
1176
  id: MailboxActionId;
1084
1177
  mailbox: MailboxThreadMailbox;
1085
1178
  threadId: MailboxThreadId | null;
@@ -1099,6 +1192,80 @@ export type MailboxNeedsYouItem = {
1099
1192
  source: "receipt" | "classifier";
1100
1193
  heldAt: string;
1101
1194
  };
1195
+ export type PolicyDecision = {
1196
+ requirement: PolicyRequirement;
1197
+ decider: PolicyDecider;
1198
+ outcome: "allow" | "hold" | "refuse";
1199
+ reason: string;
1200
+ scopes: Array<{
1201
+ kind: "organization" | "mailbox" | "agent" | "apiKey";
1202
+ id: string;
1203
+ }>;
1204
+ rule?: {
1205
+ scope: {
1206
+ kind: "organization" | "mailbox" | "agent" | "apiKey";
1207
+ id: string;
1208
+ };
1209
+ index: number;
1210
+ } | null | undefined;
1211
+ guard?: string | null | undefined;
1212
+ guardReason?: string | null | undefined;
1213
+ id: PolicyDecisionId;
1214
+ reviewRound: PolicyReviewRound;
1215
+ subject: PolicySubject;
1216
+ action: PolicyAction;
1217
+ judge?: {
1218
+ model: string;
1219
+ instructionVersion?: string | null | undefined;
1220
+ instructionHash?: string | null | undefined;
1221
+ ms: number;
1222
+ usage: JsonObject;
1223
+ } | null | undefined;
1224
+ resolution?: {
1225
+ by: UserId;
1226
+ at: string;
1227
+ as: "approved" | "edited" | "denied" | "alwaysAllowed";
1228
+ diff?: {
1229
+ text?: {
1230
+ before: string | null;
1231
+ after: string | null;
1232
+ } | null | undefined;
1233
+ html?: {
1234
+ before: string | null;
1235
+ after: string | null;
1236
+ } | null | undefined;
1237
+ } | null | undefined;
1238
+ } | null | undefined;
1239
+ };
1240
+ export type PolicyAction = {
1241
+ effect: PolicyEffect;
1242
+ resource: {
1243
+ mailboxId: MailboxId;
1244
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
1245
+ integration?: string | null | undefined;
1246
+ integrationId?: IntegrationId | null | undefined;
1247
+ tool?: string | null | undefined;
1248
+ };
1249
+ facts: JsonObject;
1250
+ kind: "send" | "reply" | "toolCall";
1251
+ args: JsonValue;
1252
+ } | {
1253
+ effect: PolicyEffect;
1254
+ resource: {
1255
+ mailboxId: MailboxId;
1256
+ channel?: "sms" | "whatsapp" | "email" | null | undefined;
1257
+ integration?: string | null | undefined;
1258
+ integrationId?: IntegrationId | null | undefined;
1259
+ tool?: string | null | undefined;
1260
+ };
1261
+ facts: JsonObject;
1262
+ kind: "handoff";
1263
+ args: {
1264
+ reason: string;
1265
+ draft?: JsonValue | null | undefined;
1266
+ };
1267
+ };
1268
+ export type IntegrationId = string;
1102
1269
  export type MailboxLabel = {
1103
1270
  id: MailboxLabelId;
1104
1271
  slug: string;
@@ -1127,31 +1294,6 @@ export type MailboxFolderCount = {
1127
1294
  count: number;
1128
1295
  unreadCount: number;
1129
1296
  };
1130
- export type MailboxPolicy = {
1131
- id: MailboxPolicyId;
1132
- name: string;
1133
- outcome: MailboxPolicyOutcomeKind;
1134
- reason: string | null;
1135
- enabled: boolean;
1136
- createdAt: string;
1137
- updatedAt: string;
1138
- };
1139
- export type MailboxPolicyOutcomeKind = "requireApproval" | "deny";
1140
- export type UpdateMailboxPolicyPayload = {
1141
- name?: string | null | undefined;
1142
- outcome?: MailboxPolicyOutcomeKind | null | undefined;
1143
- reason?: string | null | undefined;
1144
- enabled?: boolean | null | undefined;
1145
- };
1146
- export type CreateMailboxPolicyPayload = {
1147
- name: string;
1148
- outcome: MailboxPolicyOutcomeKind;
1149
- reason?: string | null | undefined;
1150
- enabled?: boolean | null | undefined;
1151
- };
1152
- export type MailboxPolicyList = {
1153
- items: Array<MailboxPolicy>;
1154
- };
1155
1297
  export type MailboxGrantId = string;
1156
1298
  export type MailboxGrant = {
1157
1299
  id: MailboxGrantId;
@@ -1161,22 +1303,15 @@ export type MailboxGrant = {
1161
1303
  displayName?: string | null | undefined;
1162
1304
  };
1163
1305
  permissions: Array<"mailbox:read" | "mailbox:configure" | "thread:read" | "thread:write" | "label:write" | "draft:write" | "note:write" | "action:propose" | "action:approve" | "policy:read" | "quarantine:read" | "quarantine:release">;
1164
- sendMode: MailboxSendMode;
1165
1306
  createdAt: string;
1166
1307
  };
1167
- /**
1168
- * How the grantee's sends execute: `send` runs them within account limits; `approval` holds each one until a different member approves it.
1169
- */
1170
- export type MailboxSendMode = "send" | "approval";
1171
1308
  export type UpdateMailboxGrantPayload = {
1172
1309
  role?: MailboxGrantRole | null | undefined;
1173
- sendMode?: MailboxSendMode | null | undefined;
1174
1310
  };
1175
1311
  export type MailboxGrantRole = "admin" | "collaborator" | "viewer";
1176
1312
  export type CreateMailboxGrantPayload = {
1177
1313
  userId: UserId;
1178
1314
  role: MailboxGrantRole;
1179
- sendMode?: MailboxSendMode | null | undefined;
1180
1315
  };
1181
1316
  export type MailboxGrantPage = {
1182
1317
  items: Array<MailboxGrant>;
@@ -1185,7 +1320,7 @@ export type MailboxGrantPage = {
1185
1320
  export type MailboxAgentActivity = {
1186
1321
  actions: {
1187
1322
  byType: Array<{
1188
- type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall";
1323
+ type: "sendMessage" | "reply" | "updateDraft" | "createNote" | "assignThread" | "changeThreadState" | "call" | "extensionRequest" | "toolCall" | "handoff";
1189
1324
  count: number;
1190
1325
  }>;
1191
1326
  byState: Array<{
@@ -1210,6 +1345,7 @@ export type Mailbox = {
1210
1345
  name: string;
1211
1346
  status: MailboxStatus;
1212
1347
  primaryAddress: string | null;
1348
+ sendingStatus: "pending" | "ready" | "failed" | null;
1213
1349
  createdAt: string;
1214
1350
  description: string | null;
1215
1351
  metadata: MailboxMetadata;
@@ -1241,6 +1377,10 @@ export type MailboxEmailEndpoint = {
1241
1377
  channel: "email";
1242
1378
  source: "samvaHosted" | "verifiedDomain";
1243
1379
  domainId: string | null;
1380
+ /**
1381
+ * Sending readiness. Pending means sending setup is incomplete. Send only when ready. If setup fails, contact support to recover the sending address.
1382
+ */
1383
+ sendingStatus: "pending" | "ready" | "failed";
1244
1384
  };
1245
1385
  export type MailboxMetadata = {
1246
1386
  [key: string]: string;
@@ -1289,6 +1429,7 @@ export type MailboxSummary = {
1289
1429
  name: string;
1290
1430
  status: MailboxStatus;
1291
1431
  primaryAddress: string | null;
1432
+ sendingStatus: "pending" | "ready" | "failed" | null;
1292
1433
  createdAt: string;
1293
1434
  };
1294
1435
  export type Whoami = {
@@ -1335,10 +1476,6 @@ export type ApiKeyMailboxAccess = {
1335
1476
  * The mailboxes the key may act on. Omit to reach every mailbox the owner can.
1336
1477
  */
1337
1478
  mailboxIds?: [MailboxId, ...Array<MailboxId>] | null | undefined;
1338
- /**
1339
- * Defaults to `send`. With `approval`, each send waits until a person other than the key approves it.
1340
- */
1341
- sendMode?: MailboxSendMode | null | undefined;
1342
1479
  };
1343
1480
  export type ApiKeyResourceAccess = {
1344
1481
  messages?: "read" | "write" | null | undefined;
@@ -1391,7 +1528,6 @@ export type ApiKeyActivityPage = {
1391
1528
  }>;
1392
1529
  nextCursor: string | null;
1393
1530
  };
1394
- export type ApiKeyId = string;
1395
1531
  export type ApiKeyWithSecret = {
1396
1532
  id: string;
1397
1533
  name: string;
@@ -1425,9 +1561,6 @@ export type ApiKey = {
1425
1561
  access: ApiKeyAccess;
1426
1562
  owner: ApiKeyOwner | null;
1427
1563
  };
1428
- export type ApiKeyMailboxAccessUpdate = {
1429
- sendMode: MailboxSendMode;
1430
- };
1431
1564
  export type ApiKeyPage = {
1432
1565
  items: Array<ApiKey>;
1433
1566
  nextCursor: string | null;
@@ -1575,7 +1708,7 @@ export type WebhookEndpoint = {
1575
1708
  id: WebhookEndpointId;
1576
1709
  name: string;
1577
1710
  url: string;
1578
- eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook">;
1711
+ eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "email.sending.paused" | "email.sending.resumed" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook">;
1579
1712
  channels: Array<"sms" | "whatsapp" | "email"> | null;
1580
1713
  mailboxIds: Array<MailboxId> | null;
1581
1714
  namespaceId: NamespaceId | null;
@@ -1589,7 +1722,7 @@ export type WebhookEndpoint = {
1589
1722
  export type UpdateWebhookPayload = {
1590
1723
  name?: string | null | undefined;
1591
1724
  url?: string | null | undefined;
1592
- eventTypes?: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook"> | null | undefined;
1725
+ eventTypes?: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "email.sending.paused" | "email.sending.resumed" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook"> | null | undefined;
1593
1726
  channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
1594
1727
  mailboxIds?: [MailboxId, ...Array<MailboxId>] | null | undefined;
1595
1728
  namespaceId?: NamespaceId | null | undefined;
@@ -1606,7 +1739,7 @@ export type WebhookEndpointListItem = {
1606
1739
  id: WebhookEndpointId;
1607
1740
  name: string;
1608
1741
  url: string;
1609
- eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook">;
1742
+ eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "email.sending.paused" | "email.sending.resumed" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook">;
1610
1743
  channels: Array<"sms" | "whatsapp" | "email"> | null;
1611
1744
  mailboxIds: Array<MailboxId> | null;
1612
1745
  namespaceId: NamespaceId | null;
@@ -1628,7 +1761,7 @@ export type WebhookDeliveryCounts = {
1628
1761
  export type CreateWebhookPayload = {
1629
1762
  name: string;
1630
1763
  url: string;
1631
- eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook">;
1764
+ eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "email.sending.paused" | "email.sending.resumed" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook">;
1632
1765
  channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
1633
1766
  mailboxIds?: [MailboxId, ...Array<MailboxId>] | null | undefined;
1634
1767
  namespaceId?: NamespaceId | null | undefined;
@@ -1736,6 +1869,14 @@ export type TemplateSourceError = {
1736
1869
  }>;
1737
1870
  revision?: string | null | undefined;
1738
1871
  };
1872
+ export type TemplateInUseError = {
1873
+ _tag: "TemplateInUseError";
1874
+ message: string;
1875
+ references: Array<{
1876
+ kind: string;
1877
+ id: string;
1878
+ }>;
1879
+ };
1739
1880
  export type TemplateProjectId = string;
1740
1881
  export type TemplateInputContractId = string;
1741
1882
  export type TemplateInputContractPage = {
@@ -1792,7 +1933,6 @@ export type Template = {
1792
1933
  shared: boolean;
1793
1934
  entryPath: string;
1794
1935
  status: "draft" | "pending" | "approved" | "published" | "rejected" | "archived";
1795
- isActive: boolean;
1796
1936
  publishedAt: string | null;
1797
1937
  brand: TemplatePublicationBrand | null;
1798
1938
  fromDefault: TemplateFromDefault | null;
@@ -1908,7 +2048,6 @@ export type UpdateTemplatePayload = {
1908
2048
  * Engagement tracking for sends of this template: `opens` and `clicks`, each inherited from the domain and organization defaults when omitted. A send request's own `tracking` still wins. Null clears the template's default.
1909
2049
  */
1910
2050
  trackingDefault?: TemplateTrackingDefault | null | undefined;
1911
- isActive?: boolean | null | undefined;
1912
2051
  /**
1913
2052
  * Share the template's project with every namespace, or stop sharing it. Applies to every entry in the project. Only an organization-level project is shared.
1914
2053
  */
@@ -1955,7 +2094,6 @@ export type CreateTemplatePayload = {
1955
2094
  useBrand?: boolean | null | undefined;
1956
2095
  description?: string | null | undefined;
1957
2096
  category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | undefined;
1958
- isActive?: boolean | null | undefined;
1959
2097
  /**
1960
2098
  * The namespace the new template project belongs to; the project and every entry added to it share it. Omit for organization level. A namespace-scoped key always creates in its own namespace.
1961
2099
  */
@@ -1978,7 +2116,6 @@ export type TemplateFamilyMember = {
1978
2116
  slug: string;
1979
2117
  channel: "sms" | "whatsapp" | "email";
1980
2118
  status: "draft" | "pending" | "approved" | "published" | "rejected" | "archived";
1981
- isActive: boolean;
1982
2119
  createdAt: string;
1983
2120
  updatedAt: string;
1984
2121
  };
@@ -2009,7 +2146,6 @@ export type TemplateSummary = {
2009
2146
  shared: boolean;
2010
2147
  entryPath: string;
2011
2148
  status: "draft" | "pending" | "approved" | "published" | "rejected" | "archived";
2012
- isActive: boolean;
2013
2149
  publishedAt: string | null;
2014
2150
  brand: TemplatePublicationBrand | null;
2015
2151
  fromDefault: TemplateFromDefault | null;
@@ -2399,10 +2535,7 @@ export type Weekday = "monday" | "tuesday" | "wednesday" | "thursday" | "friday"
2399
2535
  export type TimeZone = string;
2400
2536
  export type AgentReasoning = "auto" | "low" | "medium" | "high";
2401
2537
  export type AgentModelChoice = AgentModel | CatalogModelId;
2402
- export type AgentMode = "live" | "supervised";
2403
- export type IntegrationId = string;
2404
2538
  export type KnowledgeSourceId = string;
2405
- export type AgentId = string;
2406
2539
  export type AgentVersionPage = {
2407
2540
  items: Array<AgentVersionSummary>;
2408
2541
  nextCursor: string | null;
@@ -2450,7 +2583,7 @@ export type AgentDefinition = {
2450
2583
  knowledgeSourceIds?: Array<KnowledgeSourceId> | undefined;
2451
2584
  endpointIds: Array<MailboxEndpointId>;
2452
2585
  integrations: Array<AgentIntegrationGrant>;
2453
- mode: AgentMode;
2586
+ policy: PolicyConfiguration;
2454
2587
  model: AgentModelChoice;
2455
2588
  reasoning: AgentReasoning;
2456
2589
  workingHours: WorkingHours | null;
@@ -2465,10 +2598,14 @@ export type WorkingHoursRange = {
2465
2598
  opens: ClockTime;
2466
2599
  closes: ClockTime;
2467
2600
  };
2601
+ export type PolicyConfiguration = {
2602
+ presets: Array<string>;
2603
+ rules: Array<PolicyRule>;
2604
+ instructions?: string | null | undefined;
2605
+ };
2468
2606
  export type AgentIntegrationGrant = {
2469
2607
  integrationId: IntegrationId;
2470
2608
  tools: AgentToolScope;
2471
- requireApproval: Array<string>;
2472
2609
  };
2473
2610
  export type AgentToolScope = {
2474
2611
  kind: "all";
@@ -2498,7 +2635,7 @@ export type CreateAgentPayload = {
2498
2635
  */
2499
2636
  namespaceId?: NamespaceId | null | undefined;
2500
2637
  /**
2501
- * The first draft. Defaults to an agent with no instructions, knowledge, or endpoints, in supervised mode on the standard model at auto reasoning.
2638
+ * The first draft. Defaults to an agent with no instructions, knowledge, or endpoints, the default action policy, and the standard model at auto reasoning.
2502
2639
  */
2503
2640
  definition?: AgentDefinition | null | undefined;
2504
2641
  };
@@ -2547,6 +2684,26 @@ export type AgentListItem = {
2547
2684
  createdAt: string;
2548
2685
  updatedAt: string;
2549
2686
  };
2687
+ export type AgentTestRerun = {
2688
+ items: Array<{
2689
+ testId: AgentTestId;
2690
+ publishedDecisions: Array<AgentTestDecision> | null;
2691
+ draftDecisions: Array<AgentTestDecision>;
2692
+ changedDecisions: Array<AgentTestDecision>;
2693
+ }>;
2694
+ };
2695
+ export type AgentTestDecision = {
2696
+ actionIndex: number;
2697
+ kind: "send" | "reply" | "toolCall" | "handoff";
2698
+ tool?: string | null | undefined;
2699
+ outcome: "allow" | "hold" | "refuse";
2700
+ text?: string | null | undefined;
2701
+ };
2702
+ export type AgentTestId = string;
2703
+ export type RunAgentTestPayload = {
2704
+ name: AgentName;
2705
+ definition: AgentDefinition;
2706
+ };
2550
2707
  export type JourneyRunDetail = {
2551
2708
  id: JourneyRunId;
2552
2709
  journeyId: JourneyId;
@@ -3109,6 +3266,7 @@ export type ContactListMembership = {
3109
3266
  };
3110
3267
  export type Conversation = {
3111
3268
  id: ConversationId;
3269
+ namespaceId: NamespaceId | null;
3112
3270
  title: string | null;
3113
3271
  externalId: string | null;
3114
3272
  status: "active" | "waiting" | "resolved" | "escalated" | "archived";
@@ -3214,6 +3372,7 @@ export type ConversationPage = {
3214
3372
  };
3215
3373
  export type ConversationSummary = {
3216
3374
  id: ConversationId;
3375
+ namespaceId: NamespaceId | null;
3217
3376
  title: string | null;
3218
3377
  externalId: string | null;
3219
3378
  status: "active" | "waiting" | "resolved" | "escalated" | "archived";
@@ -4189,6 +4348,7 @@ export type CampaignPreview = {
4189
4348
  };
4190
4349
  export type ScheduledMessage = {
4191
4350
  id: ScheduledMessageId;
4351
+ namespaceId: NamespaceId | null;
4192
4352
  status: "pending" | "dispatching" | "paused" | "dispatched" | "cancelled" | "failed";
4193
4353
  scheduledFor: string;
4194
4354
  timezone: string;
@@ -5761,6 +5921,7 @@ export type ScheduledMessagesListData = {
5761
5921
  query?: {
5762
5922
  limit?: number | null | undefined;
5763
5923
  cursor?: string | undefined;
5924
+ namespaceId?: NamespaceId | undefined;
5764
5925
  status?: "pending" | "dispatching" | "paused" | "dispatched" | "cancelled" | "failed" | undefined;
5765
5926
  };
5766
5927
  url: "/v1/messages/scheduled";
@@ -5801,6 +5962,7 @@ export type ScheduledMessagesListResponses = {
5801
5962
  export type ScheduledMessagesListResponse = ScheduledMessagesListResponses[keyof ScheduledMessagesListResponses];
5802
5963
  export type ScheduledMessagesCreateData = {
5803
5964
  body: {
5965
+ namespaceId?: NamespaceId | null | undefined;
5804
5966
  send: DispatchSendMessagePayload;
5805
5967
  scheduledFor: string;
5806
5968
  timezone?: IanaTimezone | null | undefined;
@@ -5823,9 +5985,13 @@ export type ScheduledMessagesCreateErrors = {
5823
5985
  */
5824
5986
  401: UnauthorizedError;
5825
5987
  /**
5826
- * FlagDisabledError | ForbiddenError
5988
+ * ForbiddenError | FlagDisabledError
5827
5989
  */
5828
- 403: FlagDisabledError | ForbiddenError;
5990
+ 403: ForbiddenError | FlagDisabledError;
5991
+ /**
5992
+ * ResourceNotFoundError
5993
+ */
5994
+ 404: ResourceNotFoundError;
5829
5995
  /**
5830
5996
  * ConflictError
5831
5997
  */
@@ -6214,6 +6380,10 @@ export type CampaignsCreateErrors = {
6214
6380
  * FlagDisabledError | ForbiddenError
6215
6381
  */
6216
6382
  403: FlagDisabledError | ForbiddenError;
6383
+ /**
6384
+ * ResourceNotFoundError
6385
+ */
6386
+ 404: ResourceNotFoundError;
6217
6387
  /**
6218
6388
  * ValidationError
6219
6389
  */
@@ -10464,6 +10634,7 @@ export type ConversationsListData = {
10464
10634
  query?: {
10465
10635
  limit?: number | null | undefined;
10466
10636
  cursor?: string | undefined;
10637
+ namespaceId?: NamespaceId | undefined;
10467
10638
  status?: "active" | "waiting" | "resolved" | "escalated" | "archived" | undefined;
10468
10639
  channel?: "sms" | "whatsapp" | "email" | undefined;
10469
10640
  contactId?: ContactId | undefined;
@@ -10509,6 +10680,7 @@ export type ConversationsListResponses = {
10509
10680
  export type ConversationsListResponse = ConversationsListResponses[keyof ConversationsListResponses];
10510
10681
  export type ConversationsCreateData = {
10511
10682
  body: {
10683
+ namespaceId?: NamespaceId | null | undefined;
10512
10684
  title?: string | null | undefined;
10513
10685
  description?: string | null | undefined;
10514
10686
  externalId?: string | null | undefined;
@@ -10545,6 +10717,14 @@ export type ConversationsCreateErrors = {
10545
10717
  * ForbiddenError
10546
10718
  */
10547
10719
  403: ForbiddenError;
10720
+ /**
10721
+ * ResourceNotFoundError
10722
+ */
10723
+ 404: ResourceNotFoundError;
10724
+ /**
10725
+ * ConflictError
10726
+ */
10727
+ 409: ConflictError;
10548
10728
  /**
10549
10729
  * ValidationError
10550
10730
  */
@@ -10653,6 +10833,10 @@ export type ConversationsUpdateErrors = {
10653
10833
  * ResourceNotFoundError
10654
10834
  */
10655
10835
  404: ResourceNotFoundError;
10836
+ /**
10837
+ * ConflictError
10838
+ */
10839
+ 409: ConflictError;
10656
10840
  /**
10657
10841
  * ValidationError
10658
10842
  */
@@ -13308,12 +13492,62 @@ export type JourneysGetRunResponses = {
13308
13492
  200: JourneyRunDetail;
13309
13493
  };
13310
13494
  export type JourneysGetRunResponse = JourneysGetRunResponses[keyof JourneysGetRunResponses];
13495
+ export type AgentsRerunTestsData = {
13496
+ body: {
13497
+ name: AgentName;
13498
+ definition: AgentDefinition;
13499
+ };
13500
+ path: {
13501
+ id: AgentId;
13502
+ };
13503
+ query?: never;
13504
+ url: "/v1/agents/{id}/tests/rerun";
13505
+ };
13506
+ export type AgentsRerunTestsErrors = {
13507
+ /**
13508
+ * MalformedRequestError
13509
+ */
13510
+ 400: MalformedRequestError;
13511
+ /**
13512
+ * UnauthorizedError
13513
+ */
13514
+ 401: UnauthorizedError;
13515
+ /**
13516
+ * ForbiddenError
13517
+ */
13518
+ 403: ForbiddenError;
13519
+ /**
13520
+ * ResourceNotFoundError
13521
+ */
13522
+ 404: ResourceNotFoundError;
13523
+ /**
13524
+ * ValidationError
13525
+ */
13526
+ 422: ValidationError;
13527
+ /**
13528
+ * InternalError
13529
+ */
13530
+ 500: InternalError;
13531
+ /**
13532
+ * GatewayTimeoutError
13533
+ */
13534
+ 504: GatewayTimeoutError;
13535
+ };
13536
+ export type AgentsRerunTestsError = AgentsRerunTestsErrors[keyof AgentsRerunTestsErrors];
13537
+ export type AgentsRerunTestsResponses = {
13538
+ /**
13539
+ * AgentTestRerun
13540
+ */
13541
+ 200: AgentTestRerun;
13542
+ };
13543
+ export type AgentsRerunTestsResponse = AgentsRerunTestsResponses[keyof AgentsRerunTestsResponses];
13311
13544
  export type AgentsListData = {
13312
13545
  body?: never;
13313
13546
  path?: never;
13314
13547
  query?: {
13315
13548
  limit?: number | null | undefined;
13316
13549
  cursor?: string | undefined;
13550
+ namespaceId?: NamespaceId | undefined;
13317
13551
  };
13318
13552
  url: "/v1/agents";
13319
13553
  };
@@ -13359,7 +13593,7 @@ export type AgentsCreateData = {
13359
13593
  */
13360
13594
  namespaceId?: NamespaceId | null | undefined;
13361
13595
  /**
13362
- * The first draft. Defaults to an agent with no instructions, knowledge, or endpoints, in supervised mode on the standard model at auto reasoning.
13596
+ * The first draft. Defaults to an agent with no instructions, knowledge, or endpoints, the default action policy, and the standard model at auto reasoning.
13363
13597
  */
13364
13598
  definition?: AgentDefinition | null | undefined;
13365
13599
  };
@@ -17231,6 +17465,7 @@ export type AnalyticsGetStatsData = {
17231
17465
  body?: never;
17232
17466
  path?: never;
17233
17467
  query?: {
17468
+ namespaceId?: NamespaceId | undefined;
17234
17469
  after?: string | undefined;
17235
17470
  before?: string | undefined;
17236
17471
  groupBy?: "day" | "week" | "month" | undefined;
@@ -17283,6 +17518,7 @@ export type AnalyticsGetChannelStatsData = {
17283
17518
  body?: never;
17284
17519
  path?: never;
17285
17520
  query?: {
17521
+ namespaceId?: NamespaceId | undefined;
17286
17522
  after?: string | undefined;
17287
17523
  before?: string | undefined;
17288
17524
  };
@@ -17351,6 +17587,7 @@ export type AnalyticsGetTopContactsData = {
17351
17587
  body?: never;
17352
17588
  path?: never;
17353
17589
  query?: {
17590
+ namespaceId?: NamespaceId | undefined;
17354
17591
  after?: string | undefined;
17355
17592
  before?: string | undefined;
17356
17593
  limit?: number | null | undefined;
@@ -17402,6 +17639,7 @@ export type AnalyticsGetHourlyDistributionData = {
17402
17639
  body?: never;
17403
17640
  path?: never;
17404
17641
  query?: {
17642
+ namespaceId?: NamespaceId | undefined;
17405
17643
  after?: string | undefined;
17406
17644
  before?: string | undefined;
17407
17645
  };
@@ -17448,6 +17686,7 @@ export type AnalyticsGetDeliveryMetricsData = {
17448
17686
  body?: never;
17449
17687
  path?: never;
17450
17688
  query?: {
17689
+ namespaceId?: NamespaceId | undefined;
17451
17690
  after?: string | undefined;
17452
17691
  before?: string | undefined;
17453
17692
  channel?: "sms" | "whatsapp" | "email" | undefined;
@@ -17495,6 +17734,7 @@ export type AnalyticsGetDeliveryMetricsResponses = {
17495
17734
  export type AnalyticsGetDeliveryMetricsResponse = AnalyticsGetDeliveryMetricsResponses[keyof AnalyticsGetDeliveryMetricsResponses];
17496
17735
  export type AnalyticsExportDataData = {
17497
17736
  body: {
17737
+ namespaceId?: NamespaceId | null | undefined;
17498
17738
  after: string;
17499
17739
  before: string;
17500
17740
  format?: "csv" | "json" | null | undefined;
@@ -17607,7 +17847,6 @@ export type TemplatesCreateData = {
17607
17847
  useBrand?: boolean | null | undefined;
17608
17848
  description?: string | null | undefined;
17609
17849
  category?: "transactional" | "marketing" | "support" | "notification" | "verification" | "reminder" | "alert" | null | undefined;
17610
- isActive?: boolean | null | undefined;
17611
17850
  /**
17612
17851
  * The namespace the new template project belongs to; the project and every entry added to it share it. Omit for organization level. A namespace-scoped key always creates in its own namespace.
17613
17852
  */
@@ -17642,9 +17881,9 @@ export type TemplatesCreateErrors = {
17642
17881
  */
17643
17882
  404: ResourceNotFoundError;
17644
17883
  /**
17645
- * ConflictError
17884
+ * ConflictError | TemplateInUseError
17646
17885
  */
17647
- 409: ConflictError;
17886
+ 409: ConflictError | TemplateInUseError;
17648
17887
  /**
17649
17888
  * TemplateSourceError | ValidationError
17650
17889
  */
@@ -18049,7 +18288,7 @@ export type TemplatesAttachFamilyMemberResponses = {
18049
18288
  200: TemplateFamily;
18050
18289
  };
18051
18290
  export type TemplatesAttachFamilyMemberResponse = TemplatesAttachFamilyMemberResponses[keyof TemplatesAttachFamilyMemberResponses];
18052
- export type TemplatesRemoveData = {
18291
+ export type TemplatesDeleteData = {
18053
18292
  body?: never;
18054
18293
  path: {
18055
18294
  id: TemplateId;
@@ -18057,7 +18296,7 @@ export type TemplatesRemoveData = {
18057
18296
  query?: never;
18058
18297
  url: "/v1/templates/{id}";
18059
18298
  };
18060
- export type TemplatesRemoveErrors = {
18299
+ export type TemplatesDeleteErrors = {
18061
18300
  /**
18062
18301
  * MalformedRequestError
18063
18302
  */
@@ -18074,6 +18313,10 @@ export type TemplatesRemoveErrors = {
18074
18313
  * ResourceNotFoundError
18075
18314
  */
18076
18315
  404: ResourceNotFoundError;
18316
+ /**
18317
+ * TemplateInUseError
18318
+ */
18319
+ 409: TemplateInUseError;
18077
18320
  /**
18078
18321
  * ValidationError
18079
18322
  */
@@ -18087,14 +18330,14 @@ export type TemplatesRemoveErrors = {
18087
18330
  */
18088
18331
  504: GatewayTimeoutError;
18089
18332
  };
18090
- export type TemplatesRemoveError = TemplatesRemoveErrors[keyof TemplatesRemoveErrors];
18091
- export type TemplatesRemoveResponses = {
18333
+ export type TemplatesDeleteError = TemplatesDeleteErrors[keyof TemplatesDeleteErrors];
18334
+ export type TemplatesDeleteResponses = {
18092
18335
  /**
18093
18336
  * SuccessResponse
18094
18337
  */
18095
18338
  200: SuccessResponse;
18096
18339
  };
18097
- export type TemplatesRemoveResponse = TemplatesRemoveResponses[keyof TemplatesRemoveResponses];
18340
+ export type TemplatesDeleteResponse = TemplatesDeleteResponses[keyof TemplatesDeleteResponses];
18098
18341
  export type TemplatesGetByIdData = {
18099
18342
  body?: never;
18100
18343
  path: {
@@ -18155,7 +18398,6 @@ export type TemplatesUpdateData = {
18155
18398
  * Engagement tracking for sends of this template: `opens` and `clicks`, each inherited from the domain and organization defaults when omitted. A send request's own `tracking` still wins. Null clears the template's default.
18156
18399
  */
18157
18400
  trackingDefault?: TemplateTrackingDefault | null | undefined;
18158
- isActive?: boolean | null | undefined;
18159
18401
  /**
18160
18402
  * Share the template's project with every namespace, or stop sharing it. Applies to every entry in the project. Only an organization-level project is shared.
18161
18403
  */
@@ -18247,9 +18489,9 @@ export type TemplatesCreateFromWebsiteErrors = {
18247
18489
  */
18248
18490
  404: ResourceNotFoundError;
18249
18491
  /**
18250
- * ConflictError
18492
+ * ConflictError | TemplateInUseError
18251
18493
  */
18252
- 409: ConflictError;
18494
+ 409: ConflictError | TemplateInUseError;
18253
18495
  /**
18254
18496
  * TemplateSourceError | ValidationError
18255
18497
  */
@@ -18331,6 +18573,56 @@ export type TemplatesAddEntryResponses = {
18331
18573
  201: Template;
18332
18574
  };
18333
18575
  export type TemplatesAddEntryResponse = TemplatesAddEntryResponses[keyof TemplatesAddEntryResponses];
18576
+ export type TemplatesDeleteProjectData = {
18577
+ body?: never;
18578
+ path: {
18579
+ id: TemplateProjectId;
18580
+ };
18581
+ query?: never;
18582
+ url: "/v1/templates/projects/{id}";
18583
+ };
18584
+ export type TemplatesDeleteProjectErrors = {
18585
+ /**
18586
+ * MalformedRequestError
18587
+ */
18588
+ 400: MalformedRequestError;
18589
+ /**
18590
+ * UnauthorizedError
18591
+ */
18592
+ 401: UnauthorizedError;
18593
+ /**
18594
+ * ForbiddenError
18595
+ */
18596
+ 403: ForbiddenError;
18597
+ /**
18598
+ * ResourceNotFoundError
18599
+ */
18600
+ 404: ResourceNotFoundError;
18601
+ /**
18602
+ * TemplateInUseError
18603
+ */
18604
+ 409: TemplateInUseError;
18605
+ /**
18606
+ * ValidationError
18607
+ */
18608
+ 422: ValidationError;
18609
+ /**
18610
+ * InternalError
18611
+ */
18612
+ 500: InternalError;
18613
+ /**
18614
+ * GatewayTimeoutError
18615
+ */
18616
+ 504: GatewayTimeoutError;
18617
+ };
18618
+ export type TemplatesDeleteProjectError = TemplatesDeleteProjectErrors[keyof TemplatesDeleteProjectErrors];
18619
+ export type TemplatesDeleteProjectResponses = {
18620
+ /**
18621
+ * SuccessResponse
18622
+ */
18623
+ 200: SuccessResponse;
18624
+ };
18625
+ export type TemplatesDeleteProjectResponse = TemplatesDeleteProjectResponses[keyof TemplatesDeleteProjectResponses];
18334
18626
  export type TemplatesPatchWorkspaceData = {
18335
18627
  body: {
18336
18628
  expectedRevision: string;
@@ -18366,9 +18658,9 @@ export type TemplatesPatchWorkspaceErrors = {
18366
18658
  */
18367
18659
  404: ResourceNotFoundError;
18368
18660
  /**
18369
- * ConflictError
18661
+ * ConflictError | TemplateInUseError
18370
18662
  */
18371
- 409: ConflictError;
18663
+ 409: ConflictError | TemplateInUseError;
18372
18664
  /**
18373
18665
  * TemplateSourceError | ValidationError
18374
18666
  */
@@ -18500,9 +18792,9 @@ export type TemplatesOpenWorkspaceErrors = {
18500
18792
  */
18501
18793
  404: ResourceNotFoundError;
18502
18794
  /**
18503
- * ConflictError
18795
+ * ConflictError | TemplateInUseError
18504
18796
  */
18505
- 409: ConflictError;
18797
+ 409: ConflictError | TemplateInUseError;
18506
18798
  /**
18507
18799
  * TemplateSourceError | ValidationError
18508
18800
  */
@@ -18636,9 +18928,9 @@ export type TemplatesDiffWorkspaceErrors = {
18636
18928
  */
18637
18929
  404: ResourceNotFoundError;
18638
18930
  /**
18639
- * ConflictError
18931
+ * ConflictError | TemplateInUseError
18640
18932
  */
18641
- 409: ConflictError;
18933
+ 409: ConflictError | TemplateInUseError;
18642
18934
  /**
18643
18935
  * TemplateSourceError | ValidationError
18644
18936
  */
@@ -18713,9 +19005,9 @@ export type TemplatesPutWorkspaceAssetErrors = {
18713
19005
  */
18714
19006
  404: ResourceNotFoundError;
18715
19007
  /**
18716
- * ConflictError
19008
+ * ConflictError | TemplateInUseError
18717
19009
  */
18718
- 409: ConflictError;
19010
+ 409: ConflictError | TemplateInUseError;
18719
19011
  /**
18720
19012
  * TemplateSourceError | ValidationError
18721
19013
  */
@@ -18856,9 +19148,9 @@ export type TemplatesResolveWorkspaceConflictErrors = {
18856
19148
  */
18857
19149
  404: ResourceNotFoundError;
18858
19150
  /**
18859
- * ConflictError
19151
+ * ConflictError | TemplateInUseError
18860
19152
  */
18861
- 409: ConflictError;
19153
+ 409: ConflictError | TemplateInUseError;
18862
19154
  /**
18863
19155
  * TemplateSourceError | ValidationError
18864
19156
  */
@@ -18997,9 +19289,9 @@ export type TemplatesSaveWorkspaceErrors = {
18997
19289
  */
18998
19290
  404: ResourceNotFoundError;
18999
19291
  /**
19000
- * ConflictError
19292
+ * ConflictError | TemplateInUseError
19001
19293
  */
19002
- 409: ConflictError;
19294
+ 409: ConflictError | TemplateInUseError;
19003
19295
  /**
19004
19296
  * TemplateSourceError | ValidationError
19005
19297
  */
@@ -19111,9 +19403,9 @@ export type TemplatesRestoreWorkspaceErrors = {
19111
19403
  */
19112
19404
  404: ResourceNotFoundError;
19113
19405
  /**
19114
- * ConflictError
19406
+ * ConflictError | TemplateInUseError
19115
19407
  */
19116
- 409: ConflictError;
19408
+ 409: ConflictError | TemplateInUseError;
19117
19409
  /**
19118
19410
  * TemplateSourceError | ValidationError
19119
19411
  */
@@ -19253,9 +19545,9 @@ export type TemplatesWorkspaceHistoryErrors = {
19253
19545
  */
19254
19546
  404: ResourceNotFoundError;
19255
19547
  /**
19256
- * ConflictError
19548
+ * ConflictError | TemplateInUseError
19257
19549
  */
19258
- 409: ConflictError;
19550
+ 409: ConflictError | TemplateInUseError;
19259
19551
  /**
19260
19552
  * TemplateSourceError | ValidationError
19261
19553
  */
@@ -19323,9 +19615,9 @@ export type TemplatesCheckWorkspaceErrors = {
19323
19615
  */
19324
19616
  404: ResourceNotFoundError;
19325
19617
  /**
19326
- * ConflictError
19618
+ * ConflictError | TemplateInUseError
19327
19619
  */
19328
- 409: ConflictError;
19620
+ 409: ConflictError | TemplateInUseError;
19329
19621
  /**
19330
19622
  * TemplateSourceError | ValidationError
19331
19623
  */
@@ -19460,9 +19752,9 @@ export type TemplatesRenderWorkspaceFixtureErrors = {
19460
19752
  */
19461
19753
  404: ResourceNotFoundError;
19462
19754
  /**
19463
- * ConflictError
19755
+ * ConflictError | TemplateInUseError
19464
19756
  */
19465
- 409: ConflictError;
19757
+ 409: ConflictError | TemplateInUseError;
19466
19758
  /**
19467
19759
  * TemplateSourceError | ValidationError
19468
19760
  */
@@ -19674,9 +19966,9 @@ export type TemplatesPublishErrors = {
19674
19966
  */
19675
19967
  404: ResourceNotFoundError;
19676
19968
  /**
19677
- * ConflictError
19969
+ * ConflictError | TemplateInUseError
19678
19970
  */
19679
- 409: ConflictError;
19971
+ 409: ConflictError | TemplateInUseError;
19680
19972
  /**
19681
19973
  * TemplateSourceError | ValidationError
19682
19974
  */
@@ -20163,9 +20455,9 @@ export type TemplatesGetGitRepositoryErrors = {
20163
20455
  */
20164
20456
  404: ResourceNotFoundError;
20165
20457
  /**
20166
- * ConflictError
20458
+ * ConflictError | TemplateInUseError
20167
20459
  */
20168
- 409: ConflictError;
20460
+ 409: ConflictError | TemplateInUseError;
20169
20461
  /**
20170
20462
  * TemplateSourceError | ValidationError
20171
20463
  */
@@ -20222,9 +20514,9 @@ export type TemplatesIssueGitCredentialErrors = {
20222
20514
  */
20223
20515
  404: ResourceNotFoundError;
20224
20516
  /**
20225
- * ConflictError
20517
+ * ConflictError | TemplateInUseError
20226
20518
  */
20227
- 409: ConflictError;
20519
+ 409: ConflictError | TemplateInUseError;
20228
20520
  /**
20229
20521
  * TemplateSourceError | ValidationError
20230
20522
  */
@@ -20295,9 +20587,9 @@ export type TemplatesAttachWorkspaceResourceErrors = {
20295
20587
  */
20296
20588
  404: ResourceNotFoundError;
20297
20589
  /**
20298
- * ConflictError
20590
+ * ConflictError | TemplateInUseError
20299
20591
  */
20300
- 409: ConflictError;
20592
+ 409: ConflictError | TemplateInUseError;
20301
20593
  /**
20302
20594
  * TemplateSourceError | ValidationError
20303
20595
  */
@@ -20430,9 +20722,9 @@ export type TemplatesRemoveWorkspaceResourceErrors = {
20430
20722
  */
20431
20723
  404: ResourceNotFoundError;
20432
20724
  /**
20433
- * ConflictError
20725
+ * ConflictError | TemplateInUseError
20434
20726
  */
20435
- 409: ConflictError;
20727
+ 409: ConflictError | TemplateInUseError;
20436
20728
  /**
20437
20729
  * TemplateSourceError | ValidationError
20438
20730
  */
@@ -20828,6 +21120,7 @@ export type WebhooksListData = {
20828
21120
  query?: {
20829
21121
  limit?: number | null | undefined;
20830
21122
  cursor?: string | undefined;
21123
+ namespaceId?: NamespaceId | undefined;
20831
21124
  search?: string | undefined;
20832
21125
  status?: "active" | "disabled" | undefined;
20833
21126
  };
@@ -20871,7 +21164,7 @@ export type WebhooksCreateData = {
20871
21164
  body: {
20872
21165
  name: string;
20873
21166
  url: string;
20874
- eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook">;
21167
+ eventTypes: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "email.sending.paused" | "email.sending.resumed" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook">;
20875
21168
  channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
20876
21169
  mailboxIds?: [MailboxId, ...Array<MailboxId>] | null | undefined;
20877
21170
  namespaceId?: NamespaceId | null | undefined;
@@ -21037,7 +21330,7 @@ export type WebhooksUpdateData = {
21037
21330
  body: {
21038
21331
  name?: string | null | undefined;
21039
21332
  url?: string | null | undefined;
21040
- eventTypes?: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook"> | null | undefined;
21333
+ eventTypes?: Array<"message.sent" | "message.delivered" | "message.read" | "message.failed" | "message.bounced" | "message.complained" | "message.received" | "message.opened" | "message.clicked" | "contact.created" | "contact.updated" | "contact.deleted" | "contact.subscribed" | "contact.unsubscribed" | "contact.resubscribed" | "contact.consent_changed" | "conversation.created" | "conversation.updated" | "conversation.archived" | "webhook.created" | "webhook.updated" | "webhook.deleted" | "webhook.test" | "domain.updated" | "domain.warming.updated" | "email.sending.paused" | "email.sending.resumed" | "template.registration.updated" | "flow.registration.updated" | "whatsapp.number.connected" | "mailbox.message.received" | "mailbox.message.sent" | "mailbox.action.pending_approval" | "mailbox.action.resolved" | "mailbox.message.quarantined" | "mailbox.message.released" | "mailbox.message.discarded" | "mailbox.message.delivered" | "mailbox.message.read" | "mailbox.message.failed" | "journey.webhook"> | null | undefined;
21041
21334
  channels?: Array<"sms" | "whatsapp" | "email"> | null | undefined;
21042
21335
  mailboxIds?: [MailboxId, ...Array<MailboxId>] | null | undefined;
21043
21336
  namespaceId?: NamespaceId | null | undefined;
@@ -22000,6 +22293,7 @@ export type ApiKeysListData = {
22000
22293
  query?: {
22001
22294
  limit?: number | null | undefined;
22002
22295
  cursor?: string | undefined;
22296
+ namespaceId?: NamespaceId | undefined;
22003
22297
  status?: "active" | "revoked" | undefined;
22004
22298
  search?: string | undefined;
22005
22299
  };
@@ -22153,10 +22447,6 @@ export type ApiKeysUpdateData = {
22153
22447
  body: {
22154
22448
  name?: string | null | undefined;
22155
22449
  description?: string | null | undefined;
22156
- /**
22157
- * Changes the mailbox send mode of a key that holds mailbox access. Only a person can change it; the change applies to the key's next request.
22158
- */
22159
- mailboxes?: ApiKeyMailboxAccessUpdate | null | undefined;
22160
22450
  };
22161
22451
  path: {
22162
22452
  id: ApiKeyId;
@@ -22499,6 +22789,7 @@ export type MailboxesListData = {
22499
22789
  cursor?: string | undefined;
22500
22790
  after?: string | undefined;
22501
22791
  before?: string | undefined;
22792
+ namespaceId?: NamespaceId | undefined;
22502
22793
  };
22503
22794
  url: "/v1/mailboxes";
22504
22795
  };
@@ -22544,6 +22835,12 @@ export type MailboxesCreateData = {
22544
22835
  slug?: string | null | undefined;
22545
22836
  metadata?: MailboxMetadataWritable | null | undefined;
22546
22837
  };
22838
+ headers?: {
22839
+ /**
22840
+ * Optional key that makes mailbox creation idempotent for the calling key or member. The same key and body return the original mailbox in its current state. A different body with the same key returns 409. Keep the key after a lost response; it remains bound for the mailbox's lifetime.
22841
+ */
22842
+ "idempotency-key"?: string | undefined;
22843
+ };
22547
22844
  path?: never;
22548
22845
  query?: never;
22549
22846
  url: "/v1/mailboxes";
@@ -23088,7 +23385,6 @@ export type MailboxesCreateGrantData = {
23088
23385
  body: {
23089
23386
  userId: UserId;
23090
23387
  role: MailboxGrantRole;
23091
- sendMode?: MailboxSendMode | null | undefined;
23092
23388
  };
23093
23389
  path: {
23094
23390
  id: MailboxId;
@@ -23192,7 +23488,6 @@ export type MailboxesRevokeGrantResponse = MailboxesRevokeGrantResponses[keyof M
23192
23488
  export type MailboxesUpdateGrantData = {
23193
23489
  body: {
23194
23490
  role?: MailboxGrantRole | null | undefined;
23195
- sendMode?: MailboxSendMode | null | undefined;
23196
23491
  };
23197
23492
  path: {
23198
23493
  id: MailboxId;
@@ -23243,253 +23538,6 @@ export type MailboxesUpdateGrantResponses = {
23243
23538
  200: MailboxGrant;
23244
23539
  };
23245
23540
  export type MailboxesUpdateGrantResponse = MailboxesUpdateGrantResponses[keyof MailboxesUpdateGrantResponses];
23246
- export type MailboxesListPoliciesData = {
23247
- body?: never;
23248
- path: {
23249
- id: MailboxId;
23250
- };
23251
- query?: never;
23252
- url: "/v1/mailboxes/{id}/policies";
23253
- };
23254
- export type MailboxesListPoliciesErrors = {
23255
- /**
23256
- * MalformedRequestError
23257
- */
23258
- 400: MalformedRequestError;
23259
- /**
23260
- * UnauthorizedError
23261
- */
23262
- 401: UnauthorizedError;
23263
- /**
23264
- * ForbiddenError
23265
- */
23266
- 403: ForbiddenError;
23267
- /**
23268
- * ResourceNotFoundError
23269
- */
23270
- 404: ResourceNotFoundError;
23271
- /**
23272
- * ValidationError
23273
- */
23274
- 422: ValidationError;
23275
- /**
23276
- * InternalError
23277
- */
23278
- 500: InternalError;
23279
- /**
23280
- * GatewayTimeoutError
23281
- */
23282
- 504: GatewayTimeoutError;
23283
- };
23284
- export type MailboxesListPoliciesError = MailboxesListPoliciesErrors[keyof MailboxesListPoliciesErrors];
23285
- export type MailboxesListPoliciesResponses = {
23286
- /**
23287
- * MailboxPolicyList
23288
- */
23289
- 200: MailboxPolicyList;
23290
- };
23291
- export type MailboxesListPoliciesResponse = MailboxesListPoliciesResponses[keyof MailboxesListPoliciesResponses];
23292
- export type MailboxesCreatePolicyData = {
23293
- body: {
23294
- name: string;
23295
- outcome: MailboxPolicyOutcomeKind;
23296
- reason?: string | null | undefined;
23297
- enabled?: boolean | null | undefined;
23298
- };
23299
- path: {
23300
- id: MailboxId;
23301
- };
23302
- query?: never;
23303
- url: "/v1/mailboxes/{id}/policies";
23304
- };
23305
- export type MailboxesCreatePolicyErrors = {
23306
- /**
23307
- * MalformedRequestError
23308
- */
23309
- 400: MalformedRequestError;
23310
- /**
23311
- * UnauthorizedError
23312
- */
23313
- 401: UnauthorizedError;
23314
- /**
23315
- * ForbiddenError
23316
- */
23317
- 403: ForbiddenError;
23318
- /**
23319
- * ResourceNotFoundError
23320
- */
23321
- 404: ResourceNotFoundError;
23322
- /**
23323
- * ConflictError
23324
- */
23325
- 409: ConflictError;
23326
- /**
23327
- * ValidationError
23328
- */
23329
- 422: ValidationError;
23330
- /**
23331
- * InternalError
23332
- */
23333
- 500: InternalError;
23334
- /**
23335
- * GatewayTimeoutError
23336
- */
23337
- 504: GatewayTimeoutError;
23338
- };
23339
- export type MailboxesCreatePolicyError = MailboxesCreatePolicyErrors[keyof MailboxesCreatePolicyErrors];
23340
- export type MailboxesCreatePolicyResponses = {
23341
- /**
23342
- * Success
23343
- */
23344
- 201: MailboxPolicy;
23345
- };
23346
- export type MailboxesCreatePolicyResponse = MailboxesCreatePolicyResponses[keyof MailboxesCreatePolicyResponses];
23347
- export type MailboxesDeletePolicyData = {
23348
- body?: never;
23349
- path: {
23350
- id: MailboxId;
23351
- policyId: MailboxPolicyId;
23352
- };
23353
- query?: never;
23354
- url: "/v1/mailboxes/{id}/policies/{policyId}";
23355
- };
23356
- export type MailboxesDeletePolicyErrors = {
23357
- /**
23358
- * MalformedRequestError
23359
- */
23360
- 400: MalformedRequestError;
23361
- /**
23362
- * UnauthorizedError
23363
- */
23364
- 401: UnauthorizedError;
23365
- /**
23366
- * ForbiddenError
23367
- */
23368
- 403: ForbiddenError;
23369
- /**
23370
- * ResourceNotFoundError
23371
- */
23372
- 404: ResourceNotFoundError;
23373
- /**
23374
- * ValidationError
23375
- */
23376
- 422: ValidationError;
23377
- /**
23378
- * InternalError
23379
- */
23380
- 500: InternalError;
23381
- /**
23382
- * GatewayTimeoutError
23383
- */
23384
- 504: GatewayTimeoutError;
23385
- };
23386
- export type MailboxesDeletePolicyError = MailboxesDeletePolicyErrors[keyof MailboxesDeletePolicyErrors];
23387
- export type MailboxesDeletePolicyResponses = {
23388
- /**
23389
- * SuccessResponse
23390
- */
23391
- 200: SuccessResponse;
23392
- };
23393
- export type MailboxesDeletePolicyResponse = MailboxesDeletePolicyResponses[keyof MailboxesDeletePolicyResponses];
23394
- export type MailboxesGetPolicyData = {
23395
- body?: never;
23396
- path: {
23397
- id: MailboxId;
23398
- policyId: MailboxPolicyId;
23399
- };
23400
- query?: never;
23401
- url: "/v1/mailboxes/{id}/policies/{policyId}";
23402
- };
23403
- export type MailboxesGetPolicyErrors = {
23404
- /**
23405
- * MalformedRequestError
23406
- */
23407
- 400: MalformedRequestError;
23408
- /**
23409
- * UnauthorizedError
23410
- */
23411
- 401: UnauthorizedError;
23412
- /**
23413
- * ForbiddenError
23414
- */
23415
- 403: ForbiddenError;
23416
- /**
23417
- * ResourceNotFoundError
23418
- */
23419
- 404: ResourceNotFoundError;
23420
- /**
23421
- * ValidationError
23422
- */
23423
- 422: ValidationError;
23424
- /**
23425
- * InternalError
23426
- */
23427
- 500: InternalError;
23428
- /**
23429
- * GatewayTimeoutError
23430
- */
23431
- 504: GatewayTimeoutError;
23432
- };
23433
- export type MailboxesGetPolicyError = MailboxesGetPolicyErrors[keyof MailboxesGetPolicyErrors];
23434
- export type MailboxesGetPolicyResponses = {
23435
- /**
23436
- * MailboxPolicy
23437
- */
23438
- 200: MailboxPolicy;
23439
- };
23440
- export type MailboxesGetPolicyResponse = MailboxesGetPolicyResponses[keyof MailboxesGetPolicyResponses];
23441
- export type MailboxesUpdatePolicyData = {
23442
- body: {
23443
- name?: string | null | undefined;
23444
- outcome?: MailboxPolicyOutcomeKind | null | undefined;
23445
- reason?: string | null | undefined;
23446
- enabled?: boolean | null | undefined;
23447
- };
23448
- path: {
23449
- id: MailboxId;
23450
- policyId: MailboxPolicyId;
23451
- };
23452
- query?: never;
23453
- url: "/v1/mailboxes/{id}/policies/{policyId}";
23454
- };
23455
- export type MailboxesUpdatePolicyErrors = {
23456
- /**
23457
- * MalformedRequestError
23458
- */
23459
- 400: MalformedRequestError;
23460
- /**
23461
- * UnauthorizedError
23462
- */
23463
- 401: UnauthorizedError;
23464
- /**
23465
- * ForbiddenError
23466
- */
23467
- 403: ForbiddenError;
23468
- /**
23469
- * ResourceNotFoundError
23470
- */
23471
- 404: ResourceNotFoundError;
23472
- /**
23473
- * ValidationError
23474
- */
23475
- 422: ValidationError;
23476
- /**
23477
- * InternalError
23478
- */
23479
- 500: InternalError;
23480
- /**
23481
- * GatewayTimeoutError
23482
- */
23483
- 504: GatewayTimeoutError;
23484
- };
23485
- export type MailboxesUpdatePolicyError = MailboxesUpdatePolicyErrors[keyof MailboxesUpdatePolicyErrors];
23486
- export type MailboxesUpdatePolicyResponses = {
23487
- /**
23488
- * MailboxPolicy
23489
- */
23490
- 200: MailboxPolicy;
23491
- };
23492
- export type MailboxesUpdatePolicyResponse = MailboxesUpdatePolicyResponses[keyof MailboxesUpdatePolicyResponses];
23493
23541
  export type MailboxesListFoldersData = {
23494
23542
  body?: never;
23495
23543
  path: {
@@ -23834,6 +23882,9 @@ export type MailboxesListOrganizationThreadsData = {
23834
23882
  cursor?: string | undefined;
23835
23883
  after?: string | undefined;
23836
23884
  before?: string | undefined;
23885
+ /**
23886
+ * Search subjects, participants, message text, and attachment filenames by semantic and keyword relevance. Filters narrow the search. Returns up to 100 best-matching threads across cursor pages; omit q to list by recent activity. New mail can take a few seconds to become searchable. Attachment contents are not searched.
23887
+ */
23837
23888
  q?: string | undefined;
23838
23889
  state?: "active" | "done" | undefined;
23839
23890
  folder?: MailboxThreadFolder | undefined;
@@ -23895,6 +23946,9 @@ export type MailboxesListThreadsData = {
23895
23946
  cursor?: string | undefined;
23896
23947
  after?: string | undefined;
23897
23948
  before?: string | undefined;
23949
+ /**
23950
+ * Search subjects, participants, message text, and attachment filenames by semantic and keyword relevance. Filters narrow the search. Returns up to 100 best-matching threads across cursor pages; omit q to list by recent activity. New mail can take a few seconds to become searchable. Attachment contents are not searched.
23951
+ */
23898
23952
  q?: string | undefined;
23899
23953
  state?: "active" | "done" | undefined;
23900
23954
  folder?: MailboxThreadFolder | undefined;
@@ -25679,7 +25733,14 @@ export type MailboxesRetryActionResponses = {
25679
25733
  };
25680
25734
  export type MailboxesRetryActionResponse = MailboxesRetryActionResponses[keyof MailboxesRetryActionResponses];
25681
25735
  export type MailboxesApproveActionData = {
25682
- body?: never;
25736
+ body: {
25737
+ reviewRound: PolicyReviewRound;
25738
+ always?: boolean | null | undefined;
25739
+ edits?: {
25740
+ text?: string | null | undefined;
25741
+ html?: string | null | undefined;
25742
+ } | null | undefined;
25743
+ };
25683
25744
  path: {
25684
25745
  id: MailboxId;
25685
25746
  actionId: MailboxActionId;
@@ -25751,6 +25812,7 @@ export type MailboxesApproveActionResponses = {
25751
25812
  export type MailboxesApproveActionResponse = MailboxesApproveActionResponses[keyof MailboxesApproveActionResponses];
25752
25813
  export type MailboxesDenyActionData = {
25753
25814
  body: {
25815
+ reviewRound: PolicyReviewRound;
25754
25816
  reason: string;
25755
25817
  };
25756
25818
  path: {
@@ -25853,6 +25915,166 @@ export type MailboxesListEventsResponses = {
25853
25915
  200: MailboxEventPage;
25854
25916
  };
25855
25917
  export type MailboxesListEventsResponse = MailboxesListEventsResponses[keyof MailboxesListEventsResponses];
25918
+ export type PoliciesDeletePolicyData = {
25919
+ body?: never;
25920
+ path: {
25921
+ kind: "organization" | "mailbox" | "apiKey" | "agent";
25922
+ id: string;
25923
+ };
25924
+ query: {
25925
+ ifVersion: number;
25926
+ };
25927
+ url: "/v1/policies/{kind}/{id}";
25928
+ };
25929
+ export type PoliciesDeletePolicyErrors = {
25930
+ /**
25931
+ * MalformedRequestError
25932
+ */
25933
+ 400: MalformedRequestError;
25934
+ /**
25935
+ * UnauthorizedError
25936
+ */
25937
+ 401: UnauthorizedError;
25938
+ /**
25939
+ * ForbiddenError
25940
+ */
25941
+ 403: ForbiddenError;
25942
+ /**
25943
+ * ResourceNotFoundError
25944
+ */
25945
+ 404: ResourceNotFoundError;
25946
+ /**
25947
+ * ConflictError
25948
+ */
25949
+ 409: ConflictError;
25950
+ /**
25951
+ * ValidationError
25952
+ */
25953
+ 422: ValidationError;
25954
+ /**
25955
+ * InternalError
25956
+ */
25957
+ 500: InternalError;
25958
+ /**
25959
+ * GatewayTimeoutError
25960
+ */
25961
+ 504: GatewayTimeoutError;
25962
+ };
25963
+ export type PoliciesDeletePolicyError = PoliciesDeletePolicyErrors[keyof PoliciesDeletePolicyErrors];
25964
+ export type PoliciesDeletePolicyResponses = {
25965
+ /**
25966
+ * PolicySnapshot
25967
+ */
25968
+ 200: PolicySnapshot;
25969
+ };
25970
+ export type PoliciesDeletePolicyResponse = PoliciesDeletePolicyResponses[keyof PoliciesDeletePolicyResponses];
25971
+ export type PoliciesGetPolicyData = {
25972
+ body?: never;
25973
+ path: {
25974
+ kind: "organization" | "mailbox" | "apiKey" | "agent";
25975
+ id: string;
25976
+ };
25977
+ query?: never;
25978
+ url: "/v1/policies/{kind}/{id}";
25979
+ };
25980
+ export type PoliciesGetPolicyErrors = {
25981
+ /**
25982
+ * MalformedRequestError
25983
+ */
25984
+ 400: MalformedRequestError;
25985
+ /**
25986
+ * UnauthorizedError
25987
+ */
25988
+ 401: UnauthorizedError;
25989
+ /**
25990
+ * ForbiddenError
25991
+ */
25992
+ 403: ForbiddenError;
25993
+ /**
25994
+ * ResourceNotFoundError
25995
+ */
25996
+ 404: ResourceNotFoundError;
25997
+ /**
25998
+ * ConflictError
25999
+ */
26000
+ 409: ConflictError;
26001
+ /**
26002
+ * ValidationError
26003
+ */
26004
+ 422: ValidationError;
26005
+ /**
26006
+ * InternalError
26007
+ */
26008
+ 500: InternalError;
26009
+ /**
26010
+ * GatewayTimeoutError
26011
+ */
26012
+ 504: GatewayTimeoutError;
26013
+ };
26014
+ export type PoliciesGetPolicyError = PoliciesGetPolicyErrors[keyof PoliciesGetPolicyErrors];
26015
+ export type PoliciesGetPolicyResponses = {
26016
+ /**
26017
+ * PolicySnapshot
26018
+ */
26019
+ 200: PolicySnapshot;
26020
+ };
26021
+ export type PoliciesGetPolicyResponse = PoliciesGetPolicyResponses[keyof PoliciesGetPolicyResponses];
26022
+ export type PoliciesSetPolicyData = {
26023
+ body: {
26024
+ presets: Array<string>;
26025
+ rules: Array<PolicyRule>;
26026
+ instructions?: string | null | undefined;
26027
+ ifVersion: PolicyVersion;
26028
+ };
26029
+ path: {
26030
+ kind: "organization" | "mailbox" | "apiKey" | "agent";
26031
+ id: string;
26032
+ };
26033
+ query?: never;
26034
+ url: "/v1/policies/{kind}/{id}";
26035
+ };
26036
+ export type PoliciesSetPolicyErrors = {
26037
+ /**
26038
+ * MalformedRequestError
26039
+ */
26040
+ 400: MalformedRequestError;
26041
+ /**
26042
+ * UnauthorizedError
26043
+ */
26044
+ 401: UnauthorizedError;
26045
+ /**
26046
+ * ForbiddenError
26047
+ */
26048
+ 403: ForbiddenError;
26049
+ /**
26050
+ * ResourceNotFoundError
26051
+ */
26052
+ 404: ResourceNotFoundError;
26053
+ /**
26054
+ * ConflictError
26055
+ */
26056
+ 409: ConflictError;
26057
+ /**
26058
+ * ValidationError
26059
+ */
26060
+ 422: ValidationError;
26061
+ /**
26062
+ * InternalError
26063
+ */
26064
+ 500: InternalError;
26065
+ /**
26066
+ * GatewayTimeoutError
26067
+ */
26068
+ 504: GatewayTimeoutError;
26069
+ };
26070
+ export type PoliciesSetPolicyError = PoliciesSetPolicyErrors[keyof PoliciesSetPolicyErrors];
26071
+ export type PoliciesSetPolicyResponses = {
26072
+ /**
26073
+ * PolicySnapshot
26074
+ */
26075
+ 200: PolicySnapshot;
26076
+ };
26077
+ export type PoliciesSetPolicyResponse = PoliciesSetPolicyResponses[keyof PoliciesSetPolicyResponses];
25856
26078
  export type NamespacesListData = {
25857
26079
  body?: never;
25858
26080
  path?: never;
@@ -26120,9 +26342,9 @@ export type NamespacesAssignResourceErrors = {
26120
26342
  */
26121
26343
  401: UnauthorizedError;
26122
26344
  /**
26123
- * ForbiddenError
26345
+ * FlagDisabledError | ForbiddenError
26124
26346
  */
26125
- 403: ForbiddenError;
26347
+ 403: FlagDisabledError | ForbiddenError;
26126
26348
  /**
26127
26349
  * ResourceNotFoundError
26128
26350
  */
@@ -26172,9 +26394,9 @@ export type NamespacesRemoveResourceErrors = {
26172
26394
  */
26173
26395
  401: UnauthorizedError;
26174
26396
  /**
26175
- * ForbiddenError
26397
+ * FlagDisabledError | ForbiddenError
26176
26398
  */
26177
- 403: ForbiddenError;
26399
+ 403: FlagDisabledError | ForbiddenError;
26178
26400
  /**
26179
26401
  * ResourceNotFoundError
26180
26402
  */
@@ -26571,7 +26793,7 @@ export type ExtensionInstallationsInstallData = {
26571
26793
  mailboxIds?: Array<MailboxId> | null | undefined;
26572
26794
  namespaceId?: NamespaceId | null | undefined;
26573
26795
  permissions?: Array<"read" | "update" | "send" | "quarantine.read"> | null | undefined;
26574
- sendMode?: "send" | "approval" | null | undefined;
26796
+ policy?: PolicyConfiguration | null | undefined;
26575
26797
  webhookUrl?: string | null | undefined;
26576
26798
  };
26577
26799
  path?: never;