@epilot/sdk 2.0.3 → 2.1.0-rc.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (214) hide show
  1. package/definitions/access-token-runtime.json +1 -0
  2. package/definitions/access-token.json +663 -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 +1711 -0
  9. package/definitions/app-runtime.json +1 -0
  10. package/definitions/app.json +4443 -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 +4850 -0
  15. package/definitions/billing-runtime.json +1 -0
  16. package/definitions/billing.json +837 -0
  17. package/definitions/blueprint-manifest-runtime.json +1 -0
  18. package/definitions/blueprint-manifest.json +3376 -0
  19. package/definitions/consent-runtime.json +1 -0
  20. package/definitions/consent.json +344 -0
  21. package/definitions/customer-portal-runtime.json +1 -0
  22. package/definitions/customer-portal.json +15000 -0
  23. package/definitions/dashboard-runtime.json +1 -0
  24. package/definitions/dashboard.json +484 -0
  25. package/definitions/data-management-runtime.json +1 -0
  26. package/definitions/data-management.json +962 -0
  27. package/definitions/deduplication-runtime.json +1 -0
  28. package/definitions/deduplication.json +183 -0
  29. package/definitions/design-runtime.json +1 -0
  30. package/definitions/design.json +1423 -0
  31. package/definitions/document-runtime.json +1 -0
  32. package/definitions/document.json +758 -0
  33. package/definitions/email-settings-runtime.json +1 -0
  34. package/definitions/email-settings.json +2627 -0
  35. package/definitions/email-template-runtime.json +1 -0
  36. package/definitions/email-template.json +1419 -0
  37. package/definitions/entity-mapping-runtime.json +1 -0
  38. package/definitions/entity-mapping.json +1642 -0
  39. package/definitions/entity-runtime.json +1 -0
  40. package/definitions/entity.json +10074 -0
  41. package/definitions/environments-runtime.json +1 -0
  42. package/definitions/environments.json +363 -0
  43. package/definitions/erp-integration-runtime.json +1 -0
  44. package/definitions/erp-integration.json +5845 -0
  45. package/definitions/event-catalog-runtime.json +1 -0
  46. package/definitions/event-catalog.json +1051 -0
  47. package/definitions/file-runtime.json +1 -0
  48. package/definitions/file.json +2842 -0
  49. package/definitions/iban-runtime.json +1 -0
  50. package/definitions/iban.json +132 -0
  51. package/definitions/journey-runtime.json +1 -0
  52. package/definitions/journey.json +2341 -0
  53. package/definitions/kanban-runtime.json +1 -0
  54. package/definitions/kanban.json +929 -0
  55. package/definitions/message-runtime.json +1 -0
  56. package/definitions/message.json +2660 -0
  57. package/definitions/metering-runtime.json +1 -0
  58. package/definitions/metering.json +2321 -0
  59. package/definitions/notes-runtime.json +1 -0
  60. package/definitions/notes.json +1531 -0
  61. package/definitions/notification-runtime.json +1 -0
  62. package/definitions/notification.json +1425 -0
  63. package/definitions/organization-runtime.json +1 -0
  64. package/definitions/organization.json +629 -0
  65. package/definitions/partner-directory-runtime.json +1 -0
  66. package/definitions/partner-directory.json +1718 -0
  67. package/definitions/permissions-runtime.json +1 -0
  68. package/definitions/permissions.json +1480 -0
  69. package/definitions/pricing-runtime.json +1 -0
  70. package/definitions/pricing-tier-runtime.json +1 -0
  71. package/definitions/pricing-tier.json +105 -0
  72. package/definitions/pricing.json +9884 -0
  73. package/definitions/purpose-runtime.json +1 -0
  74. package/definitions/purpose.json +524 -0
  75. package/definitions/sandbox-runtime.json +1 -0
  76. package/definitions/sandbox.json +453 -0
  77. package/definitions/submission-runtime.json +1 -0
  78. package/definitions/submission.json +313 -0
  79. package/definitions/targeting-runtime.json +1 -0
  80. package/definitions/targeting.json +1474 -0
  81. package/definitions/template-variables-runtime.json +1 -0
  82. package/definitions/template-variables.json +1408 -0
  83. package/definitions/user-runtime.json +1 -0
  84. package/definitions/user.json +2408 -0
  85. package/definitions/validation-rules-runtime.json +1 -0
  86. package/definitions/validation-rules.json +1491 -0
  87. package/definitions/webhooks-runtime.json +1 -0
  88. package/definitions/webhooks.json +1525 -0
  89. package/definitions/workflow-definition-runtime.json +1 -0
  90. package/definitions/workflow-definition.json +3417 -0
  91. package/definitions/workflow-runtime.json +1 -0
  92. package/definitions/workflow.json +4106 -0
  93. package/dist/apis/access-token.cjs +7 -7
  94. package/dist/apis/access-token.js +1 -1
  95. package/dist/apis/address-suggestions.cjs +7 -7
  96. package/dist/apis/address-suggestions.js +1 -1
  97. package/dist/apis/address.cjs +7 -7
  98. package/dist/apis/address.js +1 -1
  99. package/dist/apis/ai-agents.cjs +7 -7
  100. package/dist/apis/ai-agents.js +1 -1
  101. package/dist/apis/app.cjs +7 -7
  102. package/dist/apis/app.d.cts +2 -2
  103. package/dist/apis/app.d.ts +2 -2
  104. package/dist/apis/app.js +1 -1
  105. package/dist/apis/audit-logs.cjs +7 -7
  106. package/dist/apis/audit-logs.js +1 -1
  107. package/dist/apis/automation.cjs +7 -7
  108. package/dist/apis/automation.js +1 -1
  109. package/dist/apis/billing.cjs +7 -7
  110. package/dist/apis/billing.js +1 -1
  111. package/dist/apis/blueprint-manifest.cjs +8 -8
  112. package/dist/apis/blueprint-manifest.d.cts +2 -2
  113. package/dist/apis/blueprint-manifest.d.ts +2 -2
  114. package/dist/apis/blueprint-manifest.js +2 -2
  115. package/dist/apis/consent.cjs +7 -7
  116. package/dist/apis/consent.js +1 -1
  117. package/dist/apis/customer-portal.cjs +7 -7
  118. package/dist/apis/customer-portal.js +1 -1
  119. package/dist/apis/dashboard.cjs +7 -7
  120. package/dist/apis/dashboard.js +1 -1
  121. package/dist/apis/data-management.cjs +7 -7
  122. package/dist/apis/data-management.d.cts +2 -2
  123. package/dist/apis/data-management.d.ts +2 -2
  124. package/dist/apis/data-management.js +1 -1
  125. package/dist/apis/deduplication.cjs +7 -7
  126. package/dist/apis/deduplication.js +1 -1
  127. package/dist/apis/design.cjs +7 -7
  128. package/dist/apis/design.js +1 -1
  129. package/dist/apis/document.cjs +7 -7
  130. package/dist/apis/document.js +1 -1
  131. package/dist/apis/email-settings.cjs +7 -7
  132. package/dist/apis/email-settings.js +1 -1
  133. package/dist/apis/email-template.cjs +7 -7
  134. package/dist/apis/email-template.d.cts +2 -2
  135. package/dist/apis/email-template.d.ts +2 -2
  136. package/dist/apis/email-template.js +1 -1
  137. package/dist/apis/entity-mapping.cjs +7 -7
  138. package/dist/apis/entity-mapping.js +1 -1
  139. package/dist/apis/entity.cjs +8 -8
  140. package/dist/apis/entity.d.cts +2 -2
  141. package/dist/apis/entity.d.ts +2 -2
  142. package/dist/apis/entity.js +2 -2
  143. package/dist/apis/environments.cjs +7 -7
  144. package/dist/apis/environments.js +1 -1
  145. package/dist/apis/erp-integration.cjs +7 -7
  146. package/dist/apis/erp-integration.js +1 -1
  147. package/dist/apis/event-catalog.cjs +7 -7
  148. package/dist/apis/event-catalog.js +1 -1
  149. package/dist/apis/file.cjs +7 -7
  150. package/dist/apis/file.js +1 -1
  151. package/dist/apis/iban.cjs +7 -7
  152. package/dist/apis/iban.js +1 -1
  153. package/dist/apis/journey.cjs +7 -7
  154. package/dist/apis/journey.js +1 -1
  155. package/dist/apis/kanban.cjs +7 -7
  156. package/dist/apis/kanban.js +1 -1
  157. package/dist/apis/message.cjs +7 -7
  158. package/dist/apis/message.js +1 -1
  159. package/dist/apis/metering.cjs +7 -7
  160. package/dist/apis/metering.js +1 -1
  161. package/dist/apis/notes.cjs +7 -7
  162. package/dist/apis/notes.js +1 -1
  163. package/dist/apis/notification.cjs +7 -7
  164. package/dist/apis/notification.js +1 -1
  165. package/dist/apis/organization.cjs +7 -7
  166. package/dist/apis/organization.js +1 -1
  167. package/dist/apis/partner-directory.cjs +7 -7
  168. package/dist/apis/partner-directory.js +1 -1
  169. package/dist/apis/permissions.cjs +7 -7
  170. package/dist/apis/permissions.js +1 -1
  171. package/dist/apis/pricing-tier.cjs +7 -7
  172. package/dist/apis/pricing-tier.js +1 -1
  173. package/dist/apis/pricing.cjs +7 -7
  174. package/dist/apis/pricing.js +1 -1
  175. package/dist/apis/purpose.cjs +7 -7
  176. package/dist/apis/purpose.js +1 -1
  177. package/dist/apis/sandbox.cjs +7 -7
  178. package/dist/apis/sandbox.js +1 -1
  179. package/dist/apis/submission.cjs +7 -7
  180. package/dist/apis/submission.js +1 -1
  181. package/dist/apis/targeting.cjs +7 -7
  182. package/dist/apis/targeting.js +1 -1
  183. package/dist/apis/template-variables.cjs +7 -7
  184. package/dist/apis/template-variables.js +1 -1
  185. package/dist/apis/user.cjs +7 -7
  186. package/dist/apis/user.js +1 -1
  187. package/dist/apis/validation-rules.cjs +7 -7
  188. package/dist/apis/validation-rules.js +1 -1
  189. package/dist/apis/webhooks.cjs +7 -7
  190. package/dist/apis/webhooks.js +1 -1
  191. package/dist/apis/workflow-definition.cjs +7 -7
  192. package/dist/apis/workflow-definition.js +1 -1
  193. package/dist/apis/workflow.cjs +7 -7
  194. package/dist/apis/workflow.js +1 -1
  195. package/dist/{app.d-Dr03n4J4.d.cts → app.d-BXy_QUym.d.cts} +21 -3
  196. package/dist/{app.d-Dr03n4J4.d.ts → app.d-BXy_QUym.d.ts} +21 -3
  197. package/dist/bin/cli.js +123 -25
  198. package/dist/{blueprint-manifest.d-CEWRdF3i.d.ts → blueprint-manifest.d-DECw6HdM.d.cts} +110 -2
  199. package/dist/{blueprint-manifest.d-CEWRdF3i.d.cts → blueprint-manifest.d-DECw6HdM.d.ts} +110 -2
  200. package/dist/{chunk-QMQNMCOC.js → chunk-XE25WERA.js} +1 -1
  201. package/dist/{chunk-5LXNSDG2.cjs → chunk-XEQMAKGA.cjs} +1 -1
  202. package/dist/{data-management.d-pnuiRU2h.d.cts → data-management.d-CkDmJwpx.d.cts} +1 -2
  203. package/dist/{data-management.d-pnuiRU2h.d.ts → data-management.d-CkDmJwpx.d.ts} +1 -2
  204. package/dist/{email-template.d-BeqkDHtk.d.cts → email-template.d-gtQkdaXM.d.cts} +17 -3
  205. package/dist/{email-template.d-BeqkDHtk.d.ts → email-template.d-gtQkdaXM.d.ts} +17 -3
  206. package/dist/{entity.d-CrtZaZr8.d.cts → entity.d-DtiajmaY.d.cts} +292 -10
  207. package/dist/{entity.d-CrtZaZr8.d.ts → entity.d-DtiajmaY.d.ts} +292 -10
  208. package/dist/index.cjs +17 -17
  209. package/dist/index.d.cts +5 -5
  210. package/dist/index.d.ts +5 -5
  211. package/dist/index.js +10 -10
  212. package/dist/js-yaml-UPZKYVRY.js +2645 -0
  213. package/package.json +11 -10
  214. package/LICENSE +0 -21
