@botpress/api 0.2.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.
@@ -0,0 +1,4459 @@
1
+ // This file was generated by the Opapi Generator
2
+ /* eslint-disable */
3
+ /* prettier-ignore */
4
+ import { State } from '@bpinternal/opapi'
5
+ export const state = {
6
+ operations: {
7
+ createConversation: {
8
+ name: "createConversation",
9
+ description:
10
+ "Creates a new [Conversation](#schema_conversation). When creating a new [Conversation](#schema_conversation), the required tags must be provided. See the specific integration for more details.",
11
+ method: "post",
12
+ path: "/v1/chat/conversations",
13
+ requestBody: {
14
+ description: "Conversation data",
15
+ schema: {
16
+ type: "object",
17
+ properties: {
18
+ channel: {
19
+ type: "string",
20
+ description: "Channel name",
21
+ },
22
+ tags: {
23
+ type: "object",
24
+ additionalProperties: {
25
+ type: "string",
26
+ maxLength: 500,
27
+ },
28
+ description: "Tags for the [Conversation](#schema_conversation)",
29
+ },
30
+ integrationName: {
31
+ type: "string",
32
+ description:
33
+ "Name of the integration to which the conversation creation will be delegated",
34
+ },
35
+ },
36
+ required: ["channel", "tags"],
37
+ title: "createConversationBody",
38
+ additionalProperties: false,
39
+ },
40
+ },
41
+ section: "conversation",
42
+ response: {
43
+ description:
44
+ "Returns a [Conversation](#schema_conversation) object if creation succeeds. Returns [an error](#errors) otherwise",
45
+ status: 201,
46
+ schema: {
47
+ type: "object",
48
+ properties: {
49
+ conversation: {
50
+ $ref: "#/components/schemas/Conversation",
51
+ },
52
+ },
53
+ required: ["conversation"],
54
+ title: "createConversationResponse",
55
+ additionalProperties: false,
56
+ },
57
+ },
58
+ parameters: {},
59
+ },
60
+ getConversation: {
61
+ name: "getConversation",
62
+ description:
63
+ "Retrieves the [Conversation](#schema_conversation) object for a valid identifier.",
64
+ method: "get",
65
+ path: "/v1/chat/conversations/{id}",
66
+ parameters: {
67
+ id: {
68
+ in: "path",
69
+ type: "string",
70
+ description: "Conversation id",
71
+ },
72
+ },
73
+ section: "conversation",
74
+ response: {
75
+ description:
76
+ "Returns a [Conversation](#schema_conversation) object if a valid identifier was provided. Returns [an error](#errors) otherwise",
77
+ schema: {
78
+ type: "object",
79
+ properties: {
80
+ conversation: {
81
+ $ref: "#/components/schemas/Conversation",
82
+ },
83
+ },
84
+ required: ["conversation"],
85
+ title: "getConversationResponse",
86
+ additionalProperties: false,
87
+ },
88
+ },
89
+ },
90
+ listConversations: {
91
+ name: "listConversations",
92
+ description:
93
+ "Retrieves a list of [Conversation](#schema_conversation) you’ve previously created. The conversations are returned in sorted order, with the most recent appearing first. The list can be filtered using [Tags](#tags).",
94
+ method: "get",
95
+ path: "/v1/chat/conversations",
96
+ parameters: {
97
+ nextToken: {
98
+ in: "query",
99
+ description:
100
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
101
+ type: "string",
102
+ },
103
+ tags: {
104
+ in: "query",
105
+ type: "object",
106
+ schema: {
107
+ type: "object",
108
+ additionalProperties: {
109
+ type: "string",
110
+ },
111
+ },
112
+ description: "Filter by tags",
113
+ },
114
+ participantIds: {
115
+ in: "query",
116
+ type: "string[]",
117
+ description: "Filter by participant ids",
118
+ },
119
+ },
120
+ section: "conversation",
121
+ response: {
122
+ description:
123
+ "Returns a list of [Conversation](#schema_conversation) objects",
124
+ schema: {
125
+ type: "object",
126
+ properties: {
127
+ conversations: {
128
+ type: "array",
129
+ items: {
130
+ $ref: "#/components/schemas/Conversation",
131
+ },
132
+ },
133
+ meta: {
134
+ type: "object",
135
+ properties: {
136
+ nextToken: {
137
+ type: "string",
138
+ description:
139
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
140
+ },
141
+ },
142
+ additionalProperties: false,
143
+ },
144
+ },
145
+ required: ["conversations", "meta"],
146
+ title: "listConversationsResponse",
147
+ additionalProperties: false,
148
+ },
149
+ },
150
+ },
151
+ getOrCreateConversation: {
152
+ name: "getOrCreateConversation",
153
+ description:
154
+ "Retrieves the [Conversation](#schema_conversation) object for a valid identifier. If the conversation does not exist, it will be created.",
155
+ method: "post",
156
+ path: "/v1/chat/conversations/get-or-create",
157
+ requestBody: {
158
+ description: "Conversation data",
159
+ schema: {
160
+ type: "object",
161
+ properties: {
162
+ channel: {
163
+ type: "string",
164
+ description: "Channel name",
165
+ },
166
+ tags: {
167
+ type: "object",
168
+ additionalProperties: {
169
+ type: "string",
170
+ maxLength: 500,
171
+ },
172
+ description: "Tags for the [Conversation](#schema_conversation)",
173
+ },
174
+ integrationName: {
175
+ type: "string",
176
+ description:
177
+ "Name of the integration to which the conversation creation will be delegated",
178
+ },
179
+ },
180
+ required: ["channel", "tags"],
181
+ title: "getOrCreateConversationBody",
182
+ additionalProperties: false,
183
+ },
184
+ },
185
+ section: "conversation",
186
+ response: {
187
+ description:
188
+ "Returns a [Conversation](#schema_conversation) object if a valid identifier was provided. Returns [an error](#errors) otherwise",
189
+ schema: {
190
+ type: "object",
191
+ properties: {
192
+ conversation: {
193
+ $ref: "#/components/schemas/Conversation",
194
+ },
195
+ },
196
+ required: ["conversation"],
197
+ title: "getOrCreateConversationResponse",
198
+ additionalProperties: false,
199
+ },
200
+ },
201
+ parameters: {},
202
+ },
203
+ updateConversation: {
204
+ name: "updateConversation",
205
+ description:
206
+ "Update a [Conversation](#schema_conversation) object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.",
207
+ method: "put",
208
+ path: "/v1/chat/conversations/{id}",
209
+ parameters: {
210
+ id: {
211
+ in: "path",
212
+ type: "string",
213
+ description: "Conversation id",
214
+ },
215
+ },
216
+ requestBody: {
217
+ description: "Conversation data",
218
+ schema: {
219
+ type: "object",
220
+ properties: {
221
+ tags: {
222
+ type: "object",
223
+ additionalProperties: {
224
+ type: "string",
225
+ },
226
+ description: "Tags for the [Conversation](#schema_conversation)",
227
+ },
228
+ participantIds: {
229
+ type: "array",
230
+ items: {
231
+ type: "string",
232
+ },
233
+ description:
234
+ "Ids of the [User]s(#schema_user) participating in the conversation",
235
+ },
236
+ },
237
+ required: ["tags", "participantIds"],
238
+ title: "updateConversationBody",
239
+ additionalProperties: false,
240
+ },
241
+ },
242
+ section: "conversation",
243
+ response: {
244
+ description:
245
+ "Returns an updated [Conversation](#schema_conversation) object if a valid identifier was provided. Returns [an error](#errors) otherwise",
246
+ schema: {
247
+ type: "object",
248
+ properties: {
249
+ conversation: {
250
+ $ref: "#/components/schemas/Conversation",
251
+ },
252
+ },
253
+ required: ["conversation"],
254
+ title: "updateConversationResponse",
255
+ additionalProperties: false,
256
+ },
257
+ },
258
+ },
259
+ deleteConversation: {
260
+ name: "deleteConversation",
261
+ description:
262
+ "Permanently deletes a [Conversation](#schema_conversation). It cannot be undone. Also immediately deletes corresponding [Messages](#schema_message).",
263
+ method: "delete",
264
+ path: "/v1/chat/conversations/{id}",
265
+ parameters: {
266
+ id: {
267
+ in: "path",
268
+ type: "string",
269
+ description: "Conversation id",
270
+ },
271
+ },
272
+ section: "conversation",
273
+ response: {
274
+ description:
275
+ "Returns the [Conversation](#schema_conversation) object that was deleted",
276
+ schema: {
277
+ type: "object",
278
+ title: "deleteConversationResponse",
279
+ additionalProperties: false,
280
+ },
281
+ },
282
+ },
283
+ createEvent: {
284
+ name: "createEvent",
285
+ description:
286
+ "Creates a new [Event](#schema_event). When creating a new [Event](#schema_event), the required tags must be provided. See the specific integration for more details.",
287
+ method: "post",
288
+ path: "/v1/chat/events",
289
+ section: "event",
290
+ requestBody: {
291
+ description: "Event data",
292
+ schema: {
293
+ type: "object",
294
+ properties: {
295
+ type: {
296
+ type: "string",
297
+ description: "Type of the [Event](#schema_event).",
298
+ },
299
+ payload: {
300
+ type: "object",
301
+ additionalProperties: true,
302
+ description:
303
+ "Payload is the content of the event defined by the integration installed on your bot or one of the default events created by our API.",
304
+ },
305
+ schedule: {
306
+ type: "object",
307
+ properties: {
308
+ dateTime: {
309
+ type: "string",
310
+ description:
311
+ "When the [Event](#schema_event) will be sent, in the ISO 8601 format",
312
+ },
313
+ delay: {
314
+ type: "number",
315
+ description:
316
+ "Delay in milliseconds before sending the [Event](#schema_event)",
317
+ },
318
+ },
319
+ description:
320
+ "Schedule the Event to be sent at a specific time. Either dateTime or delay must be provided.",
321
+ additionalProperties: false,
322
+ },
323
+ },
324
+ required: ["type", "payload"],
325
+ title: "createEventBody",
326
+ additionalProperties: false,
327
+ },
328
+ },
329
+ response: {
330
+ description:
331
+ "Returns a [Event](#schema_event) object if creation succeeds. Returns [an error](#errors) otherwise",
332
+ status: 201,
333
+ schema: {
334
+ type: "object",
335
+ properties: {
336
+ event: {
337
+ $ref: "#/components/schemas/Event",
338
+ },
339
+ },
340
+ required: ["event"],
341
+ title: "createEventResponse",
342
+ additionalProperties: false,
343
+ },
344
+ },
345
+ parameters: {},
346
+ },
347
+ getEvent: {
348
+ name: "getEvent",
349
+ description:
350
+ "Retrieves the [Event](#schema_event) object for a valid identifiers.",
351
+ method: "get",
352
+ path: "/v1/chat/events/{id}",
353
+ parameters: {
354
+ id: {
355
+ in: "path",
356
+ type: "string",
357
+ description: "Event id",
358
+ },
359
+ },
360
+ section: "event",
361
+ response: {
362
+ description:
363
+ "Returns the [Event](#schema_event) object if a valid identifiers were provided. Returns [an error](#errors) otherwise",
364
+ schema: {
365
+ type: "object",
366
+ properties: {
367
+ event: {
368
+ $ref: "#/components/schemas/Event",
369
+ },
370
+ },
371
+ required: ["event"],
372
+ title: "getEventResponse",
373
+ additionalProperties: false,
374
+ },
375
+ },
376
+ },
377
+ listEvents: {
378
+ name: "listEvents",
379
+ description:
380
+ "Retreives a list of [Event](#schema_event) you’ve previously created. The events are returned in sorted order, with the most recent appearing first.",
381
+ method: "get",
382
+ path: "/v1/chat/events",
383
+ section: "event",
384
+ parameters: {
385
+ nextToken: {
386
+ in: "query",
387
+ description:
388
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
389
+ type: "string",
390
+ },
391
+ type: {
392
+ in: "query",
393
+ type: "string",
394
+ description: "Filter by event type",
395
+ },
396
+ },
397
+ response: {
398
+ description: "Returns a list of [Event](#schema_event) objects",
399
+ schema: {
400
+ type: "object",
401
+ properties: {
402
+ events: {
403
+ type: "array",
404
+ items: {
405
+ $ref: "#/components/schemas/Event",
406
+ },
407
+ },
408
+ meta: {
409
+ type: "object",
410
+ properties: {
411
+ nextToken: {
412
+ type: "string",
413
+ description:
414
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
415
+ },
416
+ },
417
+ additionalProperties: false,
418
+ },
419
+ },
420
+ required: ["events", "meta"],
421
+ title: "listEventsResponse",
422
+ additionalProperties: false,
423
+ },
424
+ },
425
+ },
426
+ createMessage: {
427
+ name: "createMessage",
428
+ description:
429
+ "Creates a new [Message](#schema_message). When creating a new [Message](#schema_message), the required tags must be provided. See the specific integration for more details.",
430
+ method: "post",
431
+ path: "/v1/chat/messages",
432
+ requestBody: {
433
+ description: "Message data",
434
+ schema: {
435
+ type: "object",
436
+ properties: {
437
+ payload: {
438
+ type: "object",
439
+ additionalProperties: true,
440
+ description:
441
+ "Payload is the content type of the message. Accepted payload options: Text, Image, Choice, Dropdown, Card, Carousel, File, Audio, Video, Location",
442
+ },
443
+ userId: {
444
+ type: "string",
445
+ description: "ID of the [User](#schema_user)",
446
+ },
447
+ conversationId: {
448
+ type: "string",
449
+ description: "ID of the [Conversation](#schema_conversation)",
450
+ },
451
+ type: {
452
+ type: "string",
453
+ description:
454
+ "Type of the [Message](#schema_message) represents the resource type that the message is related to",
455
+ },
456
+ tags: {
457
+ type: "object",
458
+ additionalProperties: {
459
+ type: "string",
460
+ maxLength: 500,
461
+ },
462
+ description:
463
+ "Set of [Tags](#tags) that you can attach to a [Conversation](#schema_conversation). The set of [Tags](#tags) available on a [Conversation](#schema_conversation) is restricted by the list of [Tags](#tags) defined previously by the [Bot](#schema_bot). Individual keys can be unset by posting an empty value to them.",
464
+ },
465
+ schedule: {
466
+ type: "object",
467
+ properties: {
468
+ dateTime: {
469
+ type: "string",
470
+ description:
471
+ "When the [Message](#schema_message) will be sent, in the ISO 8601 format",
472
+ },
473
+ delay: {
474
+ type: "number",
475
+ description:
476
+ "Delay in milliseconds before sending the [Message](#schema_message)",
477
+ },
478
+ },
479
+ description:
480
+ "Schedule the Message to be sent at a specific time. Either dateTime or delay must be provided.",
481
+ additionalProperties: false,
482
+ },
483
+ },
484
+ required: ["payload", "userId", "conversationId", "type", "tags"],
485
+ title: "createMessageBody",
486
+ additionalProperties: false,
487
+ },
488
+ },
489
+ section: "message",
490
+ response: {
491
+ description:
492
+ "Returns a [Message](#schema_message) object if creation succeeds.",
493
+ status: 201,
494
+ schema: {
495
+ type: "object",
496
+ properties: {
497
+ message: {
498
+ $ref: "#/components/schemas/Message",
499
+ },
500
+ },
501
+ required: ["message"],
502
+ title: "createMessageResponse",
503
+ additionalProperties: false,
504
+ },
505
+ },
506
+ parameters: {},
507
+ },
508
+ getOrCreateMessage: {
509
+ name: "getOrCreateMessage",
510
+ description:
511
+ "Retrieves the [Message](#schema_message) object for a valid identifier. If the message does not exist, it will be created.",
512
+ method: "post",
513
+ path: "/v1/chat/messages/get-or-create",
514
+ requestBody: {
515
+ description: "Message data",
516
+ schema: {
517
+ type: "object",
518
+ properties: {
519
+ payload: {
520
+ type: "object",
521
+ additionalProperties: true,
522
+ description:
523
+ "Payload is the content type of the message. Accepted payload options: Text, Image, Choice, Dropdown, Card, Carousel, File, Audio, Video, Location",
524
+ },
525
+ userId: {
526
+ type: "string",
527
+ description: "ID of the [User](#schema_user)",
528
+ },
529
+ conversationId: {
530
+ type: "string",
531
+ description: "ID of the [Conversation](#schema_conversation)",
532
+ },
533
+ type: {
534
+ type: "string",
535
+ description:
536
+ "Type of the [Message](#schema_message) represents the resource type that the message is related to",
537
+ },
538
+ tags: {
539
+ type: "object",
540
+ additionalProperties: {
541
+ type: "string",
542
+ maxLength: 500,
543
+ },
544
+ description:
545
+ "Set of [Tags](#tags) that you can attach to a [Conversation](#schema_conversation). The set of [Tags](#tags) available on a [Conversation](#schema_conversation) is restricted by the list of [Tags](#tags) defined previously by the [Bot](#schema_bot). Individual keys can be unset by posting an empty value to them.",
546
+ },
547
+ schedule: {
548
+ type: "object",
549
+ properties: {
550
+ dateTime: {
551
+ type: "string",
552
+ description:
553
+ "When the [Message](#schema_message) will be sent, in the ISO 8601 format",
554
+ },
555
+ delay: {
556
+ type: "number",
557
+ description:
558
+ "Delay in milliseconds before sending the [Message](#schema_message)",
559
+ },
560
+ },
561
+ description:
562
+ "Schedule the Message to be sent at a specific time. Either dateTime or delay must be provided.",
563
+ additionalProperties: false,
564
+ },
565
+ },
566
+ required: ["payload", "userId", "conversationId", "type", "tags"],
567
+ title: "getOrCreateMessageBody",
568
+ additionalProperties: false,
569
+ },
570
+ },
571
+ section: "message",
572
+ response: {
573
+ description:
574
+ "Returns a [Message](#schema_message) object if a valid identifier was provided. Returns [an error](#errors) otherwise",
575
+ schema: {
576
+ type: "object",
577
+ properties: {
578
+ message: {
579
+ $ref: "#/components/schemas/Message",
580
+ },
581
+ },
582
+ required: ["message"],
583
+ title: "getOrCreateMessageResponse",
584
+ additionalProperties: false,
585
+ },
586
+ },
587
+ parameters: {},
588
+ },
589
+ getMessage: {
590
+ name: "getMessage",
591
+ description:
592
+ "Retrieves the [Message](#schema_message) object for a valid identifier.",
593
+ method: "get",
594
+ path: "/v1/chat/messages/{id}",
595
+ parameters: {
596
+ id: {
597
+ in: "path",
598
+ type: "string",
599
+ description: "Id of the Message",
600
+ },
601
+ },
602
+ section: "message",
603
+ response: {
604
+ description:
605
+ "Returns a [Message](#schema_message) object if a valid identifier was provided. Returns [an error](#errors) otherwise",
606
+ schema: {
607
+ type: "object",
608
+ properties: {
609
+ message: {
610
+ $ref: "#/components/schemas/Message",
611
+ },
612
+ },
613
+ required: ["message"],
614
+ title: "getMessageResponse",
615
+ additionalProperties: false,
616
+ },
617
+ },
618
+ },
619
+ updateMessage: {
620
+ name: "updateMessage",
621
+ description: "Update a message",
622
+ method: "put",
623
+ path: "/v1/chat/messages/{id}",
624
+ parameters: {
625
+ id: {
626
+ in: "path",
627
+ type: "string",
628
+ description: "Message id",
629
+ },
630
+ },
631
+ section: "message",
632
+ requestBody: {
633
+ description: "Message data",
634
+ schema: {
635
+ type: "object",
636
+ properties: {
637
+ tags: {
638
+ type: "object",
639
+ additionalProperties: {
640
+ type: "string",
641
+ },
642
+ description:
643
+ "Set of [Tags](#tags) that you can attach to a [Conversation](#schema_conversation). The set of [Tags](#tags) available on a [Conversation](#schema_conversation) is restricted by the list of [Tags](#tags) defined previously by the [Bot](#schema_bot). Individual keys can be unset by posting an empty value to them.",
644
+ },
645
+ },
646
+ required: ["tags"],
647
+ title: "updateMessageBody",
648
+ additionalProperties: false,
649
+ },
650
+ },
651
+ response: {
652
+ description: "Message information",
653
+ schema: {
654
+ type: "object",
655
+ properties: {
656
+ message: {
657
+ $ref: "#/components/schemas/Message",
658
+ },
659
+ },
660
+ required: ["message"],
661
+ title: "updateMessageResponse",
662
+ additionalProperties: false,
663
+ },
664
+ },
665
+ },
666
+ listMessages: {
667
+ name: "listMessages",
668
+ description:
669
+ "Retrieves a list of [Messages](#schema_message) you’ve previously created. The messages are returned in sorted order, with the most recent appearing first. The list can be filtered using [Tags](#tags).",
670
+ method: "get",
671
+ path: "/v1/chat/messages",
672
+ parameters: {
673
+ nextToken: {
674
+ in: "query",
675
+ description:
676
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
677
+ type: "string",
678
+ },
679
+ conversationId: {
680
+ in: "query",
681
+ type: "string",
682
+ description: "Conversation id",
683
+ },
684
+ tags: {
685
+ in: "query",
686
+ type: "object",
687
+ schema: {
688
+ type: "object",
689
+ additionalProperties: {
690
+ type: "string",
691
+ },
692
+ },
693
+ description: "Filter by tags",
694
+ },
695
+ },
696
+ section: "message",
697
+ response: {
698
+ description: "Returns a list of [Messages](#schema_message) objects.",
699
+ schema: {
700
+ type: "object",
701
+ properties: {
702
+ messages: {
703
+ type: "array",
704
+ items: {
705
+ $ref: "#/components/schemas/Message",
706
+ },
707
+ },
708
+ meta: {
709
+ type: "object",
710
+ properties: {
711
+ nextToken: {
712
+ type: "string",
713
+ description:
714
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
715
+ },
716
+ },
717
+ additionalProperties: false,
718
+ },
719
+ },
720
+ required: ["messages", "meta"],
721
+ title: "listMessagesResponse",
722
+ additionalProperties: false,
723
+ },
724
+ },
725
+ },
726
+ deleteMessage: {
727
+ name: "deleteMessage",
728
+ description:
729
+ "Permanently deletes a [Message](#schema_message). It cannot be undone.",
730
+ method: "delete",
731
+ path: "/v1/chat/messages/{id}",
732
+ parameters: {
733
+ id: {
734
+ in: "path",
735
+ type: "string",
736
+ description: "Message id",
737
+ },
738
+ },
739
+ section: "message",
740
+ response: {
741
+ description:
742
+ "Returns the [Message](#schema_message) object that was deleted",
743
+ schema: {
744
+ type: "object",
745
+ title: "deleteMessageResponse",
746
+ additionalProperties: false,
747
+ },
748
+ },
749
+ },
750
+ createUser: {
751
+ name: "createUser",
752
+ description:
753
+ "Creates a new [User](#schema_user). When creating a new [User](#schema_user), the required tags must be provided. See the specific integration for more details.",
754
+ method: "post",
755
+ path: "/v1/chat/users",
756
+ requestBody: {
757
+ description: "User data",
758
+ schema: {
759
+ type: "object",
760
+ properties: {
761
+ tags: {
762
+ type: "object",
763
+ additionalProperties: {
764
+ type: "string",
765
+ maxLength: 500,
766
+ },
767
+ description: "Tags for the [User](#schema_user)",
768
+ },
769
+ integrationName: {
770
+ type: "string",
771
+ description:
772
+ "Name of the integration to which the user creation will be delegated",
773
+ },
774
+ },
775
+ required: ["tags"],
776
+ title: "createUserBody",
777
+ additionalProperties: false,
778
+ },
779
+ },
780
+ section: "user",
781
+ response: {
782
+ description:
783
+ "Returns a [User](#schema_user) object if creation succeeds. Returns [an error](#errors) otherwise",
784
+ status: 201,
785
+ schema: {
786
+ type: "object",
787
+ properties: {
788
+ user: {
789
+ $ref: "#/components/schemas/User",
790
+ },
791
+ },
792
+ required: ["user"],
793
+ title: "createUserResponse",
794
+ additionalProperties: false,
795
+ },
796
+ },
797
+ parameters: {},
798
+ },
799
+ getUser: {
800
+ name: "getUser",
801
+ description:
802
+ "Retrieves the [User](#schema_user) object for a valid identifier.",
803
+ method: "get",
804
+ path: "/v1/chat/users/{id}",
805
+ parameters: {
806
+ id: {
807
+ in: "path",
808
+ type: "string",
809
+ description: "User ID",
810
+ },
811
+ },
812
+ section: "user",
813
+ response: {
814
+ description:
815
+ "Returns a [User](#schema_user) object if a valid identifier was provided. Returns [an error](#errors) otherwise",
816
+ schema: {
817
+ type: "object",
818
+ properties: {
819
+ user: {
820
+ $ref: "#/components/schemas/User",
821
+ },
822
+ },
823
+ required: ["user"],
824
+ title: "getUserResponse",
825
+ additionalProperties: false,
826
+ },
827
+ },
828
+ },
829
+ listUsers: {
830
+ name: "listUsers",
831
+ description:
832
+ "Retrieves a list of [User](#schema_user) previously created. The users are returned in sorted order, with the most recent appearing first. The list can be filtered using [Tags](#tags).",
833
+ method: "get",
834
+ path: "/v1/chat/users",
835
+ parameters: {
836
+ nextToken: {
837
+ in: "query",
838
+ description:
839
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
840
+ type: "string",
841
+ },
842
+ conversationId: {
843
+ in: "query",
844
+ type: "string",
845
+ description:
846
+ "Filter by conversation id. This will return all users that have participated in the conversation.",
847
+ },
848
+ tags: {
849
+ in: "query",
850
+ type: "object",
851
+ schema: {
852
+ type: "object",
853
+ additionalProperties: {
854
+ type: "string",
855
+ },
856
+ },
857
+ description: "Filter by tags",
858
+ },
859
+ },
860
+ section: "user",
861
+ response: {
862
+ description: "Returns a list of [User](#schema_user) objects",
863
+ schema: {
864
+ type: "object",
865
+ properties: {
866
+ users: {
867
+ type: "array",
868
+ items: {
869
+ $ref: "#/components/schemas/User",
870
+ },
871
+ },
872
+ meta: {
873
+ type: "object",
874
+ properties: {
875
+ nextToken: {
876
+ type: "string",
877
+ description:
878
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
879
+ },
880
+ },
881
+ additionalProperties: false,
882
+ },
883
+ },
884
+ required: ["users", "meta"],
885
+ title: "listUsersResponse",
886
+ additionalProperties: false,
887
+ },
888
+ },
889
+ },
890
+ getOrCreateUser: {
891
+ name: "getOrCreateUser",
892
+ description:
893
+ "Retrieves the [User](#schema_user) object for a valid identifier. If the user does not exist, it will be created.",
894
+ method: "post",
895
+ path: "/v1/chat/users/get-or-create",
896
+ requestBody: {
897
+ description: "User data",
898
+ schema: {
899
+ type: "object",
900
+ properties: {
901
+ tags: {
902
+ type: "object",
903
+ additionalProperties: {
904
+ type: "string",
905
+ maxLength: 500,
906
+ },
907
+ description: "Tags for the [User](#schema_user)",
908
+ },
909
+ integrationName: {
910
+ type: "string",
911
+ description:
912
+ "Name of the integration to which the user creation will be delegated",
913
+ },
914
+ },
915
+ required: ["tags"],
916
+ title: "getOrCreateUserBody",
917
+ additionalProperties: false,
918
+ },
919
+ },
920
+ section: "user",
921
+ response: {
922
+ description:
923
+ "Returns a [User](#schema_user) object if a valid identifier was provided. Returns [an error](#errors) otherwise",
924
+ schema: {
925
+ type: "object",
926
+ properties: {
927
+ user: {
928
+ $ref: "#/components/schemas/User",
929
+ },
930
+ },
931
+ required: ["user"],
932
+ title: "getOrCreateUserResponse",
933
+ additionalProperties: false,
934
+ },
935
+ },
936
+ parameters: {},
937
+ },
938
+ updateUser: {
939
+ name: "updateUser",
940
+ description:
941
+ "Update a [User](#schema_user) object by setting the values of the parameters passed. Any parameters not provided will be left unchanged.",
942
+ method: "put",
943
+ path: "/v1/chat/users/{id}",
944
+ parameters: {
945
+ id: {
946
+ in: "path",
947
+ type: "string",
948
+ description: "User ID",
949
+ },
950
+ },
951
+ requestBody: {
952
+ description: "User data",
953
+ schema: {
954
+ type: "object",
955
+ properties: {
956
+ tags: {
957
+ type: "object",
958
+ additionalProperties: {
959
+ type: "string",
960
+ },
961
+ description: "Tags for the [User](#schema_user)",
962
+ },
963
+ },
964
+ required: ["tags"],
965
+ title: "updateUserBody",
966
+ additionalProperties: false,
967
+ },
968
+ },
969
+ section: "user",
970
+ response: {
971
+ description:
972
+ "Returns an updated [User](#schema_user) object if a valid identifier was provided. Returns [an error](#errors) otherwise",
973
+ schema: {
974
+ type: "object",
975
+ properties: {
976
+ user: {
977
+ $ref: "#/components/schemas/User",
978
+ },
979
+ },
980
+ required: ["user"],
981
+ title: "updateUserResponse",
982
+ additionalProperties: false,
983
+ },
984
+ },
985
+ },
986
+ deleteUser: {
987
+ name: "deleteUser",
988
+ description:
989
+ "Permanently deletes a [User](#schema_user). It cannot be undone.",
990
+ method: "delete",
991
+ path: "/v1/chat/users/{id}",
992
+ parameters: {
993
+ id: {
994
+ in: "path",
995
+ type: "string",
996
+ description: "User ID",
997
+ },
998
+ },
999
+ section: "user",
1000
+ response: {
1001
+ description: "Returns the [User](#schema_user) object that was deleted",
1002
+ schema: {
1003
+ type: "object",
1004
+ title: "deleteUserResponse",
1005
+ additionalProperties: false,
1006
+ },
1007
+ },
1008
+ },
1009
+ getState: {
1010
+ name: "getState",
1011
+ description:
1012
+ "Retrieves the [State](#schema_state) object for a valid identifiers.",
1013
+ method: "get",
1014
+ path: "/v1/chat/states/{type}/{id}/{name}",
1015
+ parameters: {
1016
+ type: {
1017
+ in: "path",
1018
+ type: "string",
1019
+ description: "State type",
1020
+ enum: ["conversation", "user", "bot", "integration"],
1021
+ },
1022
+ id: {
1023
+ in: "path",
1024
+ type: "string",
1025
+ description: "State id",
1026
+ },
1027
+ name: {
1028
+ in: "path",
1029
+ type: "string",
1030
+ description: "State name",
1031
+ },
1032
+ },
1033
+ section: "state",
1034
+ response: {
1035
+ description:
1036
+ "Returns the [State](#schema_state) object if a valid identifiers were provided. Returns [an error](#errors) otherwise",
1037
+ schema: {
1038
+ type: "object",
1039
+ properties: {
1040
+ state: {
1041
+ $ref: "#/components/schemas/State",
1042
+ },
1043
+ },
1044
+ required: ["state"],
1045
+ title: "getStateResponse",
1046
+ additionalProperties: false,
1047
+ },
1048
+ },
1049
+ },
1050
+ setState: {
1051
+ name: "setState",
1052
+ description:
1053
+ "Overrides the [State](#schema_state) object by setting the values of the parameters passed.",
1054
+ method: "post",
1055
+ path: "/v1/chat/states/{type}/{id}/{name}",
1056
+ parameters: {
1057
+ type: {
1058
+ in: "path",
1059
+ type: "string",
1060
+ description: "State type",
1061
+ enum: ["conversation", "user", "bot", "integration"],
1062
+ },
1063
+ id: {
1064
+ in: "path",
1065
+ type: "string",
1066
+ description: "State id",
1067
+ },
1068
+ name: {
1069
+ in: "path",
1070
+ type: "string",
1071
+ description: "State name",
1072
+ },
1073
+ },
1074
+ requestBody: {
1075
+ description: "State content",
1076
+ schema: {
1077
+ type: "object",
1078
+ properties: {
1079
+ payload: {
1080
+ type: "object",
1081
+ additionalProperties: true,
1082
+ nullable: true,
1083
+ description:
1084
+ "Payload is the content of the state defined by your bot.",
1085
+ },
1086
+ expiry: {
1087
+ type: "number",
1088
+ minimum: 1,
1089
+ description:
1090
+ "Expiry of the [State](#schema_state) in milliseconds. The state will expire if it is idle for the configured value. By default, a state doesn't expire.",
1091
+ },
1092
+ },
1093
+ required: ["payload"],
1094
+ title: "setStateBody",
1095
+ additionalProperties: false,
1096
+ },
1097
+ },
1098
+ section: "state",
1099
+ response: {
1100
+ description:
1101
+ "Returns the updated [State](#schema_state) object if a valid identifier was provided. Returns an [an error](#errors) otherwise",
1102
+ schema: {
1103
+ type: "object",
1104
+ properties: {
1105
+ state: {
1106
+ $ref: "#/components/schemas/State",
1107
+ },
1108
+ },
1109
+ required: ["state"],
1110
+ title: "setStateResponse",
1111
+ additionalProperties: false,
1112
+ },
1113
+ },
1114
+ },
1115
+ patchState: {
1116
+ name: "patchState",
1117
+ description:
1118
+ "Updates the [State](#schema_state) object by setting the values of the parameters passed.",
1119
+ method: "patch",
1120
+ path: "/v1/chat/states/{type}/{id}/{name}",
1121
+ parameters: {
1122
+ type: {
1123
+ in: "path",
1124
+ type: "string",
1125
+ description: "State type",
1126
+ enum: ["conversation", "user", "bot", "integration"],
1127
+ },
1128
+ id: {
1129
+ in: "path",
1130
+ type: "string",
1131
+ description: "State id",
1132
+ },
1133
+ name: {
1134
+ in: "path",
1135
+ type: "string",
1136
+ description: "State name",
1137
+ },
1138
+ },
1139
+ requestBody: {
1140
+ description: "State content",
1141
+ schema: {
1142
+ type: "object",
1143
+ properties: {
1144
+ payload: {
1145
+ type: "object",
1146
+ additionalProperties: true,
1147
+ description:
1148
+ "Payload is the content of the state defined by your bot.",
1149
+ },
1150
+ },
1151
+ required: ["payload"],
1152
+ title: "patchStateBody",
1153
+ additionalProperties: false,
1154
+ },
1155
+ },
1156
+ section: "state",
1157
+ response: {
1158
+ description:
1159
+ "Returns the updated [State](#schema_state) object if a valid identifier was provided. Returns an [an error](#errors) otherwise",
1160
+ schema: {
1161
+ type: "object",
1162
+ properties: {
1163
+ state: {
1164
+ $ref: "#/components/schemas/State",
1165
+ },
1166
+ },
1167
+ required: ["state"],
1168
+ title: "patchStateResponse",
1169
+ additionalProperties: false,
1170
+ },
1171
+ },
1172
+ },
1173
+ callAction: {
1174
+ name: "callAction",
1175
+ description: "Call an action",
1176
+ method: "post",
1177
+ path: "/v1/chat/actions",
1178
+ section: "action",
1179
+ requestBody: {
1180
+ description: "Action payload",
1181
+ schema: {
1182
+ type: "object",
1183
+ properties: {
1184
+ type: {
1185
+ type: "string",
1186
+ description: "Type of the action",
1187
+ },
1188
+ input: {
1189
+ type: "object",
1190
+ additionalProperties: true,
1191
+ description: "Input of the action",
1192
+ },
1193
+ },
1194
+ required: ["type", "input"],
1195
+ title: "callActionBody",
1196
+ additionalProperties: false,
1197
+ },
1198
+ },
1199
+ response: {
1200
+ description: "Action payload",
1201
+ schema: {
1202
+ type: "object",
1203
+ properties: {
1204
+ output: {
1205
+ type: "object",
1206
+ additionalProperties: true,
1207
+ description: "Input of the action",
1208
+ },
1209
+ },
1210
+ required: ["output"],
1211
+ title: "callActionResponse",
1212
+ additionalProperties: false,
1213
+ },
1214
+ },
1215
+ parameters: {},
1216
+ },
1217
+ configureIntegration: {
1218
+ name: "configureIntegration",
1219
+ description: "An integration can call this endpoint to configure itself",
1220
+ method: "post",
1221
+ path: "/v1/chat/integrations/configure",
1222
+ requestBody: {
1223
+ description: "Configuration of the integration",
1224
+ schema: {
1225
+ type: "object",
1226
+ properties: {
1227
+ identifier: {
1228
+ type: "string",
1229
+ description:
1230
+ "Unique identifier of the integration that was installed on the bot",
1231
+ },
1232
+ },
1233
+ required: ["identifier"],
1234
+ title: "configureIntegrationBody",
1235
+ additionalProperties: false,
1236
+ },
1237
+ },
1238
+ response: {
1239
+ description: "Configuration of the integration",
1240
+ schema: {
1241
+ type: "object",
1242
+ title: "configureIntegrationResponse",
1243
+ additionalProperties: false,
1244
+ },
1245
+ },
1246
+ parameters: {},
1247
+ },
1248
+ listPublicIntegrations: {
1249
+ name: "listPublicIntegrations",
1250
+ description: "List public integration",
1251
+ method: "get",
1252
+ section: "hub",
1253
+ path: "/v1/admin/hub/integrations",
1254
+ disableDefaultParameters: {
1255
+ "x-workspace-id": true,
1256
+ },
1257
+ parameters: {
1258
+ nextToken: {
1259
+ in: "query",
1260
+ description:
1261
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
1262
+ type: "string",
1263
+ },
1264
+ name: {
1265
+ type: "string",
1266
+ description: "Integration Name",
1267
+ in: "query",
1268
+ },
1269
+ version: {
1270
+ type: "string",
1271
+ description:
1272
+ 'Integration version. Either a semver version or tag "latest"',
1273
+ in: "query",
1274
+ },
1275
+ },
1276
+ response: {
1277
+ description: "Success",
1278
+ schema: {
1279
+ type: "object",
1280
+ properties: {
1281
+ integrations: {
1282
+ type: "array",
1283
+ items: {
1284
+ type: "object",
1285
+ properties: {
1286
+ id: {
1287
+ type: "string",
1288
+ description: "Id of the [Integration](#schema_integration)",
1289
+ },
1290
+ name: {
1291
+ type: "string",
1292
+ description:
1293
+ "Name of the [Integration](#schema_integration)",
1294
+ },
1295
+ version: {
1296
+ type: "string",
1297
+ description:
1298
+ "Version of the [Integration](#schema_integration)",
1299
+ },
1300
+ createdAt: {
1301
+ type: "string",
1302
+ format: "date-time",
1303
+ description:
1304
+ "Creation date of the [Integration](#schema_integration) in the ISO 8601 format",
1305
+ },
1306
+ updatedAt: {
1307
+ type: "string",
1308
+ format: "date-time",
1309
+ description:
1310
+ "Updating date of the [Integration](#schema_integration) in the ISO 8601 format",
1311
+ },
1312
+ title: {
1313
+ type: "string",
1314
+ minLength: 1,
1315
+ maxLength: 64,
1316
+ description:
1317
+ "Title of the integration. This is the name that will be displayed in the UI",
1318
+ },
1319
+ description: {
1320
+ type: "string",
1321
+ maxLength: 256,
1322
+ description:
1323
+ "Description of the integration. This is the description that will be displayed in the UI",
1324
+ },
1325
+ iconUrl: {
1326
+ type: "string",
1327
+ description:
1328
+ "URL of the icon of the integration. This is the icon that will be displayed in the UI",
1329
+ },
1330
+ },
1331
+ required: [
1332
+ "id",
1333
+ "name",
1334
+ "version",
1335
+ "createdAt",
1336
+ "updatedAt",
1337
+ "title",
1338
+ "description",
1339
+ "iconUrl",
1340
+ ],
1341
+ },
1342
+ },
1343
+ meta: {
1344
+ type: "object",
1345
+ properties: {
1346
+ nextToken: {
1347
+ type: "string",
1348
+ description:
1349
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
1350
+ },
1351
+ },
1352
+ additionalProperties: false,
1353
+ },
1354
+ },
1355
+ required: ["integrations", "meta"],
1356
+ title: "listPublicIntegrationsResponse",
1357
+ additionalProperties: false,
1358
+ },
1359
+ },
1360
+ },
1361
+ getPublicIntegrationById: {
1362
+ name: "getPublicIntegrationById",
1363
+ description: "Get public integration by Id",
1364
+ method: "get",
1365
+ section: "hub",
1366
+ path: "/v1/admin/hub/integrations/{id}",
1367
+ disableDefaultParameters: {
1368
+ "x-workspace-id": true,
1369
+ },
1370
+ parameters: {
1371
+ id: {
1372
+ type: "string",
1373
+ description: "Integration Id",
1374
+ in: "path",
1375
+ },
1376
+ },
1377
+ response: {
1378
+ description: "Success",
1379
+ schema: {
1380
+ type: "object",
1381
+ properties: {
1382
+ integration: {
1383
+ $ref: "#/components/schemas/Integration",
1384
+ },
1385
+ },
1386
+ required: ["integration"],
1387
+ title: "getPublicIntegrationByIdResponse",
1388
+ additionalProperties: false,
1389
+ },
1390
+ },
1391
+ },
1392
+ getPublicIntegration: {
1393
+ name: "getPublicIntegration",
1394
+ description: "Get public integration by name and version",
1395
+ method: "get",
1396
+ section: "hub",
1397
+ path: "/v1/admin/hub/integrations/{name}/{version}",
1398
+ disableDefaultParameters: {
1399
+ "x-workspace-id": true,
1400
+ },
1401
+ parameters: {
1402
+ name: {
1403
+ type: "string",
1404
+ description: "Integration Name",
1405
+ in: "path",
1406
+ },
1407
+ version: {
1408
+ type: "string",
1409
+ description:
1410
+ 'Integration version. Either a semver version or tag "latest"',
1411
+ in: "path",
1412
+ },
1413
+ },
1414
+ response: {
1415
+ description: "Success",
1416
+ schema: {
1417
+ type: "object",
1418
+ properties: {
1419
+ integration: {
1420
+ $ref: "#/components/schemas/Integration",
1421
+ },
1422
+ },
1423
+ required: ["integration"],
1424
+ title: "getPublicIntegrationResponse",
1425
+ additionalProperties: false,
1426
+ },
1427
+ },
1428
+ },
1429
+ createBot: {
1430
+ name: "createBot",
1431
+ description: "Create bot",
1432
+ method: "post",
1433
+ section: "bot",
1434
+ path: "/v1/admin/bots",
1435
+ requestBody: {
1436
+ description: "Bot metadata",
1437
+ schema: {
1438
+ type: "object",
1439
+ properties: {
1440
+ states: {
1441
+ type: "object",
1442
+ additionalProperties: {
1443
+ type: "object",
1444
+ properties: {
1445
+ type: {
1446
+ type: "string",
1447
+ enum: ["conversation", "user", "bot"],
1448
+ description:
1449
+ "Type of the [State](#schema_state) (`conversation`, `user` or `bot`)",
1450
+ },
1451
+ schema: {
1452
+ type: "object",
1453
+ additionalProperties: true,
1454
+ description:
1455
+ "Schema of the [State](#schema_state) in the `JSON schema` format. This `JSON schema` is going to be used for validating the state data.",
1456
+ },
1457
+ expiry: {
1458
+ type: "number",
1459
+ minimum: 1,
1460
+ description:
1461
+ "Expiry of the [State](#schema_state) in milliseconds. The state will expire if it is idle for the configured value. By default, a state doesn't expire.",
1462
+ },
1463
+ },
1464
+ required: ["type", "schema"],
1465
+ additionalProperties: false,
1466
+ },
1467
+ description: "A mapping of states to their definition",
1468
+ },
1469
+ tags: {
1470
+ type: "object",
1471
+ properties: {
1472
+ messages: {
1473
+ default: [],
1474
+ type: "array",
1475
+ items: {
1476
+ type: "string",
1477
+ },
1478
+ },
1479
+ conversations: {
1480
+ default: [],
1481
+ type: "array",
1482
+ items: {
1483
+ type: "string",
1484
+ },
1485
+ },
1486
+ users: {
1487
+ default: [],
1488
+ type: "array",
1489
+ items: {
1490
+ type: "string",
1491
+ },
1492
+ },
1493
+ },
1494
+ description: "Tags of the bot",
1495
+ additionalProperties: false,
1496
+ },
1497
+ events: {
1498
+ type: "object",
1499
+ additionalProperties: {
1500
+ type: "object",
1501
+ properties: {
1502
+ schema: {
1503
+ type: "object",
1504
+ additionalProperties: true,
1505
+ },
1506
+ },
1507
+ required: ["schema"],
1508
+ description: "Event schema",
1509
+ additionalProperties: false,
1510
+ },
1511
+ description: "Events definition",
1512
+ },
1513
+ recurringEvents: {
1514
+ type: "object",
1515
+ additionalProperties: {
1516
+ type: "object",
1517
+ properties: {
1518
+ schedule: {
1519
+ type: "object",
1520
+ properties: {
1521
+ cron: {
1522
+ type: "string",
1523
+ },
1524
+ },
1525
+ required: ["cron"],
1526
+ additionalProperties: false,
1527
+ },
1528
+ type: {
1529
+ type: "string",
1530
+ },
1531
+ payload: {
1532
+ type: "object",
1533
+ additionalProperties: true,
1534
+ },
1535
+ },
1536
+ required: ["schedule", "type", "payload"],
1537
+ additionalProperties: false,
1538
+ },
1539
+ description: "Recurring events",
1540
+ },
1541
+ configuration: {
1542
+ type: "object",
1543
+ properties: {
1544
+ data: {
1545
+ type: "object",
1546
+ additionalProperties: true,
1547
+ description: "Configuration data",
1548
+ },
1549
+ schema: {
1550
+ type: "object",
1551
+ additionalProperties: true,
1552
+ description:
1553
+ "Schema of the configuration in the `JSON schema` format. The configuration data is validated against this `JSON schema`.",
1554
+ },
1555
+ },
1556
+ additionalProperties: false,
1557
+ },
1558
+ code: {
1559
+ type: "string",
1560
+ description: "JavaScript code of the bot",
1561
+ },
1562
+ name: {
1563
+ type: "string",
1564
+ minLength: 1,
1565
+ description:
1566
+ "Optional name for the bot, if not provided will be auto-generated",
1567
+ },
1568
+ medias: {
1569
+ type: "array",
1570
+ items: {
1571
+ type: "object",
1572
+ properties: {
1573
+ url: {
1574
+ type: "string",
1575
+ },
1576
+ name: {
1577
+ type: "string",
1578
+ },
1579
+ },
1580
+ required: ["url", "name"],
1581
+ },
1582
+ description: "Media files associated with the [Bot](#schema_bot)",
1583
+ },
1584
+ url: {
1585
+ type: "string",
1586
+ description:
1587
+ "URL of the [Bot](#schema_bot); Only available for dev bots",
1588
+ },
1589
+ dev: {
1590
+ type: "boolean",
1591
+ description:
1592
+ "Indicates if the [Bot](#schema_bot) is a development bot; Development bots run locally and can install dev integrations",
1593
+ },
1594
+ },
1595
+ title: "createBotBody",
1596
+ additionalProperties: false,
1597
+ },
1598
+ },
1599
+ response: {
1600
+ description: "Success",
1601
+ schema: {
1602
+ type: "object",
1603
+ properties: {
1604
+ bot: {
1605
+ $ref: "#/components/schemas/Bot",
1606
+ },
1607
+ },
1608
+ required: ["bot"],
1609
+ title: "createBotResponse",
1610
+ additionalProperties: false,
1611
+ },
1612
+ },
1613
+ parameters: {},
1614
+ },
1615
+ updateBot: {
1616
+ name: "updateBot",
1617
+ description: "Update bot",
1618
+ method: "put",
1619
+ section: "bot",
1620
+ path: "/v1/admin/bots/{id}",
1621
+ parameters: {
1622
+ id: {
1623
+ type: "string",
1624
+ description: "Bot ID",
1625
+ in: "path",
1626
+ },
1627
+ },
1628
+ requestBody: {
1629
+ description: "Bot metadata",
1630
+ schema: {
1631
+ type: "object",
1632
+ properties: {
1633
+ url: {
1634
+ type: "string",
1635
+ description:
1636
+ "URL of the [Bot](#schema_bot); Only available for dev bots",
1637
+ },
1638
+ authentication: {
1639
+ type: "string",
1640
+ enum: ["iam"],
1641
+ description:
1642
+ "Type of the [Bot](#schema_bot) authentication (`iam`)",
1643
+ },
1644
+ states: {
1645
+ type: "object",
1646
+ additionalProperties: {
1647
+ type: "object",
1648
+ properties: {
1649
+ type: {
1650
+ type: "string",
1651
+ enum: ["conversation", "user", "bot"],
1652
+ description:
1653
+ "Type of the [State](#schema_state) (`conversation`, `user` or `bot`)",
1654
+ },
1655
+ schema: {
1656
+ type: "object",
1657
+ additionalProperties: true,
1658
+ description:
1659
+ "Schema of the [State](#schema_state) in the `JSON schema` format. This `JSON schema` is going to be used for validating the state data.",
1660
+ },
1661
+ expiry: {
1662
+ type: "number",
1663
+ minimum: 1,
1664
+ description:
1665
+ "Expiry of the [State](#schema_state) in milliseconds. The state will expire if it is idle for the configured value. By default, a state doesn't expire.",
1666
+ },
1667
+ },
1668
+ required: ["type", "schema"],
1669
+ additionalProperties: false,
1670
+ },
1671
+ description: "A mapping of states to their definition",
1672
+ },
1673
+ tags: {
1674
+ type: "object",
1675
+ properties: {
1676
+ messages: {
1677
+ default: [],
1678
+ type: "array",
1679
+ items: {
1680
+ type: "string",
1681
+ },
1682
+ },
1683
+ conversations: {
1684
+ default: [],
1685
+ type: "array",
1686
+ items: {
1687
+ type: "string",
1688
+ },
1689
+ },
1690
+ users: {
1691
+ default: [],
1692
+ type: "array",
1693
+ items: {
1694
+ type: "string",
1695
+ },
1696
+ },
1697
+ },
1698
+ description: "Tags of the bot",
1699
+ additionalProperties: false,
1700
+ },
1701
+ events: {
1702
+ type: "object",
1703
+ additionalProperties: {
1704
+ type: "object",
1705
+ properties: {
1706
+ schema: {
1707
+ type: "object",
1708
+ additionalProperties: true,
1709
+ },
1710
+ },
1711
+ required: ["schema"],
1712
+ description: "Event schema",
1713
+ additionalProperties: false,
1714
+ },
1715
+ description: "Events definition",
1716
+ },
1717
+ recurringEvents: {
1718
+ type: "object",
1719
+ additionalProperties: {
1720
+ type: "object",
1721
+ properties: {
1722
+ schedule: {
1723
+ type: "object",
1724
+ properties: {
1725
+ cron: {
1726
+ type: "string",
1727
+ },
1728
+ },
1729
+ required: ["cron"],
1730
+ additionalProperties: false,
1731
+ },
1732
+ type: {
1733
+ type: "string",
1734
+ },
1735
+ payload: {
1736
+ type: "object",
1737
+ additionalProperties: true,
1738
+ },
1739
+ },
1740
+ required: ["schedule", "type", "payload"],
1741
+ additionalProperties: false,
1742
+ },
1743
+ description: "Recurring events",
1744
+ },
1745
+ configuration: {
1746
+ type: "object",
1747
+ properties: {
1748
+ data: {
1749
+ type: "object",
1750
+ additionalProperties: true,
1751
+ description: "Configuration data",
1752
+ },
1753
+ schema: {
1754
+ type: "object",
1755
+ additionalProperties: true,
1756
+ description:
1757
+ "Schema of the configuration in the `JSON schema` format. The configuration data is validated against this `JSON schema`.",
1758
+ },
1759
+ },
1760
+ additionalProperties: false,
1761
+ },
1762
+ blocked: {
1763
+ type: "boolean",
1764
+ },
1765
+ integrations: {
1766
+ type: "object",
1767
+ additionalProperties: {
1768
+ type: "object",
1769
+ properties: {
1770
+ enabled: {
1771
+ type: "boolean",
1772
+ },
1773
+ configuration: {
1774
+ type: "object",
1775
+ additionalProperties: true,
1776
+ },
1777
+ },
1778
+ required: ["enabled", "configuration"],
1779
+ nullable: true,
1780
+ additionalProperties: false,
1781
+ },
1782
+ },
1783
+ code: {
1784
+ type: "string",
1785
+ description: "JavaScript code of the bot",
1786
+ },
1787
+ name: {
1788
+ type: "string",
1789
+ minLength: 1,
1790
+ description:
1791
+ "Optional name for the bot, if not provided will be auto-generated",
1792
+ },
1793
+ medias: {
1794
+ type: "array",
1795
+ items: {
1796
+ type: "object",
1797
+ properties: {
1798
+ url: {
1799
+ type: "string",
1800
+ },
1801
+ name: {
1802
+ type: "string",
1803
+ },
1804
+ },
1805
+ required: ["url", "name"],
1806
+ },
1807
+ description: "Media files associated with the [Bot](#schema_bot)",
1808
+ },
1809
+ },
1810
+ title: "updateBotBody",
1811
+ additionalProperties: false,
1812
+ },
1813
+ },
1814
+ response: {
1815
+ description: "Success",
1816
+ schema: {
1817
+ type: "object",
1818
+ properties: {
1819
+ bot: {
1820
+ $ref: "#/components/schemas/Bot",
1821
+ },
1822
+ },
1823
+ required: ["bot"],
1824
+ title: "updateBotResponse",
1825
+ additionalProperties: false,
1826
+ },
1827
+ },
1828
+ },
1829
+ transferBot: {
1830
+ name: "transferBot",
1831
+ description:
1832
+ "Transfer bot to another workspace. You need to be a Manager member of the workspace the bot currently belongs to and have permission to create bots in the target workspace.",
1833
+ method: "post",
1834
+ section: "bot",
1835
+ path: "/v1/admin/bots/{id}/transfer",
1836
+ parameters: {
1837
+ id: {
1838
+ type: "string",
1839
+ description: "Bot ID",
1840
+ in: "path",
1841
+ },
1842
+ },
1843
+ requestBody: {
1844
+ description: "Bot transfer request",
1845
+ schema: {
1846
+ type: "object",
1847
+ properties: {
1848
+ targetWorkspaceId: {
1849
+ type: "string",
1850
+ format: "uuid",
1851
+ description:
1852
+ "The ID of the workspace you want to transfer the bot to.",
1853
+ },
1854
+ },
1855
+ required: ["targetWorkspaceId"],
1856
+ title: "transferBotBody",
1857
+ additionalProperties: false,
1858
+ },
1859
+ },
1860
+ response: {
1861
+ description: "Success",
1862
+ schema: {
1863
+ type: "object",
1864
+ title: "transferBotResponse",
1865
+ additionalProperties: false,
1866
+ },
1867
+ },
1868
+ },
1869
+ listBots: {
1870
+ name: "listBots",
1871
+ description: "List bots",
1872
+ method: "get",
1873
+ path: "/v1/admin/bots",
1874
+ parameters: {
1875
+ nextToken: {
1876
+ in: "query",
1877
+ description:
1878
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
1879
+ type: "string",
1880
+ },
1881
+ },
1882
+ section: "bot",
1883
+ response: {
1884
+ description: "Success",
1885
+ schema: {
1886
+ type: "object",
1887
+ properties: {
1888
+ bots: {
1889
+ type: "array",
1890
+ items: {
1891
+ type: "object",
1892
+ properties: {
1893
+ id: {
1894
+ type: "string",
1895
+ format: "uuid",
1896
+ description: "Id of the [Bot](#schema_bot)",
1897
+ },
1898
+ createdAt: {
1899
+ type: "string",
1900
+ format: "date-time",
1901
+ description:
1902
+ "Creation date of the [Bot](#schema_bot) in the ISO 8601 format",
1903
+ },
1904
+ updatedAt: {
1905
+ type: "string",
1906
+ format: "date-time",
1907
+ description:
1908
+ "Updating date of the [Bot](#schema_bot) in the ISO 8601 format",
1909
+ },
1910
+ name: {
1911
+ type: "string",
1912
+ },
1913
+ deployedAt: {
1914
+ type: "string",
1915
+ format: "date-time",
1916
+ },
1917
+ },
1918
+ required: ["id", "createdAt", "updatedAt", "name"],
1919
+ },
1920
+ },
1921
+ meta: {
1922
+ type: "object",
1923
+ properties: {
1924
+ nextToken: {
1925
+ type: "string",
1926
+ description:
1927
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
1928
+ },
1929
+ },
1930
+ additionalProperties: false,
1931
+ },
1932
+ },
1933
+ required: ["bots", "meta"],
1934
+ title: "listBotsResponse",
1935
+ additionalProperties: false,
1936
+ },
1937
+ },
1938
+ },
1939
+ getBot: {
1940
+ name: "getBot",
1941
+ description: "Get bot details",
1942
+ method: "get",
1943
+ section: "bot",
1944
+ path: "/v1/admin/bots/{id}",
1945
+ parameters: {
1946
+ id: {
1947
+ type: "string",
1948
+ description: "Bot ID",
1949
+ in: "path",
1950
+ },
1951
+ },
1952
+ response: {
1953
+ description: "Success",
1954
+ schema: {
1955
+ type: "object",
1956
+ properties: {
1957
+ bot: {
1958
+ $ref: "#/components/schemas/Bot",
1959
+ },
1960
+ },
1961
+ required: ["bot"],
1962
+ title: "getBotResponse",
1963
+ additionalProperties: false,
1964
+ },
1965
+ },
1966
+ },
1967
+ deleteBot: {
1968
+ name: "deleteBot",
1969
+ description: "Delete bot",
1970
+ method: "delete",
1971
+ path: "/v1/admin/bots/{id}",
1972
+ section: "bot",
1973
+ parameters: {
1974
+ id: {
1975
+ type: "string",
1976
+ description: "Bot ID",
1977
+ in: "path",
1978
+ },
1979
+ },
1980
+ response: {
1981
+ description: "Success",
1982
+ schema: {
1983
+ type: "object",
1984
+ title: "deleteBotResponse",
1985
+ additionalProperties: false,
1986
+ },
1987
+ },
1988
+ },
1989
+ getBotLogs: {
1990
+ name: "getBotLogs",
1991
+ description: "Get bot logs",
1992
+ method: "get",
1993
+ path: "/v1/admin/bots/{id}/logs",
1994
+ section: "bot",
1995
+ parameters: {
1996
+ id: {
1997
+ type: "string",
1998
+ description: "Bot ID",
1999
+ in: "path",
2000
+ },
2001
+ },
2002
+ response: {
2003
+ description: "Success",
2004
+ schema: {
2005
+ type: "object",
2006
+ properties: {
2007
+ logs: {
2008
+ type: "array",
2009
+ items: {
2010
+ type: "object",
2011
+ properties: {
2012
+ timestamp: {
2013
+ type: "string",
2014
+ },
2015
+ level: {
2016
+ type: "string",
2017
+ },
2018
+ message: {
2019
+ type: "string",
2020
+ },
2021
+ },
2022
+ required: ["timestamp", "level", "message"],
2023
+ },
2024
+ },
2025
+ },
2026
+ required: ["logs"],
2027
+ title: "getBotLogsResponse",
2028
+ additionalProperties: false,
2029
+ },
2030
+ },
2031
+ },
2032
+ getBotWebchat: {
2033
+ name: "getBotWebchat",
2034
+ description: "Get the webchat code/URL for a bot",
2035
+ method: "get",
2036
+ path: "/v1/admin/bots/{id}/webchat",
2037
+ section: "bot",
2038
+ parameters: {
2039
+ id: {
2040
+ type: "string",
2041
+ description: "Bot ID",
2042
+ in: "path",
2043
+ },
2044
+ type: {
2045
+ in: "query",
2046
+ description: "type of script to get",
2047
+ type: "string",
2048
+ required: true,
2049
+ enum: ["preconfigured", "configurable", "fullscreen", "sharableUrl"],
2050
+ },
2051
+ },
2052
+ response: {
2053
+ description: "Success",
2054
+ schema: {
2055
+ type: "object",
2056
+ properties: {
2057
+ code: {
2058
+ type: "string",
2059
+ },
2060
+ },
2061
+ required: ["code"],
2062
+ title: "getBotWebchatResponse",
2063
+ additionalProperties: false,
2064
+ },
2065
+ },
2066
+ },
2067
+ getBotAnalytics: {
2068
+ name: "getBotAnalytics",
2069
+ description: "Get bot analytics",
2070
+ method: "get",
2071
+ path: "/v1/admin/bots/{id}/analytics",
2072
+ section: "bot",
2073
+ parameters: {
2074
+ id: {
2075
+ type: "string",
2076
+ description: "Bot ID",
2077
+ in: "path",
2078
+ },
2079
+ startDate: {
2080
+ in: "query",
2081
+ description: "Start date/time (inclusive)",
2082
+ type: "string",
2083
+ required: true,
2084
+ },
2085
+ endDate: {
2086
+ in: "query",
2087
+ description: "End date/time (exclusive)",
2088
+ type: "string",
2089
+ required: true,
2090
+ },
2091
+ },
2092
+ response: {
2093
+ description: "Success",
2094
+ schema: {
2095
+ type: "object",
2096
+ properties: {
2097
+ records: {
2098
+ type: "array",
2099
+ items: {
2100
+ type: "object",
2101
+ properties: {
2102
+ startDateTimeUtc: {
2103
+ type: "string",
2104
+ description:
2105
+ "ISO 8601 date string of the beginning (inclusive) of the period",
2106
+ },
2107
+ endDateTimeUtc: {
2108
+ type: "string",
2109
+ description:
2110
+ "ISO 8601 date string of the end (exclusive) of the period",
2111
+ },
2112
+ returningUsers: {
2113
+ type: "number",
2114
+ },
2115
+ newUsers: {
2116
+ type: "number",
2117
+ },
2118
+ sessions: {
2119
+ type: "number",
2120
+ },
2121
+ messages: {
2122
+ type: "number",
2123
+ },
2124
+ },
2125
+ required: [
2126
+ "startDateTimeUtc",
2127
+ "endDateTimeUtc",
2128
+ "returningUsers",
2129
+ "newUsers",
2130
+ "sessions",
2131
+ "messages",
2132
+ ],
2133
+ },
2134
+ },
2135
+ },
2136
+ required: ["records"],
2137
+ title: "getBotAnalyticsResponse",
2138
+ additionalProperties: false,
2139
+ },
2140
+ },
2141
+ },
2142
+ getWorkspace: {
2143
+ name: "getWorkspace",
2144
+ description: "Get workspace details",
2145
+ method: "get",
2146
+ path: "/v1/admin/workspaces/{id}",
2147
+ disableDefaultParameters: {
2148
+ "x-workspace-id": true,
2149
+ },
2150
+ parameters: {
2151
+ id: {
2152
+ type: "string",
2153
+ description: "Workspace ID",
2154
+ in: "path",
2155
+ },
2156
+ },
2157
+ response: {
2158
+ description: "Success",
2159
+ schema: {
2160
+ type: "object",
2161
+ properties: {
2162
+ id: {
2163
+ type: "string",
2164
+ },
2165
+ name: {
2166
+ type: "string",
2167
+ },
2168
+ ownerId: {
2169
+ type: "string",
2170
+ },
2171
+ createdAt: {
2172
+ type: "string",
2173
+ },
2174
+ updatedAt: {
2175
+ type: "string",
2176
+ },
2177
+ accountType: {
2178
+ type: "string",
2179
+ },
2180
+ blocked: {
2181
+ type: "boolean",
2182
+ },
2183
+ spendingLimit: {
2184
+ type: "number",
2185
+ },
2186
+ },
2187
+ required: [
2188
+ "id",
2189
+ "name",
2190
+ "ownerId",
2191
+ "createdAt",
2192
+ "updatedAt",
2193
+ "accountType",
2194
+ "blocked",
2195
+ "spendingLimit",
2196
+ ],
2197
+ title: "getWorkspaceResponse",
2198
+ additionalProperties: false,
2199
+ },
2200
+ },
2201
+ },
2202
+ listWorkspaces: {
2203
+ name: "listWorkspaces",
2204
+ description: "List workspaces the user has access to",
2205
+ method: "get",
2206
+ path: "/v1/admin/workspaces",
2207
+ disableDefaultParameters: {
2208
+ "x-workspace-id": true,
2209
+ },
2210
+ parameters: {
2211
+ nextToken: {
2212
+ in: "query",
2213
+ description:
2214
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
2215
+ type: "string",
2216
+ },
2217
+ },
2218
+ response: {
2219
+ description: "Success",
2220
+ schema: {
2221
+ type: "object",
2222
+ properties: {
2223
+ workspaces: {
2224
+ type: "array",
2225
+ items: {
2226
+ type: "object",
2227
+ properties: {
2228
+ id: {
2229
+ type: "string",
2230
+ },
2231
+ name: {
2232
+ type: "string",
2233
+ },
2234
+ ownerId: {
2235
+ type: "string",
2236
+ },
2237
+ createdAt: {
2238
+ type: "string",
2239
+ },
2240
+ updatedAt: {
2241
+ type: "string",
2242
+ },
2243
+ },
2244
+ required: ["id", "name", "ownerId", "createdAt", "updatedAt"],
2245
+ },
2246
+ },
2247
+ meta: {
2248
+ type: "object",
2249
+ properties: {
2250
+ nextToken: {
2251
+ type: "string",
2252
+ description:
2253
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
2254
+ },
2255
+ },
2256
+ additionalProperties: false,
2257
+ },
2258
+ },
2259
+ required: ["workspaces", "meta"],
2260
+ title: "listWorkspacesResponse",
2261
+ additionalProperties: false,
2262
+ },
2263
+ },
2264
+ },
2265
+ createIntegration: {
2266
+ name: "createIntegration",
2267
+ description: "Create integration",
2268
+ method: "post",
2269
+ section: "integration",
2270
+ path: "/v1/admin/integrations",
2271
+ requestBody: {
2272
+ description: "Integration",
2273
+ schema: {
2274
+ type: "object",
2275
+ properties: {
2276
+ name: {
2277
+ type: "string",
2278
+ description: "Name of the [Integration](#schema_integration)",
2279
+ },
2280
+ version: {
2281
+ type: "string",
2282
+ description: "Version of the [Integration](#schema_integration)",
2283
+ },
2284
+ tags: {
2285
+ type: "object",
2286
+ properties: {
2287
+ users: {
2288
+ default: [],
2289
+ type: "array",
2290
+ items: {
2291
+ type: "string",
2292
+ },
2293
+ },
2294
+ },
2295
+ description: "Tags of the [Integration](#schema_integration)",
2296
+ additionalProperties: false,
2297
+ },
2298
+ channels: {
2299
+ type: "object",
2300
+ additionalProperties: {
2301
+ type: "object",
2302
+ properties: {
2303
+ tags: {
2304
+ type: "object",
2305
+ properties: {
2306
+ messages: {
2307
+ default: [],
2308
+ type: "array",
2309
+ items: {
2310
+ type: "string",
2311
+ },
2312
+ },
2313
+ conversations: {
2314
+ default: [],
2315
+ type: "array",
2316
+ items: {
2317
+ type: "string",
2318
+ },
2319
+ },
2320
+ },
2321
+ additionalProperties: false,
2322
+ },
2323
+ messages: {
2324
+ type: "object",
2325
+ additionalProperties: {
2326
+ type: "object",
2327
+ properties: {
2328
+ schema: {
2329
+ type: "object",
2330
+ additionalProperties: true,
2331
+ },
2332
+ },
2333
+ required: ["schema"],
2334
+ additionalProperties: false,
2335
+ },
2336
+ },
2337
+ conversation: {
2338
+ type: "object",
2339
+ properties: {
2340
+ creation: {
2341
+ type: "object",
2342
+ properties: {
2343
+ enabled: {
2344
+ type: "boolean",
2345
+ description: "Enable conversation creation",
2346
+ },
2347
+ requiredTags: {
2348
+ type: "array",
2349
+ items: {
2350
+ type: "string",
2351
+ },
2352
+ description:
2353
+ "The list of tags that are required to be specified when calling the API directly to create a conversation.",
2354
+ },
2355
+ },
2356
+ required: ["enabled", "requiredTags"],
2357
+ description:
2358
+ "The conversation creation setting determines how to create a conversation through the API directly. The integration will have to implement the `createConversation` functionality to support this setting.",
2359
+ additionalProperties: false,
2360
+ },
2361
+ },
2362
+ required: ["creation"],
2363
+ additionalProperties: false,
2364
+ },
2365
+ },
2366
+ required: ["messages"],
2367
+ additionalProperties: false,
2368
+ },
2369
+ description: "Channels definition",
2370
+ },
2371
+ states: {
2372
+ type: "object",
2373
+ additionalProperties: {
2374
+ type: "object",
2375
+ properties: {
2376
+ type: {
2377
+ type: "string",
2378
+ enum: ["conversation", "user", "integration"],
2379
+ description:
2380
+ "Type of the [State](#schema_state) (`conversation`, `user` or `integration`)",
2381
+ },
2382
+ schema: {
2383
+ type: "object",
2384
+ additionalProperties: true,
2385
+ description:
2386
+ "Schema of the [State](#schema_state) in the `JSON schema` format. This `JSON schema` is going to be used for validating the state data.",
2387
+ },
2388
+ },
2389
+ required: ["type", "schema"],
2390
+ additionalProperties: false,
2391
+ },
2392
+ description: "States definition",
2393
+ },
2394
+ configuration: {
2395
+ type: "object",
2396
+ properties: {
2397
+ schema: {
2398
+ type: "object",
2399
+ additionalProperties: true,
2400
+ description: "Schema for the configuration",
2401
+ },
2402
+ },
2403
+ required: ["schema"],
2404
+ description: "Configuration definition",
2405
+ additionalProperties: false,
2406
+ },
2407
+ events: {
2408
+ type: "object",
2409
+ additionalProperties: {
2410
+ type: "object",
2411
+ properties: {
2412
+ schema: {
2413
+ type: "object",
2414
+ additionalProperties: true,
2415
+ },
2416
+ },
2417
+ required: ["schema"],
2418
+ description: "Event schema",
2419
+ additionalProperties: false,
2420
+ },
2421
+ description: "Events definition",
2422
+ },
2423
+ actions: {
2424
+ type: "object",
2425
+ additionalProperties: {
2426
+ type: "object",
2427
+ properties: {
2428
+ input: {
2429
+ type: "object",
2430
+ properties: {
2431
+ schema: {
2432
+ type: "object",
2433
+ additionalProperties: true,
2434
+ },
2435
+ },
2436
+ required: ["schema"],
2437
+ additionalProperties: false,
2438
+ },
2439
+ output: {
2440
+ type: "object",
2441
+ properties: {
2442
+ schema: {
2443
+ type: "object",
2444
+ additionalProperties: true,
2445
+ },
2446
+ },
2447
+ required: ["schema"],
2448
+ additionalProperties: false,
2449
+ },
2450
+ },
2451
+ required: ["input", "output"],
2452
+ additionalProperties: false,
2453
+ },
2454
+ description: "Action definition",
2455
+ },
2456
+ user: {
2457
+ type: "object",
2458
+ properties: {
2459
+ creation: {
2460
+ type: "object",
2461
+ properties: {
2462
+ enabled: {
2463
+ type: "boolean",
2464
+ description: "Enable user creation",
2465
+ },
2466
+ requiredTags: {
2467
+ type: "array",
2468
+ items: {
2469
+ type: "string",
2470
+ },
2471
+ description:
2472
+ "The list of tags that are required to be specified when calling the API directly to create a user.",
2473
+ },
2474
+ },
2475
+ required: ["enabled", "requiredTags"],
2476
+ description:
2477
+ "The user creation setting determines how to create a user through the API directly. The integration will have to implement the `createUser` functionality to support this setting.",
2478
+ additionalProperties: false,
2479
+ },
2480
+ },
2481
+ required: ["creation"],
2482
+ additionalProperties: false,
2483
+ },
2484
+ code: {
2485
+ type: "string",
2486
+ description: "JavaScript code of the integration",
2487
+ },
2488
+ public: {
2489
+ type: "boolean",
2490
+ description: "Whether the integration is public",
2491
+ },
2492
+ url: {
2493
+ type: "string",
2494
+ description:
2495
+ "URL of the integration; Only available for dev integrations",
2496
+ },
2497
+ dev: {
2498
+ type: "boolean",
2499
+ description:
2500
+ "Indicates if the integration is a development integration; Dev integrations run locally",
2501
+ },
2502
+ icon: {
2503
+ type: "string",
2504
+ description:
2505
+ "Base64 encoded svg of the integration icon. This icon is global to the integration each versions will be updated when this changes.",
2506
+ },
2507
+ readme: {
2508
+ type: "string",
2509
+ description:
2510
+ "Base64 encoded markdown of the integration readme. The readme is specific to each integration versions.",
2511
+ },
2512
+ title: {
2513
+ type: "string",
2514
+ minLength: 1,
2515
+ maxLength: 64,
2516
+ description:
2517
+ "Title of the integration. This is the name that will be displayed in the UI",
2518
+ },
2519
+ description: {
2520
+ type: "string",
2521
+ maxLength: 256,
2522
+ description:
2523
+ "Description of the integration. This is the description that will be displayed in the UI",
2524
+ },
2525
+ },
2526
+ required: ["name", "version"],
2527
+ title: "createIntegrationBody",
2528
+ additionalProperties: false,
2529
+ },
2530
+ },
2531
+ response: {
2532
+ description: "Success",
2533
+ schema: {
2534
+ type: "object",
2535
+ properties: {
2536
+ integration: {
2537
+ $ref: "#/components/schemas/Integration",
2538
+ },
2539
+ },
2540
+ required: ["integration"],
2541
+ title: "createIntegrationResponse",
2542
+ additionalProperties: false,
2543
+ },
2544
+ },
2545
+ parameters: {},
2546
+ },
2547
+ updateIntegration: {
2548
+ name: "updateIntegration",
2549
+ description: "Update integration",
2550
+ method: "put",
2551
+ path: "/v1/admin/integrations/{id}",
2552
+ section: "integration",
2553
+ parameters: {
2554
+ id: {
2555
+ type: "string",
2556
+ description: "Integration Id",
2557
+ in: "path",
2558
+ },
2559
+ },
2560
+ requestBody: {
2561
+ description: "Integration",
2562
+ schema: {
2563
+ type: "object",
2564
+ properties: {
2565
+ tags: {
2566
+ type: "object",
2567
+ properties: {
2568
+ users: {
2569
+ default: [],
2570
+ type: "array",
2571
+ items: {
2572
+ type: "string",
2573
+ },
2574
+ },
2575
+ },
2576
+ description: "Tags of the [Integration](#schema_integration)",
2577
+ additionalProperties: false,
2578
+ },
2579
+ channels: {
2580
+ type: "object",
2581
+ additionalProperties: {
2582
+ type: "object",
2583
+ properties: {
2584
+ tags: {
2585
+ type: "object",
2586
+ properties: {
2587
+ messages: {
2588
+ default: [],
2589
+ type: "array",
2590
+ items: {
2591
+ type: "string",
2592
+ },
2593
+ },
2594
+ conversations: {
2595
+ default: [],
2596
+ type: "array",
2597
+ items: {
2598
+ type: "string",
2599
+ },
2600
+ },
2601
+ },
2602
+ additionalProperties: false,
2603
+ },
2604
+ messages: {
2605
+ type: "object",
2606
+ additionalProperties: {
2607
+ type: "object",
2608
+ properties: {
2609
+ schema: {
2610
+ type: "object",
2611
+ additionalProperties: true,
2612
+ },
2613
+ },
2614
+ required: ["schema"],
2615
+ additionalProperties: false,
2616
+ },
2617
+ },
2618
+ conversation: {
2619
+ type: "object",
2620
+ properties: {
2621
+ creation: {
2622
+ type: "object",
2623
+ properties: {
2624
+ enabled: {
2625
+ type: "boolean",
2626
+ description: "Enable conversation creation",
2627
+ },
2628
+ requiredTags: {
2629
+ type: "array",
2630
+ items: {
2631
+ type: "string",
2632
+ },
2633
+ description:
2634
+ "The list of tags that are required to be specified when calling the API directly to create a conversation.",
2635
+ },
2636
+ },
2637
+ required: ["enabled", "requiredTags"],
2638
+ description:
2639
+ "The conversation creation setting determines how to create a conversation through the API directly. The integration will have to implement the `createConversation` functionality to support this setting.",
2640
+ additionalProperties: false,
2641
+ },
2642
+ },
2643
+ required: ["creation"],
2644
+ additionalProperties: false,
2645
+ },
2646
+ },
2647
+ required: ["messages"],
2648
+ additionalProperties: false,
2649
+ },
2650
+ description: "Channels definition",
2651
+ },
2652
+ states: {
2653
+ type: "object",
2654
+ additionalProperties: {
2655
+ type: "object",
2656
+ properties: {
2657
+ type: {
2658
+ type: "string",
2659
+ enum: ["conversation", "user", "integration"],
2660
+ description:
2661
+ "Type of the [State](#schema_state) (`conversation`, `user` or `integration`)",
2662
+ },
2663
+ schema: {
2664
+ type: "object",
2665
+ additionalProperties: true,
2666
+ description:
2667
+ "Schema of the [State](#schema_state) in the `JSON schema` format. This `JSON schema` is going to be used for validating the state data.",
2668
+ },
2669
+ },
2670
+ required: ["type", "schema"],
2671
+ additionalProperties: false,
2672
+ },
2673
+ description: "States definition",
2674
+ },
2675
+ configuration: {
2676
+ type: "object",
2677
+ properties: {
2678
+ schema: {
2679
+ type: "object",
2680
+ additionalProperties: true,
2681
+ description: "Schema for the configuration",
2682
+ },
2683
+ },
2684
+ required: ["schema"],
2685
+ description: "Configuration definition",
2686
+ additionalProperties: false,
2687
+ },
2688
+ events: {
2689
+ type: "object",
2690
+ additionalProperties: {
2691
+ type: "object",
2692
+ properties: {
2693
+ schema: {
2694
+ type: "object",
2695
+ additionalProperties: true,
2696
+ },
2697
+ },
2698
+ required: ["schema"],
2699
+ description: "Event schema",
2700
+ additionalProperties: false,
2701
+ },
2702
+ description: "Events definition",
2703
+ },
2704
+ actions: {
2705
+ type: "object",
2706
+ additionalProperties: {
2707
+ type: "object",
2708
+ properties: {
2709
+ input: {
2710
+ type: "object",
2711
+ properties: {
2712
+ schema: {
2713
+ type: "object",
2714
+ additionalProperties: true,
2715
+ },
2716
+ },
2717
+ required: ["schema"],
2718
+ additionalProperties: false,
2719
+ },
2720
+ output: {
2721
+ type: "object",
2722
+ properties: {
2723
+ schema: {
2724
+ type: "object",
2725
+ additionalProperties: true,
2726
+ },
2727
+ },
2728
+ required: ["schema"],
2729
+ additionalProperties: false,
2730
+ },
2731
+ },
2732
+ required: ["input", "output"],
2733
+ additionalProperties: false,
2734
+ },
2735
+ description: "Action definition",
2736
+ },
2737
+ user: {
2738
+ type: "object",
2739
+ properties: {
2740
+ creation: {
2741
+ type: "object",
2742
+ properties: {
2743
+ enabled: {
2744
+ type: "boolean",
2745
+ description: "Enable user creation",
2746
+ },
2747
+ requiredTags: {
2748
+ type: "array",
2749
+ items: {
2750
+ type: "string",
2751
+ },
2752
+ description:
2753
+ "The list of tags that are required to be specified when calling the API directly to create a user.",
2754
+ },
2755
+ },
2756
+ required: ["enabled", "requiredTags"],
2757
+ description:
2758
+ "The user creation setting determines how to create a user through the API directly. The integration will have to implement the `createUser` functionality to support this setting.",
2759
+ additionalProperties: false,
2760
+ },
2761
+ },
2762
+ required: ["creation"],
2763
+ additionalProperties: false,
2764
+ },
2765
+ code: {
2766
+ type: "string",
2767
+ description: "JavaScript code of the integration",
2768
+ },
2769
+ public: {
2770
+ type: "boolean",
2771
+ description: "Whether the integration is public",
2772
+ },
2773
+ url: {
2774
+ type: "string",
2775
+ description:
2776
+ "URL of the integration; Only available for dev integrations",
2777
+ },
2778
+ icon: {
2779
+ type: "string",
2780
+ description:
2781
+ "Base64 encoded svg of the integration icon. This icon is global to the integration each versions will be updated when this changes.",
2782
+ },
2783
+ readme: {
2784
+ type: "string",
2785
+ description:
2786
+ "Base64 encoded markdown of the integration readme. The readme is specific to each integration versions.",
2787
+ },
2788
+ title: {
2789
+ type: "string",
2790
+ minLength: 1,
2791
+ maxLength: 64,
2792
+ description:
2793
+ "Title of the integration. This is the name that will be displayed in the UI",
2794
+ },
2795
+ description: {
2796
+ type: "string",
2797
+ maxLength: 256,
2798
+ description:
2799
+ "Description of the integration. This is the description that will be displayed in the UI",
2800
+ },
2801
+ },
2802
+ title: "updateIntegrationBody",
2803
+ additionalProperties: false,
2804
+ },
2805
+ },
2806
+ response: {
2807
+ description: "Success",
2808
+ schema: {
2809
+ type: "object",
2810
+ properties: {
2811
+ integration: {
2812
+ $ref: "#/components/schemas/Integration",
2813
+ },
2814
+ },
2815
+ required: ["integration"],
2816
+ title: "updateIntegrationResponse",
2817
+ additionalProperties: false,
2818
+ },
2819
+ },
2820
+ },
2821
+ listIntegrations: {
2822
+ name: "listIntegrations",
2823
+ description: "List integrations",
2824
+ method: "get",
2825
+ section: "integration",
2826
+ path: "/v1/admin/integrations",
2827
+ parameters: {
2828
+ nextToken: {
2829
+ in: "query",
2830
+ description:
2831
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
2832
+ type: "string",
2833
+ },
2834
+ name: {
2835
+ type: "string",
2836
+ description: "Integration Name",
2837
+ in: "query",
2838
+ },
2839
+ version: {
2840
+ type: "string",
2841
+ description:
2842
+ 'Integration version. Either a semver version or tag "latest"',
2843
+ in: "query",
2844
+ },
2845
+ },
2846
+ response: {
2847
+ description: "Success",
2848
+ schema: {
2849
+ type: "object",
2850
+ properties: {
2851
+ integrations: {
2852
+ type: "array",
2853
+ items: {
2854
+ type: "object",
2855
+ properties: {
2856
+ id: {
2857
+ type: "string",
2858
+ description: "Id of the [Integration](#schema_integration)",
2859
+ },
2860
+ name: {
2861
+ type: "string",
2862
+ description:
2863
+ "Name of the [Integration](#schema_integration)",
2864
+ },
2865
+ version: {
2866
+ type: "string",
2867
+ description:
2868
+ "Version of the [Integration](#schema_integration)",
2869
+ },
2870
+ createdAt: {
2871
+ type: "string",
2872
+ format: "date-time",
2873
+ description:
2874
+ "Creation date of the [Integration](#schema_integration) in the ISO 8601 format",
2875
+ },
2876
+ updatedAt: {
2877
+ type: "string",
2878
+ format: "date-time",
2879
+ description:
2880
+ "Updating date of the [Integration](#schema_integration) in the ISO 8601 format",
2881
+ },
2882
+ title: {
2883
+ type: "string",
2884
+ minLength: 1,
2885
+ maxLength: 64,
2886
+ description:
2887
+ "Title of the integration. This is the name that will be displayed in the UI",
2888
+ },
2889
+ description: {
2890
+ type: "string",
2891
+ maxLength: 256,
2892
+ description:
2893
+ "Description of the integration. This is the description that will be displayed in the UI",
2894
+ },
2895
+ iconUrl: {
2896
+ type: "string",
2897
+ description:
2898
+ "URL of the icon of the integration. This is the icon that will be displayed in the UI",
2899
+ },
2900
+ },
2901
+ required: [
2902
+ "id",
2903
+ "name",
2904
+ "version",
2905
+ "createdAt",
2906
+ "updatedAt",
2907
+ "title",
2908
+ "description",
2909
+ "iconUrl",
2910
+ ],
2911
+ },
2912
+ },
2913
+ meta: {
2914
+ type: "object",
2915
+ properties: {
2916
+ nextToken: {
2917
+ type: "string",
2918
+ description:
2919
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
2920
+ },
2921
+ },
2922
+ additionalProperties: false,
2923
+ },
2924
+ },
2925
+ required: ["integrations", "meta"],
2926
+ title: "listIntegrationsResponse",
2927
+ additionalProperties: false,
2928
+ },
2929
+ },
2930
+ },
2931
+ getIntegration: {
2932
+ name: "getIntegration",
2933
+ description: "Get integration",
2934
+ method: "get",
2935
+ section: "integration",
2936
+ path: "/v1/admin/integrations/{id}",
2937
+ parameters: {
2938
+ id: {
2939
+ type: "string",
2940
+ description: "Integration Id",
2941
+ in: "path",
2942
+ },
2943
+ },
2944
+ response: {
2945
+ description: "Success",
2946
+ schema: {
2947
+ type: "object",
2948
+ properties: {
2949
+ integration: {
2950
+ $ref: "#/components/schemas/Integration",
2951
+ },
2952
+ },
2953
+ required: ["integration"],
2954
+ title: "getIntegrationResponse",
2955
+ additionalProperties: false,
2956
+ },
2957
+ },
2958
+ },
2959
+ getIntegrationLogs: {
2960
+ name: "getIntegrationLogs",
2961
+ description: "Get integration logs",
2962
+ method: "get",
2963
+ section: "integration",
2964
+ path: "/v1/admin/integrations/{id}/logs",
2965
+ parameters: {
2966
+ id: {
2967
+ type: "string",
2968
+ description: "Integration Id",
2969
+ in: "path",
2970
+ },
2971
+ },
2972
+ response: {
2973
+ description: "Success",
2974
+ schema: {
2975
+ type: "object",
2976
+ properties: {
2977
+ logs: {
2978
+ type: "array",
2979
+ items: {
2980
+ type: "object",
2981
+ properties: {
2982
+ timestamp: {
2983
+ type: "string",
2984
+ },
2985
+ level: {
2986
+ type: "string",
2987
+ },
2988
+ message: {
2989
+ type: "string",
2990
+ },
2991
+ },
2992
+ required: ["timestamp", "level", "message"],
2993
+ },
2994
+ },
2995
+ },
2996
+ required: ["logs"],
2997
+ title: "getIntegrationLogsResponse",
2998
+ additionalProperties: false,
2999
+ },
3000
+ },
3001
+ },
3002
+ getIntegrationByName: {
3003
+ name: "getIntegrationByName",
3004
+ description: "Get integration",
3005
+ method: "get",
3006
+ section: "integration",
3007
+ path: "/v1/admin/integrations/{name}/{version}",
3008
+ parameters: {
3009
+ name: {
3010
+ type: "string",
3011
+ description: "Integration Name",
3012
+ in: "path",
3013
+ },
3014
+ version: {
3015
+ type: "string",
3016
+ description:
3017
+ 'Integration version. Either a semver version or tag "latest"',
3018
+ in: "path",
3019
+ },
3020
+ },
3021
+ response: {
3022
+ description: "Success",
3023
+ schema: {
3024
+ type: "object",
3025
+ properties: {
3026
+ integration: {
3027
+ $ref: "#/components/schemas/Integration",
3028
+ },
3029
+ },
3030
+ required: ["integration"],
3031
+ title: "getIntegrationByNameResponse",
3032
+ additionalProperties: false,
3033
+ },
3034
+ },
3035
+ },
3036
+ deleteIntegration: {
3037
+ name: "deleteIntegration",
3038
+ description: "Delete integration",
3039
+ method: "delete",
3040
+ section: "integration",
3041
+ path: "/v1/admin/integrations/{id}",
3042
+ parameters: {
3043
+ id: {
3044
+ type: "string",
3045
+ description: "Integration Id",
3046
+ in: "path",
3047
+ },
3048
+ },
3049
+ response: {
3050
+ description: "Success",
3051
+ schema: {
3052
+ type: "object",
3053
+ title: "deleteIntegrationResponse",
3054
+ additionalProperties: false,
3055
+ },
3056
+ },
3057
+ },
3058
+ introspect: {
3059
+ name: "introspect",
3060
+ description: "Introspect the API",
3061
+ method: "post",
3062
+ path: "/v1/admin/introspect",
3063
+ disableDefaultParameters: {
3064
+ "x-workspace-id": true,
3065
+ },
3066
+ requestBody: {
3067
+ description: "",
3068
+ schema: {
3069
+ type: "object",
3070
+ properties: {
3071
+ botId: {
3072
+ type: "string",
3073
+ },
3074
+ },
3075
+ required: ["botId"],
3076
+ title: "introspectBody",
3077
+ additionalProperties: false,
3078
+ },
3079
+ },
3080
+ response: {
3081
+ description: "Success",
3082
+ schema: {
3083
+ type: "object",
3084
+ properties: {
3085
+ workspaceId: {
3086
+ type: "string",
3087
+ },
3088
+ botId: {
3089
+ type: "string",
3090
+ },
3091
+ userId: {
3092
+ type: "string",
3093
+ },
3094
+ },
3095
+ required: ["workspaceId", "botId", "userId"],
3096
+ title: "introspectResponse",
3097
+ additionalProperties: false,
3098
+ },
3099
+ },
3100
+ parameters: {},
3101
+ },
3102
+ createFile: {
3103
+ name: "createFile",
3104
+ description: "Create File",
3105
+ method: "post",
3106
+ path: "/v1/storage/files",
3107
+ section: "file",
3108
+ requestBody: {
3109
+ description: "Create File",
3110
+ schema: {
3111
+ type: "object",
3112
+ properties: {
3113
+ botId: {
3114
+ type: "string",
3115
+ format: "uuid",
3116
+ description: "ID of the bot the file will be used for",
3117
+ },
3118
+ contents: {
3119
+ type: "string",
3120
+ description: "Base64-encoded file contents",
3121
+ },
3122
+ name: {
3123
+ type: "string",
3124
+ description:
3125
+ "Optional arbitrary file name (e.g. my-image.jpg), will be used for display purposes only.",
3126
+ },
3127
+ accessType: {
3128
+ type: "string",
3129
+ enum: ["private", "public"],
3130
+ description: "Accepted values: private, public",
3131
+ },
3132
+ },
3133
+ required: ["botId", "contents", "name", "accessType"],
3134
+ title: "createFileBody",
3135
+ additionalProperties: false,
3136
+ },
3137
+ },
3138
+ response: {
3139
+ description: "Success",
3140
+ schema: {
3141
+ type: "object",
3142
+ properties: {
3143
+ file: {
3144
+ $ref: "#/components/schemas/File",
3145
+ },
3146
+ },
3147
+ required: ["file"],
3148
+ title: "createFileResponse",
3149
+ additionalProperties: false,
3150
+ },
3151
+ },
3152
+ parameters: {},
3153
+ },
3154
+ getFile: {
3155
+ name: "getFile",
3156
+ description: "Get File",
3157
+ method: "get",
3158
+ path: "/v1/storage/files/{id}",
3159
+ section: "file",
3160
+ parameters: {
3161
+ id: {
3162
+ type: "string",
3163
+ description: "File ID",
3164
+ in: "path",
3165
+ },
3166
+ },
3167
+ response: {
3168
+ description: "Success",
3169
+ schema: {
3170
+ type: "object",
3171
+ properties: {
3172
+ file: {
3173
+ $ref: "#/components/schemas/File",
3174
+ },
3175
+ },
3176
+ required: ["file"],
3177
+ title: "getFileResponse",
3178
+ additionalProperties: false,
3179
+ },
3180
+ },
3181
+ },
3182
+ downloadFile: {
3183
+ name: "downloadFile",
3184
+ description: "Download File",
3185
+ method: "get",
3186
+ path: "/v1/storage/files/{id}/download",
3187
+ section: "file",
3188
+ parameters: {
3189
+ id: {
3190
+ type: "string",
3191
+ description: "File ID",
3192
+ in: "path",
3193
+ },
3194
+ },
3195
+ response: {
3196
+ description: "Raw file contents",
3197
+ schema: {
3198
+ nullable: true,
3199
+ title: "downloadFileResponse",
3200
+ },
3201
+ },
3202
+ },
3203
+ deleteFile: {
3204
+ name: "deleteFile",
3205
+ description: "Delete File",
3206
+ method: "delete",
3207
+ path: "/v1/storage/files/{id}",
3208
+ section: "file",
3209
+ parameters: {
3210
+ id: {
3211
+ type: "string",
3212
+ description: "File ID",
3213
+ in: "path",
3214
+ },
3215
+ },
3216
+ response: {
3217
+ description: "Success",
3218
+ schema: {
3219
+ type: "object",
3220
+ title: "deleteFileResponse",
3221
+ additionalProperties: false,
3222
+ },
3223
+ },
3224
+ },
3225
+ listFiles: {
3226
+ name: "listFiles",
3227
+ description: "List Files",
3228
+ method: "get",
3229
+ path: "/v1/storage/files",
3230
+ section: "file",
3231
+ parameters: {
3232
+ nextToken: {
3233
+ in: "query",
3234
+ description:
3235
+ "Provide the `meta.nextToken` value provided in the last API response to retrieve the next page of results",
3236
+ type: "string",
3237
+ },
3238
+ botId: {
3239
+ in: "query",
3240
+ type: "string",
3241
+ description: "Bot ID",
3242
+ required: true,
3243
+ },
3244
+ },
3245
+ response: {
3246
+ description: "Success",
3247
+ schema: {
3248
+ type: "object",
3249
+ properties: {
3250
+ files: {
3251
+ type: "array",
3252
+ items: {
3253
+ $ref: "#/components/schemas/File",
3254
+ },
3255
+ },
3256
+ meta: {
3257
+ type: "object",
3258
+ properties: {
3259
+ nextToken: {
3260
+ type: "string",
3261
+ description:
3262
+ "The token to use to retrieve the next page of results, passed as a query string parameter (value should be URL-encoded) to this API endpoint.",
3263
+ },
3264
+ },
3265
+ additionalProperties: false,
3266
+ },
3267
+ },
3268
+ required: ["files", "meta"],
3269
+ title: "listFilesResponse",
3270
+ additionalProperties: false,
3271
+ },
3272
+ },
3273
+ },
3274
+ },
3275
+ metadata: {
3276
+ title: "Botpress API",
3277
+ description: "API for Botpress Cloud",
3278
+ server: "https://api.botpress.cloud",
3279
+ version: "0.2.0",
3280
+ prefix: "v1",
3281
+ },
3282
+ errors: [
3283
+ {
3284
+ status: 500,
3285
+ type: "Unknown",
3286
+ description: "An unknown error occurred",
3287
+ },
3288
+ {
3289
+ status: 500,
3290
+ type: "Internal",
3291
+ description: "An internal error occurred",
3292
+ },
3293
+ {
3294
+ status: 401,
3295
+ type: "Unauthorized",
3296
+ description: "The request requires to be authenticated.",
3297
+ },
3298
+ {
3299
+ status: 403,
3300
+ type: "Forbidden",
3301
+ description: "The requested action can't be peform by this resource.",
3302
+ },
3303
+ {
3304
+ status: 413,
3305
+ type: "PayloadTooLarge",
3306
+ description: "The request payload is too large.",
3307
+ },
3308
+ {
3309
+ status: 400,
3310
+ type: "InvalidPayload",
3311
+ description: "The request payload is invalid.",
3312
+ },
3313
+ {
3314
+ status: 415,
3315
+ type: "UnsupportedMediaType",
3316
+ description:
3317
+ "The request is invalid because the content-type is not supported.",
3318
+ },
3319
+ {
3320
+ status: 405,
3321
+ type: "MethodNotFound",
3322
+ description: "The requested method does not exist.",
3323
+ },
3324
+ {
3325
+ status: 404,
3326
+ type: "ResourceNotFound",
3327
+ description: "The requested resource does not exist.",
3328
+ },
3329
+ {
3330
+ status: 400,
3331
+ type: "InvalidJsonSchema",
3332
+ description: "The provided JSON schema is invalid.",
3333
+ },
3334
+ {
3335
+ status: 400,
3336
+ type: "InvalidDataFormat",
3337
+ description:
3338
+ "The provided data doesn't respect the provided JSON schema.",
3339
+ },
3340
+ {
3341
+ status: 400,
3342
+ type: "InvalidIdentifier",
3343
+ description:
3344
+ "The provided identifier is not valid. An identifier must start with a lowercase letter, be between 2 and 100 characters long and use only alphanumeric characters.",
3345
+ },
3346
+ {
3347
+ status: 409,
3348
+ type: "RelationConflict",
3349
+ description:
3350
+ "The resource is not related with another resource. This is usually caused when providing two resources that aren't linked together.",
3351
+ },
3352
+ {
3353
+ status: 400,
3354
+ type: "ReferenceNotFound",
3355
+ description:
3356
+ "The provided resource reference is missing. This is usually caused when providing an invalid id inside the payload of a request.",
3357
+ },
3358
+ {
3359
+ status: 400,
3360
+ type: "InvalidQuery",
3361
+ description:
3362
+ "The provided query is invalid. This is usually caused when providing an invalid parameter for querying a resource.",
3363
+ },
3364
+ {
3365
+ status: 400,
3366
+ type: "Runtime",
3367
+ description:
3368
+ "An error happened during the execution of a runtime (bot or integration).",
3369
+ },
3370
+ ],
3371
+ refs: {
3372
+ parameters: {},
3373
+ requestBodies: {
3374
+ createConversationBody: true,
3375
+ getOrCreateConversationBody: true,
3376
+ updateConversationBody: true,
3377
+ createEventBody: true,
3378
+ createMessageBody: true,
3379
+ getOrCreateMessageBody: true,
3380
+ updateMessageBody: true,
3381
+ createUserBody: true,
3382
+ getOrCreateUserBody: true,
3383
+ updateUserBody: true,
3384
+ setStateBody: true,
3385
+ patchStateBody: true,
3386
+ callActionBody: true,
3387
+ configureIntegrationBody: true,
3388
+ createBotBody: true,
3389
+ updateBotBody: true,
3390
+ transferBotBody: true,
3391
+ createIntegrationBody: true,
3392
+ updateIntegrationBody: true,
3393
+ introspectBody: true,
3394
+ createFileBody: true,
3395
+ },
3396
+ responses: {
3397
+ createConversationResponse: true,
3398
+ getConversationResponse: true,
3399
+ listConversationsResponse: true,
3400
+ getOrCreateConversationResponse: true,
3401
+ updateConversationResponse: true,
3402
+ deleteConversationResponse: true,
3403
+ createEventResponse: true,
3404
+ getEventResponse: true,
3405
+ listEventsResponse: true,
3406
+ createMessageResponse: true,
3407
+ getOrCreateMessageResponse: true,
3408
+ getMessageResponse: true,
3409
+ updateMessageResponse: true,
3410
+ listMessagesResponse: true,
3411
+ deleteMessageResponse: true,
3412
+ createUserResponse: true,
3413
+ getUserResponse: true,
3414
+ listUsersResponse: true,
3415
+ getOrCreateUserResponse: true,
3416
+ updateUserResponse: true,
3417
+ deleteUserResponse: true,
3418
+ getStateResponse: true,
3419
+ setStateResponse: true,
3420
+ patchStateResponse: true,
3421
+ callActionResponse: true,
3422
+ configureIntegrationResponse: true,
3423
+ listPublicIntegrationsResponse: true,
3424
+ getPublicIntegrationByIdResponse: true,
3425
+ getPublicIntegrationResponse: true,
3426
+ createBotResponse: true,
3427
+ updateBotResponse: true,
3428
+ transferBotResponse: true,
3429
+ listBotsResponse: true,
3430
+ getBotResponse: true,
3431
+ deleteBotResponse: true,
3432
+ getBotLogsResponse: true,
3433
+ getBotWebchatResponse: true,
3434
+ getBotAnalyticsResponse: true,
3435
+ getWorkspaceResponse: true,
3436
+ listWorkspacesResponse: true,
3437
+ createIntegrationResponse: true,
3438
+ updateIntegrationResponse: true,
3439
+ listIntegrationsResponse: true,
3440
+ getIntegrationResponse: true,
3441
+ getIntegrationLogsResponse: true,
3442
+ getIntegrationByNameResponse: true,
3443
+ deleteIntegrationResponse: true,
3444
+ introspectResponse: true,
3445
+ createFileResponse: true,
3446
+ getFileResponse: true,
3447
+ downloadFileResponse: true,
3448
+ deleteFileResponse: true,
3449
+ listFilesResponse: true,
3450
+ },
3451
+ schemas: {
3452
+ Bot: true,
3453
+ Integration: true,
3454
+ Workspace: true,
3455
+ User: true,
3456
+ Conversation: true,
3457
+ Event: true,
3458
+ Message: true,
3459
+ State: true,
3460
+ File: true,
3461
+ },
3462
+ },
3463
+ schemas: {
3464
+ Bot: {
3465
+ section: "bot",
3466
+ schema: {
3467
+ type: "object",
3468
+ properties: {
3469
+ id: {
3470
+ type: "string",
3471
+ format: "uuid",
3472
+ description: "Id of the [Bot](#schema_bot)",
3473
+ },
3474
+ createdAt: {
3475
+ type: "string",
3476
+ format: "date-time",
3477
+ description:
3478
+ "Creation date of the [Bot](#schema_bot) in the ISO 8601 format",
3479
+ },
3480
+ updatedAt: {
3481
+ type: "string",
3482
+ format: "date-time",
3483
+ description:
3484
+ "Updating date of the [Bot](#schema_bot) in the ISO 8601 format",
3485
+ },
3486
+ signingSecret: {
3487
+ type: "string",
3488
+ description: "Signing secret of the [Bot](#schema_bot)",
3489
+ },
3490
+ integrations: {
3491
+ type: "object",
3492
+ additionalProperties: {
3493
+ type: "object",
3494
+ properties: {
3495
+ enabled: {
3496
+ type: "boolean",
3497
+ },
3498
+ name: {
3499
+ type: "string",
3500
+ },
3501
+ version: {
3502
+ type: "string",
3503
+ },
3504
+ webhookUrl: {
3505
+ type: "string",
3506
+ },
3507
+ configuration: {
3508
+ type: "object",
3509
+ additionalProperties: true,
3510
+ },
3511
+ status: {
3512
+ type: "string",
3513
+ enum: [
3514
+ "registration_pending",
3515
+ "registered",
3516
+ "registration_failed",
3517
+ "unregistration_pending",
3518
+ "unregistered",
3519
+ "unregistration_failed",
3520
+ ],
3521
+ },
3522
+ },
3523
+ required: [
3524
+ "enabled",
3525
+ "name",
3526
+ "version",
3527
+ "webhookUrl",
3528
+ "configuration",
3529
+ "status",
3530
+ ],
3531
+ additionalProperties: false,
3532
+ },
3533
+ description: "A mapping of integrations to their configuration",
3534
+ },
3535
+ states: {
3536
+ type: "object",
3537
+ additionalProperties: {
3538
+ type: "object",
3539
+ properties: {
3540
+ type: {
3541
+ type: "string",
3542
+ enum: ["conversation", "user", "bot"],
3543
+ description:
3544
+ "Type of the [State](#schema_state) (`conversation`, `user` or `bot`)",
3545
+ },
3546
+ schema: {
3547
+ type: "object",
3548
+ additionalProperties: true,
3549
+ description:
3550
+ "Schema of the [State](#schema_state) in the `JSON schema` format. This `JSON schema` is going to be used for validating the state data.",
3551
+ },
3552
+ expiry: {
3553
+ type: "number",
3554
+ minimum: 1,
3555
+ description:
3556
+ "Expiry of the [State](#schema_state) in milliseconds. The state will expire if it is idle for the configured value. By default, a state doesn't expire.",
3557
+ },
3558
+ },
3559
+ required: ["type", "schema"],
3560
+ additionalProperties: false,
3561
+ },
3562
+ description: "A mapping of states to their definition",
3563
+ },
3564
+ tags: {
3565
+ type: "object",
3566
+ properties: {
3567
+ messages: {
3568
+ default: [],
3569
+ type: "array",
3570
+ items: {
3571
+ type: "string",
3572
+ },
3573
+ },
3574
+ conversations: {
3575
+ default: [],
3576
+ type: "array",
3577
+ items: {
3578
+ type: "string",
3579
+ },
3580
+ },
3581
+ users: {
3582
+ default: [],
3583
+ type: "array",
3584
+ items: {
3585
+ type: "string",
3586
+ },
3587
+ },
3588
+ },
3589
+ description: "Tags of the bot",
3590
+ additionalProperties: false,
3591
+ },
3592
+ configuration: {
3593
+ type: "object",
3594
+ properties: {
3595
+ data: {
3596
+ type: "object",
3597
+ additionalProperties: true,
3598
+ description: "Configuration data",
3599
+ },
3600
+ schema: {
3601
+ type: "object",
3602
+ additionalProperties: true,
3603
+ description:
3604
+ "Schema of the configuration in the `JSON schema` format. The configuration data is validated against this `JSON schema`.",
3605
+ },
3606
+ },
3607
+ required: ["data", "schema"],
3608
+ description: "Configuration of the bot",
3609
+ additionalProperties: false,
3610
+ },
3611
+ events: {
3612
+ type: "object",
3613
+ additionalProperties: {
3614
+ type: "object",
3615
+ properties: {
3616
+ schema: {
3617
+ type: "object",
3618
+ additionalProperties: true,
3619
+ },
3620
+ },
3621
+ required: ["schema"],
3622
+ description: "Event schema",
3623
+ additionalProperties: false,
3624
+ },
3625
+ description: "Events definition",
3626
+ },
3627
+ recurringEvents: {
3628
+ type: "object",
3629
+ additionalProperties: {
3630
+ type: "object",
3631
+ properties: {
3632
+ schedule: {
3633
+ type: "object",
3634
+ properties: {
3635
+ cron: {
3636
+ type: "string",
3637
+ },
3638
+ },
3639
+ required: ["cron"],
3640
+ additionalProperties: false,
3641
+ },
3642
+ type: {
3643
+ type: "string",
3644
+ },
3645
+ payload: {
3646
+ type: "object",
3647
+ additionalProperties: true,
3648
+ },
3649
+ },
3650
+ required: ["schedule", "type", "payload"],
3651
+ additionalProperties: false,
3652
+ },
3653
+ description: "Recurring events",
3654
+ },
3655
+ name: {
3656
+ type: "string",
3657
+ description: "Name of the [Bot](#schema_bot)",
3658
+ },
3659
+ deployedAt: {
3660
+ type: "string",
3661
+ format: "date-time",
3662
+ description:
3663
+ "Last deployment date of the [Bot](#schema_bot) in the ISO 8601 format",
3664
+ },
3665
+ dev: {
3666
+ type: "boolean",
3667
+ description:
3668
+ "Indicates if the [Bot](#schema_bot) is a development bot; Development bots run locally and can install dev integrations",
3669
+ },
3670
+ createdBy: {
3671
+ type: "string",
3672
+ description: "Id of the user that created the bot",
3673
+ },
3674
+ medias: {
3675
+ type: "array",
3676
+ items: {
3677
+ type: "object",
3678
+ properties: {
3679
+ url: {
3680
+ type: "string",
3681
+ description: "URL of the media file",
3682
+ },
3683
+ name: {
3684
+ type: "string",
3685
+ description: "Name of the media file",
3686
+ },
3687
+ },
3688
+ required: ["url", "name"],
3689
+ },
3690
+ description: "Media files associated with the [Bot](#schema_bot)",
3691
+ },
3692
+ },
3693
+ required: [
3694
+ "id",
3695
+ "createdAt",
3696
+ "updatedAt",
3697
+ "signingSecret",
3698
+ "integrations",
3699
+ "states",
3700
+ "tags",
3701
+ "configuration",
3702
+ "events",
3703
+ "recurringEvents",
3704
+ "name",
3705
+ "dev",
3706
+ "medias",
3707
+ ],
3708
+ additionalProperties: false,
3709
+ },
3710
+ },
3711
+ Integration: {
3712
+ section: "integration",
3713
+ schema: {
3714
+ type: "object",
3715
+ properties: {
3716
+ id: {
3717
+ type: "string",
3718
+ description: "Id of the [Integration](#schema_integration)",
3719
+ },
3720
+ createdAt: {
3721
+ type: "string",
3722
+ format: "date-time",
3723
+ description:
3724
+ "Creation date of the [Integration](#schema_integration) in the ISO 8601 format",
3725
+ },
3726
+ updatedAt: {
3727
+ type: "string",
3728
+ format: "date-time",
3729
+ description:
3730
+ "Updating date of the [Integration](#schema_integration) in the ISO 8601 format",
3731
+ },
3732
+ name: {
3733
+ type: "string",
3734
+ description: "Name of the [Integration](#schema_integration)",
3735
+ },
3736
+ version: {
3737
+ type: "string",
3738
+ description: "Version of the [Integration](#schema_integration)",
3739
+ },
3740
+ channels: {
3741
+ type: "object",
3742
+ additionalProperties: {
3743
+ type: "object",
3744
+ properties: {
3745
+ tags: {
3746
+ type: "object",
3747
+ properties: {
3748
+ messages: {
3749
+ default: [],
3750
+ type: "array",
3751
+ items: {
3752
+ type: "string",
3753
+ },
3754
+ },
3755
+ conversations: {
3756
+ default: [],
3757
+ type: "array",
3758
+ items: {
3759
+ type: "string",
3760
+ },
3761
+ },
3762
+ },
3763
+ additionalProperties: false,
3764
+ },
3765
+ messages: {
3766
+ type: "object",
3767
+ additionalProperties: {
3768
+ type: "object",
3769
+ properties: {
3770
+ schema: {
3771
+ type: "object",
3772
+ additionalProperties: true,
3773
+ },
3774
+ },
3775
+ required: ["schema"],
3776
+ additionalProperties: false,
3777
+ },
3778
+ },
3779
+ conversation: {
3780
+ type: "object",
3781
+ properties: {
3782
+ creation: {
3783
+ type: "object",
3784
+ properties: {
3785
+ enabled: {
3786
+ type: "boolean",
3787
+ description: "Enable conversation creation",
3788
+ },
3789
+ requiredTags: {
3790
+ type: "array",
3791
+ items: {
3792
+ type: "string",
3793
+ },
3794
+ description:
3795
+ "The list of tags that are required to be specified when calling the API directly to create a conversation.",
3796
+ },
3797
+ },
3798
+ required: ["enabled", "requiredTags"],
3799
+ description:
3800
+ "The conversation creation setting determines how to create a conversation through the API directly. The integration will have to implement the `createConversation` functionality to support this setting.",
3801
+ additionalProperties: false,
3802
+ },
3803
+ },
3804
+ required: ["creation"],
3805
+ additionalProperties: false,
3806
+ },
3807
+ },
3808
+ required: ["tags", "messages", "conversation"],
3809
+ additionalProperties: false,
3810
+ },
3811
+ description: "Channels definition",
3812
+ },
3813
+ states: {
3814
+ default: {},
3815
+ type: "object",
3816
+ additionalProperties: {
3817
+ type: "object",
3818
+ properties: {
3819
+ type: {
3820
+ type: "string",
3821
+ enum: ["conversation", "user", "integration"],
3822
+ description:
3823
+ "Type of the [State](#schema_state) (`conversation`, `user` or `integration`)",
3824
+ },
3825
+ schema: {
3826
+ type: "object",
3827
+ additionalProperties: true,
3828
+ description:
3829
+ "Schema of the [State](#schema_state) in the `JSON schema` format. This `JSON schema` is going to be used for validating the state data.",
3830
+ },
3831
+ },
3832
+ required: ["type", "schema"],
3833
+ additionalProperties: false,
3834
+ },
3835
+ description: "States definition",
3836
+ },
3837
+ configuration: {
3838
+ type: "object",
3839
+ properties: {
3840
+ schema: {
3841
+ type: "object",
3842
+ additionalProperties: true,
3843
+ description: "Schema for the configuration",
3844
+ },
3845
+ },
3846
+ required: ["schema"],
3847
+ description: "Configuration definition",
3848
+ additionalProperties: false,
3849
+ },
3850
+ events: {
3851
+ type: "object",
3852
+ additionalProperties: {
3853
+ type: "object",
3854
+ properties: {
3855
+ schema: {
3856
+ type: "object",
3857
+ additionalProperties: true,
3858
+ },
3859
+ },
3860
+ required: ["schema"],
3861
+ description: "Event schema",
3862
+ additionalProperties: false,
3863
+ },
3864
+ description: "Events definition",
3865
+ },
3866
+ actions: {
3867
+ type: "object",
3868
+ additionalProperties: {
3869
+ type: "object",
3870
+ properties: {
3871
+ input: {
3872
+ type: "object",
3873
+ properties: {
3874
+ schema: {
3875
+ type: "object",
3876
+ additionalProperties: true,
3877
+ },
3878
+ },
3879
+ required: ["schema"],
3880
+ additionalProperties: false,
3881
+ },
3882
+ output: {
3883
+ type: "object",
3884
+ properties: {
3885
+ schema: {
3886
+ type: "object",
3887
+ additionalProperties: true,
3888
+ },
3889
+ },
3890
+ required: ["schema"],
3891
+ additionalProperties: false,
3892
+ },
3893
+ },
3894
+ required: ["input", "output"],
3895
+ additionalProperties: false,
3896
+ },
3897
+ description: "Action definition",
3898
+ },
3899
+ user: {
3900
+ type: "object",
3901
+ properties: {
3902
+ creation: {
3903
+ type: "object",
3904
+ properties: {
3905
+ enabled: {
3906
+ type: "boolean",
3907
+ description: "Enable user creation",
3908
+ },
3909
+ requiredTags: {
3910
+ type: "array",
3911
+ items: {
3912
+ type: "string",
3913
+ },
3914
+ description:
3915
+ "The list of tags that are required to be specified when calling the API directly to create a user.",
3916
+ },
3917
+ },
3918
+ required: ["enabled", "requiredTags"],
3919
+ description:
3920
+ "The user creation setting determines how to create a user through the API directly. The integration will have to implement the `createUser` functionality to support this setting.",
3921
+ additionalProperties: false,
3922
+ },
3923
+ },
3924
+ required: ["creation"],
3925
+ additionalProperties: false,
3926
+ },
3927
+ dev: {
3928
+ type: "boolean",
3929
+ description:
3930
+ "Indicates if the integration is a development integration; Dev integrations run locally",
3931
+ },
3932
+ title: {
3933
+ type: "string",
3934
+ minLength: 1,
3935
+ maxLength: 64,
3936
+ description:
3937
+ "Title of the integration. This is the name that will be displayed in the UI",
3938
+ },
3939
+ description: {
3940
+ type: "string",
3941
+ maxLength: 256,
3942
+ description:
3943
+ "Description of the integration. This is the description that will be displayed in the UI",
3944
+ },
3945
+ iconUrl: {
3946
+ type: "string",
3947
+ description:
3948
+ "URL of the icon of the integration. This is the icon that will be displayed in the UI",
3949
+ },
3950
+ readmeUrl: {
3951
+ type: "string",
3952
+ description:
3953
+ "URL of the readme of the integration. This is the readme that will be displayed in the UI",
3954
+ },
3955
+ },
3956
+ required: [
3957
+ "id",
3958
+ "createdAt",
3959
+ "updatedAt",
3960
+ "name",
3961
+ "version",
3962
+ "channels",
3963
+ "configuration",
3964
+ "events",
3965
+ "actions",
3966
+ "user",
3967
+ "dev",
3968
+ "title",
3969
+ "description",
3970
+ "iconUrl",
3971
+ "readmeUrl",
3972
+ ],
3973
+ additionalProperties: false,
3974
+ },
3975
+ },
3976
+ Workspace: {
3977
+ section: "workspace",
3978
+ schema: {
3979
+ type: "object",
3980
+ properties: {
3981
+ id: {
3982
+ type: "string",
3983
+ },
3984
+ name: {
3985
+ type: "string",
3986
+ },
3987
+ ownerId: {
3988
+ type: "string",
3989
+ },
3990
+ createdAt: {
3991
+ type: "string",
3992
+ },
3993
+ updatedAt: {
3994
+ type: "string",
3995
+ },
3996
+ accountType: {
3997
+ type: "string",
3998
+ },
3999
+ blocked: {
4000
+ type: "boolean",
4001
+ },
4002
+ spendingLimit: {
4003
+ type: "number",
4004
+ },
4005
+ },
4006
+ required: [
4007
+ "id",
4008
+ "name",
4009
+ "ownerId",
4010
+ "createdAt",
4011
+ "updatedAt",
4012
+ "accountType",
4013
+ "blocked",
4014
+ "spendingLimit",
4015
+ ],
4016
+ additionalProperties: false,
4017
+ },
4018
+ },
4019
+ User: {
4020
+ section: "user",
4021
+ schema: {
4022
+ type: "object",
4023
+ properties: {
4024
+ id: {
4025
+ type: "string",
4026
+ description: "Id of the [User](#schema_user)",
4027
+ },
4028
+ createdAt: {
4029
+ type: "string",
4030
+ format: "date-time",
4031
+ description:
4032
+ "Creation date of the [User](#schema_user) in the ISO 8601 format",
4033
+ },
4034
+ updatedAt: {
4035
+ type: "string",
4036
+ format: "date-time",
4037
+ description:
4038
+ "Updating date of the [User](#schema_user) in the ISO 8601 format",
4039
+ },
4040
+ tags: {
4041
+ type: "object",
4042
+ additionalProperties: {
4043
+ type: "string",
4044
+ },
4045
+ description:
4046
+ "Set of [Tags](#tags) that you can attach to a [User](#schema_user). The set of [Tags](#tags) available on a [User](#schema_user) is restricted by the list of [Tags](#tags) defined previously by the [Bot](#schema_bot). Individual keys can be unset by posting an empty value to them.",
4047
+ },
4048
+ },
4049
+ required: ["id", "createdAt", "updatedAt", "tags"],
4050
+ description:
4051
+ "The user object represents someone interacting with the bot within a specific integration. The same person interacting with a bot in slack and messenger will be represented with two different users.",
4052
+ additionalProperties: false,
4053
+ },
4054
+ },
4055
+ Conversation: {
4056
+ section: "conversation",
4057
+ schema: {
4058
+ type: "object",
4059
+ properties: {
4060
+ id: {
4061
+ type: "string",
4062
+ description: "Id of the [Conversation](#schema_conversation)",
4063
+ },
4064
+ createdAt: {
4065
+ type: "string",
4066
+ format: "date-time",
4067
+ description:
4068
+ "Creation date of the [Conversation](#schema_conversation) in the ISO 8601 format",
4069
+ },
4070
+ updatedAt: {
4071
+ type: "string",
4072
+ format: "date-time",
4073
+ description:
4074
+ "Updating date of the [Conversation](#schema_conversation) in the ISO 8601 format",
4075
+ },
4076
+ channel: {
4077
+ type: "string",
4078
+ description:
4079
+ "Name of the channel where the [Conversation](#schema_conversation) is happening",
4080
+ },
4081
+ integration: {
4082
+ type: "string",
4083
+ description:
4084
+ "Name of the integration that created the [Conversation](#schema_conversation)",
4085
+ },
4086
+ tags: {
4087
+ type: "object",
4088
+ additionalProperties: {
4089
+ type: "string",
4090
+ },
4091
+ description:
4092
+ "Set of [Tags](#tags) that you can attach to a [Conversation](#schema_conversation). The set of [Tags](#tags) available on a [Conversation](#schema_conversation) is restricted by the list of [Tags](#tags) defined previously by the [Bot](#schema_bot). Individual keys can be unset by posting an empty value to them.",
4093
+ },
4094
+ },
4095
+ required: [
4096
+ "id",
4097
+ "createdAt",
4098
+ "updatedAt",
4099
+ "channel",
4100
+ "integration",
4101
+ "tags",
4102
+ ],
4103
+ description:
4104
+ "The conversation object represents an exchange of messages between one or more users. A [Conversation](#schema_conversation) is always linked to an integration's channels. For example, a Slack channel represents a conversation.",
4105
+ additionalProperties: false,
4106
+ },
4107
+ },
4108
+ Event: {
4109
+ section: "event",
4110
+ schema: {
4111
+ type: "object",
4112
+ properties: {
4113
+ id: {
4114
+ type: "string",
4115
+ description: "Id of the [Event](#schema_event)",
4116
+ },
4117
+ createdAt: {
4118
+ type: "string",
4119
+ format: "date-time",
4120
+ description:
4121
+ "Creation date of the [Event](#schema_event) in the ISO 8601 format",
4122
+ },
4123
+ type: {
4124
+ type: "string",
4125
+ description: "Type of the [Event](#schema_event).",
4126
+ },
4127
+ payload: {
4128
+ type: "object",
4129
+ additionalProperties: true,
4130
+ description:
4131
+ "Payload is the content of the event defined by the integration installed on your bot or one of the default events created by our api.",
4132
+ },
4133
+ },
4134
+ required: ["id", "createdAt", "type", "payload"],
4135
+ description: "The event object represents an action or an occurrence.",
4136
+ additionalProperties: false,
4137
+ },
4138
+ },
4139
+ Message: {
4140
+ section: "message",
4141
+ schema: {
4142
+ type: "object",
4143
+ properties: {
4144
+ id: {
4145
+ type: "string",
4146
+ description: "Id of the [Message](#schema_message)",
4147
+ },
4148
+ createdAt: {
4149
+ type: "string",
4150
+ format: "date-time",
4151
+ description:
4152
+ "Creation date of the [Message](#schema_message) in the ISO 8601 format",
4153
+ },
4154
+ type: {
4155
+ type: "string",
4156
+ description:
4157
+ "Type of the [Message](#schema_message) represents the resource type that the message is related to",
4158
+ },
4159
+ payload: {
4160
+ type: "object",
4161
+ additionalProperties: true,
4162
+ description:
4163
+ "Payload is the content type of the message. Accepted payload options: Text, Image, Choice, Dropdown, Card, Carousel, File, Audio, Video, Location",
4164
+ },
4165
+ direction: {
4166
+ type: "string",
4167
+ enum: ["incoming", "outgoing"],
4168
+ description: "Direction of the message (`incoming` or `outgoing`).",
4169
+ },
4170
+ userId: {
4171
+ type: "string",
4172
+ description: "ID of the [User](#schema_user)",
4173
+ },
4174
+ conversationId: {
4175
+ type: "string",
4176
+ description: "ID of the [Conversation](#schema_conversation)",
4177
+ },
4178
+ tags: {
4179
+ type: "object",
4180
+ additionalProperties: {
4181
+ type: "string",
4182
+ },
4183
+ description:
4184
+ "Set of [Tags](#tags) that you can attach to a [Conversation](#schema_conversation). The set of [Tags](#tags) available on a [Conversation](#schema_conversation) is restricted by the list of [Tags](#tags) defined previously by the [Bot](#schema_bot). Individual keys can be unset by posting an empty value to them.",
4185
+ },
4186
+ },
4187
+ required: [
4188
+ "id",
4189
+ "createdAt",
4190
+ "type",
4191
+ "payload",
4192
+ "direction",
4193
+ "userId",
4194
+ "conversationId",
4195
+ "tags",
4196
+ ],
4197
+ description:
4198
+ "The Message object represents a message in a [Conversation](#schema_conversation) for a specific [User](#schema_user).",
4199
+ additionalProperties: false,
4200
+ },
4201
+ },
4202
+ State: {
4203
+ section: "state",
4204
+ schema: {
4205
+ type: "object",
4206
+ properties: {
4207
+ id: {
4208
+ type: "string",
4209
+ description: "Id of the [State](#schema_state)",
4210
+ },
4211
+ createdAt: {
4212
+ type: "string",
4213
+ format: "date-time",
4214
+ description:
4215
+ "Creation date of the [State](#schema_state) in the ISO 8601 format",
4216
+ },
4217
+ updatedAt: {
4218
+ type: "string",
4219
+ format: "date-time",
4220
+ description:
4221
+ "Updating date of the [State](#schema_state) in the ISO 8601 format",
4222
+ },
4223
+ botId: {
4224
+ type: "string",
4225
+ description: "Id of the [Bot](#schema_bot)",
4226
+ },
4227
+ conversationId: {
4228
+ type: "string",
4229
+ description: "Id of the [Conversation](#schema_conversation)",
4230
+ },
4231
+ userId: {
4232
+ type: "string",
4233
+ description: "Id of the [User](#schema_user)",
4234
+ },
4235
+ name: {
4236
+ type: "string",
4237
+ description:
4238
+ "Name of the [State](#schema_state) which is declared inside the bot definition",
4239
+ },
4240
+ type: {
4241
+ type: "string",
4242
+ enum: ["conversation", "user", "bot", "integration"],
4243
+ description:
4244
+ "Type of the [State](#schema_state) represents the resource type (`conversation`, `user`, `bot` or `integration`) that the state is related to",
4245
+ },
4246
+ payload: {
4247
+ type: "object",
4248
+ additionalProperties: true,
4249
+ description:
4250
+ "Payload is the content of the state defined by your bot.",
4251
+ },
4252
+ },
4253
+ required: [
4254
+ "id",
4255
+ "createdAt",
4256
+ "updatedAt",
4257
+ "botId",
4258
+ "name",
4259
+ "type",
4260
+ "payload",
4261
+ ],
4262
+ description:
4263
+ "The state object represents the current payload. A state is always linked to either a bot, a conversation or a user.",
4264
+ additionalProperties: false,
4265
+ },
4266
+ },
4267
+ File: {
4268
+ section: "file",
4269
+ schema: {
4270
+ type: "object",
4271
+ properties: {
4272
+ botId: {
4273
+ type: "string",
4274
+ format: "uuid",
4275
+ description: "ID of the bot the file will be used for",
4276
+ },
4277
+ name: {
4278
+ type: "string",
4279
+ description:
4280
+ "Optional arbitrary file name (e.g. my-image.jpg), will be used for display purposes only.",
4281
+ },
4282
+ accessType: {
4283
+ type: "string",
4284
+ enum: ["private", "public"],
4285
+ description: "Accepted values: private, public",
4286
+ },
4287
+ id: {
4288
+ type: "string",
4289
+ description: "ID of the [File](#schema_file)",
4290
+ },
4291
+ createdAt: {
4292
+ type: "string",
4293
+ description:
4294
+ "Creation date of the [File](#schema_file) in ISO 8601 format",
4295
+ },
4296
+ size: {
4297
+ type: "number",
4298
+ description: "Size of the file in bytes",
4299
+ },
4300
+ publicUrl: {
4301
+ type: "string",
4302
+ description:
4303
+ "Public URL to the file contents, available only if the access type is public. If the file is private, use the Download endpoint to retrieve the file contents.",
4304
+ },
4305
+ },
4306
+ required: ["botId", "name", "accessType", "id", "createdAt", "size"],
4307
+ additionalProperties: false,
4308
+ },
4309
+ },
4310
+ },
4311
+ sections: [
4312
+ {
4313
+ description: "",
4314
+ title: "User",
4315
+ name: "user",
4316
+ operations: [
4317
+ "createUser",
4318
+ "getUser",
4319
+ "listUsers",
4320
+ "getOrCreateUser",
4321
+ "updateUser",
4322
+ "deleteUser",
4323
+ ],
4324
+ schema: "User",
4325
+ },
4326
+ {
4327
+ description: "",
4328
+ title: "Conversation",
4329
+ name: "conversation",
4330
+ operations: [
4331
+ "createConversation",
4332
+ "getConversation",
4333
+ "listConversations",
4334
+ "getOrCreateConversation",
4335
+ "updateConversation",
4336
+ "deleteConversation",
4337
+ ],
4338
+ schema: "Conversation",
4339
+ },
4340
+ {
4341
+ description: "",
4342
+ title: "Event",
4343
+ name: "event",
4344
+ operations: ["createEvent", "getEvent", "listEvents"],
4345
+ schema: "Event",
4346
+ },
4347
+ {
4348
+ description: "",
4349
+ title: "Message",
4350
+ name: "message",
4351
+ operations: [
4352
+ "createMessage",
4353
+ "getOrCreateMessage",
4354
+ "getMessage",
4355
+ "updateMessage",
4356
+ "listMessages",
4357
+ "deleteMessage",
4358
+ ],
4359
+ schema: "Message",
4360
+ },
4361
+ {
4362
+ description: "",
4363
+ title: "File",
4364
+ name: "file",
4365
+ operations: [
4366
+ "createFile",
4367
+ "getFile",
4368
+ "downloadFile",
4369
+ "deleteFile",
4370
+ "listFiles",
4371
+ ],
4372
+ schema: "File",
4373
+ },
4374
+ {
4375
+ description: "",
4376
+ title: "State",
4377
+ name: "state",
4378
+ operations: ["getState", "setState", "patchState"],
4379
+ schema: "State",
4380
+ },
4381
+ {
4382
+ description: "",
4383
+ title: "Hub",
4384
+ name: "hub",
4385
+ operations: [
4386
+ "listPublicIntegrations",
4387
+ "getPublicIntegrationById",
4388
+ "getPublicIntegration",
4389
+ ],
4390
+ },
4391
+ {
4392
+ description: "",
4393
+ title: "Action",
4394
+ name: "action",
4395
+ operations: ["callAction"],
4396
+ },
4397
+ {
4398
+ description: "",
4399
+ title: "Bot",
4400
+ name: "bot",
4401
+ operations: [
4402
+ "createBot",
4403
+ "updateBot",
4404
+ "transferBot",
4405
+ "listBots",
4406
+ "getBot",
4407
+ "deleteBot",
4408
+ "getBotLogs",
4409
+ "getBotWebchat",
4410
+ "getBotAnalytics",
4411
+ ],
4412
+ schema: "Bot",
4413
+ },
4414
+ {
4415
+ description: "",
4416
+ title: "Integration",
4417
+ name: "integration",
4418
+ operations: [
4419
+ "createIntegration",
4420
+ "updateIntegration",
4421
+ "listIntegrations",
4422
+ "getIntegration",
4423
+ "getIntegrationLogs",
4424
+ "getIntegrationByName",
4425
+ "deleteIntegration",
4426
+ ],
4427
+ schema: "Integration",
4428
+ },
4429
+ {
4430
+ description: "",
4431
+ title: "Workspace",
4432
+ name: "workspace",
4433
+ operations: [],
4434
+ schema: "Workspace",
4435
+ },
4436
+ ],
4437
+ } satisfies State<
4438
+ | "Bot"
4439
+ | "Integration"
4440
+ | "Workspace"
4441
+ | "User"
4442
+ | "Conversation"
4443
+ | "Event"
4444
+ | "Message"
4445
+ | "State"
4446
+ | "File",
4447
+ never,
4448
+ | "user"
4449
+ | "conversation"
4450
+ | "event"
4451
+ | "message"
4452
+ | "file"
4453
+ | "state"
4454
+ | "hub"
4455
+ | "action"
4456
+ | "bot"
4457
+ | "integration"
4458
+ | "workspace"
4459
+ >;