@epilot/message-client 1.2.1 → 1.3.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.
package/dist/openapi.json CHANGED
@@ -1,1093 +1,1093 @@
1
1
  {
2
- "openapi": "3.0.2",
3
- "info": {
4
- "title": "Message API",
5
- "version": "1.0.0",
6
- "description": "Send and receive email messages via your epilot organization\n"
2
+ "openapi": "3.0.2",
3
+ "info": {
4
+ "title": "Message API",
5
+ "version": "1.0.0",
6
+ "description": "Send and receive email messages via your epilot organization\n"
7
+ },
8
+ "security": [
9
+ {
10
+ "EpilotAuth": []
7
11
  },
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
- "paths": {
28
- "/v1/message/messages": {
29
- "post": {
30
- "operationId": "sendMessage",
31
- "summary": "sendMessage",
32
- "description": "Send an email message",
33
- "tags": [
34
- "Messages"
35
- ],
36
- "requestBody": {
37
- "content": {
38
- "application/json": {
39
- "schema": {
40
- "$ref": "#/components/schemas/MessageRequestParams"
41
- }
42
- }
43
- }
44
- },
45
- "responses": {
46
- "201": {
47
- "description": "Success",
48
- "content": {
49
- "application/json": {
50
- "schema": {
51
- "allOf": [
52
- {
53
- "$ref": "#/components/schemas/BaseEntity"
54
- },
55
- {
56
- "$ref": "#/components/schemas/Message"
57
- }
58
- ]
59
- }
60
- }
61
- }
62
- },
63
- "403": {
64
- "description": "Forbidden"
65
- }
66
- }
67
- },
68
- "put": {
69
- "operationId": "updateMessage",
70
- "summary": "updateMessage",
71
- "description": "Update message metadata",
72
- "tags": [
73
- "Messages"
74
- ],
75
- "responses": {
76
- "201": {
77
- "description": "Success",
78
- "content": {
79
- "application/json": {
80
- "schema": {
81
- "allOf": [
82
- {
83
- "$ref": "#/components/schemas/BaseEntity"
84
- },
85
- {
86
- "$ref": "#/components/schemas/Message"
87
- }
88
- ]
89
- }
90
- }
91
- }
92
- },
93
- "403": {
94
- "description": "Forbidden"
95
- }
96
- }
12
+ {
13
+ "EpilotOrg": []
14
+ }
15
+ ],
16
+ "tags": [
17
+ {
18
+ "name": "Messages"
19
+ },
20
+ {
21
+ "name": "Threads"
22
+ },
23
+ {
24
+ "name": "Drafts"
25
+ }
26
+ ],
27
+ "paths": {
28
+ "/v1/message/messages": {
29
+ "post": {
30
+ "operationId": "sendMessage",
31
+ "summary": "sendMessage",
32
+ "description": "Send an email message",
33
+ "tags": [
34
+ "Messages"
35
+ ],
36
+ "requestBody": {
37
+ "content": {
38
+ "application/json": {
39
+ "schema": {
40
+ "$ref": "#/components/schemas/MessageRequestParams"
41
+ }
97
42
  }
43
+ }
98
44
  },
99
- "/v1/message/messages/{id}": {
100
- "get": {
101
- "operationId": "getMessage",
102
- "summary": "getMessage",
103
- "description": "Get an email message by id",
104
- "tags": [
105
- "Messages"
106
- ],
107
- "parameters": [
45
+ "responses": {
46
+ "201": {
47
+ "description": "Success",
48
+ "content": {
49
+ "application/json": {
50
+ "schema": {
51
+ "allOf": [
108
52
  {
109
- "name": "id",
110
- "description": "Message ID",
111
- "in": "path",
112
- "required": true,
113
- "schema": {
114
- "type": "string"
115
- }
116
- }
117
- ],
118
- "responses": {
119
- "201": {
120
- "description": "Success",
121
- "content": {
122
- "application/json": {
123
- "schema": {
124
- "allOf": [
125
- {
126
- "$ref": "#/components/schemas/BaseEntity"
127
- },
128
- {
129
- "$ref": "#/components/schemas/Message"
130
- }
131
- ]
132
- }
133
- }
134
- }
53
+ "$ref": "#/components/schemas/BaseEntity"
135
54
  },
136
- "403": {
137
- "description": "Forbidden"
138
- }
139
- }
140
- },
141
- "delete": {
142
- "operationId": "deleteMessage",
143
- "summary": "deleteMessage",
144
- "description": "Immediately and permanently delete a message. This operation cannot be undone.",
145
- "tags": [
146
- "Messages"
147
- ],
148
- "parameters": [
149
55
  {
150
- "name": "id",
151
- "description": "Message ID",
152
- "in": "path",
153
- "required": true,
154
- "schema": {
155
- "type": "string"
156
- }
157
- }
158
- ],
159
- "responses": {
160
- "204": {
161
- "description": "Success"
162
- },
163
- "403": {
164
- "description": "Forbidden"
56
+ "$ref": "#/components/schemas/Message"
165
57
  }
58
+ ]
166
59
  }
60
+ }
167
61
  }
168
- },
169
- "/v1/message/messages/{id}/trash": {
170
- "post": {
171
- "operationId": "trashMessage",
172
- "summary": "trashMessage",
173
- "description": "Move a message to the trash",
174
- "tags": [
175
- "Messages"
176
- ],
177
- "parameters": [
62
+ },
63
+ "403": {
64
+ "description": "Forbidden"
65
+ }
66
+ }
67
+ },
68
+ "put": {
69
+ "operationId": "updateMessage",
70
+ "summary": "updateMessage",
71
+ "description": "Update message metadata",
72
+ "tags": [
73
+ "Messages"
74
+ ],
75
+ "responses": {
76
+ "201": {
77
+ "description": "Success",
78
+ "content": {
79
+ "application/json": {
80
+ "schema": {
81
+ "allOf": [
178
82
  {
179
- "name": "id",
180
- "description": "Message ID",
181
- "in": "path",
182
- "required": true,
183
- "schema": {
184
- "type": "string"
185
- }
186
- }
187
- ],
188
- "responses": {
189
- "204": {
190
- "description": "Success"
83
+ "$ref": "#/components/schemas/BaseEntity"
191
84
  },
192
- "403": {
193
- "description": "Forbidden"
194
- }
195
- }
196
- }
197
- },
198
- "/v1/message/messages/{id}/untrash": {
199
- "post": {
200
- "operationId": "untrashMessage",
201
- "summary": "untrashMessage",
202
- "description": "Restore a trashed message",
203
- "tags": [
204
- "Messages"
205
- ],
206
- "parameters": [
207
85
  {
208
- "name": "id",
209
- "description": "Message ID",
210
- "in": "path",
211
- "required": true,
212
- "schema": {
213
- "type": "string"
214
- }
215
- }
216
- ],
217
- "responses": {
218
- "204": {
219
- "description": "Success"
220
- },
221
- "403": {
222
- "description": "Forbidden"
86
+ "$ref": "#/components/schemas/Message"
223
87
  }
88
+ ]
224
89
  }
90
+ }
225
91
  }
226
- },
227
- "/v1/message/messages/{id}/read": {
228
- "post": {
229
- "operationId": "markReadMessage",
230
- "summary": "markReadMessage",
231
- "description": "Mark message as read",
232
- "tags": [
233
- "Messages"
234
- ],
235
- "parameters": [
236
- {
237
- "name": "id",
238
- "description": "Message ID",
239
- "in": "path",
240
- "required": true,
241
- "schema": {
242
- "type": "string"
243
- }
244
- }
245
- ],
246
- "responses": {
247
- "204": {
248
- "description": "Success"
249
- },
250
- "403": {
251
- "description": "Forbidden"
252
- }
253
- }
92
+ },
93
+ "403": {
94
+ "description": "Forbidden"
95
+ }
96
+ }
97
+ }
98
+ },
99
+ "/v1/message/messages/{id}": {
100
+ "get": {
101
+ "operationId": "getMessage",
102
+ "summary": "getMessage",
103
+ "description": "Get an email message by id",
104
+ "tags": [
105
+ "Messages"
106
+ ],
107
+ "parameters": [
108
+ {
109
+ "name": "id",
110
+ "description": "Message ID",
111
+ "in": "path",
112
+ "required": true,
113
+ "schema": {
114
+ "type": "string"
254
115
  }
255
- },
256
- "/v1/message/messages/{id}/unread": {
257
- "post": {
258
- "operationId": "markUnreadMessage",
259
- "summary": "markUnreadMessage",
260
- "description": "Mark message as unread",
261
- "tags": [
262
- "Messages"
263
- ],
264
- "parameters": [
116
+ }
117
+ ],
118
+ "responses": {
119
+ "201": {
120
+ "description": "Success",
121
+ "content": {
122
+ "application/json": {
123
+ "schema": {
124
+ "allOf": [
265
125
  {
266
- "name": "id",
267
- "description": "Message ID",
268
- "in": "path",
269
- "required": true,
270
- "schema": {
271
- "type": "string"
272
- }
273
- }
274
- ],
275
- "responses": {
276
- "204": {
277
- "description": "Success"
126
+ "$ref": "#/components/schemas/BaseEntity"
278
127
  },
279
- "403": {
280
- "description": "Forbidden"
128
+ {
129
+ "$ref": "#/components/schemas/Message"
281
130
  }
131
+ ]
282
132
  }
133
+ }
283
134
  }
284
- },
285
- "/v1/message/threads:search": {
286
- "post": {
287
- "operationId": "searchThreads",
288
- "summary": "searchThreads",
289
- "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",
290
- "tags": [
291
- "Threads"
292
- ],
293
- "requestBody": {
294
- "content": {
295
- "application/json": {
296
- "schema": {
297
- "$ref": "#/components/schemas/SearchParams"
298
- }
299
- }
300
- }
301
- },
302
- "responses": {
303
- "200": {
304
- "description": "Success",
305
- "content": {
306
- "application/json": {
307
- "schema": {
308
- "type": "object",
309
- "required": [
310
- "hits",
311
- "results"
312
- ],
313
- "properties": {
314
- "hits": {
315
- "type": "number",
316
- "description": "Total of matched threads",
317
- "example": 14
318
- },
319
- "results": {
320
- "type": "array",
321
- "description": "Matched threads",
322
- "items": {
323
- "allOf": [
324
- {
325
- "$ref": "#/components/schemas/BaseEntity"
326
- },
327
- {
328
- "$ref": "#/components/schemas/Thread"
329
- }
330
- ]
331
- }
332
- }
333
- }
334
- }
335
- }
336
- }
337
- },
338
- "403": {
339
- "description": "Forbidden"
340
- }
341
- }
135
+ },
136
+ "403": {
137
+ "description": "Forbidden"
138
+ }
139
+ }
140
+ },
141
+ "delete": {
142
+ "operationId": "deleteMessage",
143
+ "summary": "deleteMessage",
144
+ "description": "Immediately and permanently delete a message. This operation cannot be undone.",
145
+ "tags": [
146
+ "Messages"
147
+ ],
148
+ "parameters": [
149
+ {
150
+ "name": "id",
151
+ "description": "Message ID",
152
+ "in": "path",
153
+ "required": true,
154
+ "schema": {
155
+ "type": "string"
342
156
  }
343
- },
344
- "/v1/message/threads": {
345
- "put": {
346
- "operationId": "updateThread",
347
- "summary": "updateThread",
348
- "description": "Modify thread metadata",
349
- "tags": [
350
- "Threads"
351
- ],
352
- "responses": {
353
- "201": {
354
- "description": "Success",
355
- "content": {
356
- "application/json": {
357
- "schema": {
358
- "allOf": [
359
- {
360
- "$ref": "#/components/schemas/BaseEntity"
361
- },
362
- {
363
- "$ref": "#/components/schemas/Thread"
364
- }
365
- ]
366
- }
367
- }
368
- }
369
- },
370
- "403": {
371
- "description": "Forbidden"
372
- }
373
- }
157
+ }
158
+ ],
159
+ "responses": {
160
+ "204": {
161
+ "description": "Success"
162
+ },
163
+ "403": {
164
+ "description": "Forbidden"
165
+ }
166
+ }
167
+ }
168
+ },
169
+ "/v1/message/messages/{id}/trash": {
170
+ "post": {
171
+ "operationId": "trashMessage",
172
+ "summary": "trashMessage",
173
+ "description": "Move a message to the trash",
174
+ "tags": [
175
+ "Messages"
176
+ ],
177
+ "parameters": [
178
+ {
179
+ "name": "id",
180
+ "description": "Message ID",
181
+ "in": "path",
182
+ "required": true,
183
+ "schema": {
184
+ "type": "string"
374
185
  }
375
- },
376
- "/v1/message/threads/{id}": {
377
- "delete": {
378
- "operationId": "deleteThread",
379
- "summary": "deleteThread",
380
- "description": "Immediately and permanently delete a thread. This operation cannot be undone.",
381
- "tags": [
382
- "Threads"
383
- ],
384
- "parameters": [
385
- {
386
- "name": "id",
387
- "description": "Thread ID",
388
- "in": "path",
389
- "required": true,
390
- "schema": {
391
- "type": "string"
392
- }
393
- }
394
- ],
395
- "responses": {
396
- "204": {
397
- "description": "Success"
398
- },
399
- "403": {
400
- "description": "Forbidden"
401
- }
402
- }
186
+ }
187
+ ],
188
+ "responses": {
189
+ "204": {
190
+ "description": "Success"
191
+ },
192
+ "403": {
193
+ "description": "Forbidden"
194
+ }
195
+ }
196
+ }
197
+ },
198
+ "/v1/message/messages/{id}/untrash": {
199
+ "post": {
200
+ "operationId": "untrashMessage",
201
+ "summary": "untrashMessage",
202
+ "description": "Restore a trashed message",
203
+ "tags": [
204
+ "Messages"
205
+ ],
206
+ "parameters": [
207
+ {
208
+ "name": "id",
209
+ "description": "Message ID",
210
+ "in": "path",
211
+ "required": true,
212
+ "schema": {
213
+ "type": "string"
403
214
  }
404
- },
405
- "/v1/message/threads/{id}/trash": {
406
- "post": {
407
- "operationId": "trashThread",
408
- "summary": "trashThread",
409
- "description": "Move a thread to trash",
410
- "tags": [
411
- "Threads"
412
- ],
413
- "parameters": [
414
- {
415
- "name": "id",
416
- "description": "Thread ID",
417
- "in": "path",
418
- "required": true,
419
- "schema": {
420
- "type": "string"
421
- }
422
- }
423
- ],
424
- "responses": {
425
- "204": {
426
- "description": "Success"
427
- },
428
- "403": {
429
- "description": "Forbidden"
430
- }
431
- }
215
+ }
216
+ ],
217
+ "responses": {
218
+ "204": {
219
+ "description": "Success"
220
+ },
221
+ "403": {
222
+ "description": "Forbidden"
223
+ }
224
+ }
225
+ }
226
+ },
227
+ "/v1/message/messages/{id}/read": {
228
+ "post": {
229
+ "operationId": "markReadMessage",
230
+ "summary": "markReadMessage",
231
+ "description": "Mark message as read",
232
+ "tags": [
233
+ "Messages"
234
+ ],
235
+ "parameters": [
236
+ {
237
+ "name": "id",
238
+ "description": "Message ID",
239
+ "in": "path",
240
+ "required": true,
241
+ "schema": {
242
+ "type": "string"
243
+ }
244
+ }
245
+ ],
246
+ "responses": {
247
+ "204": {
248
+ "description": "Success"
249
+ },
250
+ "403": {
251
+ "description": "Forbidden"
252
+ }
253
+ }
254
+ }
255
+ },
256
+ "/v1/message/messages/{id}/unread": {
257
+ "post": {
258
+ "operationId": "markUnreadMessage",
259
+ "summary": "markUnreadMessage",
260
+ "description": "Mark message as unread",
261
+ "tags": [
262
+ "Messages"
263
+ ],
264
+ "parameters": [
265
+ {
266
+ "name": "id",
267
+ "description": "Message ID",
268
+ "in": "path",
269
+ "required": true,
270
+ "schema": {
271
+ "type": "string"
272
+ }
273
+ }
274
+ ],
275
+ "responses": {
276
+ "204": {
277
+ "description": "Success"
278
+ },
279
+ "403": {
280
+ "description": "Forbidden"
281
+ }
282
+ }
283
+ }
284
+ },
285
+ "/v1/message/threads:search": {
286
+ "post": {
287
+ "operationId": "searchThreads",
288
+ "summary": "searchThreads",
289
+ "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",
290
+ "tags": [
291
+ "Threads"
292
+ ],
293
+ "requestBody": {
294
+ "content": {
295
+ "application/json": {
296
+ "schema": {
297
+ "$ref": "#/components/schemas/SearchParams"
298
+ }
432
299
  }
300
+ }
433
301
  },
434
- "/v1/message/threads/{id}/untrash": {
435
- "post": {
436
- "operationId": "untrashThread",
437
- "summary": "untrashThread",
438
- "description": "Restore a trashed thread",
439
- "tags": [
440
- "Threads"
441
- ],
442
- "parameters": [
443
- {
444
- "name": "id",
445
- "description": "Thread ID",
446
- "in": "path",
447
- "required": true,
448
- "schema": {
449
- "type": "string"
450
- }
451
- }
452
- ],
453
- "responses": {
454
- "204": {
455
- "description": "Success"
456
- },
457
- "403": {
458
- "description": "Forbidden"
302
+ "responses": {
303
+ "200": {
304
+ "description": "Success",
305
+ "content": {
306
+ "application/json": {
307
+ "schema": {
308
+ "type": "object",
309
+ "required": [
310
+ "hits",
311
+ "results"
312
+ ],
313
+ "properties": {
314
+ "hits": {
315
+ "type": "number",
316
+ "description": "Total of matched threads",
317
+ "example": 14
318
+ },
319
+ "results": {
320
+ "type": "array",
321
+ "description": "Matched threads",
322
+ "items": {
323
+ "allOf": [
324
+ {
325
+ "$ref": "#/components/schemas/BaseEntity"
326
+ },
327
+ {
328
+ "$ref": "#/components/schemas/Thread"
329
+ }
330
+ ]
331
+ }
459
332
  }
333
+ }
460
334
  }
335
+ }
461
336
  }
462
- },
463
- "/v1/message/threads/{id}/read": {
464
- "post": {
465
- "operationId": "markReadThread",
466
- "summary": "markReadThread",
467
- "description": "Mark thread as read",
468
- "tags": [
469
- "Threads"
470
- ],
471
- "parameters": [
337
+ },
338
+ "403": {
339
+ "description": "Forbidden"
340
+ }
341
+ }
342
+ }
343
+ },
344
+ "/v1/message/threads": {
345
+ "put": {
346
+ "operationId": "updateThread",
347
+ "summary": "updateThread",
348
+ "description": "Modify thread metadata",
349
+ "tags": [
350
+ "Threads"
351
+ ],
352
+ "responses": {
353
+ "201": {
354
+ "description": "Success",
355
+ "content": {
356
+ "application/json": {
357
+ "schema": {
358
+ "allOf": [
472
359
  {
473
- "name": "id",
474
- "description": "Thread ID",
475
- "in": "path",
476
- "required": true,
477
- "schema": {
478
- "type": "string"
479
- }
480
- }
481
- ],
482
- "responses": {
483
- "204": {
484
- "description": "Success"
360
+ "$ref": "#/components/schemas/BaseEntity"
485
361
  },
486
- "403": {
487
- "description": "Forbidden"
362
+ {
363
+ "$ref": "#/components/schemas/Thread"
488
364
  }
365
+ ]
489
366
  }
367
+ }
490
368
  }
491
- },
492
- "/v1/message/threads/{id}/unread": {
493
- "post": {
494
- "operationId": "markUnreadThread",
495
- "summary": "markUnreadThread",
496
- "description": "Mark thread as unread",
497
- "tags": [
498
- "Threads"
499
- ],
500
- "parameters": [
501
- {
502
- "name": "id",
503
- "description": "Thread ID",
504
- "in": "path",
505
- "required": true,
506
- "schema": {
507
- "type": "string"
508
- }
509
- }
510
- ],
511
- "responses": {
512
- "204": {
513
- "description": "Success"
369
+ },
370
+ "403": {
371
+ "description": "Forbidden"
372
+ }
373
+ }
374
+ }
375
+ },
376
+ "/v1/message/threads/{id}": {
377
+ "delete": {
378
+ "operationId": "deleteThread",
379
+ "summary": "deleteThread",
380
+ "description": "Immediately and permanently delete a thread. This operation cannot be undone.",
381
+ "tags": [
382
+ "Threads"
383
+ ],
384
+ "parameters": [
385
+ {
386
+ "name": "id",
387
+ "description": "Thread ID",
388
+ "in": "path",
389
+ "required": true,
390
+ "schema": {
391
+ "type": "string"
392
+ }
393
+ }
394
+ ],
395
+ "responses": {
396
+ "204": {
397
+ "description": "Success"
398
+ },
399
+ "403": {
400
+ "description": "Forbidden"
401
+ }
402
+ }
403
+ }
404
+ },
405
+ "/v1/message/threads/{id}/trash": {
406
+ "post": {
407
+ "operationId": "trashThread",
408
+ "summary": "trashThread",
409
+ "description": "Move a thread to trash",
410
+ "tags": [
411
+ "Threads"
412
+ ],
413
+ "parameters": [
414
+ {
415
+ "name": "id",
416
+ "description": "Thread ID",
417
+ "in": "path",
418
+ "required": true,
419
+ "schema": {
420
+ "type": "string"
421
+ }
422
+ }
423
+ ],
424
+ "responses": {
425
+ "204": {
426
+ "description": "Success"
427
+ },
428
+ "403": {
429
+ "description": "Forbidden"
430
+ }
431
+ }
432
+ }
433
+ },
434
+ "/v1/message/threads/{id}/untrash": {
435
+ "post": {
436
+ "operationId": "untrashThread",
437
+ "summary": "untrashThread",
438
+ "description": "Restore a trashed thread",
439
+ "tags": [
440
+ "Threads"
441
+ ],
442
+ "parameters": [
443
+ {
444
+ "name": "id",
445
+ "description": "Thread ID",
446
+ "in": "path",
447
+ "required": true,
448
+ "schema": {
449
+ "type": "string"
450
+ }
451
+ }
452
+ ],
453
+ "responses": {
454
+ "204": {
455
+ "description": "Success"
456
+ },
457
+ "403": {
458
+ "description": "Forbidden"
459
+ }
460
+ }
461
+ }
462
+ },
463
+ "/v1/message/threads/{id}/read": {
464
+ "post": {
465
+ "operationId": "markReadThread",
466
+ "summary": "markReadThread",
467
+ "description": "Mark thread as read",
468
+ "tags": [
469
+ "Threads"
470
+ ],
471
+ "parameters": [
472
+ {
473
+ "name": "id",
474
+ "description": "Thread ID",
475
+ "in": "path",
476
+ "required": true,
477
+ "schema": {
478
+ "type": "string"
479
+ }
480
+ }
481
+ ],
482
+ "responses": {
483
+ "204": {
484
+ "description": "Success"
485
+ },
486
+ "403": {
487
+ "description": "Forbidden"
488
+ }
489
+ }
490
+ }
491
+ },
492
+ "/v1/message/threads/{id}/unread": {
493
+ "post": {
494
+ "operationId": "markUnreadThread",
495
+ "summary": "markUnreadThread",
496
+ "description": "Mark thread as unread",
497
+ "tags": [
498
+ "Threads"
499
+ ],
500
+ "parameters": [
501
+ {
502
+ "name": "id",
503
+ "description": "Thread ID",
504
+ "in": "path",
505
+ "required": true,
506
+ "schema": {
507
+ "type": "string"
508
+ }
509
+ }
510
+ ],
511
+ "responses": {
512
+ "204": {
513
+ "description": "Success"
514
+ },
515
+ "403": {
516
+ "description": "Forbidden"
517
+ }
518
+ }
519
+ }
520
+ },
521
+ "/v1/message/threads/{id}/assign": {
522
+ "post": {
523
+ "operationId": "assignThread",
524
+ "summary": "assignThread",
525
+ "description": "Assign thread to entities",
526
+ "tags": [
527
+ "Threads"
528
+ ],
529
+ "parameters": [
530
+ {
531
+ "name": "id",
532
+ "description": "Thread ID",
533
+ "in": "path",
534
+ "required": true,
535
+ "schema": {
536
+ "type": "string"
537
+ }
538
+ }
539
+ ],
540
+ "requestBody": {
541
+ "required": true,
542
+ "content": {
543
+ "application/json": {
544
+ "schema": {
545
+ "description": "Entities which thread is assigned to",
546
+ "type": "array",
547
+ "items": {
548
+ "type": "object",
549
+ "properties": {
550
+ "slug": {
551
+ "description": "Entity slug",
552
+ "type": "string",
553
+ "example": "contact"
514
554
  },
515
- "403": {
516
- "description": "Forbidden"
555
+ "entity_id": {
556
+ "description": "Entity ID",
557
+ "type": "string",
558
+ "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
559
+ },
560
+ "is_main_entity": {
561
+ "description": "To indicate this is main entity",
562
+ "type": "boolean",
563
+ "example": true
517
564
  }
565
+ }
518
566
  }
567
+ }
519
568
  }
569
+ }
520
570
  },
521
- "/v1/message/threads/{id}/assign": {
522
- "post": {
523
- "operationId": "assignThread",
524
- "summary": "assignThread",
525
- "description": "Assign thread to entities",
526
- "tags": [
527
- "Threads"
528
- ],
529
- "parameters": [
530
- {
531
- "name": "id",
532
- "description": "Thread ID",
533
- "in": "path",
534
- "required": true,
535
- "schema": {
536
- "type": "string"
537
- }
538
- }
539
- ],
540
- "requestBody": {
541
- "required": true,
542
- "content": {
543
- "application/json": {
544
- "schema": {
545
- "description": "Entities which thread is assigned to",
546
- "type": "array",
547
- "items": {
548
- "type": "object",
549
- "properties": {
550
- "slug": {
551
- "description": "Entity slug",
552
- "type": "string",
553
- "example": "contact"
554
- },
555
- "entity_id": {
556
- "description": "Entity ID",
557
- "type": "string",
558
- "example": "3f34ce73-089c-4d45-a5ee-c161234e41c3"
559
- },
560
- "is_main_entity": {
561
- "description": "To indicate this is main entity",
562
- "type": "boolean",
563
- "example": true
564
- }
565
- }
566
- }
567
- }
568
- }
569
- }
570
- },
571
- "responses": {
572
- "204": {
573
- "description": "Success"
574
- },
575
- "403": {
576
- "description": "Forbidden"
577
- }
578
- }
571
+ "responses": {
572
+ "204": {
573
+ "description": "Success"
574
+ },
575
+ "403": {
576
+ "description": "Forbidden"
577
+ }
578
+ }
579
+ }
580
+ },
581
+ "/v1/message/drafts": {
582
+ "post": {
583
+ "operationId": "createDraft",
584
+ "summary": "createDraft",
585
+ "description": "Create a new draft",
586
+ "tags": [
587
+ "Drafts"
588
+ ],
589
+ "requestBody": {
590
+ "content": {
591
+ "application/json": {
592
+ "schema": {
593
+ "$ref": "#/components/schemas/MessageRequestParams"
594
+ }
579
595
  }
596
+ }
580
597
  },
581
- "/v1/message/drafts": {
582
- "post": {
583
- "operationId": "createDraft",
584
- "summary": "createDraft",
585
- "description": "Create a new draft",
586
- "tags": [
587
- "Drafts"
588
- ],
589
- "requestBody": {
590
- "content": {
591
- "application/json": {
592
- "schema": {
593
- "$ref": "#/components/schemas/MessageRequestParams"
594
- }
595
- }
596
- }
597
- },
598
- "responses": {
599
- "201": {
600
- "description": "Success",
601
- "content": {
602
- "application/json": {
603
- "schema": {
604
- "allOf": [
605
- {
606
- "$ref": "#/components/schemas/BaseEntity"
607
- },
608
- {
609
- "$ref": "#/components/schemas/Message"
610
- }
611
- ]
612
- }
613
- }
614
- }
598
+ "responses": {
599
+ "201": {
600
+ "description": "Success",
601
+ "content": {
602
+ "application/json": {
603
+ "schema": {
604
+ "allOf": [
605
+ {
606
+ "$ref": "#/components/schemas/BaseEntity"
615
607
  },
616
- "403": {
617
- "description": "Forbidden"
608
+ {
609
+ "$ref": "#/components/schemas/Message"
618
610
  }
611
+ ]
619
612
  }
613
+ }
620
614
  }
621
- },
622
- "/v1/message/drafts:send": {
623
- "post": {
624
- "operationId": "sendDraft",
625
- "summary": "sendDraft",
626
- "description": "Send the existing draft to the recipients",
627
- "tags": [
628
- "Drafts"
629
- ],
630
- "responses": {
631
- "201": {
632
- "description": "Success",
633
- "content": {
634
- "application/json": {
635
- "schema": {
636
- "allOf": [
637
- {
638
- "$ref": "#/components/schemas/BaseEntity"
639
- },
640
- {
641
- "$ref": "#/components/schemas/Message"
642
- }
643
- ]
644
- }
645
- }
646
- }
615
+ },
616
+ "403": {
617
+ "description": "Forbidden"
618
+ }
619
+ }
620
+ }
621
+ },
622
+ "/v1/message/drafts:send": {
623
+ "post": {
624
+ "operationId": "sendDraft",
625
+ "summary": "sendDraft",
626
+ "description": "Send the existing draft to the recipients",
627
+ "tags": [
628
+ "Drafts"
629
+ ],
630
+ "responses": {
631
+ "201": {
632
+ "description": "Success",
633
+ "content": {
634
+ "application/json": {
635
+ "schema": {
636
+ "allOf": [
637
+ {
638
+ "$ref": "#/components/schemas/BaseEntity"
647
639
  },
648
- "403": {
649
- "description": "Forbidden"
640
+ {
641
+ "$ref": "#/components/schemas/Message"
650
642
  }
643
+ ]
651
644
  }
645
+ }
652
646
  }
647
+ },
648
+ "403": {
649
+ "description": "Forbidden"
650
+ }
653
651
  }
652
+ }
653
+ }
654
+ },
655
+ "components": {
656
+ "securitySchemes": {
657
+ "EpilotAuth": {
658
+ "type": "http",
659
+ "scheme": "bearer",
660
+ "description": "Authorization header with epilot OAuth2 bearer token",
661
+ "bearerFormat": "JWT"
662
+ },
663
+ "EpilotOrg": {
664
+ "description": "Overrides the target organization to allow shared tenant access",
665
+ "name": "x-epilot-org-id",
666
+ "in": "header",
667
+ "type": "apiKey"
668
+ }
654
669
  },
655
- "components": {
656
- "securitySchemes": {
657
- "EpilotAuth": {
658
- "type": "http",
659
- "scheme": "bearer",
660
- "description": "Authorization header with epilot OAuth2 bearer token",
661
- "bearerFormat": "JWT"
670
+ "schemas": {
671
+ "BaseEntity": {
672
+ "type": "object",
673
+ "required": [
674
+ "_id",
675
+ "_title",
676
+ "_org",
677
+ "_schema",
678
+ "_created_at",
679
+ "_updated_at"
680
+ ],
681
+ "properties": {
682
+ "_id": {
683
+ "type": "string",
684
+ "description": "Entity ID",
685
+ "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
686
+ },
687
+ "_title": {
688
+ "type": "string",
689
+ "description": "Entity title"
690
+ },
691
+ "_org": {
692
+ "type": "string",
693
+ "description": "Ivy Organization ID the entity belongs to",
694
+ "example": "206801"
695
+ },
696
+ "_schema": {
697
+ "type": "string",
698
+ "description": "URL-friendly identifier for the entity schema",
699
+ "example": "message"
700
+ },
701
+ "_tags": {
702
+ "type": "array",
703
+ "description": "Entity tags",
704
+ "items": {
705
+ "type": "string"
662
706
  },
663
- "EpilotOrg": {
664
- "description": "Overrides the target organization to allow shared tenant access",
665
- "name": "x-epilot-org-id",
666
- "in": "header",
667
- "type": "apiKey"
707
+ "example": [
708
+ "pricing",
709
+ "INBOX"
710
+ ]
711
+ },
712
+ "_created_at": {
713
+ "type": "string",
714
+ "description": "Created date",
715
+ "format": "date-time",
716
+ "example": "2021-02-09T12:41:43.662Z"
717
+ },
718
+ "_updated_at": {
719
+ "type": "string",
720
+ "description": "Updated date",
721
+ "format": "date-time",
722
+ "example": "2021-02-10T09:14:31.990Z"
723
+ }
724
+ }
725
+ },
726
+ "Thread": {
727
+ "description": "Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.",
728
+ "required": [
729
+ "topic"
730
+ ],
731
+ "properties": {
732
+ "topic": {
733
+ "type": "string",
734
+ "description": "Message topic (e.g. which service sends the message or message category)",
735
+ "example": "CUSTOMER_MESSAGE"
736
+ },
737
+ "assigned_to": {
738
+ "type": "array",
739
+ "description": "Ivy User ID of who the message is assigned to. Default is the user who sends message.",
740
+ "items": {
741
+ "type": "string",
742
+ "example": [
743
+ "206801",
744
+ "200109"
745
+ ]
668
746
  }
669
- },
670
- "schemas": {
671
- "BaseEntity": {
672
- "type": "object",
673
- "required": [
674
- "_id",
675
- "_title",
676
- "_org",
677
- "_schema",
678
- "_created_at",
679
- "_updated_at"
680
- ],
681
- "properties": {
682
- "_id": {
683
- "type": "string",
684
- "description": "Entity ID",
685
- "example": "3fa85f64-5717-4562-b3fc-2c963f66afa6"
686
- },
687
- "_title": {
688
- "type": "string",
689
- "description": "Entity title"
690
- },
691
- "_org": {
692
- "type": "string",
693
- "description": "Ivy Organization ID the entity belongs to",
694
- "example": "206801"
695
- },
696
- "_schema": {
697
- "type": "string",
698
- "description": "URL-friendly identifier for the entity schema",
699
- "example": "message"
700
- },
701
- "_tags": {
702
- "type": "array",
703
- "description": "Entity tags",
704
- "items": {
705
- "type": "string"
706
- },
707
- "example": [
708
- "pricing",
709
- "INBOX"
710
- ]
711
- },
712
- "_created_at": {
713
- "type": "string",
714
- "description": "Created date",
715
- "format": "date-time",
716
- "example": "2021-02-09T12:41:43.662Z"
717
- },
718
- "_updated_at": {
719
- "type": "string",
720
- "description": "Updated date",
721
- "format": "date-time",
722
- "example": "2021-02-10T09:14:31.990Z"
723
- }
724
- }
725
- },
726
- "Thread": {
727
- "description": "Thread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.",
728
- "required": [
729
- "topic"
730
- ],
731
- "properties": {
732
- "topic": {
733
- "type": "string",
734
- "description": "Message topic (e.g. which service sends the message or message category)",
735
- "example": "CUSTOMER_MESSAGE"
736
- },
737
- "assigned_to": {
738
- "type": "array",
739
- "description": "Ivy User ID of who the message is assigned to. Default is the user who sends message.",
740
- "items": {
741
- "type": "string",
742
- "example": [
743
- "206801",
744
- "200109"
745
- ]
746
- }
747
- },
748
- "org_read_message": {
749
- "type": "array",
750
- "description": "Ivy Organization ID of organization read the message.",
751
- "items": {
752
- "type": "string",
753
- "example": [
754
- "789372",
755
- "210291"
756
- ]
757
- }
758
- },
759
- "latest_message": {
760
- "type": "object",
761
- "description": "Latest message of thread",
762
- "$ref": "#/components/schemas/Message"
763
- },
764
- "latest_trash_message": {
765
- "type": "object",
766
- "description": "Latest trash message of thread",
767
- "$ref": "#/components/schemas/Message"
768
- }
769
- }
770
- },
771
- "Message": {
772
- "type": "object",
773
- "required": [
774
- "subject",
775
- "from"
776
- ],
777
- "properties": {
778
- "message_id": {
779
- "type": "string",
780
- "description": "Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.",
781
- "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>"
782
- },
783
- "sender": {
784
- "type": "string",
785
- "description": "Ivy User ID of user sends the message.",
786
- "example": "206801"
787
- },
788
- "subject": {
789
- "type": "string",
790
- "description": "Subject",
791
- "example": "Request for solar panel price"
792
- },
793
- "html": {
794
- "type": "string",
795
- "description": "HTML body",
796
- "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"
797
- },
798
- "text": {
799
- "type": "string",
800
- "description": "Text body",
801
- "example": "We at ABC GmbH would like to request a price quote for the solar panel."
802
- },
803
- "from": {
804
- "$ref": "#/components/schemas/Address"
805
- },
806
- "reply_to": {
807
- "$ref": "#/components/schemas/Address"
808
- },
809
- "to": {
810
- "type": "array",
811
- "description": "To email addresses",
812
- "items": {
813
- "$ref": "#/components/schemas/Address"
814
- }
815
- },
816
- "cc": {
817
- "type": "array",
818
- "description": "Cc email addresses",
819
- "items": {
820
- "$ref": "#/components/schemas/Address"
821
- }
822
- },
823
- "bcc": {
824
- "type": "array",
825
- "description": "Bcc email addresses",
826
- "items": {
827
- "$ref": "#/components/schemas/Address"
828
- }
829
- },
830
- "file": {
831
- "$ref": "#/components/schemas/AttachmentsRelation"
832
- },
833
- "references": {
834
- "type": "string",
835
- "description": "References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\\\nThe last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\\\nThe basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.\n",
836
- "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"
837
- },
838
- "in_reply_to": {
839
- "type": "string",
840
- "description": "In-Reply-To header. Value is the `message_id` of parent message.\n",
841
- "example": "<CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"
842
- },
843
- "user_read_message": {
844
- "type": "array",
845
- "description": "Ivy User ID of user read the message.",
846
- "items": {
847
- "type": "string",
848
- "example": [
849
- "206801",
850
- "200109"
851
- ]
852
- }
853
- },
854
- "org_read_message": {
855
- "type": "array",
856
- "description": "Ivy Organization ID of organization read the message.",
857
- "items": {
858
- "type": "string",
859
- "example": [
860
- "789372",
861
- "210291"
862
- ]
863
- }
864
- },
865
- "send_status": {
866
- "type": "array",
867
- "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`\\\nReference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\n",
868
- "items": {
869
- "type": "string",
870
- "enum": [
871
- "SEND",
872
- "DELIVERY",
873
- "REJECT",
874
- "COMPLAINT",
875
- "BOUNCE",
876
- "ERROR"
877
- ]
878
- }
879
- },
880
- "type": {
881
- "type": "string",
882
- "description": "Message type",
883
- "enum": [
884
- "SENT",
885
- "RECEIVED"
886
- ]
887
- }
888
- }
889
- },
890
- "Address": {
891
- "type": "object",
892
- "required": [
893
- "address"
894
- ],
895
- "properties": {
896
- "name": {
897
- "type": "string",
898
- "description": "Email address alias",
899
- "example": "epilot"
900
- },
901
- "address": {
902
- "type": "string",
903
- "description": "Email address",
904
- "example": "messaging@epilot.cloud"
905
- },
906
- "send_status": {
907
- "type": "string",
908
- "description": "Sent message status regarding to this recipient.\\\nReference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\n",
909
- "enum": [
910
- "SEND",
911
- "DELIVERY",
912
- "REJECT",
913
- "COMPLAINT",
914
- "BOUNCE",
915
- "ERROR"
916
- ]
917
- },
918
- "send_error": {
919
- "type": "object",
920
- "description": "Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\\\nJSON object is defined by AWS SES. Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html>\n"
921
- }
922
- }
923
- },
924
- "AttachmentsRelation": {
925
- "type": "object",
926
- "description": "Message attachments",
927
- "properties": {
928
- "$relation": {
929
- "type": "array",
930
- "description": "It's normal entity relation with some additional properties for sending message attachment.",
931
- "items": {
932
- "$ref": "#/components/schemas/File"
933
- }
934
- }
935
- }
936
- },
937
- "File": {
938
- "type": "object",
939
- "required": [
940
- "entity_id"
941
- ],
942
- "properties": {
943
- "entity_id": {
944
- "type": "string",
945
- "description": "File entity ID",
946
- "example": "f820ce3b-07b0-45ae-bcc6-babb2f53f79f"
947
- },
948
- "filename": {
949
- "type": "string",
950
- "description": "File name",
951
- "example": "Produktinformationen_epilot360_Double_Opt_in.pdf"
952
- },
953
- "is_message_attachment": {
954
- "type": "boolean",
955
- "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."
956
- },
957
- "cid": {
958
- "type": "string",
959
- "description": "Content ID (for inline)",
960
- "example": "fb222496-a1a5-4639-94f2-07b5e35e4068"
961
- },
962
- "inline": {
963
- "type": "boolean",
964
- "description": "If true then this attachment should not be offered for download (at least not in the main attachments list).\\\nThe usecase is CID embedded image (aka inline image).\n",
965
- "default": false
966
- },
967
- "send_as_link": {
968
- "type": "boolean",
969
- "description": "If true then this attachment is sent via link. The link have to be inserted to email body by API caller.\\\nIn this case, service doesn't process this attachment.\n",
970
- "default": false
971
- }
972
- }
973
- },
974
- "MessageRequestParams": {
975
- "required": [
976
- "subject",
977
- "from"
978
- ],
979
- "properties": {
980
- "thread": {
981
- "type": "object",
982
- "required": [
983
- "topic"
984
- ],
985
- "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,...).\\\nThread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.\\\n`thread` or `parent_id` must be provided either.\n",
986
- "properties": {
987
- "topic": {
988
- "type": "string",
989
- "description": "Message topic (e.g. which service sends the message or message category)"
990
- },
991
- "assigned_to": {
992
- "type": "array",
993
- "description": "Ivy User ID of who the message is assigned to. Default is the user who sends message.",
994
- "items": {
995
- "type": "string"
996
- }
997
- }
998
- },
999
- "example": {
1000
- "topic": "CUSTOMER_MESSAGE",
1001
- "assigned_to": [
1002
- "206801",
1003
- "200109"
1004
- ],
1005
- "opportunity_id": 829072
1006
- }
1007
- },
1008
- "parent_id": {
1009
- "type": "string",
1010
- "description": "Entity ID of parent message which this message replies to or forwards from.\\\nIf both `parent_id` and `thread` are provided, `thread` is discarded.\n",
1011
- "example": "44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2"
1012
- },
1013
- "subject": {
1014
- "type": "string",
1015
- "description": "Subject",
1016
- "example": "Request for solar panel price"
1017
- },
1018
- "html": {
1019
- "type": "string",
1020
- "description": "HTML body",
1021
- "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"
1022
- },
1023
- "text": {
1024
- "type": "string",
1025
- "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)",
1026
- "example": "We at ABC GmbH would like to request a price quote for the solar panel."
1027
- },
1028
- "from": {
1029
- "$ref": "#/components/schemas/Address"
1030
- },
1031
- "reply_to": {
1032
- "$ref": "#/components/schemas/Address"
1033
- },
1034
- "to": {
1035
- "type": "array",
1036
- "description": "To email addresses",
1037
- "items": {
1038
- "$ref": "#/components/schemas/Address"
1039
- }
1040
- },
1041
- "cc": {
1042
- "type": "array",
1043
- "description": "Cc email addresses",
1044
- "items": {
1045
- "$ref": "#/components/schemas/Address"
1046
- }
1047
- },
1048
- "bcc": {
1049
- "type": "array",
1050
- "description": "Bcc email addresses",
1051
- "items": {
1052
- "$ref": "#/components/schemas/Address"
1053
- }
1054
- },
1055
- "file": {
1056
- "$ref": "#/components/schemas/AttachmentsRelation"
1057
- }
747
+ },
748
+ "org_read_message": {
749
+ "type": "array",
750
+ "description": "Ivy Organization ID of organization read the message.",
751
+ "items": {
752
+ "type": "string",
753
+ "example": [
754
+ "789372",
755
+ "210291"
756
+ ]
757
+ }
758
+ },
759
+ "latest_message": {
760
+ "type": "object",
761
+ "description": "Latest message of thread",
762
+ "$ref": "#/components/schemas/Message"
763
+ },
764
+ "latest_trash_message": {
765
+ "type": "object",
766
+ "description": "Latest trash message of thread",
767
+ "$ref": "#/components/schemas/Message"
768
+ }
769
+ }
770
+ },
771
+ "Message": {
772
+ "type": "object",
773
+ "required": [
774
+ "subject",
775
+ "from"
776
+ ],
777
+ "properties": {
778
+ "message_id": {
779
+ "type": "string",
780
+ "description": "Message ID which is from email provider. If you provide `message-id`, API overrides by its own value.",
781
+ "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com>"
782
+ },
783
+ "sender": {
784
+ "type": "string",
785
+ "description": "Ivy User ID of user sends the message.",
786
+ "example": "206801"
787
+ },
788
+ "subject": {
789
+ "type": "string",
790
+ "description": "Subject",
791
+ "example": "Request for solar panel price"
792
+ },
793
+ "html": {
794
+ "type": "string",
795
+ "description": "HTML body",
796
+ "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"
797
+ },
798
+ "text": {
799
+ "type": "string",
800
+ "description": "Text body",
801
+ "example": "We at ABC GmbH would like to request a price quote for the solar panel."
802
+ },
803
+ "from": {
804
+ "$ref": "#/components/schemas/Address"
805
+ },
806
+ "reply_to": {
807
+ "$ref": "#/components/schemas/Address"
808
+ },
809
+ "to": {
810
+ "type": "array",
811
+ "description": "To email addresses",
812
+ "items": {
813
+ "$ref": "#/components/schemas/Address"
814
+ }
815
+ },
816
+ "cc": {
817
+ "type": "array",
818
+ "description": "Cc email addresses",
819
+ "items": {
820
+ "$ref": "#/components/schemas/Address"
821
+ }
822
+ },
823
+ "bcc": {
824
+ "type": "array",
825
+ "description": "Bcc email addresses",
826
+ "items": {
827
+ "$ref": "#/components/schemas/Address"
828
+ }
829
+ },
830
+ "file": {
831
+ "$ref": "#/components/schemas/AttachmentsRelation"
832
+ },
833
+ "references": {
834
+ "type": "string",
835
+ "description": "References header. Value is the series of `message_id` which is reparated by space to indicate that message has parent.\\\nThe last message ID in references identifies the parent. The first message ID in references identifies the first message in the thread.\\\nThe basic idea is that sender should copy `references` from the parent and append the parent's `message_id` when replying.\n",
836
+ "example": "<0102017b97a502f8-a67f01c2-68cc-4928-b91b-45853f34e259-000000@eu-west-1.amazonses.com> <CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"
837
+ },
838
+ "in_reply_to": {
839
+ "type": "string",
840
+ "description": "In-Reply-To header. Value is the `message_id` of parent message.\n",
841
+ "example": "<CALHgQpziyxW9NaFUs+nRMykzr6Ljq6vjq4WO9SaihAuMasuDyg@mail.gmail.com>"
842
+ },
843
+ "user_read_message": {
844
+ "type": "array",
845
+ "description": "Ivy User ID of user read the message.",
846
+ "items": {
847
+ "type": "string",
848
+ "example": [
849
+ "206801",
850
+ "200109"
851
+ ]
852
+ }
853
+ },
854
+ "org_read_message": {
855
+ "type": "array",
856
+ "description": "Ivy Organization ID of organization read the message.",
857
+ "items": {
858
+ "type": "string",
859
+ "example": [
860
+ "789372",
861
+ "210291"
862
+ ]
863
+ }
864
+ },
865
+ "send_status": {
866
+ "type": "array",
867
+ "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`\\\nReference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\n",
868
+ "items": {
869
+ "type": "string",
870
+ "enum": [
871
+ "SEND",
872
+ "DELIVERY",
873
+ "REJECT",
874
+ "COMPLAINT",
875
+ "BOUNCE",
876
+ "ERROR"
877
+ ]
878
+ }
879
+ },
880
+ "type": {
881
+ "type": "string",
882
+ "description": "Message type",
883
+ "enum": [
884
+ "SENT",
885
+ "RECEIVED"
886
+ ]
887
+ }
888
+ }
889
+ },
890
+ "Address": {
891
+ "type": "object",
892
+ "required": [
893
+ "address"
894
+ ],
895
+ "properties": {
896
+ "name": {
897
+ "type": "string",
898
+ "description": "Email address alias",
899
+ "example": "epilot"
900
+ },
901
+ "address": {
902
+ "type": "string",
903
+ "description": "Email address",
904
+ "example": "messaging@epilot.cloud"
905
+ },
906
+ "send_status": {
907
+ "type": "string",
908
+ "description": "Sent message status regarding to this recipient.\\\nReference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/monitor-sending-activity.html>\n",
909
+ "enum": [
910
+ "SEND",
911
+ "DELIVERY",
912
+ "REJECT",
913
+ "COMPLAINT",
914
+ "BOUNCE",
915
+ "ERROR"
916
+ ]
917
+ },
918
+ "send_error": {
919
+ "type": "object",
920
+ "description": "Information about reject, complaint or bounce event. Only available if `send_status` is REJECT, COMPLAINT, BOUNCE or ERROR.\\\nJSON object is defined by AWS SES. Reference at <https://docs.aws.amazon.com/ses/latest/DeveloperGuide/notification-contents.html>\n"
921
+ }
922
+ }
923
+ },
924
+ "AttachmentsRelation": {
925
+ "type": "object",
926
+ "description": "Message attachments",
927
+ "properties": {
928
+ "$relation": {
929
+ "type": "array",
930
+ "description": "It's normal entity relation with some additional properties for sending message attachment.",
931
+ "items": {
932
+ "$ref": "#/components/schemas/File"
933
+ }
934
+ }
935
+ }
936
+ },
937
+ "File": {
938
+ "type": "object",
939
+ "required": [
940
+ "entity_id"
941
+ ],
942
+ "properties": {
943
+ "entity_id": {
944
+ "type": "string",
945
+ "description": "File entity ID",
946
+ "example": "f820ce3b-07b0-45ae-bcc6-babb2f53f79f"
947
+ },
948
+ "filename": {
949
+ "type": "string",
950
+ "description": "File name",
951
+ "example": "Produktinformationen_epilot360_Double_Opt_in.pdf"
952
+ },
953
+ "is_message_attachment": {
954
+ "type": "boolean",
955
+ "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."
956
+ },
957
+ "cid": {
958
+ "type": "string",
959
+ "description": "Content ID (for inline)",
960
+ "example": "fb222496-a1a5-4639-94f2-07b5e35e4068"
961
+ },
962
+ "inline": {
963
+ "type": "boolean",
964
+ "description": "If true then this attachment should not be offered for download (at least not in the main attachments list).\\\nThe usecase is CID embedded image (aka inline image).\n",
965
+ "default": false
966
+ },
967
+ "send_as_link": {
968
+ "type": "boolean",
969
+ "description": "If true then this attachment is sent via link. The link have to be inserted to email body by API caller.\\\nIn this case, service doesn't process this attachment.\n",
970
+ "default": false
971
+ }
972
+ }
973
+ },
974
+ "MessageRequestParams": {
975
+ "required": [
976
+ "subject",
977
+ "from"
978
+ ],
979
+ "properties": {
980
+ "thread": {
981
+ "type": "object",
982
+ "required": [
983
+ "topic"
984
+ ],
985
+ "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,...).\\\nThread properties depend on API caller as it's not pre-defined. We do recommend having at least `topic` property for categorizing.\\\n`thread` or `parent_id` must be provided either.\n",
986
+ "properties": {
987
+ "topic": {
988
+ "type": "string",
989
+ "description": "Message topic (e.g. which service sends the message or message category)"
990
+ },
991
+ "assigned_to": {
992
+ "type": "array",
993
+ "description": "Ivy User ID of who the message is assigned to. Default is the user who sends message.",
994
+ "items": {
995
+ "type": "string"
1058
996
  }
997
+ }
1059
998
  },
1060
- "SearchParams": {
1061
- "type": "object",
1062
- "required": [
1063
- "q"
1064
- ],
1065
- "properties": {
1066
- "q": {
1067
- "description": "Lucene query syntax supported with ElasticSearch",
1068
- "type": "string",
1069
- "example": "subject:\"Request for solar panel price\" AND _tags:INBOX"
1070
- },
1071
- "from": {
1072
- "type": "integer",
1073
- "minimum": 0,
1074
- "default": 0
1075
- },
1076
- "size": {
1077
- "type": "integer",
1078
- "minimum": 1,
1079
- "default": 10
1080
- }
1081
- }
999
+ "example": {
1000
+ "topic": "CUSTOMER_MESSAGE",
1001
+ "assigned_to": [
1002
+ "206801",
1003
+ "200109"
1004
+ ],
1005
+ "opportunity_id": 829072
1082
1006
  }
1007
+ },
1008
+ "parent_id": {
1009
+ "type": "string",
1010
+ "description": "Entity ID of parent message which this message replies to or forwards from.\\\nIf both `parent_id` and `thread` are provided, `thread` is discarded.\n",
1011
+ "example": "44d7a3eb-0cce-4bd3-a7cd-0b3e652de0c2"
1012
+ },
1013
+ "subject": {
1014
+ "type": "string",
1015
+ "description": "Subject",
1016
+ "example": "Request for solar panel price"
1017
+ },
1018
+ "html": {
1019
+ "type": "string",
1020
+ "description": "HTML body",
1021
+ "example": "<div>We at ABC GmbH would like to request a price quote for the solar panel.</div>"
1022
+ },
1023
+ "text": {
1024
+ "type": "string",
1025
+ "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)",
1026
+ "example": "We at ABC GmbH would like to request a price quote for the solar panel."
1027
+ },
1028
+ "from": {
1029
+ "$ref": "#/components/schemas/Address"
1030
+ },
1031
+ "reply_to": {
1032
+ "$ref": "#/components/schemas/Address"
1033
+ },
1034
+ "to": {
1035
+ "type": "array",
1036
+ "description": "To email addresses",
1037
+ "items": {
1038
+ "$ref": "#/components/schemas/Address"
1039
+ }
1040
+ },
1041
+ "cc": {
1042
+ "type": "array",
1043
+ "description": "Cc email addresses",
1044
+ "items": {
1045
+ "$ref": "#/components/schemas/Address"
1046
+ }
1047
+ },
1048
+ "bcc": {
1049
+ "type": "array",
1050
+ "description": "Bcc email addresses",
1051
+ "items": {
1052
+ "$ref": "#/components/schemas/Address"
1053
+ }
1054
+ },
1055
+ "file": {
1056
+ "$ref": "#/components/schemas/AttachmentsRelation"
1057
+ }
1083
1058
  }
1084
- },
1085
- "servers": [
1086
- {
1087
- "url": "https://message.sls.epilot.io"
1088
- },
1089
- {
1090
- "url": "https://message.sls.epilot.io"
1059
+ },
1060
+ "SearchParams": {
1061
+ "type": "object",
1062
+ "required": [
1063
+ "q"
1064
+ ],
1065
+ "properties": {
1066
+ "q": {
1067
+ "description": "Lucene query syntax supported with ElasticSearch",
1068
+ "type": "string",
1069
+ "example": "subject:\"Request for solar panel price\" AND _tags:INBOX"
1070
+ },
1071
+ "from": {
1072
+ "type": "integer",
1073
+ "minimum": 0,
1074
+ "default": 0
1075
+ },
1076
+ "size": {
1077
+ "type": "integer",
1078
+ "minimum": 1,
1079
+ "default": 10
1080
+ }
1091
1081
  }
1092
- ]
1082
+ }
1083
+ }
1084
+ },
1085
+ "servers": [
1086
+ {
1087
+ "url": "https://message.sls.epilot.io"
1088
+ },
1089
+ {
1090
+ "url": "https://message.sls.epilot.io"
1091
+ }
1092
+ ]
1093
1093
  }