@epilot/sdk 2.19.3 → 2.19.5

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 (231) hide show
  1. package/definitions/access-token-runtime.json +1 -0
  2. package/definitions/access-token.json +835 -0
  3. package/definitions/address-runtime.json +1 -0
  4. package/definitions/address-suggestions-runtime.json +1 -0
  5. package/definitions/address-suggestions.json +582 -0
  6. package/definitions/address.json +578 -0
  7. package/definitions/ai-agents-runtime.json +1 -0
  8. package/definitions/ai-agents.json +2863 -0
  9. package/definitions/app-runtime.json +1 -0
  10. package/definitions/app.json +5743 -0
  11. package/definitions/audit-logs-runtime.json +1 -0
  12. package/definitions/audit-logs.json +305 -0
  13. package/definitions/automation-runtime.json +1 -0
  14. package/definitions/automation.json +5557 -0
  15. package/definitions/billing-runtime.json +1 -0
  16. package/definitions/billing.json +2386 -0
  17. package/definitions/blueprint-manifest-runtime.json +1 -0
  18. package/definitions/blueprint-manifest.json +7718 -0
  19. package/definitions/calendar-runtime.json +1 -0
  20. package/definitions/calendar.json +2904 -0
  21. package/definitions/configuration-hub-runtime.json +1 -0
  22. package/definitions/configuration-hub.json +2250 -0
  23. package/definitions/consent-runtime.json +1 -0
  24. package/definitions/consent.json +344 -0
  25. package/definitions/customer-portal-runtime.json +1 -0
  26. package/definitions/customer-portal.json +19945 -0
  27. package/definitions/dashboard-runtime.json +1 -0
  28. package/definitions/dashboard.json +1355 -0
  29. package/definitions/data-governance-runtime.json +1 -0
  30. package/definitions/data-governance.json +1126 -0
  31. package/definitions/deduplication-runtime.json +1 -0
  32. package/definitions/deduplication.json +782 -0
  33. package/definitions/design-runtime.json +1 -0
  34. package/definitions/design.json +1827 -0
  35. package/definitions/document-runtime.json +1 -0
  36. package/definitions/document.json +758 -0
  37. package/definitions/email-settings-runtime.json +1 -0
  38. package/definitions/email-settings.json +3736 -0
  39. package/definitions/email-template-runtime.json +1 -0
  40. package/definitions/email-template.json +1441 -0
  41. package/definitions/entity-mapping-runtime.json +1 -0
  42. package/definitions/entity-mapping.json +1642 -0
  43. package/definitions/entity-runtime.json +1 -0
  44. package/definitions/entity.json +11517 -0
  45. package/definitions/environments-runtime.json +1 -0
  46. package/definitions/environments.json +539 -0
  47. package/definitions/event-catalog-runtime.json +1 -0
  48. package/definitions/event-catalog.json +1524 -0
  49. package/definitions/file-runtime.json +1 -0
  50. package/definitions/file.json +3905 -0
  51. package/definitions/iban-runtime.json +1 -0
  52. package/definitions/iban.json +132 -0
  53. package/definitions/integration-toolkit-runtime.json +1 -0
  54. package/definitions/integration-toolkit.json +12769 -0
  55. package/definitions/journey-runtime.json +1 -0
  56. package/definitions/journey.json +2640 -0
  57. package/definitions/kanban-runtime.json +1 -0
  58. package/definitions/kanban.json +1506 -0
  59. package/definitions/message-runtime.json +1 -0
  60. package/definitions/message.json +3667 -0
  61. package/definitions/metering-runtime.json +1 -0
  62. package/definitions/metering.json +3132 -0
  63. package/definitions/notes-runtime.json +1 -0
  64. package/definitions/notes.json +1698 -0
  65. package/definitions/notification-runtime.json +1 -0
  66. package/definitions/notification.json +1439 -0
  67. package/definitions/organization-runtime.json +1 -0
  68. package/definitions/organization.json +1192 -0
  69. package/definitions/partner-directory-runtime.json +1 -0
  70. package/definitions/partner-directory.json +2284 -0
  71. package/definitions/permissions-runtime.json +1 -0
  72. package/definitions/permissions.json +1598 -0
  73. package/definitions/pricing-runtime.json +1 -0
  74. package/definitions/pricing-tier-runtime.json +1 -0
  75. package/definitions/pricing-tier.json +105 -0
  76. package/definitions/pricing.json +11569 -0
  77. package/definitions/purpose-runtime.json +1 -0
  78. package/definitions/purpose.json +524 -0
  79. package/definitions/query-runtime.json +1 -0
  80. package/definitions/query.json +3178 -0
  81. package/definitions/sandbox-runtime.json +1 -0
  82. package/definitions/sandbox.json +453 -0
  83. package/definitions/sharing-runtime.json +1 -0
  84. package/definitions/sharing.json +956 -0
  85. package/definitions/snapshot-runtime.json +1 -0
  86. package/definitions/snapshot.json +1103 -0
  87. package/definitions/submission-runtime.json +1 -0
  88. package/definitions/submission.json +313 -0
  89. package/definitions/targeting-runtime.json +1 -0
  90. package/definitions/targeting.json +2222 -0
  91. package/definitions/template-variables-runtime.json +1 -0
  92. package/definitions/template-variables.json +1416 -0
  93. package/definitions/user-runtime.json +1 -0
  94. package/definitions/user.json +3051 -0
  95. package/definitions/validation-rules-runtime.json +1 -0
  96. package/definitions/validation-rules.json +2365 -0
  97. package/definitions/webhooks-runtime.json +1 -0
  98. package/definitions/webhooks.json +1875 -0
  99. package/definitions/workflow-definition-runtime.json +1 -0
  100. package/definitions/workflow-definition.json +3592 -0
  101. package/definitions/workflow-runtime.json +1 -0
  102. package/definitions/workflow.json +4669 -0
  103. package/dist/apis/access-token.cjs +6 -6
  104. package/dist/apis/access-token.js +1 -1
  105. package/dist/apis/address-suggestions.cjs +6 -6
  106. package/dist/apis/address-suggestions.js +1 -1
  107. package/dist/apis/address.cjs +6 -6
  108. package/dist/apis/address.js +1 -1
  109. package/dist/apis/ai-agents.cjs +6 -6
  110. package/dist/apis/ai-agents.js +1 -1
  111. package/dist/apis/app.cjs +6 -6
  112. package/dist/apis/app.js +1 -1
  113. package/dist/apis/audit-logs.cjs +6 -6
  114. package/dist/apis/audit-logs.js +1 -1
  115. package/dist/apis/automation.cjs +6 -6
  116. package/dist/apis/automation.js +1 -1
  117. package/dist/apis/billing.cjs +6 -6
  118. package/dist/apis/billing.js +1 -1
  119. package/dist/apis/blueprint-manifest.cjs +6 -6
  120. package/dist/apis/blueprint-manifest.js +1 -1
  121. package/dist/apis/calendar.cjs +6 -6
  122. package/dist/apis/calendar.js +1 -1
  123. package/dist/apis/configuration-hub.cjs +6 -6
  124. package/dist/apis/configuration-hub.js +1 -1
  125. package/dist/apis/consent.cjs +6 -6
  126. package/dist/apis/consent.js +1 -1
  127. package/dist/apis/customer-portal.cjs +6 -6
  128. package/dist/apis/customer-portal.d.cts +2 -2
  129. package/dist/apis/customer-portal.d.ts +2 -2
  130. package/dist/apis/customer-portal.js +1 -1
  131. package/dist/apis/dashboard.cjs +6 -6
  132. package/dist/apis/dashboard.js +1 -1
  133. package/dist/apis/data-governance.cjs +6 -6
  134. package/dist/apis/data-governance.js +1 -1
  135. package/dist/apis/deduplication.cjs +6 -6
  136. package/dist/apis/deduplication.js +1 -1
  137. package/dist/apis/design.cjs +6 -6
  138. package/dist/apis/design.js +1 -1
  139. package/dist/apis/document.cjs +6 -6
  140. package/dist/apis/document.js +1 -1
  141. package/dist/apis/email-settings.cjs +6 -6
  142. package/dist/apis/email-settings.js +1 -1
  143. package/dist/apis/email-template.cjs +6 -6
  144. package/dist/apis/email-template.js +1 -1
  145. package/dist/apis/entity-mapping.cjs +6 -6
  146. package/dist/apis/entity-mapping.js +1 -1
  147. package/dist/apis/entity.cjs +6 -6
  148. package/dist/apis/entity.js +1 -1
  149. package/dist/apis/environments.cjs +6 -6
  150. package/dist/apis/environments.js +1 -1
  151. package/dist/apis/event-catalog.cjs +6 -6
  152. package/dist/apis/event-catalog.js +1 -1
  153. package/dist/apis/file.cjs +6 -6
  154. package/dist/apis/file.js +1 -1
  155. package/dist/apis/iban.cjs +6 -6
  156. package/dist/apis/iban.js +1 -1
  157. package/dist/apis/integration-toolkit.cjs +6 -6
  158. package/dist/apis/integration-toolkit.js +1 -1
  159. package/dist/apis/journey.cjs +6 -6
  160. package/dist/apis/journey.js +1 -1
  161. package/dist/apis/kanban.cjs +6 -6
  162. package/dist/apis/kanban.js +1 -1
  163. package/dist/apis/message.cjs +6 -6
  164. package/dist/apis/message.js +1 -1
  165. package/dist/apis/metering.cjs +6 -6
  166. package/dist/apis/metering.js +1 -1
  167. package/dist/apis/notes.cjs +6 -6
  168. package/dist/apis/notes.js +1 -1
  169. package/dist/apis/notification.cjs +6 -6
  170. package/dist/apis/notification.js +1 -1
  171. package/dist/apis/organization.cjs +6 -6
  172. package/dist/apis/organization.js +1 -1
  173. package/dist/apis/partner-directory.cjs +6 -6
  174. package/dist/apis/partner-directory.js +1 -1
  175. package/dist/apis/permissions.cjs +6 -6
  176. package/dist/apis/permissions.js +1 -1
  177. package/dist/apis/pricing-tier.cjs +6 -6
  178. package/dist/apis/pricing-tier.js +1 -1
  179. package/dist/apis/pricing.cjs +6 -6
  180. package/dist/apis/pricing.js +1 -1
  181. package/dist/apis/purpose.cjs +6 -6
  182. package/dist/apis/purpose.js +1 -1
  183. package/dist/apis/query.cjs +6 -6
  184. package/dist/apis/query.js +1 -1
  185. package/dist/apis/sandbox.cjs +6 -6
  186. package/dist/apis/sandbox.js +1 -1
  187. package/dist/apis/sharing.cjs +6 -6
  188. package/dist/apis/sharing.js +1 -1
  189. package/dist/apis/snapshot.cjs +6 -6
  190. package/dist/apis/snapshot.js +1 -1
  191. package/dist/apis/submission.cjs +6 -6
  192. package/dist/apis/submission.js +1 -1
  193. package/dist/apis/target.cjs +6 -6
  194. package/dist/apis/target.js +1 -1
  195. package/dist/apis/targeting.cjs +6 -6
  196. package/dist/apis/targeting.d.cts +2 -2
  197. package/dist/apis/targeting.d.ts +2 -2
  198. package/dist/apis/targeting.js +1 -1
  199. package/dist/apis/template-variables.cjs +6 -6
  200. package/dist/apis/template-variables.js +1 -1
  201. package/dist/apis/user.cjs +6 -6
  202. package/dist/apis/user.js +1 -1
  203. package/dist/apis/validation-rules.cjs +6 -6
  204. package/dist/apis/validation-rules.js +1 -1
  205. package/dist/apis/webhooks.cjs +6 -6
  206. package/dist/apis/webhooks.js +1 -1
  207. package/dist/apis/workflow-definition.cjs +6 -6
  208. package/dist/apis/workflow-definition.js +1 -1
  209. package/dist/apis/workflow.cjs +6 -6
  210. package/dist/apis/workflow.js +1 -1
  211. package/dist/{chunk-UC3IKFHD.js → chunk-HWPPR3IM.js} +2 -2
  212. package/dist/{chunk-QWWGJOYR.cjs → chunk-VB6VABGZ.cjs} +2 -2
  213. package/dist/customer-portal-CDFQM72A.js +7 -0
  214. package/dist/customer-portal-MS6WNXAO.cjs +7 -0
  215. package/dist/{customer-portal.d-DTnk0yQf.d.cts → customer-portal.d-DJHJY-vb.d.cts} +51 -8
  216. package/dist/{customer-portal.d-DTnk0yQf.d.ts → customer-portal.d-DJHJY-vb.d.ts} +51 -8
  217. package/dist/index.cjs +8 -8
  218. package/dist/index.d.cts +2 -2
  219. package/dist/index.d.ts +2 -2
  220. package/dist/index.js +1 -1
  221. package/dist/targeting-5U4XGOXY.cjs +7 -0
  222. package/dist/targeting-R3G32HI4.js +7 -0
  223. package/dist/{targeting.d-16SvPyj4.d.cts → targeting.d-KcawmWBB.d.cts} +8 -0
  224. package/dist/{targeting.d-16SvPyj4.d.ts → targeting.d-KcawmWBB.d.ts} +8 -0
  225. package/docs/customer-portal.md +13 -4
  226. package/docs/targeting.md +9 -1
  227. package/package.json +1 -1
  228. package/dist/customer-portal-FCUPDA7V.cjs +0 -7
  229. package/dist/customer-portal-GRWXQYKT.js +0 -7
  230. package/dist/targeting-BTVCLYFW.cjs +0 -7
  231. package/dist/targeting-NWYDE3E7.js +0 -7