@@ -0,0 +1,2660 @@
1
+ {
2
+ "openapi": "3.0.2",
3
+ "info": {
4
+ "title": "Message API",
5
+ "version": "1.4.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
+ }
128
+ }
129
+ },
130
+ "/v1/message/messages/{id}": {
131
+ "get": {
132
+ "operationId": "getMessage",
133
+ "summary": "getMessage",
134
+ "description": "Get an email message by id",
135
+ "tags": [
136
+ "Messages"
137
+ ],
138
+ "parameters": [
139
+ {
140
+ "name": "id",
141
+ "description": "Message ID",
142
+ "in": "path",
143
+ "required": true,
144
+ "schema": {
145
+ "type": "string",
146
+ "example": "4d74976d-fb64-47fd-85e2-65eea140f5eb"
147
+ }
148
+ }
149
+ ],
150
+ "responses": {
151
+ "200": {
152
+ "description": "Success",
153
+ "content": {
154
+ "application/json": {
155
+ "schema": {
156
+ "allOf": [
157
+ {
158
+ "$ref": "#/components/schemas/BaseEntity"
159
+ },
160
+ {
161
+ "$ref": "#/components/schemas/Message"
162
+ }
163
+ ]
164
+ }
165
+ }
166
+ }
167
+ },
168
+ "302": {
169
+ "description": "Redirect to V2 API to fetch the download URL",
170
+ "headers": {
171
+ "Location": {
172
+ "description": "V2 API",
173
+ "schema": {
174
+ "type": "string",
175
+ "example": "https://message.sls.epilot.io/v2/messages/4d74976d-fb64-47fd-85e2-65eea140f5eb"
176
+ }
177
+ }
178
+ }
179
+ },
180
+ "403": {
181
+ "description": "Forbidden"
182
+ }
183
+ }
184
+ },
185
+ "delete": {
186
+ "operationId": "deleteMessage",
187
+ "summary": "deleteMessage",
188
+ "description": "Immediately and permanently delete a message. This operation cannot be undone.",
189
+ "tags": [
190
+ "Messages"
191
+ ],
192
+ "parameters": [
193
+ {
194
+ "name": "id",
195
+ "description": "Message ID",
196
+ "in": "path",
197
+ "required": true,
198
+ "schema": {
199
+ "type": "string"
200
+ }
201
+ }
202
+ ],
203
+ "responses": {
204
+ "204": {
205
+ "description": "Success"
206
+ },
207
+ "403": {
208
+ "description": "Forbidden"
209
+ }
210
+ }
211
+ }
212
+ },
213
+ "/v1/message/messages/{id}/eml": {
214
+ "get": {
215
+ "operationId": "getMessageEml",
216
+ "summary": "getMessageEml",
217
+ "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",
218
+ "tags": [
219
+ "Messages"
220
+ ],
221
+ "parameters": [
222
+ {
223
+ "name": "id",
224
+ "description": "Message entity ID",
225
+ "in": "path",
226
+ "required": true,
227
+ "schema": {
228
+ "type": "string",
229
+ "example": "4d74976d-fb64-47fd-85e2-65eea140f5eb"
230
+ }
231
+ }
232
+ ],
233
+ "responses": {
234
+ "302": {
235
+ "description": "Redirect to EML file download URL",
236
+ "headers": {
237
+ "Location": {
238
+ "description": "Pre-signed S3 URL to download the EML file (expires in 15 minutes)",
239
+ "schema": {
240
+ "type": "string"
241
+ }
242
+ }
243
+ }
244
+ },
245
+ "403": {
246
+ "description": "Forbidden"
247
+ },
248
+ "404": {
249
+ "description": "Message not found"
250
+ }
251
+ }
252
+ }
253
+ },
254
+ "/v1/message/messages:search": {
255
+ "post": {
256
+ "operationId": "searchMessages",
257
+ "summary": "searchMessages",
258
+ "description": "Search Messages",
259
+ "tags": [
260
+ "Messages"
261
+ ],
262
+ "requestBody": {
263
+ "content": {
264
+ "application/json": {
265
+ "schema": {
266
+ "$ref": "#/components/schemas/SearchParamsV2"
267
+ }
268
+ }
269
+ }
270
+ },
271
+ "responses": {
272
+ "200": {
273
+ "description": "Success",
274
+ "content": {
275
+ "application/json": {
276
+ "schema": {
277
+ "type": "object",
278
+ "required": [
279
+ "hits",
280
+ "results"
281
+ ],
282
+ "properties": {
283
+ "hits": {
284
+ "type": "number",
285
+ "description": "Total of matched messages",
286
+ "example": 14
287
+ },
288
+ "results": {
289
+ "type": "array",
290
+ "description": "Matched messages",
291
+ "items": {
292
+ "allOf": [
293
+ {
294
+ "$ref": "#/components/schemas/BaseEntity"
295
+ },
296
+ {
297
+ "$ref": "#/components/schemas/Message"
298
+ }
299
+ ]
300
+ }
301
+ }
302
+ }
303
+ }
304
+ }
305
+ }
306
+ },
307
+ "403": {
308
+ "description": "Forbidden"
309
+ }
310
+ }
311
+ }
312
+ },
313
+ "/v1/message/messages/{id}/trash": {
314
+ "post": {
315
+ "operationId": "trashMessage",
316
+ "summary": "trashMessage",
317
+ "description": "Move a message to the trash",
318
+ "tags": [
319
+ "Messages"
320
+ ],
321
+ "parameters": [
322
+ {
323
+ "name": "id",
324
+ "description": "Message ID",
325
+ "in": "path",
326
+ "required": true,
327
+ "schema": {
328
+ "type": "string"
329
+ }
330
+ }
331
+ ],
332
+ "responses": {
333
+ "204": {
334
+ "description": "Success"
335
+ },
336
+ "403": {
337
+ "description": "Forbidden"
338
+ }
339
+ }
340
+ }
341
+ },
342
+ "/v1/message/messages/{id}/untrash": {
343
+ "post": {
344
+ "operationId": "untrashMessage",
345
+ "summary": "untrashMessage",
346
+ "description": "Restore a trashed message",
347
+ "tags": [
348
+ "Messages"
349
+ ],
350
+ "parameters": [
351
+ {
352
+ "name": "id",
353
+ "description": "Message ID",
354
+ "in": "path",
355
+ "required": true,
356
+ "schema": {
357
+ "type": "string"
358
+ }
359
+ }
360
+ ],
361
+ "responses": {
362
+ "204": {
363
+ "description": "Success"
364
+ },
365
+ "403": {
366
+ "description": "Forbidden"
367
+ }
368
+ }
369
+ }
370
+ },
371
+ "/v1/message/messages/{id}/read": {
372
+ "post": {
373
+ "operationId": "markReadMessage",
374
+ "summary": "markReadMessage",
375
+ "description": "Mark message as read",
376
+ "tags": [
377
+ "Messages"
378
+ ],
379
+ "parameters": [
380
+ {
381
+ "name": "id",
382
+ "description": "Message ID",
383
+ "in": "path",
384
+ "required": true,
385
+ "schema": {
386
+ "type": "string"
387
+ }
388
+ }
389
+ ],
390
+ "responses": {
391
+ "204": {
392
+ "description": "Success"
393
+ },
394
+ "403": {
395
+ "description": "Forbidden"
396
+ }
397
+ }
398
+ }
399
+ },
400
+ "/v2/message/messages/{id}/read": {
401
+ "post": {
402
+ "operationId": "markReadMessageV2",
403
+ "summary": "markReadMessageV2",
404
+ "description": "Mark message as read within a scope",
405
+ "tags": [
406
+ "Messages"
407
+ ],
408
+ "parameters": [
409
+ {
410
+ "name": "id",
411
+ "description": "Message ID",
412
+ "in": "path",
413
+ "required": true,
414
+ "schema": {
415
+ "type": "string"
416
+ }
417
+ }
418
+ ],
419
+ "requestBody": {
420
+ "required": true,
421
+ "content": {
422
+ "application/json": {
423
+ "schema": {
424
+ "$ref": "#/components/schemas/ReadMessagePayload"
425
+ }
426
+ }
427
+ }
428
+ },
429
+ "responses": {
430
+ "204": {
431
+ "description": "Success"
432
+ },
433
+ "403": {
434
+ "description": "Forbidden"
435
+ }
436
+ }
437
+ }
438
+ },
439
+ "/v1/message/messages/{id}/unread": {
440
+ "post": {
441
+ "operationId": "markUnreadMessage",
442
+ "summary": "markUnreadMessage",
443
+ "description": "Mark message as unread",
444
+ "tags": [
445
+ "Messages"
446
+ ],
447
+ "parameters": [
448
+ {
449
+ "name": "id",
450
+ "description": "Message ID",
451
+ "in": "path",
452
+ "required": true,
453
+ "schema": {
454
+ "type": "string"
455
+ }
456
+ }
457
+ ],
458
+ "responses": {
459
+ "204": {
460
+ "description": "Success"
461
+ },
462
+ "403": {
463
+ "description": "Forbidden"
464
+ }
465
+ }
466
+ }
467
+ },
468
+ "/v1/message/messages/unread/{actor}": {
469
+ "get": {
470
+ "operationId": "getUnread",
471
+ "summary": "getUnread",
472
+ "description": "Get all unread messages by actor",
473
+ "tags": [
474
+ "Messages"
475
+ ],
476
+ "parameters": [
477
+ {
478
+ "name": "actor",
479
+ "description": "Actor performing call, can be user or organization",
480
+ "in": "path",
481
+ "required": true,
482
+ "schema": {
483
+ "type": "string",
484
+ "enum": [
485
+ "organization",
486
+ "user"
487
+ ]
488
+ }
489
+ },
490
+ {
491
+ "in": "query",
492
+ "name": "email_filter",
493
+ "description": "emails to filter by",
494
+ "schema": {
495
+ "oneOf": [
496
+ {
497
+ "type": "array",
498
+ "items": {
499
+ "type": "string"
500
+ }
501
+ },
502
+ {
503
+ "type": "string"
504
+ }
505
+ ]
506
+ }
507
+ }
508
+ ],
509
+ "responses": {
510
+ "200": {
511
+ "description": "Success",
512
+ "content": {
513
+ "application/json": {
514
+ "schema": {
515
+ "type": "object",
516
+ "required": [
517
+ "count"
518
+ ],
519
+ "properties": {
520
+ "count": {
521
+ "type": "number",
522
+ "description": "Total of unread messages",
523
+ "example": 14
524
+ },
525
+ "unread": {
526
+ "type": "number",
527
+ "description": "Total of unread messages",
528
+ "example": 0
529
+ },
530
+ "drafts": {
531
+ "type": "number",
532
+ "description": "Total of drafts messages",
533
+ "example": 12
534
+ },
535
+ "unassigned": {
536
+ "type": "number",
537
+ "description": "Total of unassigned messages",
538
+ "example": 1
539
+ }
540
+ }
541
+ }
542
+ }
543
+ }
544
+ },
545
+ "403": {
546
+ "description": "Forbidden"
547
+ }
548
+ }
549
+ }
550
+ },
551
+ "/v2/message/messages/{id}/unread": {
552
+ "post": {
553
+ "operationId": "markUnreadMessageV2",
554
+ "summary": "markUnreadMessageV2",
555
+ "description": "Mark message as unread within a scope",
556
+ "tags": [
557
+ "Messages"
558
+ ],
559
+ "parameters": [
560
+ {
561
+ "name": "id",
562
+ "description": "Message ID",
563
+ "in": "path",
564
+ "required": true,
565
+ "schema": {
566
+ "type": "string"
567
+ }
568
+ }
569
+ ],
570
+ "requestBody": {
571
+ "required": true,
572
+ "content": {
573
+ "application/json": {
574
+ "schema": {
575
+ "$ref": "#/components/schemas/ReadMessagePayload"
576
+ }
577
+ }
578
+ }
579
+ },
580
+ "responses": {
581
+ "204": {
582
+ "description": "Success"
583
+ },
584
+ "403": {
585
+ "description": "Forbidden"
586
+ }
587
+ }
588
+ }
589
+ },
590
+ "/v1/message/threads:search": {
591
+ "post": {
592
+ "operationId": "searchThreads",
593
+ "summary": "searchThreads",
594
+ "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",
595
+ "tags": [
596
+ "Threads"
597
+ ],
598
+ "requestBody": {
599
+ "content": {
600
+ "application/json": {
601
+ "schema": {
602
+ "$ref": "#/components/schemas/SearchParams"
603
+ }
604
+ }
605
+ }
606
+ },
607
+ "responses": {
608
+ "200": {
609
+ "description": "Success",
610
+ "content": {
611
+ "application/json": {
612
+ "schema": {
613
+ "type": "object",
614
+ "required": [
615
+ "hits",
616
+ "results"
617
+ ],
618
+ "properties": {
619
+ "hits": {
620
+ "type": "number",
621
+ "description": "Total of matched threads",
622
+ "example": 14
623
+ },
624
+ "results": {
625
+ "type": "array",
626
+ "description": "Matched threads",
627
+ "items": {
628
+ "allOf": [
629
+ {
630
+ "$ref": "#/components/schemas/BaseEntity"
631
+ },
632
+ {
633
+ "$ref": "#/components/schemas/Thread"
634
+ }
635
+ ]
636
+ }
637
+ }
638
+ }
639
+ }
640
+ }
641
+ }
642
+ },
643
+ "403": {
644
+ "description": "Forbidden"
645
+ }
646
+ }
647
+ }
648
+ },
649
+ "/v2/message/threads:search": {
650
+ "post": {
651
+ "operationId": "searchThreadsV2",
652
+ "summary": "searchThreadsV2",
653
+ "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",
654
+ "tags": [
655
+ "Threads"
656
+ ],
657
+ "requestBody": {
658
+ "content": {
659
+ "application/json": {
660
+ "schema": {
661
+ "$ref": "#/components/schemas/SearchParamsV2"
662
+ }
663
+ }
664
+ }
665
+ },
666
+ "responses": {
667
+ "200": {
668
+ "description": "Success",
669
+ "content": {
670
+ "application/json": {
671
+ "schema": {
672
+ "type": "object",
673
+ "required": [
674
+ "hits",
675
+ "results"
676
+ ],
677
+ "properties": {
678
+ "hits": {
679
+ "type": "number",
680
+ "description": "Total of matched threads",
681
+ "example": 14
682
+ },
683
+ "results": {
684
+ "type": "array",
685
+ "description": "Matched threads",
686
+ "items": {
687
+ "allOf": [
688
+ {
689
+ "$ref": "#/components/schemas/BaseEntity"
690
+ },
691
+ {
692
+ "$ref": "#/components/schemas/Thread"
693
+ }
694
+ ]
695
+ }
696
+ }
697
+ }
698
+ }
699
+ }
700
+ }
701
+ },
702
+ "403": {
703
+ "description": "Forbidden"
704
+ }
705
+ }
706
+ }
707
+ },
708
+ "/v1/message/threads:searchIds": {
709
+ "post": {
710
+ "operationId": "searchIds",
711
+ "summary": "Search threads and return all id's",
712
+ "description": "Return all thread id's that match a criteria\n\nLucene syntax supported.\n",
713
+ "tags": [
714
+ "Threads"
715
+ ],
716
+ "requestBody": {
717
+ "content": {
718
+ "application/json": {
719
+ "schema": {
720
+ "$ref": "#/components/schemas/SearchIDParams"
721
+ }
722
+ }
723
+ }
724
+ },
725
+ "responses": {
726
+ "200": {
727
+ "description": "Success",
728
+ "content": {
729
+ "application/json": {
730
+ "schema": {
731
+ "type": "object",
732
+ "required": [
733
+ "hits",
734
+ "results"
735
+ ],
736
+ "properties": {
737
+ "hits": {
738
+ "type": "number",
739
+ "description": "Total of matched threads",
740
+ "example": 14
741
+ },
742
+ "results": {
743
+ "type": "array",
744
+ "description": "Matched threads ids",
745
+ "items": {
746
+ "type": "string"
747
+ }
748
+ }
749
+ }
750
+ }
751
+ }
752
+ }
753
+ },
754
+ "403": {
755
+ "description": "Forbidden"
756
+ }
757
+ }
758
+ }
759
+ },
760
+ "/v1/message/threads": {
761
+ "put": {
762
+ "operationId": "updateThread",
763
+ "summary": "updateThread",
764
+ "description": "Modify thread metadata",
765
+ "tags": [
766
+ "Threads"
767
+ ],
768
+ "responses": {
769
+ "201": {
770
+ "description": "Success",
771
+ "content": {
772
+ "application/json": {
773
+ "schema": {
774
+ "allOf": [
775
+ {
776
+ "$ref": "#/components/schemas/BaseEntity"
777
+ },
778
+ {
779
+ "$ref": "#/components/schemas/Thread"
780
+ }
781
+ ]
782
+ }
783
+ }
784
+ }
785
+ },
786
+ "403": {
787
+ "description": "Forbidden"
788
+ }
789
+ }
790
+ }
791
+ },
792
+ "/v1/message/threads/{id}": {
793
+ "delete": {
794
+ "operationId": "deleteThread",
795
+ "summary": "deleteThread",
796
+ "description": "Immediately and permanently delete a thread. This operation cannot be undone.",
797
+ "tags": [
798
+ "Threads"
799
+ ],
800
+ "parameters": [
801
+ {
802
+ "name": "id",
803
+ "description": "Thread ID",
804
+ "in": "path",
805
+ "required": true,
806
+ "schema": {
807
+ "type": "string"
808
+ }
809
+ }
810
+ ],
811
+ "responses": {
812
+ "204": {
813
+ "description": "Success"
814
+ },
815
+ "403": {
816
+ "description": "Forbidden"
817
+ }
818
+ }
819
+ }
820
+ },
821
+ "/v1/message/threads/{id}:move": {
822
+ "post": {
823
+ "operationId": "moveThread",
824
+ "summary": "moveThread",
825
+ "description": "Move thread to a different Inbox",
826
+ "tags": [
827
+ "Threads"
828
+ ],
829
+ "parameters": [
830
+ {
831
+ "name": "id",
832
+ "description": "Thread ID",
833
+ "in": "path",
834
+ "required": true,
835
+ "schema": {
836
+ "type": "string"
837
+ }
838
+ }
839
+ ],
840
+ "requestBody": {
841
+ "required": true,
842
+ "content": {
843
+ "application/json": {
844
+ "schema": {
845
+ "$ref": "#/components/schemas/MoveThreadPayload"
846
+ }
847
+ }
848
+ }
849
+ },
850
+ "responses": {
851
+ "204": {
852
+ "description": "Success"
853
+ },
854
+ "400": {
855
+ "$ref": "#/components/responses/BadRequest"
856
+ },
857
+ "403": {
858
+ "$ref": "#/components/responses/Forbidden"
859
+ },
860
+ "404": {
861
+ "$ref": "#/components/responses/NotFound"
862
+ },
863
+ "409": {
864
+ "$ref": "#/components/responses/Conflict"
865
+ },
866
+ "500": {
867
+ "$ref": "#/components/responses/InternalServerError"
868
+ }
869
+ }
870
+ }
871
+ },
872
+ "/v1/message/threads/{id}:markAsDone": {
873
+ "post": {
874
+ "operationId": "markThreadAsDone",
875
+ "summary": "markThreadAsDone",
876
+ "description": "Mark thread as done",
877
+ "tags": [
878
+ "Threads"
879
+ ],
880
+ "parameters": [
881
+ {
882
+ "name": "id",
883
+ "description": "Thread ID",
884
+ "in": "path",
885
+ "required": true,
886
+ "schema": {
887
+ "type": "string"
888
+ }
889
+ }
890
+ ],
891
+ "responses": {
892
+ "204": {
893
+ "description": "Success"
894
+ },
895
+ "400": {
896
+ "description": "Bad Request"
897
+ }
898
+ }
899
+ }
900
+ },
901
+ "/v1/message/threads/{id}:markAsOpen": {
902
+ "post": {
903
+ "operationId": "markThreadAsOpen",
904
+ "summary": "markThreadAsOpen",
905
+ "description": "Mark thread as open",
906
+ "tags": [
907
+ "Threads"
908
+ ],
909
+ "parameters": [
910
+ {
911
+ "name": "id",
912
+ "description": "Thread ID",
913
+ "in": "path",
914
+ "required": true,
915
+ "schema": {
916
+ "type": "string"
917
+ }
918
+ }
919
+ ],
920
+ "responses": {
921
+ "204": {
922
+ "description": "Success"
923
+ },
924
+ "400": {
925
+ "description": "Bad Request"
926
+ }
927
+ }
928
+ }
929
+ },
930
+ "/v1/message/threads/{id}/timeline": {
931
+ "get": {
932
+ "operationId": "getThreadTimeline",
933
+ "summary": "getThreadTimeline",
934
+ "description": "Get thread timeline",
935
+ "tags": [
936
+ "Threads"
937
+ ],
938
+ "parameters": [
939
+ {
940
+ "name": "id",
941
+ "description": "Thread ID",
942
+ "in": "path",
943
+ "required": true,
944
+ "schema": {
945
+ "type": "string"
946
+ }
947
+ }
948
+ ],
949
+ "responses": {
950
+ "200": {
951
+ "description": "Success",
952
+ "content": {
953
+ "application/json": {
954
+ "schema": {
955
+ "$ref": "#/components/schemas/ThreadTimeline"
956
+ }
957
+ }
958
+ }
959
+ },
960
+ "403": {
961
+ "description": "Forbidden"
962
+ }
963
+ }
964
+ }
965
+ },
966
+ "/v1/message/threads/{id}/trash": {
967
+ "post": {
968
+ "operationId": "trashThread",
969
+ "summary": "trashThread",
970
+ "description": "Move a thread to trash",
971
+ "tags": [
972
+ "Threads"
973
+ ],
974
+ "parameters": [
975
+ {
976
+ "name": "id",
977
+ "description": "Thread ID",
978
+ "in": "path",
979
+ "required": true,
980
+ "schema": {
981
+ "type": "string"
982
+ }
983
+ }
984
+ ],
985
+ "responses": {
986
+ "200": {
987
+ "description": "Success"
988
+ },
989
+ "403": {
990
+ "description": "Forbidden"
991
+ }
992
+ }
993
+ }
994
+ },
995
+ "/v1/message/threads/{id}/untrash": {
996
+ "post": {
997
+ "operationId": "untrashThread",
998
+ "summary": "untrashThread",
999
+ "description": "Restore a trashed thread",
1000
+ "tags": [
1001
+ "Threads"
1002
+ ],
1003
+ "parameters": [
1004
+ {
1005
+ "name": "id",
1006
+ "description": "Thread ID",
1007
+ "in": "path",
1008
+ "required": true,
1009
+ "schema": {
1010
+ "type": "string"
1011
+ }
1012
+ }
1013
+ ],
1014
+ "responses": {
1015
+ "200": {
1016
+ "description": "Success"
1017
+ },
1018
+ "403": {
1019
+ "description": "Forbidden"
1020
+ }
1021
+ }
1022
+ }
1023
+ },
1024
+ "/v1/message/threads/bulk:read": {
1025
+ "post": {
1026
+ "operationId": "threadBulkActionsRead",
1027
+ "summary": "threadBulkActionsRead",
1028
+ "description": "Perform a bulk action of marking an array of thread ids as read",
1029
+ "tags": [
1030
+ "Threads"
1031
+ ],
1032
+ "requestBody": {
1033
+ "required": true,
1034
+ "content": {
1035
+ "application/json": {
1036
+ "schema": {
1037
+ "$ref": "#/components/schemas/BulkActionsPayloadWithScopes"
1038
+ }
1039
+ }
1040
+ }
1041
+ },
1042
+ "responses": {
1043
+ "200": {
1044
+ "description": "Success"
1045
+ },
1046
+ "403": {
1047
+ "description": "Forbidden"
1048
+ }
1049
+ }
1050
+ }
1051
+ },
1052
+ "/v1/message/threads/bulk:unread": {
1053
+ "post": {
1054
+ "operationId": "threadBulkActionsUnread",
1055
+ "summary": "threadBulkActionsUnread",
1056
+ "description": "Perform a bulk action of marking an array of thread ids as unread",
1057
+ "tags": [
1058
+ "Threads"
1059
+ ],
1060
+ "requestBody": {
1061
+ "required": true,
1062
+ "content": {
1063
+ "application/json": {
1064
+ "schema": {
1065
+ "$ref": "#/components/schemas/BulkActionsPayloadWithScopes"
1066
+ }
1067
+ }
1068
+ }
1069
+ },
1070
+ "responses": {
1071
+ "200": {
1072
+ "description": "Success"
1073
+ },
1074
+ "403": {
1075
+ "description": "Forbidden"
1076
+ }
1077
+ }
1078
+ }
1079
+ },
1080
+ "/v1/message/threads/bulk:favorite": {
1081
+ "post": {
1082
+ "operationId": "threadBulkActionsFavorite",
1083
+ "summary": "threadBulkActionsFavorite",
1084
+ "description": "Perform a bulk action of marking an array of thread ids favorite",
1085
+ "tags": [
1086
+ "Threads"
1087
+ ],
1088
+ "requestBody": {
1089
+ "required": true,
1090
+ "content": {
1091
+ "application/json": {
1092
+ "schema": {
1093
+ "$ref": "#/components/schemas/BulkActionsPayload"
1094
+ }
1095
+ }
1096
+ }
1097
+ },
1098
+ "responses": {
1099
+ "200": {
1100
+ "description": "Success"
1101
+ },
1102
+ "403": {
1103
+ "description": "Forbidden"
1104
+ }
1105
+ }
1106
+ }
1107
+ },
1108
+ "/v1/message/threads/bulk:unfavorite": {
1109
+ "post": {
1110
+ "operationId": "threadBulkActionsUnfavorite",
1111
+ "summary": "threadBulkActionsUnfavorite",
1112
+ "description": "Perform a bulk action of marking an array of thread ids unfavorited",
1113
+ "tags": [
1114
+ "Threads"
1115
+ ],
1116
+ "requestBody": {
1117
+ "required": true,
1118
+ "content": {
1119
+ "application/json": {
1120
+ "schema": {
1121
+ "$ref": "#/components/schemas/BulkActionsPayload"
1122
+ }
1123
+ }
1124
+ }
1125
+ },
1126
+ "responses": {
1127
+ "200": {
1128
+ "description": "Success"
1129
+ },
1130
+ "403": {
1131
+ "description": "Forbidden"
1132
+ }
1133
+ }
1134
+ }
1135
+ },
1136
+ "/v1/message/threads/bulk:trash": {
1137
+ "post": {
1138
+ "operationId": "threadBulkActionsTrash",
1139
+ "summary": "threadBulkActionsTrash",
1140
+ "description": "Perform a bulk action of trashing an array of threads",
1141
+ "tags": [
1142
+ "Threads"
1143
+ ],
1144
+ "requestBody": {
1145
+ "required": true,
1146
+ "content": {
1147
+ "application/json": {
1148
+ "schema": {
1149
+ "$ref": "#/components/schemas/BulkActionsPayload"
1150
+ }
1151
+ }
1152
+ }
1153
+ },
1154
+ "responses": {
1155
+ "200": {
1156
+ "description": "Success"
1157
+ },
1158
+ "403": {
1159
+ "description": "Forbidden"
1160
+ }
1161
+ }
1162
+ }
1163
+ },
1164
+ "/v1/message/threads/bulk:untrash": {
1165
+ "post": {
1166
+ "operationId": "threadBulkActionsUntrash",
1167
+ "summary": "threadBulkActionsUntrash",
1168
+ "description": "Perform a bulk action of untrashing an array of threads",
1169
+ "tags": [
1170
+ "Threads"
1171
+ ],
1172
+ "requestBody": {
1173
+ "required": true,
1174
+ "content": {
1175
+ "application/json": {
1176
+ "schema": {
1177
+ "$ref": "#/components/schemas/BulkActionsPayload"
1178
+ }
1179
+ }
1180
+ }
1181
+ },
1182
+ "responses": {
1183
+ "200": {
1184
+ "description": "Success"
1185
+ },
1186
+ "403": {
1187
+ "description": "Forbidden"
1188
+ }
1189
+ }
1190
+ }
1191
+ },
1192
+ "/v1/message/threads/bulk:delete": {
1193
+ "post": {
1194
+ "operationId": "threadBulkActionsDelete",
1195
+ "summary": "threadBulkActionsDelete",
1196
+ "description": "Performs a bulk permanent delete for all threads",
1197
+ "tags": [
1198
+ "Threads"
1199
+ ],
1200
+ "requestBody": {
1201
+ "required": true,
1202
+ "content": {
1203
+ "application/json": {
1204
+ "schema": {
1205
+ "$ref": "#/components/schemas/BulkActionsPayload"
1206
+ }
1207
+ }
1208
+ }
1209
+ },
1210
+ "responses": {
1211
+ "200": {
1212
+ "description": "Success"
1213
+ },
1214
+ "403": {
1215
+ "description": "Forbidden"
1216
+ }
1217
+ }
1218
+ }
1219
+ },
1220
+ "/v1/message/threads/bulk:done": {
1221
+ "post": {
1222
+ "operationId": "threadBulkActionsDone",
1223
+ "summary": "threadBulkActionsDone",
1224
+ "description": "Perform a bulk action of marking an array of threads as done",
1225
+ "tags": [
1226
+ "Threads"
1227
+ ],
1228
+ "requestBody": {
1229
+ "required": true,
1230
+ "content": {
1231
+ "application/json": {
1232
+ "schema": {
1233
+ "$ref": "#/components/schemas/BulkActionsPayload"
1234
+ }
1235
+ }
1236
+ }
1237
+ },
1238
+ "responses": {
1239
+ "200": {
1240
+ "description": "Success"
1241
+ },
1242
+ "403": {
1243
+ "description": "Forbidden"
1244
+ }
1245
+ }
1246
+ }
1247
+ },
1248
+ "/v1/message/threads/bulk:open": {
1249
+ "post": {
1250
+ "operationId": "threadBulkActionsOpen",
1251
+ "summary": "threadBulkActionsOpen",
1252
+ "description": "Perform a bulk action of marking an array of threads as open",
1253
+ "tags": [
1254
+ "Threads"
1255
+ ],
1256
+ "requestBody": {
1257
+ "required": true,
1258
+ "content": {
1259
+ "application/json": {
1260
+ "schema": {
1261
+ "$ref": "#/components/schemas/BulkActionsPayload"
1262
+ }
1263
+ }
1264
+ }
1265
+ },
1266
+ "responses": {
1267
+ "200": {
1268
+ "description": "Success"
1269
+ },
1270
+ "403": {
1271
+ "description": "Forbidden"
1272
+ }
1273
+ }
1274
+ }
1275
+ },
1276
+ "/v1/message/threads/{id}/read": {
1277
+ "post": {
1278
+ "operationId": "markReadThread",
1279
+ "summary": "markReadThread",
1280
+ "description": "Mark thread as read",
1281
+ "tags": [
1282
+ "Threads"
1283
+ ],
1284
+ "parameters": [
1285
+ {
1286
+ "name": "id",
1287
+ "description": "Thread ID",
1288
+ "in": "path",
1289
+ "required": true,
1290
+ "schema": {
1291
+ "type": "string"
1292
+ }
1293
+ }
1294
+ ],
1295
+ "responses": {
1296
+ "200": {
1297
+ "description": "Success"
1298
+ },
1299
+ "403": {
1300
+ "description": "Forbidden"
1301
+ }
1302
+ }
1303
+ }
1304
+ },
1305
+ "/v2/message/threads/{id}/read": {
1306
+ "post": {
1307
+ "operationId": "markReadThreadV2",
1308
+ "summary": "markReadThreadV2",
1309
+ "description": "Mark thread as read within a scope",
1310
+ "tags": [
1311
+ "Threads"
1312
+ ],
1313
+ "parameters": [
1314
+ {
1315
+ "name": "id",
1316
+ "description": "Thread ID",
1317
+ "in": "path",
1318
+ "required": true,
1319
+ "schema": {
1320
+ "type": "string"
1321
+ }
1322
+ }
1323
+ ],
1324
+ "requestBody": {
1325
+ "required": true,
1326
+ "content": {
1327
+ "application/json": {
1328
+ "schema": {
1329
+ "$ref": "#/components/schemas/ReadMessagePayload"
1330
+ }
1331
+ }
1332
+ }
1333
+ },
1334
+ "responses": {
1335
+ "200": {
1336
+ "description": "Success"
1337
+ },
1338
+ "403": {
1339
+ "description": "Forbidden"
1340
+ }
1341
+ }
1342
+ }
1343
+ },
1344
+ "/v1/message/threads/{id}/unread": {
1345
+ "post": {
1346
+ "operationId": "markUnreadThread",
1347
+ "summary": "markUnreadThread",
1348
+ "description": "Mark thread as unread",
1349
+ "tags": [
1350
+ "Threads"
1351
+ ],
1352
+ "parameters": [
1353
+ {
1354
+ "name": "id",
1355
+ "description": "Thread ID",
1356
+ "in": "path",
1357
+ "required": true,
1358
+ "schema": {
1359
+ "type": "string"
1360
+ }
1361
+ }
1362
+ ],
1363
+ "responses": {
1364
+ "200": {
1365
+ "description": "Success"
1366
+ },
1367
+ "403": {
1368
+ "description": "Forbidden"
1369
+ }
1370
+ }
1371
+ }
1372
+ },
1373
+ "/v2/message/threads/{id}/unread": {
1374
+ "post": {
1375
+ "operationId": "markUnreadThreadV2",
1376
+ "summary": "markUnreadThreadV2",
1377
+ "description": "Mark thread as unread within a scope",
1378
+ "tags": [
1379
+ "Threads"
1380
+ ],
1381
+ "parameters": [
1382
+ {
1383
+ "name": "id",
1384
+ "description": "Thread ID",
1385
+ "in": "path",
1386
+ "required": true,
1387
+ "schema": {
1388
+ "type": "string"
1389
+ }
1390
+ }
1391
+ ],
1392
+ "requestBody": {
1393
+ "required": true,
1394
+ "content": {
1395
+ "application/json": {
1396
+ "schema": {
1397
+ "$ref": "#/components/schemas/ReadMessagePayload"
1398
+ }
1399
+ }
1400
+ }
1401
+ },
1402
+ "responses": {
1403
+ "200": {
1404
+ "description": "Success"
1405
+ },
1406
+ "403": {
1407
+ "description": "Forbidden"
1408
+ }
1409
+ }
1410
+ }
1411
+ },
1412
+ "/v1/message/threads/{id}/assign": {
1413
+ "post": {
1414
+ "operationId": "assignThread",
1415
+ "summary": "assignThread",
1416
+ "description": "Assign thread to entities",
1417
+ "tags": [
1418
+ "Threads"
1419
+ ],
1420
+ "parameters": [
1421
+ {
1422
+ "name": "id",
1423
+ "description": "Thread ID",
1424
+ "in": "path",
1425
+ "required": true,
1426
+ "schema": {
1427
+ "type": "string"
1428
+ }
1429
+ }
1430
+ ],
1431
+ "requestBody": {
1432
+ "required": true,
1433
+ "content": {
1434
+ "application/json": {
1435
+ "schema": {
1436
+ "description": "Entities which thread is assigned to",
1437
+ "type": "array",
1438
+ "items": {
1439
+ "type": "object",
1440
+ "properties": {
1441
+ "slug": {
1442
+ "description": "Entity slug",
1443
+ "type": "string",
1444
+ "example": "contact"
1445
+ },
1446
+ "entity_id": {
1447
+ "description": "Entity ID",
1448
+ "type": "string",
1449
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
1450
+ },
1451
+ "org_id": {
1452
+ "description": "Organization ID",
1453
+ "type": "string",
1454
+ "example": "206801"
1455
+ },
1456
+ "is_main_entity": {
1457
+ "description": "To indicate this is main entity",
1458
+ "type": "boolean",
1459
+ "example": true
1460
+ }
1461
+ }
1462
+ }
1463
+ }
1464
+ }
1465
+ }
1466
+ },
1467
+ "responses": {
1468
+ "204": {
1469
+ "description": "Success"
1470
+ },
1471
+ "403": {
1472
+ "description": "Forbidden"
1473
+ }
1474
+ }
1475
+ }
1476
+ },
1477
+ "/v1/message/threads/{id}/unassign": {
1478
+ "post": {
1479
+ "operationId": "unassignThread",
1480
+ "summary": "unassignThread",
1481
+ "description": "Unassign thread from entities",
1482
+ "tags": [
1483
+ "Threads"
1484
+ ],
1485
+ "parameters": [
1486
+ {
1487
+ "name": "id",
1488
+ "description": "Thread ID",
1489
+ "in": "path",
1490
+ "required": true,
1491
+ "schema": {
1492
+ "type": "string"
1493
+ }
1494
+ }
1495
+ ],
1496
+ "requestBody": {
1497
+ "required": true,
1498
+ "content": {
1499
+ "application/json": {
1500
+ "schema": {
1501
+ "description": "Entities which thread is unassigned from",
1502
+ "type": "array",
1503
+ "items": {
1504
+ "type": "object",
1505
+ "properties": {
1506
+ "slug": {
1507
+ "description": "Entity slug",
1508
+ "type": "string",
1509
+ "example": "contact"
1510
+ },
1511
+ "entity_id": {
1512
+ "description": "Entity ID",
1513
+ "type": "string",
1514
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
1515
+ }
1516
+ }
1517
+ }
1518
+ }
1519
+ }
1520
+ }
1521
+ },
1522
+ "responses": {
1523
+ "204": {
1524
+ "description": "Success"
1525
+ },
1526
+ "403": {
1527
+ "description": "Forbidden"
1528
+ }
1529
+ }
1530
+ }
1531
+ },
1532
+ "/v1/message/threads/{id}/assign:users": {
1533
+ "post": {
1534
+ "operationId": "assignUsers",
1535
+ "summary": "assignUsers",
1536
+ "description": "Assign users to thread for receiving notifications.\nThe operation replaces all existing assigned users in thread.\n",
1537
+ "tags": [
1538
+ "Threads"
1539
+ ],
1540
+ "parameters": [
1541
+ {
1542
+ "name": "id",
1543
+ "description": "Thread ID",
1544
+ "in": "path",
1545
+ "required": true,
1546
+ "schema": {
1547
+ "type": "string"
1548
+ }
1549
+ }
1550
+ ],
1551
+ "requestBody": {
1552
+ "required": true,
1553
+ "content": {
1554
+ "application/json": {
1555
+ "schema": {
1556
+ "description": "User IDs of users assigned to thread",
1557
+ "type": "object",
1558
+ "properties": {
1559
+ "assigned_to": {
1560
+ "type": "array",
1561
+ "description": "IDs of users assigned to thread",
1562
+ "items": {
1563
+ "type": "string",
1564
+ "example": "206801"
1565
+ }
1566
+ }
1567
+ }
1568
+ }
1569
+ }
1570
+ }
1571
+ },
1572
+ "responses": {
1573
+ "204": {
1574
+ "description": "Success"
1575
+ },
1576
+ "403": {
1577
+ "description": "Forbidden"
1578
+ }
1579
+ }
1580
+ }
1581
+ },
1582
+ "/v2/message/threads/{id}/assign:users": {
1583
+ "post": {
1584
+ "operationId": "assignUsersV2",
1585
+ "summary": "assignUsersV2",
1586
+ "description": "Assign users to thread.\n",
1587
+ "tags": [
1588
+ "Threads"
1589
+ ],
1590
+ "parameters": [
1591
+ {
1592
+ "name": "id",
1593
+ "description": "Thread ID",
1594
+ "in": "path",
1595
+ "required": true,
1596
+ "schema": {
1597
+ "type": "string"
1598
+ }
1599
+ }
1600
+ ],
1601
+ "requestBody": {
1602
+ "required": true,
1603
+ "content": {
1604
+ "application/json": {
1605
+ "schema": {
1606
+ "type": "object",
1607
+ "required": [
1608
+ "add",
1609
+ "remove"
1610
+ ],
1611
+ "properties": {
1612
+ "add": {
1613
+ "type": "array",
1614
+ "description": "User IDs of users to add to thread",
1615
+ "items": {
1616
+ "type": "string",
1617
+ "example": "206801"
1618
+ }
1619
+ },
1620
+ "remove": {
1621
+ "type": "array",
1622
+ "description": "User IDs of users to remove from thread",
1623
+ "items": {
1624
+ "type": "string",
1625
+ "example": "206801"
1626
+ }
1627
+ }
1628
+ }
1629
+ }
1630
+ }
1631
+ }
1632
+ },
1633
+ "responses": {
1634
+ "204": {
1635
+ "description": "Success"
1636
+ },
1637
+ "403": {
1638
+ "description": "Forbidden"
1639
+ }
1640
+ }
1641
+ }
1642
+ },
1643
+ "/v1/message/threads/{id}:pin": {
1644
+ "post": {
1645
+ "operationId": "pinThread",
1646
+ "summary": "Pin a single thread",
1647
+ "description": "Pin a single thread",
1648
+ "tags": [
1649
+ "Threads"
1650
+ ],
1651
+ "parameters": [
1652
+ {
1653
+ "name": "id",
1654
+ "description": "Thread ID",
1655
+ "in": "path",
1656
+ "required": true,
1657
+ "schema": {
1658
+ "type": "string"
1659
+ }
1660
+ }
1661
+ ],
1662
+ "responses": {
1663
+ "204": {
1664
+ "description": "Success"
1665
+ },
1666
+ "400": {
1667
+ "description": "Bad request"
1668
+ },
1669
+ "404": {
1670
+ "description": "Thread not found"
1671
+ },
1672
+ "409": {
1673
+ "description": "Concurrent update error"
1674
+ },
1675
+ "500": {
1676
+ "description": "Internal server error"
1677
+ }
1678
+ }
1679
+ },
1680
+ "delete": {
1681
+ "operationId": "unpinThread",
1682
+ "summary": "Unpin a single thread",
1683
+ "description": "Unpin a single thread",
1684
+ "tags": [
1685
+ "Threads"
1686
+ ],
1687
+ "parameters": [
1688
+ {
1689
+ "name": "id",
1690
+ "description": "Thread ID",
1691
+ "in": "path",
1692
+ "required": true,
1693
+ "schema": {
1694
+ "type": "string"
1695
+ }
1696
+ }
1697
+ ],
1698
+ "responses": {
1699
+ "204": {
1700
+ "description": "Success"
1701
+ },
1702
+ "400": {
1703
+ "description": "Bad request"
1704
+ },
1705
+ "404": {
1706
+ "description": "Thread not found"
1707
+ },
1708
+ "409": {
1709
+ "description": "Concurrent update error"
1710
+ },
1711
+ "500": {
1712
+ "description": "Internal server error"
1713
+ }
1714
+ }
1715
+ }
1716
+ },
1717
+ "/v1/message/drafts": {
1718
+ "post": {
1719
+ "operationId": "createDraft",
1720
+ "summary": "createDraft",
1721
+ "description": "Create a new draft",
1722
+ "tags": [
1723
+ "Drafts"
1724
+ ],
1725
+ "requestBody": {
1726
+ "content": {
1727
+ "application/json": {
1728
+ "schema": {
1729
+ "$ref": "#/components/schemas/MessageRequestParams"
1730
+ }
1731
+ }
1732
+ }
1733
+ },
1734
+ "responses": {
1735
+ "201": {
1736
+ "description": "Success",
1737
+ "content": {
1738
+ "application/json": {
1739
+ "schema": {
1740
+ "allOf": [
1741
+ {
1742
+ "$ref": "#/components/schemas/BaseEntity"
1743
+ },
1744
+ {
1745
+ "$ref": "#/components/schemas/Message"
1746
+ }
1747
+ ]
1748
+ }
1749
+ }
1750
+ }
1751
+ },
1752
+ "403": {
1753
+ "description": "Forbidden"
1754
+ }
1755
+ }
1756
+ }
1757
+ },
1758
+ "/v1/message/drafts:send": {
1759
+ "post": {
1760
+ "operationId": "sendDraft",
1761
+ "summary": "sendDraft",
1762
+ "description": "Send the existing draft to the recipients",
1763
+ "tags": [
1764
+ "Drafts"
1765
+ ],
1766
+ "responses": {
1767
+ "201": {
1768
+ "description": "Success",
1769
+ "content": {
1770
+ "application/json": {
1771
+ "schema": {
1772
+ "allOf": [
1773
+ {
1774
+ "$ref": "#/components/schemas/BaseEntity"
1775
+ },
1776
+ {
1777
+ "$ref": "#/components/schemas/Message"
1778
+ }
1779
+ ]
1780
+ }
1781
+ }
1782
+ }
1783
+ },
1784
+ "403": {
1785
+ "description": "Forbidden"
1786
+ }
1787
+ }
1788
+ }
1789
+ },
1790
+ "/v2/message/messages/{id}": {
1791
+ "get": {
1792
+ "operationId": "getMessageV2",
1793
+ "summary": "getMessageV2",
1794
+ "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",
1795
+ "tags": [
1796
+ "Messages"
1797
+ ],
1798
+ "parameters": [
1799
+ {
1800
+ "name": "id",
1801
+ "description": "Message ID",
1802
+ "in": "path",
1803
+ "required": true,
1804
+ "schema": {
1805
+ "type": "string",
1806
+ "example": "4d74976d-fb64-47fd-85e2-65eea140f5eb"
1807
+ }
1808
+ }
1809
+ ],
1810
+ "responses": {
1811
+ "200": {
1812
+ "description": "Success",
1813
+ "content": {
1814
+ "application/json": {
1815
+ "schema": {
1816
+ "allOf": [
1817
+ {
1818
+ "$ref": "#/components/schemas/MessageV2"
1819
+ }
1820
+ ]
1821
+ }
1822
+ }
1823
+ }
1824
+ },
1825
+ "403": {
1826
+ "description": "Forbidden"
1827
+ }
1828
+ }
1829
+ }
1830
+ }
1831
+ },
1832
+ "components": {
1833
+ "responses": {
1834
+ "NotFound": {
1835
+ "description": "Not found",
1836
+ "content": {
1837
+ "application/json": {
1838
+ "schema": {
1839
+ "$ref": "#/components/schemas/ErrorResponse"
1840
+ }
1841
+ }
1842
+ }
1843
+ },
1844
+ "Conflict": {
1845
+ "description": "Conflict",
1846
+ "content": {
1847
+ "application/json": {
1848
+ "schema": {
1849
+ "$ref": "#/components/schemas/ErrorResponse"
1850
+ }
1851
+ }
1852
+ }
1853
+ },
1854
+ "InternalServerError": {
1855
+ "description": "Internal server error",
1856
+ "content": {
1857
+ "application/json": {
1858
+ "schema": {
1859
+ "$ref": "#/components/schemas/ErrorResponse"
1860
+ }
1861
+ }
1862
+ }
1863
+ },
1864
+ "BadRequest": {
1865
+ "description": "Bad request",
1866
+ "content": {
1867
+ "application/json": {
1868
+ "schema": {
1869
+ "$ref": "#/components/schemas/ErrorResponse"
1870
+ }
1871
+ }
1872
+ }
1873
+ },
1874
+ "Forbidden": {
1875
+ "description": "Forbidden",
1876
+ "content": {
1877
+ "application/json": {
1878
+ "schema": {
1879
+ "$ref": "#/components/schemas/ErrorResponse"
1880
+ }
1881
+ }
1882
+ }
1883
+ }
1884
+ },
1885
+ "securitySchemes": {
1886
+ "EpilotAuth": {
1887
+ "type": "http",
1888
+ "scheme": "bearer",
1889
+ "description": "Authorization header with epilot OAuth2 bearer token",
1890
+ "bearerFormat": "JWT"
1891
+ },
1892
+ "EpilotOrg": {
1893
+ "description": "Overrides the target organization to allow shared tenant access",
1894
+ "name": "x-epilot-org-id",
1895
+ "in": "header",
1896
+ "type": "apiKey"
1897
+ }
1898
+ },
1899
+ "schemas": {
1900
+ "ErrorResponse": {
1901
+ "type": "object",
1902
+ "properties": {
1903
+ "error": {
1904
+ "type": "string",
1905
+ "description": "Error message",
1906
+ "example": "Thread not found"
1907
+ }
1908
+ }
1909
+ },
1910
+ "MoveThreadPayload": {
1911
+ "type": "object",
1912
+ "required": [
1913
+ "inbox_id"
1914
+ ],
1915
+ "properties": {
1916
+ "inbox_id": {
1917
+ "type": "string",
1918
+ "description": "Inbox ID",
1919
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
1920
+ }
1921
+ }
1922
+ },
1923
+ "BaseEntity": {
1924
+ "type": "object",
1925
+ "required": [
1926
+ "_id",
1927
+ "_title",
1928
+ "_org",
1929
+ "_schema",
1930
+ "_created_at",
1931
+ "_updated_at"
1932
+ ],
1933
+ "properties": {
1934
+ "_id": {
1935
+ "type": "string",
1936
+ "description": "Entity ID",
1937
+ "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
1938
+ },
1939
+ "_title": {
1940
+ "type": "string",
1941
+ "description": "Entity title"
1942
+ },
1943
+ "_org": {
1944
+ "type": "string",
1945
+ "description": "Organization ID the entity belongs to",
1946
+ "example": "206801"
1947
+ },
1948
+ "_schema": {
1949
+ "type": "string",
1950
+ "description": "URL-friendly identifier for the entity schema",
1951
+ "example": "message"
1952
+ },
1953
+ "_tags": {
1954
+ "type": "array",
1955
+ "description": "Entity tags",
1956
+ "items": {
1957
+ "type": "string"
1958
+ },
1959
+ "example": [
1960
+ "pricing",
1961
+ "INBOX"
1962
+ ]
1963
+ },
1964
+ "_created_at": {
1965
+ "type": "string",
1966
+ "description": "Created date",
1967
+ "format": "date-time",
1968
+ "example": "2021-02-09T12:41:43.662Z"
1969
+ },
1970
+ "_updated_at": {
1971
+ "type": "string",
1972
+ "description": "Updated date",
1973
+ "format": "date-time",
1974
+ "example": "2021-02-10T09:14:31.990Z"
1975
+ }
1976
+ }
1977
+ },
1978
+ "Thread": {
1979
+ "description": "Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.",
1980
+ "required": [
1981
+ "topic"
1982
+ ],
1983
+ "properties": {
1984
+ "topic": {
1985
+ "type": "string",
1986
+ "description": "Message topic (e.g. which service sends the message or message category)",
1987
+ "example": "CUSTOMER_MESSAGE"
1988
+ },
1989
+ "assigned_to": {
1990
+ "type": "array",
1991
+ "description": "User ID of who the message is assigned to. Default is the user who sends message.",
1992
+ "items": {
1993
+ "type": "string"
1994
+ },
1995
+ "example": [
1996
+ "206801",
1997
+ "200109"
1998
+ ]
1999
+ },
2000
+ "org_read_message": {
2001
+ "type": "array",
2002
+ "description": "Organization ID of organization read the message.",
2003
+ "items": {
2004
+ "type": "string"
2005
+ },
2006
+ "example": [
2007
+ "789372",
2008
+ "210291"
2009
+ ]
2010
+ },
2011
+ "done": {
2012
+ "type": "boolean",
2013
+ "description": "Whether the thread is marked as Done",
2014
+ "example": false
2015
+ },
2016
+ "latest_message": {
2017
+ "$ref": "#/components/schemas/Message"
2018
+ },
2019
+ "latest_trash_message": {
2020
+ "$ref": "#/components/schemas/Message"
2021
+ },
2022
+ "latest_message_at": {
2023
+ "type": "string",
2024
+ "description": "The date of the latest message time in the thread",
2025
+ "example": "2024-02-10T09:14:31.990Z"
2026
+ }
2027
+ }
2028
+ },
2029
+ "Message": {
2030
+ "type": "object",
2031
+ "required": [
2032
+ "subject",
2033
+ "from"
2034
+ ],
2035
+ "properties": {
2036
+ "message_id": {
2037
+ "type": "string",
2038
+ "description": "Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.",
2039
+ "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>"
2040
+ },
2041
+ "sender": {
2042
+ "type": "string",
2043
+ "description": "User ID of user sends the message.",
2044
+ "example": "206801"
2045
+ },
2046
+ "subject": {
2047
+ "type": "string",
2048
+ "description": "Subject",
2049
+ "example": "Request for solar panel price"
2050
+ },
2051
+ "html": {
2052
+ "type": "string",
2053
+ "description": "HTML body",
2054
+ "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"
2055
+ },
2056
+ "text": {
2057
+ "type": "string",
2058
+ "description": "Text body",
2059
+ "example": "We at ABC GmbH would like to request a price quote for the solar panel."
2060
+ },
2061
+ "from": {
2062
+ "$ref": "#/components/schemas/Address"
2063
+ },
2064
+ "reply_to": {
2065
+ "$ref": "#/components/schemas/Address"
2066
+ },
2067
+ "to": {
2068
+ "type": "array",
2069
+ "description": "To email addresses",
2070
+ "items": {
2071
+ "$ref": "#/components/schemas/Address"
2072
+ }
2073
+ },
2074
+ "cc": {
2075
+ "type": "array",
2076
+ "description": "Cc email addresses",
2077
+ "items": {
2078
+ "$ref": "#/components/schemas/Address"
2079
+ }
2080
+ },
2081
+ "bcc": {
2082
+ "type": "array",
2083
+ "description": "Bcc email addresses",
2084
+ "items": {
2085
+ "$ref": "#/components/schemas/Address"
2086
+ }
2087
+ },
2088
+ "file": {
2089
+ "$ref": "#/components/schemas/AttachmentsRelation"
2090
+ },
2091
+ "references": {
2092
+ "type": "string",
2093
+ "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",
2094
+ "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"
2095
+ },
2096
+ "in_reply_to": {
2097
+ "type": "string",
2098
+ "description": "In-Reply-To header. Value is the `message_id` of parent message.\n",
2099
+ "example": "<CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"
2100
+ },
2101
+ "user_read_message": {
2102
+ "type": "array",
2103
+ "description": "User ID of user read the message.",
2104
+ "items": {
2105
+ "type": "string"
2106
+ },
2107
+ "example": [
2108
+ "206801",
2109
+ "200109"
2110
+ ]
2111
+ },
2112
+ "org_read_message": {
2113
+ "type": "array",
2114
+ "description": "Organization ID of organization read the message.",
2115
+ "items": {
2116
+ "type": "string"
2117
+ },
2118
+ "example": [
2119
+ "789372",
2120
+ "210291"
2121
+ ]
2122
+ },
2123
+ "send_status": {
2124
+ "type": "array",
2125
+ "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",
2126
+ "items": {
2127
+ "type": "string",
2128
+ "enum": [
2129
+ "SEND",
2130
+ "DELIVERY",
2131
+ "REJECT",
2132
+ "COMPLAINT",
2133
+ "BOUNCE",
2134
+ "ERROR"
2135
+ ]
2136
+ }
2137
+ },
2138
+ "type": {
2139
+ "type": "string",
2140
+ "description": "Message type",
2141
+ "enum": [
2142
+ "SENT",
2143
+ "RECEIVED"
2144
+ ]
2145
+ },
2146
+ "template_id": {
2147
+ "type": "string",
2148
+ "description": "Template ID used for sending message.",
2149
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2150
+ }
2151
+ }
2152
+ },
2153
+ "MessageV2": {
2154
+ "allOf": [
2155
+ {
2156
+ "$ref": "#/components/schemas/BaseEntity"
2157
+ },
2158
+ {
2159
+ "$ref": "#/components/schemas/Message"
2160
+ }
2161
+ ],
2162
+ "properties": {
2163
+ "html_omitted": {
2164
+ "type": "boolean",
2165
+ "description": "If true then html is not provided and must be downloaded using the html_download_url",
2166
+ "default": false
2167
+ },
2168
+ "html_download_url": {
2169
+ "type": "string",
2170
+ "description": "HTML body download URL",
2171
+ "example": "https://s3.eu-central-1.amazonaws.com/epilot-attachments/3f34ce73-089c-4d45-a5ee-c161234e41c3/3f34ce73-089c-4d45-a5ee-c161234e41c3.html"
2172
+ }
2173
+ }
2174
+ },
2175
+ "Address": {
2176
+ "type": "object",
2177
+ "required": [
2178
+ "address"
2179
+ ],
2180
+ "properties": {
2181
+ "name": {
2182
+ "type": "string",
2183
+ "description": "Email address alias",
2184
+ "example": "epilot"
2185
+ },
2186
+ "address": {
2187
+ "type": "string",
2188
+ "description": "Email address",
2189
+ "example": "messaging@epilot.cloud"
2190
+ },
2191
+ "email_type": {
2192
+ "type": "string",
2193
+ "description": "Type of the email, Internal (360 Agents), Partners, External users(Customers)\n",
2194
+ "nullable": true,
2195
+ "enum": [
2196
+ "INTERNAL",
2197
+ "EXTERNAL",
2198
+ "PARTNER"
2199
+ ]
2200
+ },
2201
+ "send_status": {
2202
+ "type": "string",
2203
+ "description": "Sent message status regarding to this recipient. Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\n",
2204
+ "enum": [
2205
+ "SEND",
2206
+ "DELIVERY",
2207
+ "REJECT",
2208
+ "COMPLAINT",
2209
+ "BOUNCE",
2210
+ "ERROR"
2211
+ ]
2212
+ },
2213
+ "send_error": {
2214
+ "type": "object",
2215
+ "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"
2216
+ }
2217
+ }
2218
+ },
2219
+ "AttachmentsRelation": {
2220
+ "type": "object",
2221
+ "description": "Message attachments",
2222
+ "properties": {
2223
+ "$relation": {
2224
+ "type": "array",
2225
+ "description": "It's normal entity relation with some additional properties for sending message attachment.",
2226
+ "items": {
2227
+ "$ref": "#/components/schemas/File"
2228
+ }
2229
+ }
2230
+ }
2231
+ },
2232
+ "File": {
2233
+ "type": "object",
2234
+ "required": [
2235
+ "entity_id"
2236
+ ],
2237
+ "properties": {
2238
+ "entity_id": {
2239
+ "type": "string",
2240
+ "description": "File entity ID",
2241
+ "example": "f820ce3b-07b0-45ae-bcc6-babb2f53f79f"
2242
+ },
2243
+ "filename": {
2244
+ "type": "string",
2245
+ "description": "File name",
2246
+ "example": "Produktinformationen_epilot360_Double_Opt_in.pdf"
2247
+ },
2248
+ "is_message_attachment": {
2249
+ "type": "boolean",
2250
+ "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."
2251
+ },
2252
+ "may_be_signature_attachment": {
2253
+ "type": "boolean",
2254
+ "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."
2255
+ },
2256
+ "cid": {
2257
+ "type": "string",
2258
+ "description": "Content ID (for inline)",
2259
+ "example": "fb222496-a1a5-4639-94f2-07b5e35e4068"
2260
+ },
2261
+ "inline": {
2262
+ "type": "boolean",
2263
+ "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",
2264
+ "default": false
2265
+ },
2266
+ "send_as_link": {
2267
+ "type": "boolean",
2268
+ "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",
2269
+ "default": false
2270
+ }
2271
+ }
2272
+ },
2273
+ "MessageRequestParams": {
2274
+ "required": [
2275
+ "subject",
2276
+ "from"
2277
+ ],
2278
+ "additionalProperties": true,
2279
+ "properties": {
2280
+ "complete_thread": {
2281
+ "type": "boolean",
2282
+ "description": "Whether the thread is marked as Done immediately after sending the message",
2283
+ "default": false
2284
+ },
2285
+ "thread": {
2286
+ "type": "object",
2287
+ "required": [
2288
+ "topic"
2289
+ ],
2290
+ "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",
2291
+ "properties": {
2292
+ "topic": {
2293
+ "type": "string",
2294
+ "description": "Message topic (e.g. which service sends the message or message category)"
2295
+ },
2296
+ "assigned_to": {
2297
+ "type": "array",
2298
+ "description": "User ID of who the message is assigned to. Default is the user who sends message.",
2299
+ "items": {
2300
+ "type": "string"
2301
+ }
2302
+ }
2303
+ },
2304
+ "example": {
2305
+ "topic": "CUSTOMER_MESSAGE",
2306
+ "assigned_to": [
2307
+ "206801",
2308
+ "200109"
2309
+ ],
2310
+ "opportunity_id": 829072
2311
+ }
2312
+ },
2313
+ "parent_id": {
2314
+ "type": "string",
2315
+ "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",
2316
+ "example": "44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2"
2317
+ },
2318
+ "subject": {
2319
+ "type": "string",
2320
+ "description": "Subject",
2321
+ "example": "Request for solar panel price"
2322
+ },
2323
+ "html": {
2324
+ "type": "string",
2325
+ "description": "HTML body",
2326
+ "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"
2327
+ },
2328
+ "text": {
2329
+ "type": "string",
2330
+ "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)",
2331
+ "example": "We at ABC GmbH would like to request a price quote for the solar panel."
2332
+ },
2333
+ "from": {
2334
+ "$ref": "#/components/schemas/Address"
2335
+ },
2336
+ "reply_to": {
2337
+ "$ref": "#/components/schemas/Address"
2338
+ },
2339
+ "to": {
2340
+ "type": "array",
2341
+ "description": "To email addresses",
2342
+ "items": {
2343
+ "$ref": "#/components/schemas/Address"
2344
+ }
2345
+ },
2346
+ "cc": {
2347
+ "type": "array",
2348
+ "description": "Cc email addresses",
2349
+ "items": {
2350
+ "$ref": "#/components/schemas/Address"
2351
+ }
2352
+ },
2353
+ "bcc": {
2354
+ "type": "array",
2355
+ "description": "Bcc email addresses",
2356
+ "items": {
2357
+ "$ref": "#/components/schemas/Address"
2358
+ }
2359
+ },
2360
+ "file": {
2361
+ "$ref": "#/components/schemas/AttachmentsRelation"
2362
+ },
2363
+ "template_id": {
2364
+ "type": "string",
2365
+ "description": "Template ID used for sending message.",
2366
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2367
+ }
2368
+ }
2369
+ },
2370
+ "SearchParamsV2": {
2371
+ "type": "object",
2372
+ "required": [
2373
+ "q"
2374
+ ],
2375
+ "properties": {
2376
+ "inbox_id": {
2377
+ "oneOf": [
2378
+ {
2379
+ "type": "string",
2380
+ "description": "Inbox ID",
2381
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
2382
+ },
2383
+ {
2384
+ "type": "array",
2385
+ "items": {
2386
+ "type": "string"
2387
+ },
2388
+ "description": "Inbox IDs",
2389
+ "example": [
2390
+ "3f34ce73-089c-4d45-a5ee-c161234e41c3",
2391
+ "3f34ce73-089c-4d45-a5ee-c161234e41c4"
2392
+ ]
2393
+ }
2394
+ ]
2395
+ },
2396
+ "q": {
2397
+ "description": "Lucene query syntax supported with ElasticSearch",
2398
+ "type": "string",
2399
+ "example": "subject:\"Request for solar panel price\" AND _tags:INBOX"
2400
+ },
2401
+ "fields": {
2402
+ "$ref": "#/components/schemas/FieldsParam"
2403
+ },
2404
+ "from": {
2405
+ "type": "integer",
2406
+ "minimum": 0,
2407
+ "default": 0
2408
+ },
2409
+ "size": {
2410
+ "type": "integer",
2411
+ "minimum": 1,
2412
+ "default": 10
2413
+ },
2414
+ "hydrate": {
2415
+ "type": "boolean",
2416
+ "default": false
2417
+ },
2418
+ "include_scores": {
2419
+ "type": "boolean",
2420
+ "default": false
2421
+ },
2422
+ "sort": {
2423
+ "type": "string"
2424
+ },
2425
+ "highlight": {}
2426
+ }
2427
+ },
2428
+ "SearchParams": {
2429
+ "type": "object",
2430
+ "required": [
2431
+ "q"
2432
+ ],
2433
+ "properties": {
2434
+ "q": {
2435
+ "description": "Lucene query syntax supported with ElasticSearch",
2436
+ "type": "string",
2437
+ "example": "subject:\"Request for solar panel price\" AND _tags:INBOX"
2438
+ },
2439
+ "from": {
2440
+ "type": "integer",
2441
+ "minimum": 0,
2442
+ "default": 0
2443
+ },
2444
+ "size": {
2445
+ "type": "integer",
2446
+ "minimum": 1,
2447
+ "default": 10
2448
+ },
2449
+ "hydrate": {
2450
+ "type": "boolean",
2451
+ "default": false
2452
+ }
2453
+ }
2454
+ },
2455
+ "SearchIDParams": {
2456
+ "type": "object",
2457
+ "properties": {
2458
+ "q": {
2459
+ "description": "Lucene query syntax supported with ElasticSearch",
2460
+ "type": "string",
2461
+ "example": "subject:\"Request for solar panel price\" AND _tags:INBOX"
2462
+ }
2463
+ }
2464
+ },
2465
+ "ReadMessagePayload": {
2466
+ "type": "object",
2467
+ "required": [
2468
+ "scopes"
2469
+ ],
2470
+ "properties": {
2471
+ "scopes": {
2472
+ "description": "The scopes to be used when marking an item as read or unread. The read status will be synced for all provided scopes.",
2473
+ "example": [
2474
+ "organization",
2475
+ "user"
2476
+ ],
2477
+ "type": "array",
2478
+ "default": [
2479
+ "organization",
2480
+ "user"
2481
+ ],
2482
+ "items": {
2483
+ "$ref": "#/components/schemas/ReadingScope"
2484
+ }
2485
+ }
2486
+ }
2487
+ },
2488
+ "ReadingScope": {
2489
+ "description": "Who is marking an item as read or unread.",
2490
+ "type": "string",
2491
+ "enum": [
2492
+ "organization",
2493
+ "user"
2494
+ ]
2495
+ },
2496
+ "ThreadTimeline": {
2497
+ "type": "object",
2498
+ "required": [
2499
+ "events"
2500
+ ],
2501
+ "properties": {
2502
+ "events": {
2503
+ "type": "array",
2504
+ "items": {
2505
+ "$ref": "#/components/schemas/TimelineEvent"
2506
+ }
2507
+ }
2508
+ }
2509
+ },
2510
+ "ThreadDoneEvent": {
2511
+ "type": "object",
2512
+ "required": [
2513
+ "type",
2514
+ "user_id",
2515
+ "organization_id"
2516
+ ],
2517
+ "properties": {
2518
+ "type": {
2519
+ "type": "string",
2520
+ "enum": [
2521
+ "THREAD_DONE"
2522
+ ]
2523
+ },
2524
+ "user_id": {
2525
+ "type": "string",
2526
+ "description": "User ID of the user who marked the thread as done",
2527
+ "example": "123"
2528
+ },
2529
+ "organization_id": {
2530
+ "type": "string",
2531
+ "description": "Organization ID of the organization who marked the thread as done",
2532
+ "example": "456"
2533
+ }
2534
+ }
2535
+ },
2536
+ "ThreadOpenEvent": {
2537
+ "type": "object",
2538
+ "required": [
2539
+ "type",
2540
+ "user_id",
2541
+ "organization_id"
2542
+ ],
2543
+ "properties": {
2544
+ "type": {
2545
+ "type": "string",
2546
+ "enum": [
2547
+ "THREAD_OPEN"
2548
+ ]
2549
+ },
2550
+ "user_id": {
2551
+ "type": "string",
2552
+ "description": "User ID of the user who marked the thread as open",
2553
+ "example": "123"
2554
+ },
2555
+ "organization_id": {
2556
+ "type": "string",
2557
+ "description": "Organization ID of the organization who marked the thread as open",
2558
+ "example": "456"
2559
+ }
2560
+ }
2561
+ },
2562
+ "TimelineEventData": {
2563
+ "type": "object",
2564
+ "discriminator": {
2565
+ "propertyName": "type"
2566
+ },
2567
+ "oneOf": [
2568
+ {
2569
+ "$ref": "#/components/schemas/ThreadDoneEvent"
2570
+ },
2571
+ {
2572
+ "$ref": "#/components/schemas/ThreadOpenEvent"
2573
+ }
2574
+ ]
2575
+ },
2576
+ "TimelineEvent": {
2577
+ "type": "object",
2578
+ "required": [
2579
+ "timestamp",
2580
+ "data"
2581
+ ],
2582
+ "properties": {
2583
+ "data": {
2584
+ "$ref": "#/components/schemas/TimelineEventData"
2585
+ },
2586
+ "timestamp": {
2587
+ "type": "string",
2588
+ "description": "Timestamp of the event",
2589
+ "example": "2024-01-01T00:00:00.000Z"
2590
+ }
2591
+ }
2592
+ },
2593
+ "BulkActionsPayloadWithScopes": {
2594
+ "allOf": [
2595
+ {
2596
+ "$ref": "#/components/schemas/BulkActionsPayload"
2597
+ },
2598
+ {
2599
+ "type": "object",
2600
+ "properties": {
2601
+ "scopes": {
2602
+ "description": "The scopes to be used when marking an item as read or unread. The read status will be synced for all provided scopes.",
2603
+ "example": [
2604
+ "organization",
2605
+ "user"
2606
+ ],
2607
+ "type": "array",
2608
+ "default": [
2609
+ "organization",
2610
+ "user"
2611
+ ],
2612
+ "items": {
2613
+ "$ref": "#/components/schemas/ReadingScope"
2614
+ }
2615
+ }
2616
+ }
2617
+ }
2618
+ ]
2619
+ },
2620
+ "BulkActionsPayload": {
2621
+ "type": "object",
2622
+ "required": [
2623
+ "ids"
2624
+ ],
2625
+ "properties": {
2626
+ "ids": {
2627
+ "description": "Array of threads you wish to perform bulk actions on",
2628
+ "example": [
2629
+ "6b299eda-4018-4554-8965-c4b5598e6531"
2630
+ ],
2631
+ "type": "array",
2632
+ "items": {
2633
+ "type": "string"
2634
+ }
2635
+ }
2636
+ }
2637
+ },
2638
+ "FieldsParam": {
2639
+ "type": "array",
2640
+ "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",
2641
+ "items": {
2642
+ "type": "string"
2643
+ },
2644
+ "example": [
2645
+ "_id",
2646
+ "_title",
2647
+ "first_name",
2648
+ "account",
2649
+ "!account.*._files",
2650
+ "**._product"
2651
+ ]
2652
+ }
2653
+ }
2654
+ },
2655
+ "servers": [
2656
+ {
2657
+ "url": "https://message.sls.epilot.io"
2658
+ }
2659
+ ]
2660
+ }