@@ -0,0 +1,3667 @@
1
+ {
2
+ "openapi": "3.0.2",
3
+ "info": {
4
+ "title": "Message API",
5
+ "version": "1.5.0",
6
+ "description": "Send and receive email messages via your epilot organization\n"
7
+ },
8
+ "security": [
9
+ {
10
+ "EpilotAuth": []
11
+ },
12
+ {
13
+ "EpilotOrg": []
14
+ }
15
+ ],
16
+ "tags": [
17
+ {
18
+ "name": "Messages"
19
+ },
20
+ {
21
+ "name": "Threads"
22
+ },
23
+ {
24
+ "name": "Drafts"
25
+ },
26
+ {
27
+ "name": "message_schema",
28
+ "x-displayName": "Message",
29
+ "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Message\" />\n"
30
+ },
31
+ {
32
+ "name": "thread_schema",
33
+ "x-displayName": "Thread",
34
+ "description": "<SchemaDefinition schemaRef=\"#/components/schemas/Thread\" />\n"
35
+ }
36
+ ],
37
+ "x-tagGroups": [
38
+ {
39
+ "name": "APIs",
40
+ "tags": [
41
+ "Messages",
42
+ "Threads",
43
+ "Drafts"
44
+ ]
45
+ },
46
+ {
47
+ "name": "Schemas",
48
+ "tags": [
49
+ "message_schema",
50
+ "thread_schema"
51
+ ]
52
+ }
53
+ ],
54
+ "paths": {
55
+ "/v1/message/messages": {
56
+ "post": {
57
+ "operationId": "sendMessage",
58
+ "summary": "sendMessage",
59
+ "description": "Send an email message",
60
+ "tags": [
61
+ "Messages"
62
+ ],
63
+ "parameters": [
64
+ {
65
+ "in": "query",
66
+ "name": "do_not_create_entities",
67
+ "description": "When true, this flag lets the caller to send only the message and by-pass creating the thread & message entities.",
68
+ "schema": {
69
+ "type": "boolean",
70
+ "default": false
71
+ }
72
+ }
73
+ ],
74
+ "requestBody": {
75
+ "content": {
76
+ "application/json": {
77
+ "schema": {
78
+ "$ref": "#/components/schemas/MessageRequestParams"
79
+ }
80
+ }
81
+ }
82
+ },
83
+ "responses": {
84
+ "201": {
85
+ "description": "Success",
86
+ "content": {
87
+ "application/json": {
88
+ "schema": {
89
+ "$ref": "#/components/schemas/MessageRequestParams"
90
+ }
91
+ }
92
+ }
93
+ },
94
+ "403": {
95
+ "description": "Forbidden"
96
+ }
97
+ }
98
+ },
99
+ "put": {
100
+ "operationId": "updateMessage",
101
+ "summary": "updateMessage",
102
+ "description": "Update message metadata",
103
+ "tags": [
104
+ "Messages"
105
+ ],
106
+ "responses": {
107
+ "201": {
108
+ "description": "Success",
109
+ "content": {
110
+ "application/json": {
111
+ "schema": {
112
+ "allOf": [
113
+ {
114
+ "$ref": "#/components/schemas/BaseEntity"
115
+ },
116
+ {
117
+ "$ref": "#/components/schemas/Message"
118
+ }
119
+ ]
120
+ }
121
+ }
122
+ }
123
+ },
124
+ "403": {
125
+ "description": "Forbidden"
126
+ },
127
+ "409": {
128
+ "description": "Conflict - the draft was edited by someone else since it was loaded",
129
+ "content": {
130
+ "application/json": {
131
+ "schema": {
132
+ "type": "object",
133
+ "properties": {
134
+ "error": {
135
+ "type": "string",
136
+ "description": "Human-readable conflict message",
137
+ "example": "This draft was edited by someone else. Please reload and try again."
138
+ },
139
+ "current_message": {
140
+ "description": "The current server version of the message (includes updated_by / _updated_at)",
141
+ "allOf": [
142
+ {
143
+ "$ref": "#/components/schemas/BaseEntity"
144
+ },
145
+ {
146
+ "$ref": "#/components/schemas/Message"
147
+ }
148
+ ]
149
+ }
150
+ }
151
+ }
152
+ }
153
+ }
154
+ }
155
+ }
156
+ }
157
+ },
158
+ "/v1/message/messages/{id}": {
159
+ "get": {
160
+ "operationId": "getMessage",
161
+ "summary": "getMessage",
162
+ "description": "Get an email message by id",
163
+ "tags": [
164
+ "Messages"
165
+ ],
166
+ "parameters": [
167
+ {
168
+ "name": "id",
169
+ "description": "Message ID",
170
+ "in": "path",
171
+ "required": true,
172
+ "schema": {
173
+ "type": "string",
174
+ "example": "4d74976d-fb64-47fd-85e2-65eea140f5eb"
175
+ }
176
+ }
177
+ ],
178
+ "responses": {
179
+ "200": {
180
+ "description": "Success",
181
+ "content": {
182
+ "application/json": {
183
+ "schema": {
184
+ "allOf": [
185
+ {
186
+ "$ref": "#/components/schemas/BaseEntity"
187
+ },
188
+ {
189
+ "$ref": "#/components/schemas/Message"
190
+ }
191
+ ]
192
+ }
193
+ }
194
+ }
195
+ },
196
+ "302": {
197
+ "description": "Redirect to V2 API to fetch the download URL",
198
+ "headers": {
199
+ "Location": {
200
+ "description": "V2 API",
201
+ "schema": {
202
+ "type": "string",
203
+ "example": "https://message.sls.epilot.io/v2/messages/4d74976d-fb64-47fd-85e2-65eea140f5eb"
204
+ }
205
+ }
206
+ }
207
+ },
208
+ "403": {
209
+ "description": "Forbidden"
210
+ }
211
+ }
212
+ },
213
+ "delete": {
214
+ "operationId": "deleteMessage",
215
+ "summary": "deleteMessage",
216
+ "description": "Immediately and permanently delete a message. This operation cannot be undone.",
217
+ "tags": [
218
+ "Messages"
219
+ ],
220
+ "parameters": [
221
+ {
222
+ "name": "id",
223
+ "description": "Message ID",
224
+ "in": "path",
225
+ "required": true,
226
+ "schema": {
227
+ "type": "string"
228
+ }
229
+ }
230
+ ],
231
+ "responses": {
232
+ "204": {
233
+ "description": "Success"
234
+ },
235
+ "403": {
236
+ "description": "Forbidden"
237
+ }
238
+ }
239
+ }
240
+ },
241
+ "/v1/message/messages/{id}/eml": {
242
+ "get": {
243
+ "operationId": "getMessageEml",
244
+ "summary": "getMessageEml",
245
+ "description": "Download a message as an EML file.\nReturns a 302 redirect to a pre-signed S3 URL where the EML file can be downloaded.\n",
246
+ "tags": [
247
+ "Messages"
248
+ ],
249
+ "parameters": [
250
+ {
251
+ "name": "id",
252
+ "description": "Message entity ID",
253
+ "in": "path",
254
+ "required": true,
255
+ "schema": {
256
+ "type": "string",
257
+ "example": "4d74976d-fb64-47fd-85e2-65eea140f5eb"
258
+ }
259
+ }
260
+ ],
261
+ "responses": {
262
+ "302": {
263
+ "description": "Redirect to EML file download URL",
264
+ "headers": {
265
+ "Location": {
266
+ "description": "Pre-signed S3 URL to download the EML file (expires in 15 minutes)",
267
+ "schema": {
268
+ "type": "string"
269
+ }
270
+ }
271
+ }
272
+ },
273
+ "403": {
274
+ "description": "Forbidden"
275
+ },
276
+ "404": {
277
+ "description": "Message not found"
278
+ }
279
+ }
280
+ }
281
+ },
282
+ "/v1/message/messages:search": {
283
+ "post": {
284
+ "operationId": "searchMessages",
285
+ "summary": "searchMessages",
286
+ "description": "Search Messages",
287
+ "tags": [
288
+ "Messages"
289
+ ],
290
+ "requestBody": {
291
+ "content": {
292
+ "application/json": {
293
+ "schema": {
294
+ "$ref": "#/components/schemas/SearchParamsV2"
295
+ }
296
+ }
297
+ }
298
+ },
299
+ "responses": {
300
+ "200": {
301
+ "description": "Success",
302
+ "content": {
303
+ "application/json": {
304
+ "schema": {
305
+ "type": "object",
306
+ "required": [
307
+ "hits",
308
+ "results"
309
+ ],
310
+ "properties": {
311
+ "hits": {
312
+ "type": "number",
313
+ "description": "Total of matched messages",
314
+ "example": 14
315
+ },
316
+ "results": {
317
+ "type": "array",
318
+ "description": "Matched messages",
319
+ "items": {
320
+ "allOf": [
321
+ {
322
+ "$ref": "#/components/schemas/BaseEntity"
323
+ },
324
+ {
325
+ "$ref": "#/components/schemas/Message"
326
+ }
327
+ ]
328
+ }
329
+ }
330
+ }
331
+ }
332
+ }
333
+ }
334
+ },
335
+ "403": {
336
+ "description": "Forbidden"
337
+ }
338
+ }
339
+ }
340
+ },
341
+ "/v1/message/messages/{id}/trash": {
342
+ "post": {
343
+ "operationId": "trashMessage",
344
+ "summary": "trashMessage",
345
+ "description": "Move a message to the trash",
346
+ "tags": [
347
+ "Messages"
348
+ ],
349
+ "parameters": [
350
+ {
351
+ "name": "id",
352
+ "description": "Message ID",
353
+ "in": "path",
354
+ "required": true,
355
+ "schema": {
356
+ "type": "string"
357
+ }
358
+ }
359
+ ],
360
+ "responses": {
361
+ "204": {
362
+ "description": "Success"
363
+ },
364
+ "403": {
365
+ "description": "Forbidden"
366
+ }
367
+ }
368
+ }
369
+ },
370
+ "/v1/message/messages/{id}/untrash": {
371
+ "post": {
372
+ "operationId": "untrashMessage",
373
+ "summary": "untrashMessage",
374
+ "description": "Restore a trashed message",
375
+ "tags": [
376
+ "Messages"
377
+ ],
378
+ "parameters": [
379
+ {
380
+ "name": "id",
381
+ "description": "Message ID",
382
+ "in": "path",
383
+ "required": true,
384
+ "schema": {
385
+ "type": "string"
386
+ }
387
+ }
388
+ ],
389
+ "responses": {
390
+ "204": {
391
+ "description": "Success"
392
+ },
393
+ "403": {
394
+ "description": "Forbidden"
395
+ }
396
+ }
397
+ }
398
+ },
399
+ "/v1/message/messages/{id}/read": {
400
+ "post": {
401
+ "operationId": "markReadMessage",
402
+ "summary": "markReadMessage",
403
+ "description": "Mark message as read",
404
+ "tags": [
405
+ "Messages"
406
+ ],
407
+ "parameters": [
408
+ {
409
+ "name": "id",
410
+ "description": "Message ID",
411
+ "in": "path",
412
+ "required": true,
413
+ "schema": {
414
+ "type": "string"
415
+ }
416
+ }
417
+ ],
418
+ "responses": {
419
+ "204": {
420
+ "description": "Success"
421
+ },
422
+ "403": {
423
+ "description": "Forbidden"
424
+ }
425
+ }
426
+ }
427
+ },
428
+ "/v2/message/messages/{id}/read": {
429
+ "post": {
430
+ "operationId": "markReadMessageV2",
431
+ "summary": "markReadMessageV2",
432
+ "description": "Mark message as read within a scope",
433
+ "tags": [
434
+ "Messages"
435
+ ],
436
+ "parameters": [
437
+ {
438
+ "name": "id",
439
+ "description": "Message ID",
440
+ "in": "path",
441
+ "required": true,
442
+ "schema": {
443
+ "type": "string"
444
+ }
445
+ }
446
+ ],
447
+ "requestBody": {
448
+ "required": true,
449
+ "content": {
450
+ "application/json": {
451
+ "schema": {
452
+ "$ref": "#/components/schemas/ReadMessagePayload"
453
+ }
454
+ }
455
+ }
456
+ },
457
+ "responses": {
458
+ "204": {
459
+ "description": "Success"
460
+ },
461
+ "403": {
462
+ "description": "Forbidden"
463
+ }
464
+ }
465
+ }
466
+ },
467
+ "/v1/message/messages/{id}/unread": {
468
+ "post": {
469
+ "operationId": "markUnreadMessage",
470
+ "summary": "markUnreadMessage",
471
+ "description": "Mark message as unread",
472
+ "tags": [
473
+ "Messages"
474
+ ],
475
+ "parameters": [
476
+ {
477
+ "name": "id",
478
+ "description": "Message ID",
479
+ "in": "path",
480
+ "required": true,
481
+ "schema": {
482
+ "type": "string"
483
+ }
484
+ }
485
+ ],
486
+ "responses": {
487
+ "204": {
488
+ "description": "Success"
489
+ },
490
+ "403": {
491
+ "description": "Forbidden"
492
+ }
493
+ }
494
+ }
495
+ },
496
+ "/v1/message/messages/unread/{actor}": {
497
+ "get": {
498
+ "operationId": "getUnread",
499
+ "summary": "getUnread",
500
+ "description": "Get all unread messages by actor",
501
+ "tags": [
502
+ "Messages"
503
+ ],
504
+ "parameters": [
505
+ {
506
+ "name": "actor",
507
+ "description": "Actor performing call, can be user or organization",
508
+ "in": "path",
509
+ "required": true,
510
+ "schema": {
511
+ "type": "string",
512
+ "enum": [
513
+ "organization",
514
+ "user"
515
+ ]
516
+ }
517
+ },
518
+ {
519
+ "in": "query",
520
+ "name": "email_filter",
521
+ "description": "emails to filter by",
522
+ "schema": {
523
+ "oneOf": [
524
+ {
525
+ "type": "array",
526
+ "items": {
527
+ "type": "string"
528
+ }
529
+ },
530
+ {
531
+ "type": "string"
532
+ }
533
+ ]
534
+ }
535
+ }
536
+ ],
537
+ "responses": {
538
+ "200": {
539
+ "description": "Success",
540
+ "content": {
541
+ "application/json": {
542
+ "schema": {
543
+ "type": "object",
544
+ "required": [
545
+ "count"
546
+ ],
547
+ "properties": {
548
+ "count": {
549
+ "type": "number",
550
+ "description": "Total of unread messages",
551
+ "example": 14
552
+ },
553
+ "unread": {
554
+ "type": "number",
555
+ "description": "Total of unread messages",
556
+ "example": 0
557
+ },
558
+ "drafts": {
559
+ "type": "number",
560
+ "description": "Total of drafts messages",
561
+ "example": 12
562
+ },
563
+ "unassigned": {
564
+ "type": "number",
565
+ "description": "Total of unassigned messages",
566
+ "example": 1
567
+ },
568
+ "spam": {
569
+ "type": "number",
570
+ "description": "Total of spam messages",
571
+ "example": 3
572
+ }
573
+ }
574
+ }
575
+ }
576
+ }
577
+ },
578
+ "403": {
579
+ "description": "Forbidden"
580
+ }
581
+ }
582
+ }
583
+ },
584
+ "/v1/message/unread:counts": {
585
+ "post": {
586
+ "operationId": "getUnreadCounts",
587
+ "summary": "getUnreadCounts",
588
+ "description": "Unread counts for several named scopes in one request.\n\nA scope is a name plus the same parameters the thread list already takes (`q`, `inbox_id`),\nso a scope's count and the list beneath it are the same predicate and agree by construction.\nThe server adds only the read-state condition; it does not re-author the caller's view.\n\nThe `organization` scope is the exception and takes no `q`: it reuses the four canonical\ncentral-inbox queries, so its numbers match `getUnread` exactly.\n\nWhich buckets come back varies by scope type and actor. Every scope other than `organization`\nreturns `unread` alone. An `organization` scope returns all four (`unread`, `drafts`,\n`unassigned`, `spam`) for `actor: organization`, and `unread` and `drafts` only for\n`actor: user`. `getUnread` returns all four for both actors; this endpoint omits the two that\nno per-user surface renders, since each costs an aggregation.\n\nGated on the `message-unread-counts` flag, evaluated once per request against the calling\norg. With the flag off the response is `{ \"enabled\": false, \"counts\": {} }` and no\nElasticsearch query is issued.\n",
589
+ "tags": [
590
+ "Messages"
591
+ ],
592
+ "requestBody": {
593
+ "required": true,
594
+ "content": {
595
+ "application/json": {
596
+ "schema": {
597
+ "$ref": "#/components/schemas/UnreadCountsPayload"
598
+ }
599
+ }
600
+ }
601
+ },
602
+ "responses": {
603
+ "200": {
604
+ "description": "Success",
605
+ "content": {
606
+ "application/json": {
607
+ "schema": {
608
+ "$ref": "#/components/schemas/UnreadCountsResult"
609
+ }
610
+ }
611
+ }
612
+ },
613
+ "400": {
614
+ "description": "The request names more scopes than the cap allows, repeats a scope name, or omits both\n`q` and `view` on a scope type that needs a predicate. Over-cap requests are refused rather than truncated:\na silently dropped scope renders as a missing badge, which is indistinguishable from\nzero unread.\n"
615
+ },
616
+ "403": {
617
+ "description": "Forbidden"
618
+ }
619
+ }
620
+ }
621
+ },
622
+ "/v2/message/messages/{id}/unread": {
623
+ "post": {
624
+ "operationId": "markUnreadMessageV2",
625
+ "summary": "markUnreadMessageV2",
626
+ "description": "Mark message as unread within a scope",
627
+ "tags": [
628
+ "Messages"
629
+ ],
630
+ "parameters": [
631
+ {
632
+ "name": "id",
633
+ "description": "Message ID",
634
+ "in": "path",
635
+ "required": true,
636
+ "schema": {
637
+ "type": "string"
638
+ }
639
+ }
640
+ ],
641
+ "requestBody": {
642
+ "required": true,
643
+ "content": {
644
+ "application/json": {
645
+ "schema": {
646
+ "$ref": "#/components/schemas/ReadMessagePayload"
647
+ }
648
+ }
649
+ }
650
+ },
651
+ "responses": {
652
+ "204": {
653
+ "description": "Success"
654
+ },
655
+ "403": {
656
+ "description": "Forbidden"
657
+ }
658
+ }
659
+ }
660
+ },
661
+ "/v1/message/threads:search": {
662
+ "post": {
663
+ "operationId": "searchThreads",
664
+ "summary": "searchThreads",
665
+ "description": "Search for threads of email messages.\n\nMessages with no replies yet are treated as threads with single message.\n\nLucene syntax supported.\n",
666
+ "tags": [
667
+ "Threads"
668
+ ],
669
+ "requestBody": {
670
+ "content": {
671
+ "application/json": {
672
+ "schema": {
673
+ "$ref": "#/components/schemas/SearchParams"
674
+ }
675
+ }
676
+ }
677
+ },
678
+ "responses": {
679
+ "200": {
680
+ "description": "Success",
681
+ "content": {
682
+ "application/json": {
683
+ "schema": {
684
+ "type": "object",
685
+ "required": [
686
+ "hits",
687
+ "results"
688
+ ],
689
+ "properties": {
690
+ "hits": {
691
+ "type": "number",
692
+ "description": "Total of matched threads",
693
+ "example": 14
694
+ },
695
+ "results": {
696
+ "type": "array",
697
+ "description": "Matched threads",
698
+ "items": {
699
+ "allOf": [
700
+ {
701
+ "$ref": "#/components/schemas/BaseEntity"
702
+ },
703
+ {
704
+ "$ref": "#/components/schemas/Thread"
705
+ }
706
+ ]
707
+ }
708
+ }
709
+ }
710
+ }
711
+ }
712
+ }
713
+ },
714
+ "403": {
715
+ "description": "Forbidden"
716
+ }
717
+ }
718
+ }
719
+ },
720
+ "/v2/message/threads:search": {
721
+ "post": {
722
+ "operationId": "searchThreadsV2",
723
+ "summary": "searchThreadsV2",
724
+ "description": "Search for threads of email messages.\n\nMessages with no replies yet are treated as threads with single message.\n\nLucene syntax supported.\n",
725
+ "tags": [
726
+ "Threads"
727
+ ],
728
+ "requestBody": {
729
+ "content": {
730
+ "application/json": {
731
+ "schema": {
732
+ "$ref": "#/components/schemas/SearchParamsV2"
733
+ }
734
+ }
735
+ }
736
+ },
737
+ "responses": {
738
+ "200": {
739
+ "description": "Success",
740
+ "content": {
741
+ "application/json": {
742
+ "schema": {
743
+ "type": "object",
744
+ "required": [
745
+ "hits",
746
+ "results"
747
+ ],
748
+ "properties": {
749
+ "hits": {
750
+ "type": "number",
751
+ "description": "Total of matched threads",
752
+ "example": 14
753
+ },
754
+ "results": {
755
+ "type": "array",
756
+ "description": "Matched threads",
757
+ "items": {
758
+ "allOf": [
759
+ {
760
+ "$ref": "#/components/schemas/BaseEntity"
761
+ },
762
+ {
763
+ "$ref": "#/components/schemas/Thread"
764
+ }
765
+ ]
766
+ }
767
+ }
768
+ }
769
+ }
770
+ }
771
+ }
772
+ },
773
+ "403": {
774
+ "description": "Forbidden"
775
+ }
776
+ }
777
+ }
778
+ },
779
+ "/v1/message/threads:searchIds": {
780
+ "post": {
781
+ "operationId": "searchIds",
782
+ "summary": "Search threads and return all id's",
783
+ "description": "Return all thread id's that match a criteria\n\nLucene syntax supported.\n",
784
+ "tags": [
785
+ "Threads"
786
+ ],
787
+ "requestBody": {
788
+ "content": {
789
+ "application/json": {
790
+ "schema": {
791
+ "$ref": "#/components/schemas/SearchIDParams"
792
+ }
793
+ }
794
+ }
795
+ },
796
+ "responses": {
797
+ "200": {
798
+ "description": "Success",
799
+ "content": {
800
+ "application/json": {
801
+ "schema": {
802
+ "type": "object",
803
+ "required": [
804
+ "hits",
805
+ "results"
806
+ ],
807
+ "properties": {
808
+ "hits": {
809
+ "type": "number",
810
+ "description": "Total of matched threads",
811
+ "example": 14
812
+ },
813
+ "results": {
814
+ "type": "array",
815
+ "description": "Matched threads ids",
816
+ "items": {
817
+ "type": "string"
818
+ }
819
+ }
820
+ }
821
+ }
822
+ }
823
+ }
824
+ },
825
+ "403": {
826
+ "description": "Forbidden"
827
+ }
828
+ }
829
+ }
830
+ },
831
+ "/v2/message/threads:workload": {
832
+ "post": {
833
+ "operationId": "getAssigneeWorkload",
834
+ "summary": "getAssigneeWorkload",
835
+ "description": "Return the open-thread workload for a set of user ids.\n\nFor each requested user id, returns the number of *open* threads assigned\ndirectly to that user \u2014 matching what the user sees in their central-inbox\nopen view: in inbox, not trashed, not done, and excluding notification-only\nand spam threads.\n\nOnly threads assigned directly to a user are counted; threads assigned to a\ngroup the user belongs to are not. Intended for assignment load-balancing\n(e.g. even-distribution automations) that need a consistent, inbox-aligned\nworkload per user.\n",
836
+ "tags": [
837
+ "Threads"
838
+ ],
839
+ "requestBody": {
840
+ "required": true,
841
+ "content": {
842
+ "application/json": {
843
+ "schema": {
844
+ "$ref": "#/components/schemas/AssigneeWorkloadParams"
845
+ }
846
+ }
847
+ }
848
+ },
849
+ "responses": {
850
+ "200": {
851
+ "description": "Success",
852
+ "content": {
853
+ "application/json": {
854
+ "schema": {
855
+ "$ref": "#/components/schemas/AssigneeWorkloadResults"
856
+ }
857
+ }
858
+ }
859
+ },
860
+ "403": {
861
+ "description": "Forbidden"
862
+ }
863
+ }
864
+ }
865
+ },
866
+ "/v1/message/threads": {
867
+ "put": {
868
+ "operationId": "updateThread",
869
+ "summary": "updateThread",
870
+ "description": "Modify thread metadata",
871
+ "tags": [
872
+ "Threads"
873
+ ],
874
+ "responses": {
875
+ "201": {
876
+ "description": "Success",
877
+ "content": {
878
+ "application/json": {
879
+ "schema": {
880
+ "allOf": [
881
+ {
882
+ "$ref": "#/components/schemas/BaseEntity"
883
+ },
884
+ {
885
+ "$ref": "#/components/schemas/Thread"
886
+ }
887
+ ]
888
+ }
889
+ }
890
+ }
891
+ },
892
+ "403": {
893
+ "description": "Forbidden"
894
+ }
895
+ }
896
+ }
897
+ },
898
+ "/v1/message/threads/{id}": {
899
+ "delete": {
900
+ "operationId": "deleteThread",
901
+ "summary": "deleteThread",
902
+ "description": "Immediately and permanently delete a thread. This operation cannot be undone.",
903
+ "tags": [
904
+ "Threads"
905
+ ],
906
+ "parameters": [
907
+ {
908
+ "name": "id",
909
+ "description": "Thread ID",
910
+ "in": "path",
911
+ "required": true,
912
+ "schema": {
913
+ "type": "string"
914
+ }
915
+ }
916
+ ],
917
+ "responses": {
918
+ "204": {
919
+ "description": "Success"
920
+ },
921
+ "403": {
922
+ "description": "Forbidden"
923
+ }
924
+ }
925
+ }
926
+ },
927
+ "/v1/message/threads/{id}:move": {
928
+ "post": {
929
+ "operationId": "moveThread",
930
+ "summary": "moveThread",
931
+ "description": "Move thread to a different Inbox",
932
+ "tags": [
933
+ "Threads"
934
+ ],
935
+ "parameters": [
936
+ {
937
+ "name": "id",
938
+ "description": "Thread ID",
939
+ "in": "path",
940
+ "required": true,
941
+ "schema": {
942
+ "type": "string"
943
+ }
944
+ }
945
+ ],
946
+ "requestBody": {
947
+ "required": true,
948
+ "content": {
949
+ "application/json": {
950
+ "schema": {
951
+ "$ref": "#/components/schemas/MoveThreadPayload"
952
+ }
953
+ }
954
+ }
955
+ },
956
+ "responses": {
957
+ "204": {
958
+ "description": "Success"
959
+ },
960
+ "400": {
961
+ "$ref": "#/components/responses/BadRequest"
962
+ },
963
+ "403": {
964
+ "$ref": "#/components/responses/Forbidden"
965
+ },
966
+ "404": {
967
+ "$ref": "#/components/responses/NotFound"
968
+ },
969
+ "409": {
970
+ "$ref": "#/components/responses/Conflict"
971
+ },
972
+ "500": {
973
+ "$ref": "#/components/responses/InternalServerError"
974
+ }
975
+ }
976
+ }
977
+ },
978
+ "/v1/message/threads/{id}:markAsDone": {
979
+ "post": {
980
+ "operationId": "markThreadAsDone",
981
+ "summary": "markThreadAsDone",
982
+ "description": "Mark thread as done",
983
+ "tags": [
984
+ "Threads"
985
+ ],
986
+ "parameters": [
987
+ {
988
+ "name": "id",
989
+ "description": "Thread ID",
990
+ "in": "path",
991
+ "required": true,
992
+ "schema": {
993
+ "type": "string"
994
+ }
995
+ }
996
+ ],
997
+ "responses": {
998
+ "204": {
999
+ "description": "Success"
1000
+ },
1001
+ "400": {
1002
+ "description": "Bad Request"
1003
+ }
1004
+ }
1005
+ }
1006
+ },
1007
+ "/v1/message/threads/{id}:markAsOpen": {
1008
+ "post": {
1009
+ "operationId": "markThreadAsOpen",
1010
+ "summary": "markThreadAsOpen",
1011
+ "description": "Mark thread as open",
1012
+ "tags": [
1013
+ "Threads"
1014
+ ],
1015
+ "parameters": [
1016
+ {
1017
+ "name": "id",
1018
+ "description": "Thread ID",
1019
+ "in": "path",
1020
+ "required": true,
1021
+ "schema": {
1022
+ "type": "string"
1023
+ }
1024
+ }
1025
+ ],
1026
+ "responses": {
1027
+ "204": {
1028
+ "description": "Success"
1029
+ },
1030
+ "400": {
1031
+ "description": "Bad Request"
1032
+ }
1033
+ }
1034
+ }
1035
+ },
1036
+ "/v1/message/threads/{id}/timeline": {
1037
+ "get": {
1038
+ "operationId": "getThreadTimeline",
1039
+ "summary": "getThreadTimeline",
1040
+ "description": "Get thread timeline",
1041
+ "tags": [
1042
+ "Threads"
1043
+ ],
1044
+ "parameters": [
1045
+ {
1046
+ "name": "id",
1047
+ "description": "Thread ID",
1048
+ "in": "path",
1049
+ "required": true,
1050
+ "schema": {
1051
+ "type": "string"
1052
+ }
1053
+ }
1054
+ ],
1055
+ "responses": {
1056
+ "200": {
1057
+ "description": "Success",
1058
+ "content": {
1059
+ "application/json": {
1060
+ "schema": {
1061
+ "$ref": "#/components/schemas/ThreadTimeline"
1062
+ }
1063
+ }
1064
+ }
1065
+ },
1066
+ "403": {
1067
+ "description": "Forbidden"
1068
+ }
1069
+ }
1070
+ }
1071
+ },
1072
+ "/v1/message/threads/{id}/trash": {
1073
+ "post": {
1074
+ "operationId": "trashThread",
1075
+ "summary": "trashThread",
1076
+ "description": "Move a thread to trash",
1077
+ "tags": [
1078
+ "Threads"
1079
+ ],
1080
+ "parameters": [
1081
+ {
1082
+ "name": "id",
1083
+ "description": "Thread ID",
1084
+ "in": "path",
1085
+ "required": true,
1086
+ "schema": {
1087
+ "type": "string"
1088
+ }
1089
+ }
1090
+ ],
1091
+ "responses": {
1092
+ "200": {
1093
+ "description": "Success"
1094
+ },
1095
+ "403": {
1096
+ "description": "Forbidden"
1097
+ }
1098
+ }
1099
+ }
1100
+ },
1101
+ "/v1/message/threads/{id}/untrash": {
1102
+ "post": {
1103
+ "operationId": "untrashThread",
1104
+ "summary": "untrashThread",
1105
+ "description": "Restore a trashed thread",
1106
+ "tags": [
1107
+ "Threads"
1108
+ ],
1109
+ "parameters": [
1110
+ {
1111
+ "name": "id",
1112
+ "description": "Thread ID",
1113
+ "in": "path",
1114
+ "required": true,
1115
+ "schema": {
1116
+ "type": "string"
1117
+ }
1118
+ }
1119
+ ],
1120
+ "responses": {
1121
+ "200": {
1122
+ "description": "Success"
1123
+ },
1124
+ "403": {
1125
+ "description": "Forbidden"
1126
+ }
1127
+ }
1128
+ }
1129
+ },
1130
+ "/v1/message/threads/{id}/spam": {
1131
+ "post": {
1132
+ "operationId": "spamThread",
1133
+ "summary": "spamThread",
1134
+ "description": "Mark a thread as spam",
1135
+ "tags": [
1136
+ "Threads"
1137
+ ],
1138
+ "parameters": [
1139
+ {
1140
+ "name": "id",
1141
+ "description": "Thread ID",
1142
+ "in": "path",
1143
+ "required": true,
1144
+ "schema": {
1145
+ "type": "string"
1146
+ }
1147
+ }
1148
+ ],
1149
+ "responses": {
1150
+ "200": {
1151
+ "description": "Success"
1152
+ },
1153
+ "403": {
1154
+ "description": "Forbidden"
1155
+ },
1156
+ "404": {
1157
+ "description": "Not Found"
1158
+ }
1159
+ }
1160
+ }
1161
+ },
1162
+ "/v1/message/threads/{id}/unspam": {
1163
+ "post": {
1164
+ "operationId": "unspamThread",
1165
+ "summary": "unspamThread",
1166
+ "description": "Remove spam marking from a thread",
1167
+ "tags": [
1168
+ "Threads"
1169
+ ],
1170
+ "parameters": [
1171
+ {
1172
+ "name": "id",
1173
+ "description": "Thread ID",
1174
+ "in": "path",
1175
+ "required": true,
1176
+ "schema": {
1177
+ "type": "string"
1178
+ }
1179
+ }
1180
+ ],
1181
+ "responses": {
1182
+ "200": {
1183
+ "description": "Success"
1184
+ },
1185
+ "403": {
1186
+ "description": "Forbidden"
1187
+ },
1188
+ "404": {
1189
+ "description": "Not Found"
1190
+ }
1191
+ }
1192
+ }
1193
+ },
1194
+ "/v1/message/messages/{id}/spam": {
1195
+ "post": {
1196
+ "operationId": "spamMessage",
1197
+ "summary": "spamMessage",
1198
+ "description": "Mark a single message as spam. Also marks the parent thread as spam if all messages in the thread are spam.",
1199
+ "tags": [
1200
+ "Messages"
1201
+ ],
1202
+ "parameters": [
1203
+ {
1204
+ "name": "id",
1205
+ "description": "Message ID",
1206
+ "in": "path",
1207
+ "required": true,
1208
+ "schema": {
1209
+ "type": "string"
1210
+ }
1211
+ }
1212
+ ],
1213
+ "responses": {
1214
+ "204": {
1215
+ "description": "Success"
1216
+ },
1217
+ "403": {
1218
+ "description": "Forbidden"
1219
+ },
1220
+ "404": {
1221
+ "description": "Not Found"
1222
+ }
1223
+ }
1224
+ }
1225
+ },
1226
+ "/v1/message/messages/{id}/unspam": {
1227
+ "post": {
1228
+ "operationId": "unspamMessage",
1229
+ "summary": "unspamMessage",
1230
+ "description": "Remove spam marking from a single message. Also removes spam from the parent thread if no other messages are spam.",
1231
+ "tags": [
1232
+ "Messages"
1233
+ ],
1234
+ "parameters": [
1235
+ {
1236
+ "name": "id",
1237
+ "description": "Message ID",
1238
+ "in": "path",
1239
+ "required": true,
1240
+ "schema": {
1241
+ "type": "string"
1242
+ }
1243
+ }
1244
+ ],
1245
+ "responses": {
1246
+ "204": {
1247
+ "description": "Success"
1248
+ },
1249
+ "403": {
1250
+ "description": "Forbidden"
1251
+ },
1252
+ "404": {
1253
+ "description": "Not Found"
1254
+ }
1255
+ }
1256
+ }
1257
+ },
1258
+ "/v1/message/threads/bulk:move": {
1259
+ "post": {
1260
+ "operationId": "bulkMoveThreads",
1261
+ "summary": "bulkMoveThreads",
1262
+ "description": "Move many threads to a different inbox",
1263
+ "tags": [
1264
+ "Threads"
1265
+ ],
1266
+ "requestBody": {
1267
+ "required": true,
1268
+ "content": {
1269
+ "application/json": {
1270
+ "schema": {
1271
+ "$ref": "#/components/schemas/BulkActionsPayloadWithScopes"
1272
+ }
1273
+ }
1274
+ }
1275
+ },
1276
+ "responses": {
1277
+ "200": {
1278
+ "description": "Success"
1279
+ },
1280
+ "403": {
1281
+ "description": "Forbidden"
1282
+ }
1283
+ }
1284
+ }
1285
+ },
1286
+ "/v1/message/threads/bulk:assign": {
1287
+ "post": {
1288
+ "operationId": "bulkAssignThreads",
1289
+ "summary": "bulkAssignThreads",
1290
+ "description": "Assign many threads",
1291
+ "tags": [
1292
+ "Threads"
1293
+ ],
1294
+ "requestBody": {
1295
+ "required": true,
1296
+ "content": {
1297
+ "application/json": {
1298
+ "schema": {
1299
+ "$ref": "#/components/schemas/BulkActionsPayloadWithScopes"
1300
+ }
1301
+ }
1302
+ }
1303
+ },
1304
+ "responses": {
1305
+ "200": {
1306
+ "description": "Success"
1307
+ },
1308
+ "403": {
1309
+ "description": "Forbidden"
1310
+ }
1311
+ }
1312
+ }
1313
+ },
1314
+ "/v1/message/threads/bulk:read": {
1315
+ "post": {
1316
+ "operationId": "threadBulkActionsRead",
1317
+ "summary": "threadBulkActionsRead",
1318
+ "description": "Perform a bulk action of marking an array of thread ids as read",
1319
+ "tags": [
1320
+ "Threads"
1321
+ ],
1322
+ "requestBody": {
1323
+ "required": true,
1324
+ "content": {
1325
+ "application/json": {
1326
+ "schema": {
1327
+ "$ref": "#/components/schemas/BulkActionsPayloadWithScopes"
1328
+ }
1329
+ }
1330
+ }
1331
+ },
1332
+ "responses": {
1333
+ "200": {
1334
+ "description": "Success"
1335
+ },
1336
+ "403": {
1337
+ "description": "Forbidden"
1338
+ }
1339
+ }
1340
+ }
1341
+ },
1342
+ "/v1/message/threads/bulk:unread": {
1343
+ "post": {
1344
+ "operationId": "threadBulkActionsUnread",
1345
+ "summary": "threadBulkActionsUnread",
1346
+ "description": "Perform a bulk action of marking an array of thread ids as unread",
1347
+ "tags": [
1348
+ "Threads"
1349
+ ],
1350
+ "requestBody": {
1351
+ "required": true,
1352
+ "content": {
1353
+ "application/json": {
1354
+ "schema": {
1355
+ "$ref": "#/components/schemas/BulkActionsPayloadWithScopes"
1356
+ }
1357
+ }
1358
+ }
1359
+ },
1360
+ "responses": {
1361
+ "200": {
1362
+ "description": "Success"
1363
+ },
1364
+ "403": {
1365
+ "description": "Forbidden"
1366
+ }
1367
+ }
1368
+ }
1369
+ },
1370
+ "/v1/message/threads/bulk:favorite": {
1371
+ "post": {
1372
+ "operationId": "threadBulkActionsFavorite",
1373
+ "summary": "threadBulkActionsFavorite",
1374
+ "description": "Perform a bulk action of marking an array of thread ids favorite",
1375
+ "tags": [
1376
+ "Threads"
1377
+ ],
1378
+ "requestBody": {
1379
+ "required": true,
1380
+ "content": {
1381
+ "application/json": {
1382
+ "schema": {
1383
+ "$ref": "#/components/schemas/BulkActionsPayload"
1384
+ }
1385
+ }
1386
+ }
1387
+ },
1388
+ "responses": {
1389
+ "200": {
1390
+ "description": "Success"
1391
+ },
1392
+ "403": {
1393
+ "description": "Forbidden"
1394
+ }
1395
+ }
1396
+ }
1397
+ },
1398
+ "/v1/message/threads/bulk:unfavorite": {
1399
+ "post": {
1400
+ "operationId": "threadBulkActionsUnfavorite",
1401
+ "summary": "threadBulkActionsUnfavorite",
1402
+ "description": "Perform a bulk action of marking an array of thread ids unfavorited",
1403
+ "tags": [
1404
+ "Threads"
1405
+ ],
1406
+ "requestBody": {
1407
+ "required": true,
1408
+ "content": {
1409
+ "application/json": {
1410
+ "schema": {
1411
+ "$ref": "#/components/schemas/BulkActionsPayload"
1412
+ }
1413
+ }
1414
+ }
1415
+ },
1416
+ "responses": {
1417
+ "200": {
1418
+ "description": "Success"
1419
+ },
1420
+ "403": {
1421
+ "description": "Forbidden"
1422
+ }
1423
+ }
1424
+ }
1425
+ },
1426
+ "/v1/message/threads/bulk:trash": {
1427
+ "post": {
1428
+ "operationId": "threadBulkActionsTrash",
1429
+ "summary": "threadBulkActionsTrash",
1430
+ "description": "Perform a bulk action of trashing an array of threads",
1431
+ "tags": [
1432
+ "Threads"
1433
+ ],
1434
+ "requestBody": {
1435
+ "required": true,
1436
+ "content": {
1437
+ "application/json": {
1438
+ "schema": {
1439
+ "$ref": "#/components/schemas/BulkActionsPayload"
1440
+ }
1441
+ }
1442
+ }
1443
+ },
1444
+ "responses": {
1445
+ "200": {
1446
+ "description": "Success"
1447
+ },
1448
+ "403": {
1449
+ "description": "Forbidden"
1450
+ }
1451
+ }
1452
+ }
1453
+ },
1454
+ "/v1/message/threads/bulk:untrash": {
1455
+ "post": {
1456
+ "operationId": "threadBulkActionsUntrash",
1457
+ "summary": "threadBulkActionsUntrash",
1458
+ "description": "Perform a bulk action of untrashing an array of threads",
1459
+ "tags": [
1460
+ "Threads"
1461
+ ],
1462
+ "requestBody": {
1463
+ "required": true,
1464
+ "content": {
1465
+ "application/json": {
1466
+ "schema": {
1467
+ "$ref": "#/components/schemas/BulkActionsPayload"
1468
+ }
1469
+ }
1470
+ }
1471
+ },
1472
+ "responses": {
1473
+ "200": {
1474
+ "description": "Success"
1475
+ },
1476
+ "403": {
1477
+ "description": "Forbidden"
1478
+ }
1479
+ }
1480
+ }
1481
+ },
1482
+ "/v1/message/threads/bulk:delete": {
1483
+ "post": {
1484
+ "operationId": "threadBulkActionsDelete",
1485
+ "summary": "threadBulkActionsDelete",
1486
+ "description": "Performs a bulk permanent delete for all threads",
1487
+ "tags": [
1488
+ "Threads"
1489
+ ],
1490
+ "requestBody": {
1491
+ "required": true,
1492
+ "content": {
1493
+ "application/json": {
1494
+ "schema": {
1495
+ "$ref": "#/components/schemas/BulkActionsPayload"
1496
+ }
1497
+ }
1498
+ }
1499
+ },
1500
+ "responses": {
1501
+ "200": {
1502
+ "description": "Success"
1503
+ },
1504
+ "403": {
1505
+ "description": "Forbidden"
1506
+ }
1507
+ }
1508
+ }
1509
+ },
1510
+ "/v1/message/threads/bulk:done": {
1511
+ "post": {
1512
+ "operationId": "threadBulkActionsDone",
1513
+ "summary": "threadBulkActionsDone",
1514
+ "description": "Perform a bulk action of marking an array of threads as done",
1515
+ "tags": [
1516
+ "Threads"
1517
+ ],
1518
+ "requestBody": {
1519
+ "required": true,
1520
+ "content": {
1521
+ "application/json": {
1522
+ "schema": {
1523
+ "$ref": "#/components/schemas/BulkActionsPayload"
1524
+ }
1525
+ }
1526
+ }
1527
+ },
1528
+ "responses": {
1529
+ "200": {
1530
+ "description": "Success"
1531
+ },
1532
+ "403": {
1533
+ "description": "Forbidden"
1534
+ }
1535
+ }
1536
+ }
1537
+ },
1538
+ "/v1/message/threads/bulk:open": {
1539
+ "post": {
1540
+ "operationId": "threadBulkActionsOpen",
1541
+ "summary": "threadBulkActionsOpen",
1542
+ "description": "Perform a bulk action of marking an array of threads as open",
1543
+ "tags": [
1544
+ "Threads"
1545
+ ],
1546
+ "requestBody": {
1547
+ "required": true,
1548
+ "content": {
1549
+ "application/json": {
1550
+ "schema": {
1551
+ "$ref": "#/components/schemas/BulkActionsPayload"
1552
+ }
1553
+ }
1554
+ }
1555
+ },
1556
+ "responses": {
1557
+ "200": {
1558
+ "description": "Success"
1559
+ },
1560
+ "403": {
1561
+ "description": "Forbidden"
1562
+ }
1563
+ }
1564
+ }
1565
+ },
1566
+ "/v1/message/threads/{id}/read": {
1567
+ "post": {
1568
+ "operationId": "markReadThread",
1569
+ "summary": "markReadThread",
1570
+ "description": "Mark thread as read",
1571
+ "tags": [
1572
+ "Threads"
1573
+ ],
1574
+ "parameters": [
1575
+ {
1576
+ "name": "id",
1577
+ "description": "Thread ID",
1578
+ "in": "path",
1579
+ "required": true,
1580
+ "schema": {
1581
+ "type": "string"
1582
+ }
1583
+ }
1584
+ ],
1585
+ "responses": {
1586
+ "200": {
1587
+ "description": "Success"
1588
+ },
1589
+ "403": {
1590
+ "description": "Forbidden"
1591
+ }
1592
+ }
1593
+ }
1594
+ },
1595
+ "/v2/message/threads/{id}/read": {
1596
+ "post": {
1597
+ "operationId": "markReadThreadV2",
1598
+ "summary": "markReadThreadV2",
1599
+ "description": "Mark thread as read within a scope",
1600
+ "tags": [
1601
+ "Threads"
1602
+ ],
1603
+ "parameters": [
1604
+ {
1605
+ "name": "id",
1606
+ "description": "Thread ID",
1607
+ "in": "path",
1608
+ "required": true,
1609
+ "schema": {
1610
+ "type": "string"
1611
+ }
1612
+ }
1613
+ ],
1614
+ "requestBody": {
1615
+ "required": true,
1616
+ "content": {
1617
+ "application/json": {
1618
+ "schema": {
1619
+ "$ref": "#/components/schemas/ReadMessagePayload"
1620
+ }
1621
+ }
1622
+ }
1623
+ },
1624
+ "responses": {
1625
+ "200": {
1626
+ "description": "Success"
1627
+ },
1628
+ "403": {
1629
+ "description": "Forbidden"
1630
+ }
1631
+ }
1632
+ }
1633
+ },
1634
+ "/v1/message/threads/{id}/unread": {
1635
+ "post": {
1636
+ "operationId": "markUnreadThread",
1637
+ "summary": "markUnreadThread",
1638
+ "description": "Mark thread as unread",
1639
+ "tags": [
1640
+ "Threads"
1641
+ ],
1642
+ "parameters": [
1643
+ {
1644
+ "name": "id",
1645
+ "description": "Thread ID",
1646
+ "in": "path",
1647
+ "required": true,
1648
+ "schema": {
1649
+ "type": "string"
1650
+ }
1651
+ }
1652
+ ],
1653
+ "responses": {
1654
+ "200": {
1655
+ "description": "Success"
1656
+ },
1657
+ "403": {
1658
+ "description": "Forbidden"
1659
+ }
1660
+ }
1661
+ }
1662
+ },
1663
+ "/v2/message/threads/{id}/unread": {
1664
+ "post": {
1665
+ "operationId": "markUnreadThreadV2",
1666
+ "summary": "markUnreadThreadV2",
1667
+ "description": "Mark thread as unread within a scope",
1668
+ "tags": [
1669
+ "Threads"
1670
+ ],
1671
+ "parameters": [
1672
+ {
1673
+ "name": "id",
1674
+ "description": "Thread ID",
1675
+ "in": "path",
1676
+ "required": true,
1677
+ "schema": {
1678
+ "type": "string"
1679
+ }
1680
+ }
1681
+ ],
1682
+ "requestBody": {
1683
+ "required": true,
1684
+ "content": {
1685
+ "application/json": {
1686
+ "schema": {
1687
+ "$ref": "#/components/schemas/ReadMessagePayload"
1688
+ }
1689
+ }
1690
+ }
1691
+ },
1692
+ "responses": {
1693
+ "200": {
1694
+ "description": "Success"
1695
+ },
1696
+ "403": {
1697
+ "description": "Forbidden"
1698
+ }
1699
+ }
1700
+ }
1701
+ },
1702
+ "/v1/message/threads/{id}/assign": {
1703
+ "post": {
1704
+ "operationId": "assignThread",
1705
+ "summary": "assignThread",
1706
+ "description": "Assign thread to entities",
1707
+ "tags": [
1708
+ "Threads"
1709
+ ],
1710
+ "parameters": [
1711
+ {
1712
+ "name": "id",
1713
+ "description": "Thread ID",
1714
+ "in": "path",
1715
+ "required": true,
1716
+ "schema": {
1717
+ "type": "string"
1718
+ }
1719
+ }
1720
+ ],
1721
+ "requestBody": {
1722
+ "required": true,
1723
+ "content": {
1724
+ "application/json": {
1725
+ "schema": {
1726
+ "description": "Entities which thread is assigned to",
1727
+ "type": "array",
1728
+ "items": {
1729
+ "type": "object",
1730
+ "properties": {
1731
+ "slug": {
1732
+ "description": "Entity slug",
1733
+ "type": "string",
1734
+ "example": "contact"
1735
+ },
1736
+ "entity_id": {
1737
+ "description": "Entity ID",
1738
+ "type": "string",
1739
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
1740
+ },
1741
+ "org_id": {
1742
+ "description": "Organization ID",
1743
+ "type": "string",
1744
+ "example": "206801"
1745
+ },
1746
+ "is_main_entity": {
1747
+ "description": "To indicate this is main entity",
1748
+ "type": "boolean",
1749
+ "example": true
1750
+ }
1751
+ }
1752
+ }
1753
+ }
1754
+ }
1755
+ }
1756
+ },
1757
+ "responses": {
1758
+ "204": {
1759
+ "description": "Success"
1760
+ },
1761
+ "403": {
1762
+ "description": "Forbidden"
1763
+ }
1764
+ }
1765
+ }
1766
+ },
1767
+ "/v1/message/threads/{id}/unassign": {
1768
+ "post": {
1769
+ "operationId": "unassignThread",
1770
+ "summary": "unassignThread",
1771
+ "description": "Unassign thread from entities",
1772
+ "tags": [
1773
+ "Threads"
1774
+ ],
1775
+ "parameters": [
1776
+ {
1777
+ "name": "id",
1778
+ "description": "Thread ID",
1779
+ "in": "path",
1780
+ "required": true,
1781
+ "schema": {
1782
+ "type": "string"
1783
+ }
1784
+ },
1785
+ {
1786
+ "name": "unlink_mapped_entities",
1787
+ "description": "When true, also removes unassigned entities from mapped_entities on related source entities",
1788
+ "in": "query",
1789
+ "required": false,
1790
+ "schema": {
1791
+ "type": "boolean",
1792
+ "default": false
1793
+ }
1794
+ }
1795
+ ],
1796
+ "requestBody": {
1797
+ "required": true,
1798
+ "content": {
1799
+ "application/json": {
1800
+ "schema": {
1801
+ "description": "Entities which thread is unassigned from",
1802
+ "type": "array",
1803
+ "items": {
1804
+ "type": "object",
1805
+ "properties": {
1806
+ "slug": {
1807
+ "description": "Entity slug",
1808
+ "type": "string",
1809
+ "example": "contact"
1810
+ },
1811
+ "entity_id": {
1812
+ "description": "Entity ID",
1813
+ "type": "string",
1814
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
1815
+ }
1816
+ }
1817
+ }
1818
+ }
1819
+ }
1820
+ }
1821
+ },
1822
+ "responses": {
1823
+ "204": {
1824
+ "description": "Success"
1825
+ },
1826
+ "403": {
1827
+ "description": "Forbidden"
1828
+ }
1829
+ }
1830
+ }
1831
+ },
1832
+ "/v1/message/threads/{id}/assign:users": {
1833
+ "post": {
1834
+ "operationId": "assignUsers",
1835
+ "summary": "assignUsers",
1836
+ "description": "Assign users to thread for receiving notifications.\nThe operation replaces all existing assigned users in thread.\n",
1837
+ "tags": [
1838
+ "Threads"
1839
+ ],
1840
+ "parameters": [
1841
+ {
1842
+ "name": "id",
1843
+ "description": "Thread ID",
1844
+ "in": "path",
1845
+ "required": true,
1846
+ "schema": {
1847
+ "type": "string"
1848
+ }
1849
+ }
1850
+ ],
1851
+ "requestBody": {
1852
+ "required": true,
1853
+ "content": {
1854
+ "application/json": {
1855
+ "schema": {
1856
+ "description": "User IDs of users assigned to thread",
1857
+ "type": "object",
1858
+ "properties": {
1859
+ "assigned_to": {
1860
+ "type": "array",
1861
+ "description": "IDs of users assigned to thread",
1862
+ "items": {
1863
+ "type": "string",
1864
+ "example": "206801"
1865
+ }
1866
+ }
1867
+ }
1868
+ }
1869
+ }
1870
+ }
1871
+ },
1872
+ "responses": {
1873
+ "204": {
1874
+ "description": "Success"
1875
+ },
1876
+ "403": {
1877
+ "description": "Forbidden"
1878
+ }
1879
+ }
1880
+ }
1881
+ },
1882
+ "/v2/message/threads/{id}/assign:users": {
1883
+ "post": {
1884
+ "operationId": "assignUsersV2",
1885
+ "summary": "assignUsersV2",
1886
+ "description": "Assign users to thread.\n",
1887
+ "tags": [
1888
+ "Threads"
1889
+ ],
1890
+ "parameters": [
1891
+ {
1892
+ "name": "id",
1893
+ "description": "Thread ID",
1894
+ "in": "path",
1895
+ "required": true,
1896
+ "schema": {
1897
+ "type": "string"
1898
+ }
1899
+ }
1900
+ ],
1901
+ "requestBody": {
1902
+ "required": true,
1903
+ "content": {
1904
+ "application/json": {
1905
+ "schema": {
1906
+ "type": "object",
1907
+ "required": [
1908
+ "add",
1909
+ "remove"
1910
+ ],
1911
+ "properties": {
1912
+ "add": {
1913
+ "type": "array",
1914
+ "description": "User IDs of users to add to thread",
1915
+ "items": {
1916
+ "type": "string",
1917
+ "example": "206801"
1918
+ }
1919
+ },
1920
+ "remove": {
1921
+ "type": "array",
1922
+ "description": "User IDs of users to remove from thread",
1923
+ "items": {
1924
+ "type": "string",
1925
+ "example": "206801"
1926
+ }
1927
+ }
1928
+ }
1929
+ }
1930
+ }
1931
+ }
1932
+ },
1933
+ "responses": {
1934
+ "204": {
1935
+ "description": "Success"
1936
+ },
1937
+ "403": {
1938
+ "description": "Forbidden"
1939
+ }
1940
+ }
1941
+ }
1942
+ },
1943
+ "/v1/message/threads/{id}:pin": {
1944
+ "post": {
1945
+ "operationId": "pinThread",
1946
+ "summary": "Pin a single thread",
1947
+ "description": "Pin a single thread",
1948
+ "tags": [
1949
+ "Threads"
1950
+ ],
1951
+ "parameters": [
1952
+ {
1953
+ "name": "id",
1954
+ "description": "Thread ID",
1955
+ "in": "path",
1956
+ "required": true,
1957
+ "schema": {
1958
+ "type": "string"
1959
+ }
1960
+ }
1961
+ ],
1962
+ "responses": {
1963
+ "204": {
1964
+ "description": "Success"
1965
+ },
1966
+ "400": {
1967
+ "description": "Bad request"
1968
+ },
1969
+ "404": {
1970
+ "description": "Thread not found"
1971
+ },
1972
+ "409": {
1973
+ "description": "Concurrent update error"
1974
+ },
1975
+ "500": {
1976
+ "description": "Internal server error"
1977
+ }
1978
+ }
1979
+ },
1980
+ "delete": {
1981
+ "operationId": "unpinThread",
1982
+ "summary": "Unpin a single thread",
1983
+ "description": "Unpin a single thread",
1984
+ "tags": [
1985
+ "Threads"
1986
+ ],
1987
+ "parameters": [
1988
+ {
1989
+ "name": "id",
1990
+ "description": "Thread ID",
1991
+ "in": "path",
1992
+ "required": true,
1993
+ "schema": {
1994
+ "type": "string"
1995
+ }
1996
+ }
1997
+ ],
1998
+ "responses": {
1999
+ "204": {
2000
+ "description": "Success"
2001
+ },
2002
+ "400": {
2003
+ "description": "Bad request"
2004
+ },
2005
+ "404": {
2006
+ "description": "Thread not found"
2007
+ },
2008
+ "409": {
2009
+ "description": "Concurrent update error"
2010
+ },
2011
+ "500": {
2012
+ "description": "Internal server error"
2013
+ }
2014
+ }
2015
+ }
2016
+ },
2017
+ "/v1/message/drafts": {
2018
+ "post": {
2019
+ "operationId": "createDraft",
2020
+ "summary": "createDraft",
2021
+ "description": "Create a new draft",
2022
+ "tags": [
2023
+ "Drafts"
2024
+ ],
2025
+ "requestBody": {
2026
+ "content": {
2027
+ "application/json": {
2028
+ "schema": {
2029
+ "$ref": "#/components/schemas/MessageRequestParams"
2030
+ }
2031
+ }
2032
+ }
2033
+ },
2034
+ "responses": {
2035
+ "201": {
2036
+ "description": "Success",
2037
+ "content": {
2038
+ "application/json": {
2039
+ "schema": {
2040
+ "allOf": [
2041
+ {
2042
+ "$ref": "#/components/schemas/BaseEntity"
2043
+ },
2044
+ {
2045
+ "$ref": "#/components/schemas/Message"
2046
+ }
2047
+ ]
2048
+ }
2049
+ }
2050
+ }
2051
+ },
2052
+ "403": {
2053
+ "description": "Forbidden"
2054
+ }
2055
+ }
2056
+ }
2057
+ },
2058
+ "/v1/message/drafts:send": {
2059
+ "post": {
2060
+ "operationId": "sendDraft",
2061
+ "summary": "sendDraft",
2062
+ "description": "Send the existing draft to the recipients",
2063
+ "tags": [
2064
+ "Drafts"
2065
+ ],
2066
+ "responses": {
2067
+ "201": {
2068
+ "description": "Success",
2069
+ "content": {
2070
+ "application/json": {
2071
+ "schema": {
2072
+ "allOf": [
2073
+ {
2074
+ "$ref": "#/components/schemas/BaseEntity"
2075
+ },
2076
+ {
2077
+ "$ref": "#/components/schemas/Message"
2078
+ }
2079
+ ]
2080
+ }
2081
+ }
2082
+ }
2083
+ },
2084
+ "403": {
2085
+ "description": "Forbidden"
2086
+ }
2087
+ }
2088
+ }
2089
+ },
2090
+ "/v2/message/messages/{id}": {
2091
+ "get": {
2092
+ "operationId": "getMessageV2",
2093
+ "summary": "getMessageV2",
2094
+ "description": "- Fetches message by ID\n- If the message html is omitted on the entity, then it keeps the content on the message as a signed url\n {\n ...\n _id: \"4d74976d-fb64-47fd-85e2-65eea140f5eb\",\n _schema: \"message\",\n _org: \"org-123\",\n html_omitted: true,\n html_download_url: \"https://s3.eu-central-1.amazonaws.com/epilot-attachments/3f34ce73-089c-4d45-a5ee-c161234e41c3/3f34ce73-089c-4d45-a5ee-c161234e41c3.html\"\n }\n",
2095
+ "tags": [
2096
+ "Messages"
2097
+ ],
2098
+ "parameters": [
2099
+ {
2100
+ "name": "id",
2101
+ "description": "Message ID",
2102
+ "in": "path",
2103
+ "required": true,
2104
+ "schema": {
2105
+ "type": "string",
2106
+ "example": "4d74976d-fb64-47fd-85e2-65eea140f5eb"
2107
+ }
2108
+ }
2109
+ ],
2110
+ "responses": {
2111
+ "200": {
2112
+ "description": "Success",
2113
+ "content": {
2114
+ "application/json": {
2115
+ "schema": {
2116
+ "allOf": [
2117
+ {
2118
+ "$ref": "#/components/schemas/MessageV2"
2119
+ }
2120
+ ]
2121
+ }
2122
+ }
2123
+ }
2124
+ },
2125
+ "403": {
2126
+ "description": "Forbidden"
2127
+ }
2128
+ }
2129
+ }
2130
+ }
2131
+ },
2132
+ "components": {
2133
+ "responses": {
2134
+ "NotFound": {
2135
+ "description": "Not found",
2136
+ "content": {
2137
+ "application/json": {
2138
+ "schema": {
2139
+ "$ref": "#/components/schemas/ErrorResponse"
2140
+ }
2141
+ }
2142
+ }
2143
+ },
2144
+ "Conflict": {
2145
+ "description": "Conflict",
2146
+ "content": {
2147
+ "application/json": {
2148
+ "schema": {
2149
+ "$ref": "#/components/schemas/ErrorResponse"
2150
+ }
2151
+ }
2152
+ }
2153
+ },
2154
+ "InternalServerError": {
2155
+ "description": "Internal server error",
2156
+ "content": {
2157
+ "application/json": {
2158
+ "schema": {
2159
+ "$ref": "#/components/schemas/ErrorResponse"
2160
+ }
2161
+ }
2162
+ }
2163
+ },
2164
+ "BadRequest": {
2165
+ "description": "Bad request",
2166
+ "content": {
2167
+ "application/json": {
2168
+ "schema": {
2169
+ "$ref": "#/components/schemas/ErrorResponse"
2170
+ }
2171
+ }
2172
+ }
2173
+ },
2174
+ "Forbidden": {
2175
+ "description": "Forbidden",
2176
+ "content": {
2177
+ "application/json": {
2178
+ "schema": {
2179
+ "$ref": "#/components/schemas/ErrorResponse"
2180
+ }
2181
+ }
2182
+ }
2183
+ }
2184
+ },
2185
+ "securitySchemes": {
2186
+ "EpilotAuth": {
2187
+ "type": "http",
2188
+ "scheme": "bearer",
2189
+ "description": "Authorization header with epilot OAuth2 bearer token",
2190
+ "bearerFormat": "JWT"
2191
+ },
2192
+ "EpilotOrg": {
2193
+ "description": "Overrides the target organization to allow shared tenant access",
2194
+ "name": "x-epilot-org-id",
2195
+ "in": "header",
2196
+ "type": "apiKey"
2197
+ }
2198
+ },
2199
+ "schemas": {
2200
+ "ErrorResponse": {
2201
+ "type": "object",
2202
+ "properties": {
2203
+ "error": {
2204
+ "type": "string",
2205
+ "description": "Error message",
2206
+ "example": "Thread not found"
2207
+ }
2208
+ }
2209
+ },
2210
+ "MoveThreadPayload": {
2211
+ "type": "object",
2212
+ "required": [
2213
+ "inbox_id"
2214
+ ],
2215
+ "properties": {
2216
+ "inbox_id": {
2217
+ "type": "string",
2218
+ "description": "Inbox ID",
2219
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2220
+ }
2221
+ }
2222
+ },
2223
+ "BaseEntity": {
2224
+ "type": "object",
2225
+ "required": [
2226
+ "_id",
2227
+ "_title",
2228
+ "_org",
2229
+ "_schema",
2230
+ "_created_at",
2231
+ "_updated_at"
2232
+ ],
2233
+ "properties": {
2234
+ "_id": {
2235
+ "type": "string",
2236
+ "description": "Entity ID",
2237
+ "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
2238
+ },
2239
+ "_title": {
2240
+ "type": "string",
2241
+ "description": "Entity title"
2242
+ },
2243
+ "_org": {
2244
+ "type": "string",
2245
+ "description": "Organization ID the entity belongs to",
2246
+ "example": "206801"
2247
+ },
2248
+ "_schema": {
2249
+ "type": "string",
2250
+ "description": "URL-friendly identifier for the entity schema",
2251
+ "example": "message"
2252
+ },
2253
+ "_tags": {
2254
+ "type": "array",
2255
+ "description": "Entity tags",
2256
+ "items": {
2257
+ "type": "string"
2258
+ },
2259
+ "example": [
2260
+ "pricing",
2261
+ "INBOX"
2262
+ ]
2263
+ },
2264
+ "_created_at": {
2265
+ "type": "string",
2266
+ "description": "Created date",
2267
+ "format": "date-time",
2268
+ "example": "2021-02-09T12:41:43.662Z"
2269
+ },
2270
+ "_updated_at": {
2271
+ "type": "string",
2272
+ "description": "Updated date",
2273
+ "format": "date-time",
2274
+ "example": "2021-02-10T09:14:31.990Z"
2275
+ }
2276
+ }
2277
+ },
2278
+ "Thread": {
2279
+ "description": "Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.",
2280
+ "required": [
2281
+ "topic"
2282
+ ],
2283
+ "properties": {
2284
+ "topic": {
2285
+ "type": "string",
2286
+ "description": "Message topic (e.g. which service sends the message or message category)",
2287
+ "example": "CUSTOMER_MESSAGE"
2288
+ },
2289
+ "assigned_to": {
2290
+ "type": "array",
2291
+ "description": "User ID of who the message is assigned to. Default is the user who sends message.",
2292
+ "items": {
2293
+ "type": "string"
2294
+ },
2295
+ "example": [
2296
+ "206801",
2297
+ "200109"
2298
+ ]
2299
+ },
2300
+ "org_read_message": {
2301
+ "type": "array",
2302
+ "description": "Organization ID of organization read the message.",
2303
+ "items": {
2304
+ "type": "string"
2305
+ },
2306
+ "example": [
2307
+ "789372",
2308
+ "210291"
2309
+ ]
2310
+ },
2311
+ "done": {
2312
+ "type": "boolean",
2313
+ "description": "Whether the thread is marked as Done",
2314
+ "example": false
2315
+ },
2316
+ "latest_message": {
2317
+ "$ref": "#/components/schemas/Message"
2318
+ },
2319
+ "latest_trash_message": {
2320
+ "$ref": "#/components/schemas/Message"
2321
+ },
2322
+ "latest_message_at": {
2323
+ "type": "string",
2324
+ "description": "The date of the latest message time in the thread",
2325
+ "example": "2024-02-10T09:14:31.990Z"
2326
+ }
2327
+ }
2328
+ },
2329
+ "Message": {
2330
+ "type": "object",
2331
+ "required": [
2332
+ "subject",
2333
+ "from"
2334
+ ],
2335
+ "properties": {
2336
+ "message_id": {
2337
+ "type": "string",
2338
+ "description": "Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.",
2339
+ "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>"
2340
+ },
2341
+ "sender": {
2342
+ "type": "string",
2343
+ "description": "User ID of user sends the message.",
2344
+ "example": "206801"
2345
+ },
2346
+ "updated_by": {
2347
+ "type": "string",
2348
+ "description": "User ID of the user who last updated (edited) the message. Set for drafts on each save.",
2349
+ "example": "206801"
2350
+ },
2351
+ "subject": {
2352
+ "type": "string",
2353
+ "description": "Subject",
2354
+ "example": "Request for solar panel price"
2355
+ },
2356
+ "html": {
2357
+ "type": "string",
2358
+ "description": "HTML body",
2359
+ "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"
2360
+ },
2361
+ "text": {
2362
+ "type": "string",
2363
+ "description": "Text body",
2364
+ "example": "We at ABC GmbH would like to request a price quote for the solar panel."
2365
+ },
2366
+ "from": {
2367
+ "$ref": "#/components/schemas/Address"
2368
+ },
2369
+ "reply_to": {
2370
+ "$ref": "#/components/schemas/Address"
2371
+ },
2372
+ "to": {
2373
+ "type": "array",
2374
+ "description": "To email addresses",
2375
+ "items": {
2376
+ "$ref": "#/components/schemas/Address"
2377
+ }
2378
+ },
2379
+ "cc": {
2380
+ "type": "array",
2381
+ "description": "Cc email addresses",
2382
+ "items": {
2383
+ "$ref": "#/components/schemas/Address"
2384
+ }
2385
+ },
2386
+ "bcc": {
2387
+ "type": "array",
2388
+ "description": "Bcc email addresses",
2389
+ "items": {
2390
+ "$ref": "#/components/schemas/Address"
2391
+ }
2392
+ },
2393
+ "file": {
2394
+ "$ref": "#/components/schemas/AttachmentsRelation"
2395
+ },
2396
+ "references": {
2397
+ "type": "string",
2398
+ "description": "References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent. The last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread. The basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.\n",
2399
+ "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"
2400
+ },
2401
+ "in_reply_to": {
2402
+ "type": "string",
2403
+ "description": "In-Reply-To header. Value is the `message_id` of parent message.\n",
2404
+ "example": "<CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"
2405
+ },
2406
+ "user_read_message": {
2407
+ "type": "array",
2408
+ "description": "User ID of user read the message.",
2409
+ "items": {
2410
+ "type": "string"
2411
+ },
2412
+ "example": [
2413
+ "206801",
2414
+ "200109"
2415
+ ]
2416
+ },
2417
+ "org_read_message": {
2418
+ "type": "array",
2419
+ "description": "Organization ID of organization read the message.",
2420
+ "items": {
2421
+ "type": "string"
2422
+ },
2423
+ "example": [
2424
+ "789372",
2425
+ "210291"
2426
+ ]
2427
+ },
2428
+ "send_status": {
2429
+ "type": "array",
2430
+ "description": "Sent message status. The array contains sending message status corresponding to all recipients. For more detail, check `send_status` of each recipient in `to`, `cc`, `bcc` Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\n",
2431
+ "items": {
2432
+ "type": "string",
2433
+ "enum": [
2434
+ "SEND",
2435
+ "DELIVERY",
2436
+ "REJECT",
2437
+ "COMPLAINT",
2438
+ "BOUNCE",
2439
+ "ERROR"
2440
+ ]
2441
+ }
2442
+ },
2443
+ "type": {
2444
+ "type": "string",
2445
+ "description": "Message type",
2446
+ "enum": [
2447
+ "SENT",
2448
+ "RECEIVED"
2449
+ ]
2450
+ },
2451
+ "template_id": {
2452
+ "type": "string",
2453
+ "description": "Template ID used for sending message.",
2454
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2455
+ }
2456
+ }
2457
+ },
2458
+ "MessageV2": {
2459
+ "allOf": [
2460
+ {
2461
+ "$ref": "#/components/schemas/BaseEntity"
2462
+ },
2463
+ {
2464
+ "$ref": "#/components/schemas/Message"
2465
+ }
2466
+ ],
2467
+ "properties": {
2468
+ "html_omitted": {
2469
+ "type": "boolean",
2470
+ "description": "If true then html is not provided and must be downloaded using the html_download_url",
2471
+ "default": false
2472
+ },
2473
+ "html_download_url": {
2474
+ "type": "string",
2475
+ "description": "HTML body download URL",
2476
+ "example": "https://s3.eu-central-1.amazonaws.com/epilot-attachments/3f34ce73-089c-4d45-a5ee-c161234e41c3/3f34ce73-089c-4d45-a5ee-c161234e41c3.html"
2477
+ }
2478
+ }
2479
+ },
2480
+ "Address": {
2481
+ "type": "object",
2482
+ "required": [
2483
+ "address"
2484
+ ],
2485
+ "properties": {
2486
+ "name": {
2487
+ "type": "string",
2488
+ "description": "Email address alias",
2489
+ "example": "epilot"
2490
+ },
2491
+ "address": {
2492
+ "type": "string",
2493
+ "description": "Email address",
2494
+ "example": "messaging@epilot.cloud"
2495
+ },
2496
+ "email_type": {
2497
+ "type": "string",
2498
+ "description": "Type of the email, Internal (360 Agents), Partners, External users(Customers)\n",
2499
+ "nullable": true,
2500
+ "enum": [
2501
+ "INTERNAL",
2502
+ "EXTERNAL",
2503
+ "PARTNER"
2504
+ ]
2505
+ },
2506
+ "send_status": {
2507
+ "type": "string",
2508
+ "description": "Sent message status regarding to this recipient. Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\n",
2509
+ "enum": [
2510
+ "SEND",
2511
+ "DELIVERY",
2512
+ "REJECT",
2513
+ "COMPLAINT",
2514
+ "BOUNCE",
2515
+ "ERROR"
2516
+ ]
2517
+ },
2518
+ "send_error": {
2519
+ "type": "object",
2520
+ "description": "Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR. JSON object is defined by AWS SES. Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html>\n"
2521
+ }
2522
+ }
2523
+ },
2524
+ "AttachmentsRelation": {
2525
+ "type": "object",
2526
+ "description": "Message attachments",
2527
+ "properties": {
2528
+ "$relation": {
2529
+ "type": "array",
2530
+ "description": "It's normal entity relation with some additional properties for sending message attachment.",
2531
+ "items": {
2532
+ "$ref": "#/components/schemas/File"
2533
+ }
2534
+ }
2535
+ }
2536
+ },
2537
+ "File": {
2538
+ "type": "object",
2539
+ "required": [
2540
+ "entity_id"
2541
+ ],
2542
+ "properties": {
2543
+ "entity_id": {
2544
+ "type": "string",
2545
+ "description": "File entity ID",
2546
+ "example": "f820ce3b-07b0-45ae-bcc6-babb2f53f79f"
2547
+ },
2548
+ "filename": {
2549
+ "type": "string",
2550
+ "description": "File name",
2551
+ "example": "Produktinformationen_epilot360_Double_Opt_in.pdf"
2552
+ },
2553
+ "is_message_attachment": {
2554
+ "type": "boolean",
2555
+ "description": "To indicate this file relation is message attachment. If false then this file will not be sent and simply kept as a file relation."
2556
+ },
2557
+ "may_be_signature_attachment": {
2558
+ "type": "boolean",
2559
+ "description": "To indicate this file relation may be signature attachment. If true then this file will be sent as signature attachment and not related to any entity."
2560
+ },
2561
+ "cid": {
2562
+ "type": "string",
2563
+ "description": "Content ID (for inline)",
2564
+ "example": "fb222496-a1a5-4639-94f2-07b5e35e4068"
2565
+ },
2566
+ "inline": {
2567
+ "type": "boolean",
2568
+ "description": "If true then this attachment should not be offered for download (at least not in the main attachments list). The usecase is CID embedded image (aka inline image).\n",
2569
+ "default": false
2570
+ },
2571
+ "send_as_link": {
2572
+ "type": "boolean",
2573
+ "description": "If true then this attachment is sent via link. The link have to be inserted to email body by API caller. In this case, service doesn't process this attachment.\n",
2574
+ "default": false
2575
+ },
2576
+ "save_to_entity": {
2577
+ "type": "boolean",
2578
+ "description": "If false, this file relation is kept on the message (e.g. for CID/inline rendering) but is NOT propagated to the entity the email is sent from. Used for inline images such as logos, signatures and social icons. Defaults to true.\n",
2579
+ "default": true
2580
+ }
2581
+ }
2582
+ },
2583
+ "MessageRequestParams": {
2584
+ "required": [
2585
+ "subject",
2586
+ "from"
2587
+ ],
2588
+ "additionalProperties": true,
2589
+ "properties": {
2590
+ "complete_thread": {
2591
+ "type": "boolean",
2592
+ "description": "Whether the thread is marked as Done immediately after sending the message",
2593
+ "default": false
2594
+ },
2595
+ "mark_thread_as_read": {
2596
+ "type": "boolean",
2597
+ "description": "Whether to mark the thread as read by the sender's org/user after sending a reply.\nOnly applies when `parent_id` is set. When false, the thread's `org_read_message` and\n`user_read_message` arrays are left unchanged, so the thread remains unread for anyone\nwho had it unread before. Defaults to true for backward compatibility.\n",
2598
+ "default": true
2599
+ },
2600
+ "thread": {
2601
+ "type": "object",
2602
+ "required": [
2603
+ "topic"
2604
+ ],
2605
+ "description": "Open new thread when sending the very first message in conversation. Thread should contains context related to all messages in it (eg. topic, brand_id, opportunity_id, assigned_to,...). Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing. `thread` or `parent_id` must be provided either.\n",
2606
+ "properties": {
2607
+ "topic": {
2608
+ "type": "string",
2609
+ "description": "Message topic (e.g. which service sends the message or message category)"
2610
+ },
2611
+ "assigned_to": {
2612
+ "type": "array",
2613
+ "description": "User ID of who the message is assigned to. Default is the user who sends message.",
2614
+ "items": {
2615
+ "type": "string"
2616
+ }
2617
+ }
2618
+ },
2619
+ "example": {
2620
+ "topic": "CUSTOMER_MESSAGE",
2621
+ "assigned_to": [
2622
+ "206801",
2623
+ "200109"
2624
+ ],
2625
+ "opportunity_id": 829072
2626
+ }
2627
+ },
2628
+ "parent_id": {
2629
+ "type": "string",
2630
+ "description": "Entity ID of parent message which this message replies to or forwards from. If both `parent_id` and `thread` are provided, `thread` is discarded.\n",
2631
+ "example": "44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2"
2632
+ },
2633
+ "subject": {
2634
+ "type": "string",
2635
+ "description": "Subject",
2636
+ "example": "Request for solar panel price"
2637
+ },
2638
+ "html": {
2639
+ "type": "string",
2640
+ "description": "HTML body",
2641
+ "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"
2642
+ },
2643
+ "text": {
2644
+ "type": "string",
2645
+ "description": "Text body. If not provided, text body is converted from HTML body using [html-to-text](https://www.npmjs.com/package/html-to-text)",
2646
+ "example": "We at ABC GmbH would like to request a price quote for the solar panel."
2647
+ },
2648
+ "from": {
2649
+ "$ref": "#/components/schemas/Address"
2650
+ },
2651
+ "reply_to": {
2652
+ "$ref": "#/components/schemas/Address"
2653
+ },
2654
+ "to": {
2655
+ "type": "array",
2656
+ "description": "To email addresses",
2657
+ "items": {
2658
+ "$ref": "#/components/schemas/Address"
2659
+ }
2660
+ },
2661
+ "cc": {
2662
+ "type": "array",
2663
+ "description": "Cc email addresses",
2664
+ "items": {
2665
+ "$ref": "#/components/schemas/Address"
2666
+ }
2667
+ },
2668
+ "bcc": {
2669
+ "type": "array",
2670
+ "description": "Bcc email addresses",
2671
+ "items": {
2672
+ "$ref": "#/components/schemas/Address"
2673
+ }
2674
+ },
2675
+ "file": {
2676
+ "$ref": "#/components/schemas/AttachmentsRelation"
2677
+ },
2678
+ "template_id": {
2679
+ "type": "string",
2680
+ "description": "Template ID used for sending message.",
2681
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2682
+ },
2683
+ "source": {
2684
+ "type": "string",
2685
+ "description": "Identifies who triggered the send so server-side policy can branch on it.\nFor `manual` sends, the caller's curated `_tags` are trusted as-is and no\nserver-side enrichment from the referenced `template_id` (e.g. merging the\ntemplate's `email_tags`) is performed. Any non-manual value (or omitting the\nfield) opts into template-derived enrichment.\n",
2686
+ "enum": [
2687
+ "manual",
2688
+ "automation",
2689
+ "workflow",
2690
+ "partner",
2691
+ "bulk",
2692
+ "system"
2693
+ ],
2694
+ "example": "manual"
2695
+ }
2696
+ }
2697
+ },
2698
+ "ThreadView": {
2699
+ "type": "object",
2700
+ "additionalProperties": true,
2701
+ "description": "A central-inbox view, described structurally so the server compiles the query for it. Both the\nthread list and the unread count for a view are compiled from the same description, so the two\ncannot disagree about what the view means.\n\nEvery field is optional and an omitted field adds no condition, so a view narrows the whole\nmailbox rather than being a template with required holes. Unknown fields are ignored.\n",
2702
+ "properties": {
2703
+ "folder": {
2704
+ "type": "string",
2705
+ "enum": [
2706
+ "inbox",
2707
+ "favorite",
2708
+ "sent",
2709
+ "trash",
2710
+ "spam",
2711
+ "unassignable",
2712
+ "draft"
2713
+ ],
2714
+ "description": "Which sidebar folder's membership predicate to apply."
2715
+ },
2716
+ "mailbox": {
2717
+ "type": "string",
2718
+ "enum": [
2719
+ "organization",
2720
+ "agent"
2721
+ ],
2722
+ "description": "Whose mailbox this is. `agent` scopes to threads assigned to the caller or their groups;\n`organization` scopes to the org and is the only mailbox that carries address filtering.\n"
2723
+ },
2724
+ "labels": {
2725
+ "type": "array",
2726
+ "items": {
2727
+ "type": "string"
2728
+ },
2729
+ "description": "Saved-filter labels, ANDed. Matched exactly against the tag rather than against its\ntokens, so a label whose words overlap a folder tag no longer lands in that folder.\n"
2730
+ },
2731
+ "purposes": {
2732
+ "type": "array",
2733
+ "items": {
2734
+ "type": "string"
2735
+ },
2736
+ "description": "Purpose ids on linked entities, ANDed."
2737
+ },
2738
+ "filters": {
2739
+ "type": "array",
2740
+ "items": {
2741
+ "type": "string",
2742
+ "enum": [
2743
+ "unread",
2744
+ "resolved",
2745
+ "trash"
2746
+ ]
2747
+ },
2748
+ "description": "State filters, independent of the folder. `resolved` and `trash` reach the Inbox folder\nonly and are mutually exclusive there; `unread` applies anywhere.\n"
2749
+ },
2750
+ "from": {
2751
+ "type": "array",
2752
+ "items": {
2753
+ "type": "string"
2754
+ },
2755
+ "description": "Sender addresses to filter on."
2756
+ },
2757
+ "to": {
2758
+ "type": "array",
2759
+ "items": {
2760
+ "type": "string"
2761
+ },
2762
+ "description": "Recipient addresses to filter on."
2763
+ },
2764
+ "assigned_to": {
2765
+ "type": "array",
2766
+ "items": {
2767
+ "type": "string"
2768
+ },
2769
+ "description": "Assignee user ids."
2770
+ },
2771
+ "include_unassigned": {
2772
+ "type": "boolean",
2773
+ "description": "Whether threads with no assignee join the `assigned_to` set. A separate flag rather than a\nsentinel entry in that list, so `assigned_to` holds user ids and nothing else.\n"
2774
+ },
2775
+ "date_from_days_ago": {
2776
+ "type": "integer",
2777
+ "minimum": 0,
2778
+ "description": "Lower bound of the date range, in days before now. Omitted means the epoch."
2779
+ },
2780
+ "date_to_days_ago": {
2781
+ "type": "integer",
2782
+ "minimum": 0,
2783
+ "description": "Upper bound of the date range, in days before now. Omitted means now."
2784
+ },
2785
+ "email_filter": {
2786
+ "type": "array",
2787
+ "items": {
2788
+ "type": "string"
2789
+ },
2790
+ "description": "Addresses the user selected in the address filter. Absent and empty differ, and the\ndifference is a real UI state: absent is \"not filtering by address\", empty is \"every\naddress deselected\", which matches nothing.\n\nDistinct from the permission restriction, which the server derives and a caller cannot\nauthor.\n"
2791
+ },
2792
+ "text": {
2793
+ "type": "string",
2794
+ "description": "The user's search string, as typed. Expanded across the searched fields server-side and\nnever interpreted as query syntax, so a typed operator or a stray bracket cannot\nre-associate the predicate around it.\n"
2795
+ },
2796
+ "thread_ids": {
2797
+ "type": "array",
2798
+ "items": {
2799
+ "type": "string"
2800
+ },
2801
+ "description": "Restrict the view to these threads. Exists because \"would this thread appear in the view\nthe user is looking at?\" is a real question the inbox asks when a new thread arrives, and\nit is a membership test against the view rather than a different view.\n"
2802
+ },
2803
+ "pinned_by": {
2804
+ "type": "string",
2805
+ "description": "Restrict the view to threads this user pinned. The pinned strip above the list is the same\nview with this one extra condition.\n"
2806
+ }
2807
+ }
2808
+ },
2809
+ "UnreadCountScope": {
2810
+ "type": "object",
2811
+ "required": [
2812
+ "name",
2813
+ "type"
2814
+ ],
2815
+ "properties": {
2816
+ "name": {
2817
+ "type": "string",
2818
+ "description": "Caller-chosen key for this scope. Echoed back as the key in `counts`, so it is how the\ncaller matches a number to the sidebar row it belongs to. Must be unique within the\nrequest; duplicates are refused rather than silently collapsed.\n",
2819
+ "example": "inbox-support"
2820
+ },
2821
+ "type": {
2822
+ "type": "string",
2823
+ "enum": [
2824
+ "organization",
2825
+ "shared_inbox",
2826
+ "saved_view"
2827
+ ],
2828
+ "description": "Decides which buckets come back, and whether `q` is required. `organization` returns all\nfour buckets from the canonical central-inbox queries and takes no `q`. `shared_inbox`\nand `saved_view` return `unread` alone. A `saved_view` scope names its view with `view_id`;\na `shared_inbox` scope needs only its `inbox_id`, since the query follows from the type.\n\nA `shared_inbox` scope additionally requires `actor: organization` and is refused with a\n400 otherwise. A shared inbox is an organization-level construct \u2014 selecting one always\nswitches the mailbox to the organization \u2014 so it has no per-user read state and the\ncombination would compute a number no surface renders. `saved_view` accepts either actor,\nbecause a view's own configuration names its mailbox.\n"
2829
+ },
2830
+ "q": {
2831
+ "type": "string",
2832
+ "description": "The scope's query, in Lucene syntax, as passed to `threads:search` for the same scope. The\nserver adds the read-state condition and nothing else, so the count matches that list.\n\nAccepted for `shared_inbox` and `saved_view`; rejected for `organization`.\n\nSuperseded by server-side compilation. It remains accepted for callers whose counts are\nenabled while compilation is not, and is ignored when compilation is enabled. It will be\nremoved once compilation is enabled everywhere counts are.\n",
2833
+ "example": "_tags.keyword:inbox AND !_tags.keyword:trash"
2834
+ },
2835
+ "view_id": {
2836
+ "type": "string",
2837
+ "description": "The id of the saved view this scope counts. The server reads that view and compiles the same\nquery the thread list runs for it, so the count and the list cannot describe the view\ndifferently.\n\nRequired for `saved_view` scopes unless `q` is supplied instead; rejected for the other two\ntypes. A `shared_inbox` scope needs no predicate field at all, because its query follows from\nthe type and its `inbox_id`. An `organization` scope uses the canonical folder queries.\n\nThe view's own shared-inbox filter is read from the stored view, so `inbox_id` need not be\nsent alongside this.\n\nCompilation is enabled per organization by the `message-unread-unified-predicate` feature\nflag. While it is off, a scope supplying only a `view_id` has no query to run and its name is\nreturned in `omitted` rather than counted. A named view that this organization does not have,\nor whose stored configuration cannot be read, is omitted the same way.\n",
2838
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2839
+ },
2840
+ "inbox_id": {
2841
+ "description": "Shared inbox ids, resolved to bucket ids the same way `threads:search` resolves them.",
2842
+ "oneOf": [
2843
+ {
2844
+ "type": "string",
2845
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2846
+ },
2847
+ {
2848
+ "type": "array",
2849
+ "items": {
2850
+ "type": "string"
2851
+ }
2852
+ }
2853
+ ]
2854
+ }
2855
+ }
2856
+ },
2857
+ "UnreadCountsPayload": {
2858
+ "type": "object",
2859
+ "required": [
2860
+ "actor",
2861
+ "scopes"
2862
+ ],
2863
+ "properties": {
2864
+ "actor": {
2865
+ "type": "string",
2866
+ "enum": [
2867
+ "organization",
2868
+ "user"
2869
+ ],
2870
+ "description": "Which read state to count against \u2014 the org's or the calling user's. Same meaning as\n`getUnread`'s path parameter, and unrelated to a scope's `type`.\n"
2871
+ },
2872
+ "email_filter": {
2873
+ "type": "array",
2874
+ "items": {
2875
+ "type": "string"
2876
+ },
2877
+ "description": "Restrict every scope to messages involving these addresses."
2878
+ },
2879
+ "user_groups": {
2880
+ "type": "array",
2881
+ "items": {
2882
+ "type": "string"
2883
+ },
2884
+ "description": "The caller's group ids, as `group_<id>`, with the same meaning and constraints as on\n`threads:search`. Read only when a scope carries a `view`. Entries not matching\n`group_<id>` are dropped. Not an authorization input.\n"
2885
+ },
2886
+ "scopes": {
2887
+ "type": "array",
2888
+ "minItems": 1,
2889
+ "maxItems": 25,
2890
+ "items": {
2891
+ "$ref": "#/components/schemas/UnreadCountScope"
2892
+ }
2893
+ }
2894
+ }
2895
+ },
2896
+ "UnreadCountsResult": {
2897
+ "type": "object",
2898
+ "required": [
2899
+ "enabled",
2900
+ "counts"
2901
+ ],
2902
+ "properties": {
2903
+ "enabled": {
2904
+ "type": "boolean",
2905
+ "description": "False when the `message-unread-counts` flag is off for the calling org, in which case\n`counts` is empty and no Elasticsearch work was done. Callers render no badges rather\nthan rendering zeroes.\n",
2906
+ "example": true
2907
+ },
2908
+ "counts": {
2909
+ "type": "object",
2910
+ "description": "One entry per scope, keyed by the scope's `name`. A scope whose predicate could not be\nbuilt is **absent** rather than zero, because a zero badge is a claim about the mailbox\nand an absent one is a claim about the request.\n",
2911
+ "additionalProperties": {
2912
+ "$ref": "#/components/schemas/UnreadCountBuckets"
2913
+ }
2914
+ },
2915
+ "omitted": {
2916
+ "type": "array",
2917
+ "description": "Names of scopes that were accepted but could not be counted. Each appears here and is\nabsent from `counts`, so an omission is distinguishable from a mis-spelled scope name.\n\nCauses, not distinguishable from this field: a `shared_inbox` scope whose ids matched no\nbucket in the organization; a scope with no query to run because compilation is disabled for\nthe organization and no `q` was supplied; and a `view_id` naming a view this organization\ndoes not have or whose stored configuration cannot be read.\n",
2918
+ "items": {
2919
+ "type": "string"
2920
+ }
2921
+ }
2922
+ }
2923
+ },
2924
+ "UnreadCountBuckets": {
2925
+ "type": "object",
2926
+ "required": [
2927
+ "unread"
2928
+ ],
2929
+ "properties": {
2930
+ "unread": {
2931
+ "type": "number",
2932
+ "example": 14
2933
+ },
2934
+ "drafts": {
2935
+ "type": "number",
2936
+ "description": "Organization scope only.",
2937
+ "example": 12
2938
+ },
2939
+ "unassigned": {
2940
+ "type": "number",
2941
+ "description": "Organization scope only.",
2942
+ "example": 1
2943
+ },
2944
+ "spam": {
2945
+ "type": "number",
2946
+ "description": "Organization scope only.",
2947
+ "example": 3
2948
+ }
2949
+ }
2950
+ },
2951
+ "SearchParamsV2": {
2952
+ "type": "object",
2953
+ "properties": {
2954
+ "inbox_id": {
2955
+ "oneOf": [
2956
+ {
2957
+ "type": "string",
2958
+ "description": "Inbox ID",
2959
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2960
+ },
2961
+ {
2962
+ "type": "array",
2963
+ "items": {
2964
+ "type": "string"
2965
+ },
2966
+ "description": "Inbox IDs",
2967
+ "example": [
2968
+ "3f34ce73-089c-4d45-a5ee-c161234e41c3",
2969
+ "3f34ce73-089c-4d45-a5ee-c161234e41c4"
2970
+ ]
2971
+ }
2972
+ ]
2973
+ },
2974
+ "q": {
2975
+ "description": "Lucene query syntax supported with ElasticSearch.\n\nSend this or `view`, not both. At least one is required; a request with neither is refused\nwith a 400. An empty string is accepted and returns no hits.\n",
2976
+ "type": "string",
2977
+ "example": "subject:\"Request for solar panel price\" AND _tags:INBOX"
2978
+ },
2979
+ "view": {
2980
+ "allOf": [
2981
+ {
2982
+ "$ref": "#/components/schemas/ThreadView"
2983
+ }
2984
+ ],
2985
+ "description": "A view for the server to compile into the query, instead of supplying `q`. When a view is\npresent and compilation is enabled for the calling organization, the compiled query runs and\n`q` is not consulted.\n\nRead by `threads:search` and `threads:searchIds` only. This schema is shared with\n`messages:search`, which compiles no view and ignores the field, so a request there must\nsupply `q`.\n\nCompilation is enabled per organization by the `message-unread-unified-predicate` feature\nflag. While it is off, `q` runs and a request supplying only a view returns no hits.\n"
2986
+ },
2987
+ "user_groups": {
2988
+ "type": "array",
2989
+ "items": {
2990
+ "type": "string"
2991
+ },
2992
+ "description": "The caller's group ids, as `group_<id>`. Read only when a `view` is compiled, where they\ndetermine the agent mailbox's assignee condition and which shared inboxes, and therefore\nwhich addresses, are reachable. Required for those conditions to be correct, because group\nmembership is not present on the id token this service parses.\n\nEntries not matching `group_<id>` are dropped.\n\nNot an authorization input, and not treated as one: naming groups the caller is not in\nwidens what the response includes, exactly as supplying a broader `q` does. Access control\nis enforced elsewhere.\n"
2993
+ },
2994
+ "fields": {
2995
+ "$ref": "#/components/schemas/FieldsParam"
2996
+ },
2997
+ "from": {
2998
+ "type": "integer",
2999
+ "minimum": 0,
3000
+ "default": 0
3001
+ },
3002
+ "size": {
3003
+ "type": "integer",
3004
+ "minimum": 1,
3005
+ "default": 10
3006
+ },
3007
+ "hydrate": {
3008
+ "type": "boolean",
3009
+ "default": false
3010
+ },
3011
+ "include_scores": {
3012
+ "type": "boolean",
3013
+ "default": false
3014
+ },
3015
+ "sort": {
3016
+ "type": "string"
3017
+ },
3018
+ "highlight": {}
3019
+ }
3020
+ },
3021
+ "SearchParams": {
3022
+ "type": "object",
3023
+ "required": [
3024
+ "q"
3025
+ ],
3026
+ "properties": {
3027
+ "q": {
3028
+ "description": "Lucene query syntax supported with ElasticSearch",
3029
+ "type": "string",
3030
+ "example": "subject:\"Request for solar panel price\" AND _tags:INBOX"
3031
+ },
3032
+ "from": {
3033
+ "type": "integer",
3034
+ "minimum": 0,
3035
+ "default": 0
3036
+ },
3037
+ "size": {
3038
+ "type": "integer",
3039
+ "minimum": 1,
3040
+ "default": 10
3041
+ },
3042
+ "hydrate": {
3043
+ "type": "boolean",
3044
+ "default": false
3045
+ }
3046
+ }
3047
+ },
3048
+ "SearchIDParams": {
3049
+ "type": "object",
3050
+ "properties": {
3051
+ "view": {
3052
+ "allOf": [
3053
+ {
3054
+ "$ref": "#/components/schemas/ThreadView"
3055
+ }
3056
+ ],
3057
+ "description": "The view to compile, with the same meaning as on `threads:search`. Present here because\nthis endpoint returns the ordered id set *for that list*: if one compiled its view and the\nother ran an authored `q`, the two would disagree inside a single feature, which is the\ndrift this replaces.\n"
3058
+ },
3059
+ "user_groups": {
3060
+ "type": "array",
3061
+ "items": {
3062
+ "type": "string"
3063
+ },
3064
+ "description": "The caller's group ids, with the same meaning and caveats as on `threads:search`."
3065
+ },
3066
+ "inbox_id": {
3067
+ "oneOf": [
3068
+ {
3069
+ "type": "string",
3070
+ "description": "Inbox ID",
3071
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
3072
+ },
3073
+ {
3074
+ "type": "array",
3075
+ "items": {
3076
+ "type": "string"
3077
+ },
3078
+ "description": "Inbox IDs",
3079
+ "example": [
3080
+ "3f34ce73-089c-4d45-a5ee-c161234e41c3",
3081
+ "3f34ce73-089c-4d45-a5ee-c161234e41c4"
3082
+ ]
3083
+ }
3084
+ ]
3085
+ },
3086
+ "q": {
3087
+ "description": "Lucene query syntax supported with ElasticSearch",
3088
+ "type": "string",
3089
+ "example": "subject:\"Request for solar panel price\" AND _tags:INBOX"
3090
+ }
3091
+ }
3092
+ },
3093
+ "AssigneeWorkloadParams": {
3094
+ "type": "object",
3095
+ "required": [
3096
+ "user_ids"
3097
+ ],
3098
+ "properties": {
3099
+ "user_ids": {
3100
+ "type": "array",
3101
+ "description": "User ids to compute the open-thread workload for. At most 100 per request; larger requests are rejected with 422.",
3102
+ "minItems": 1,
3103
+ "items": {
3104
+ "type": "string"
3105
+ },
3106
+ "example": [
3107
+ "11000902",
3108
+ "11001053"
3109
+ ]
3110
+ }
3111
+ }
3112
+ },
3113
+ "AssigneeWorkload": {
3114
+ "type": "object",
3115
+ "required": [
3116
+ "user_id",
3117
+ "open_threads"
3118
+ ],
3119
+ "properties": {
3120
+ "user_id": {
3121
+ "type": "string",
3122
+ "description": "The user id.",
3123
+ "example": "11000902"
3124
+ },
3125
+ "open_threads": {
3126
+ "type": "number",
3127
+ "description": "Number of open threads assigned directly to the user.",
3128
+ "example": 2
3129
+ }
3130
+ }
3131
+ },
3132
+ "AssigneeWorkloadResults": {
3133
+ "type": "object",
3134
+ "required": [
3135
+ "workloads"
3136
+ ],
3137
+ "properties": {
3138
+ "workloads": {
3139
+ "type": "array",
3140
+ "description": "Open-thread workload per requested user id, in request order.",
3141
+ "items": {
3142
+ "$ref": "#/components/schemas/AssigneeWorkload"
3143
+ }
3144
+ }
3145
+ }
3146
+ },
3147
+ "ReadMessagePayload": {
3148
+ "type": "object",
3149
+ "required": [
3150
+ "scopes"
3151
+ ],
3152
+ "properties": {
3153
+ "scopes": {
3154
+ "description": "The scopes to be used when marking an item as read or unread. The read status will be synced for all provided scopes.",
3155
+ "example": [
3156
+ "organization",
3157
+ "user"
3158
+ ],
3159
+ "type": "array",
3160
+ "default": [
3161
+ "organization",
3162
+ "user"
3163
+ ],
3164
+ "items": {
3165
+ "$ref": "#/components/schemas/ReadingScope"
3166
+ }
3167
+ }
3168
+ }
3169
+ },
3170
+ "ReadingScope": {
3171
+ "description": "Who is marking an item as read or unread.",
3172
+ "type": "string",
3173
+ "enum": [
3174
+ "organization",
3175
+ "user"
3176
+ ]
3177
+ },
3178
+ "ThreadTimeline": {
3179
+ "type": "object",
3180
+ "required": [
3181
+ "events"
3182
+ ],
3183
+ "properties": {
3184
+ "events": {
3185
+ "type": "array",
3186
+ "items": {
3187
+ "$ref": "#/components/schemas/TimelineEvent"
3188
+ }
3189
+ }
3190
+ }
3191
+ },
3192
+ "ThreadDoneEvent": {
3193
+ "type": "object",
3194
+ "required": [
3195
+ "type",
3196
+ "user_id",
3197
+ "organization_id"
3198
+ ],
3199
+ "properties": {
3200
+ "type": {
3201
+ "type": "string",
3202
+ "enum": [
3203
+ "THREAD_DONE"
3204
+ ]
3205
+ },
3206
+ "user_id": {
3207
+ "type": "string",
3208
+ "description": "User ID of the user who marked the thread as done",
3209
+ "example": "123"
3210
+ },
3211
+ "organization_id": {
3212
+ "type": "string",
3213
+ "description": "Organization ID of the organization who marked the thread as done",
3214
+ "example": "456"
3215
+ }
3216
+ }
3217
+ },
3218
+ "ThreadOpenEvent": {
3219
+ "type": "object",
3220
+ "required": [
3221
+ "type",
3222
+ "user_id",
3223
+ "organization_id"
3224
+ ],
3225
+ "properties": {
3226
+ "type": {
3227
+ "type": "string",
3228
+ "enum": [
3229
+ "THREAD_OPEN"
3230
+ ]
3231
+ },
3232
+ "user_id": {
3233
+ "type": "string",
3234
+ "description": "User ID of the user who marked the thread as open",
3235
+ "example": "123"
3236
+ },
3237
+ "organization_id": {
3238
+ "type": "string",
3239
+ "description": "Organization ID of the organization who marked the thread as open",
3240
+ "example": "456"
3241
+ }
3242
+ }
3243
+ },
3244
+ "WorkflowStartedEvent": {
3245
+ "type": "object",
3246
+ "required": [
3247
+ "type"
3248
+ ],
3249
+ "properties": {
3250
+ "type": {
3251
+ "type": "string",
3252
+ "enum": [
3253
+ "WORKFLOW_STARTED"
3254
+ ]
3255
+ },
3256
+ "workflow_id": {
3257
+ "type": "string",
3258
+ "description": "ID of the workflow/flow execution that was started"
3259
+ },
3260
+ "workflow_name": {
3261
+ "type": "string",
3262
+ "description": "Name of the workflow that was started"
3263
+ }
3264
+ }
3265
+ },
3266
+ "ThreadUserAssignedEvent": {
3267
+ "type": "object",
3268
+ "required": [
3269
+ "type"
3270
+ ],
3271
+ "properties": {
3272
+ "type": {
3273
+ "type": "string",
3274
+ "enum": [
3275
+ "THREAD_USER_ASSIGNED"
3276
+ ]
3277
+ },
3278
+ "added": {
3279
+ "type": "array",
3280
+ "description": "User IDs assigned to the thread",
3281
+ "items": {
3282
+ "type": "string"
3283
+ }
3284
+ },
3285
+ "removed": {
3286
+ "type": "array",
3287
+ "description": "User IDs unassigned from the thread",
3288
+ "items": {
3289
+ "type": "string"
3290
+ }
3291
+ }
3292
+ }
3293
+ },
3294
+ "MessageLabelAddedEvent": {
3295
+ "type": "object",
3296
+ "required": [
3297
+ "type",
3298
+ "label"
3299
+ ],
3300
+ "properties": {
3301
+ "type": {
3302
+ "type": "string",
3303
+ "enum": [
3304
+ "MESSAGE_LABEL_ADDED"
3305
+ ]
3306
+ },
3307
+ "label": {
3308
+ "type": "string",
3309
+ "description": "The label that was added (raw tag slug, e.g. `sentiments:angry`)"
3310
+ },
3311
+ "label_name": {
3312
+ "type": "string",
3313
+ "description": "Resolved taxonomy classification display name (e.g. `Ver\u00e4rgert`), when the label is a classification. Absent for free-form tags."
3314
+ }
3315
+ }
3316
+ },
3317
+ "MessageLabelRemovedEvent": {
3318
+ "type": "object",
3319
+ "required": [
3320
+ "type",
3321
+ "label"
3322
+ ],
3323
+ "properties": {
3324
+ "type": {
3325
+ "type": "string",
3326
+ "enum": [
3327
+ "MESSAGE_LABEL_REMOVED"
3328
+ ]
3329
+ },
3330
+ "label": {
3331
+ "type": "string",
3332
+ "description": "The label that was removed (raw tag slug, e.g. `sentiments:angry`)"
3333
+ },
3334
+ "label_name": {
3335
+ "type": "string",
3336
+ "description": "Resolved taxonomy classification display name (e.g. `Ver\u00e4rgert`), when the label is a classification. Absent for free-form tags."
3337
+ }
3338
+ }
3339
+ },
3340
+ "MessageEntityLinkedEvent": {
3341
+ "type": "object",
3342
+ "required": [
3343
+ "type"
3344
+ ],
3345
+ "properties": {
3346
+ "type": {
3347
+ "type": "string",
3348
+ "enum": [
3349
+ "MESSAGE_ENTITY_LINKED"
3350
+ ]
3351
+ },
3352
+ "entities": {
3353
+ "type": "array",
3354
+ "items": {
3355
+ "$ref": "#/components/schemas/TimelineLinkedEntity"
3356
+ }
3357
+ },
3358
+ "link_kind": {
3359
+ "type": "string",
3360
+ "enum": [
3361
+ "manual",
3362
+ "auto"
3363
+ ]
3364
+ }
3365
+ }
3366
+ },
3367
+ "MessageEntityUnlinkedEvent": {
3368
+ "type": "object",
3369
+ "required": [
3370
+ "type"
3371
+ ],
3372
+ "properties": {
3373
+ "type": {
3374
+ "type": "string",
3375
+ "enum": [
3376
+ "MESSAGE_ENTITY_UNLINKED"
3377
+ ]
3378
+ },
3379
+ "entities": {
3380
+ "type": "array",
3381
+ "items": {
3382
+ "$ref": "#/components/schemas/TimelineLinkedEntity"
3383
+ }
3384
+ },
3385
+ "link_kind": {
3386
+ "type": "string",
3387
+ "enum": [
3388
+ "manual",
3389
+ "auto"
3390
+ ]
3391
+ }
3392
+ }
3393
+ },
3394
+ "MessageAutoReplySentEvent": {
3395
+ "type": "object",
3396
+ "required": [
3397
+ "type"
3398
+ ],
3399
+ "properties": {
3400
+ "type": {
3401
+ "type": "string",
3402
+ "enum": [
3403
+ "MESSAGE_AUTO_REPLY_SENT"
3404
+ ]
3405
+ },
3406
+ "reply_message_id": {
3407
+ "type": "string",
3408
+ "description": "ID of the message that was sent as the automatic reply"
3409
+ },
3410
+ "parent_message_id": {
3411
+ "type": "string",
3412
+ "description": "ID of the message the automatic reply responded to"
3413
+ }
3414
+ }
3415
+ },
3416
+ "ThreadMovedToInboxEvent": {
3417
+ "type": "object",
3418
+ "required": [
3419
+ "type"
3420
+ ],
3421
+ "properties": {
3422
+ "type": {
3423
+ "type": "string",
3424
+ "enum": [
3425
+ "THREAD_MOVED_TO_INBOX"
3426
+ ]
3427
+ },
3428
+ "target_inbox_id": {
3429
+ "type": "string",
3430
+ "description": "ID of the shared inbox the thread was moved to"
3431
+ },
3432
+ "target_inbox_name": {
3433
+ "type": "string",
3434
+ "description": "Name of the shared inbox the thread was moved to"
3435
+ }
3436
+ }
3437
+ },
3438
+ "ThreadTrashedEvent": {
3439
+ "type": "object",
3440
+ "required": [
3441
+ "type"
3442
+ ],
3443
+ "properties": {
3444
+ "type": {
3445
+ "type": "string",
3446
+ "enum": [
3447
+ "THREAD_TRASHED"
3448
+ ]
3449
+ }
3450
+ }
3451
+ },
3452
+ "ThreadRestoredEvent": {
3453
+ "type": "object",
3454
+ "required": [
3455
+ "type"
3456
+ ],
3457
+ "properties": {
3458
+ "type": {
3459
+ "type": "string",
3460
+ "enum": [
3461
+ "THREAD_RESTORED"
3462
+ ]
3463
+ }
3464
+ }
3465
+ },
3466
+ "TimelineLinkedEntity": {
3467
+ "type": "object",
3468
+ "required": [
3469
+ "entity_id"
3470
+ ],
3471
+ "properties": {
3472
+ "entity_id": {
3473
+ "type": "string"
3474
+ },
3475
+ "schema": {
3476
+ "type": "string",
3477
+ "description": "Entity schema slug, e.g. \"opportunity\""
3478
+ }
3479
+ }
3480
+ },
3481
+ "TimelineActor": {
3482
+ "type": "object",
3483
+ "properties": {
3484
+ "user_id": {
3485
+ "type": "string"
3486
+ },
3487
+ "email": {
3488
+ "type": "string"
3489
+ }
3490
+ }
3491
+ },
3492
+ "TimelineEventData": {
3493
+ "type": "object",
3494
+ "discriminator": {
3495
+ "propertyName": "type"
3496
+ },
3497
+ "oneOf": [
3498
+ {
3499
+ "$ref": "#/components/schemas/ThreadDoneEvent"
3500
+ },
3501
+ {
3502
+ "$ref": "#/components/schemas/ThreadOpenEvent"
3503
+ },
3504
+ {
3505
+ "$ref": "#/components/schemas/WorkflowStartedEvent"
3506
+ },
3507
+ {
3508
+ "$ref": "#/components/schemas/ThreadUserAssignedEvent"
3509
+ },
3510
+ {
3511
+ "$ref": "#/components/schemas/MessageLabelAddedEvent"
3512
+ },
3513
+ {
3514
+ "$ref": "#/components/schemas/MessageLabelRemovedEvent"
3515
+ },
3516
+ {
3517
+ "$ref": "#/components/schemas/MessageEntityLinkedEvent"
3518
+ },
3519
+ {
3520
+ "$ref": "#/components/schemas/MessageEntityUnlinkedEvent"
3521
+ },
3522
+ {
3523
+ "$ref": "#/components/schemas/MessageAutoReplySentEvent"
3524
+ },
3525
+ {
3526
+ "$ref": "#/components/schemas/ThreadMovedToInboxEvent"
3527
+ },
3528
+ {
3529
+ "$ref": "#/components/schemas/ThreadTrashedEvent"
3530
+ },
3531
+ {
3532
+ "$ref": "#/components/schemas/ThreadRestoredEvent"
3533
+ }
3534
+ ]
3535
+ },
3536
+ "TimelineEvent": {
3537
+ "type": "object",
3538
+ "required": [
3539
+ "timestamp",
3540
+ "data"
3541
+ ],
3542
+ "properties": {
3543
+ "id": {
3544
+ "type": "string",
3545
+ "description": "Activity id (ActivityItem._id), for deep-linking to the item in the activity feed"
3546
+ },
3547
+ "data": {
3548
+ "$ref": "#/components/schemas/TimelineEventData"
3549
+ },
3550
+ "timestamp": {
3551
+ "type": "string",
3552
+ "description": "Timestamp of the event",
3553
+ "example": "2024-01-01T00:00:00.000Z"
3554
+ },
3555
+ "message_id": {
3556
+ "type": "string",
3557
+ "description": "For message-level events, the message the activity is anchored to"
3558
+ },
3559
+ "source": {
3560
+ "type": "string",
3561
+ "enum": [
3562
+ "user",
3563
+ "automation",
3564
+ "system"
3565
+ ]
3566
+ },
3567
+ "automated": {
3568
+ "type": "boolean",
3569
+ "description": "Whether the activity was performed automatically (automation/system)"
3570
+ },
3571
+ "actor": {
3572
+ "$ref": "#/components/schemas/TimelineActor"
3573
+ },
3574
+ "automation": {
3575
+ "type": "object",
3576
+ "properties": {
3577
+ "id": {
3578
+ "type": "string"
3579
+ },
3580
+ "name": {
3581
+ "type": "string"
3582
+ }
3583
+ }
3584
+ }
3585
+ }
3586
+ },
3587
+ "BulkActionsPayloadWithScopes": {
3588
+ "allOf": [
3589
+ {
3590
+ "$ref": "#/components/schemas/BulkActionsPayload"
3591
+ },
3592
+ {
3593
+ "type": "object",
3594
+ "properties": {
3595
+ "assign_to": {
3596
+ "description": "Assignable IDs to assign the threads to",
3597
+ "type": "array",
3598
+ "items": {
3599
+ "type": "string",
3600
+ "example": "206801"
3601
+ }
3602
+ },
3603
+ "inbox_id": {
3604
+ "description": "Inbox ID to move the threads to",
3605
+ "type": "string",
3606
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
3607
+ },
3608
+ "scopes": {
3609
+ "description": "The scopes to be used when marking an item as read or unread. The read status will be synced for all provided scopes.",
3610
+ "example": [
3611
+ "organization",
3612
+ "user"
3613
+ ],
3614
+ "type": "array",
3615
+ "default": [
3616
+ "organization",
3617
+ "user"
3618
+ ],
3619
+ "items": {
3620
+ "$ref": "#/components/schemas/ReadingScope"
3621
+ }
3622
+ }
3623
+ }
3624
+ }
3625
+ ]
3626
+ },
3627
+ "BulkActionsPayload": {
3628
+ "type": "object",
3629
+ "required": [
3630
+ "ids"
3631
+ ],
3632
+ "properties": {
3633
+ "ids": {
3634
+ "description": "Array of threads you wish to perform bulk actions on",
3635
+ "example": [
3636
+ "6b299eda-4018-4554-8965-c4b5598e6531"
3637
+ ],
3638
+ "type": "array",
3639
+ "items": {
3640
+ "type": "string"
3641
+ }
3642
+ }
3643
+ }
3644
+ },
3645
+ "FieldsParam": {
3646
+ "type": "array",
3647
+ "description": "List of entity fields to include or exclude in the response\n\nUse ! to exclude fields, e.g. `!_id` to exclude the `_id` field.\n\nGlobbing and globstart (**) is supported for nested fields.\n",
3648
+ "items": {
3649
+ "type": "string"
3650
+ },
3651
+ "example": [
3652
+ "_id",
3653
+ "_title",
3654
+ "first_name",
3655
+ "account",
3656
+ "!account.*._files",
3657
+ "**._product"
3658
+ ]
3659
+ }
3660
+ }
3661
+ },
3662
+ "servers": [
3663
+ {
3664
+ "url": "https://message.sls.epilot.io"
3665
+ }
3666
+ ]
3667
+ }