@catandbox/schrodinger-contracts 0.1.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,2463 @@
1
+ openapi: 3.1.0
2
+ info:
3
+ title: Schrodinger Helpdesk API
4
+ version: 0.1.0
5
+ servers:
6
+ - url: https://api.example.com
7
+ components:
8
+ securitySchemes:
9
+ SchrodingerSignedHeaders:
10
+ type: apiKey
11
+ in: header
12
+ name: X-Sch-Signature
13
+ AdminBearer:
14
+ type: http
15
+ scheme: bearer
16
+ bearerFormat: token
17
+ parameters:
18
+ TicketId:
19
+ name: ticketId
20
+ in: path
21
+ required: true
22
+ schema:
23
+ type: string
24
+ CategoryId:
25
+ name: categoryId
26
+ in: path
27
+ required: true
28
+ schema:
29
+ type: string
30
+ schemas:
31
+ ErrorResponse:
32
+ type: object
33
+ required: [error, message]
34
+ properties:
35
+ error:
36
+ type: string
37
+ message:
38
+ type: string
39
+ requestId:
40
+ type: string
41
+ TicketStatus:
42
+ type: string
43
+ enum: [Active, InProgress, AwaitingResponse, Closed, Archived]
44
+ Ticket:
45
+ type: object
46
+ required: [id, tenantId, principalId, status, title, createdAt, updatedAt]
47
+ properties:
48
+ id:
49
+ type: string
50
+ tenantId:
51
+ type: string
52
+ principalId:
53
+ type: string
54
+ categoryId:
55
+ type: string
56
+ nullable: true
57
+ status:
58
+ $ref: "#/components/schemas/TicketStatus"
59
+ title:
60
+ type: string
61
+ maxLength: 2048
62
+ assignedAliasId:
63
+ type: string
64
+ nullable: true
65
+ createdAt:
66
+ type: integer
67
+ updatedAt:
68
+ type: integer
69
+ Message:
70
+ type: object
71
+ required: [id, ticketId, authorType, isPublic, bodyPlain, createdAt]
72
+ properties:
73
+ id:
74
+ type: string
75
+ ticketId:
76
+ type: string
77
+ authorType:
78
+ type: string
79
+ enum: [customer, agent, admin, system]
80
+ isPublic:
81
+ type: boolean
82
+ bodyPlain:
83
+ type: string
84
+ maxLength: 65535
85
+ authorAliasId:
86
+ type: string
87
+ nullable: true
88
+ createdAt:
89
+ type: integer
90
+ Category:
91
+ type: object
92
+ required: [id, integrationId, name]
93
+ properties:
94
+ id:
95
+ type: string
96
+ integrationId:
97
+ type: string
98
+ name:
99
+ type: string
100
+ isDeleted:
101
+ type: boolean
102
+ PublicCategory:
103
+ type: object
104
+ required: [id, name]
105
+ properties:
106
+ id:
107
+ type: string
108
+ name:
109
+ type: string
110
+ Alias:
111
+ type: object
112
+ required: [id, integrationId, department, displayName, isActive]
113
+ properties:
114
+ id:
115
+ type: string
116
+ integrationId:
117
+ type: string
118
+ department:
119
+ type: string
120
+ displayName:
121
+ type: string
122
+ avatarUrl:
123
+ type: string
124
+ nullable: true
125
+ toneStyle:
126
+ type: object
127
+ additionalProperties: true
128
+ isActive:
129
+ type: boolean
130
+ Macro:
131
+ type: object
132
+ required: [id, integrationId, title, bodyTemplate, isActive, createdAt, updatedAt]
133
+ properties:
134
+ id:
135
+ type: string
136
+ integrationId:
137
+ type: string
138
+ categoryId:
139
+ type: string
140
+ nullable: true
141
+ title:
142
+ type: string
143
+ bodyTemplate:
144
+ type: string
145
+ isActive:
146
+ type: boolean
147
+ createdAt:
148
+ type: integer
149
+ updatedAt:
150
+ type: integer
151
+ RatingRequest:
152
+ type: object
153
+ required: [tenantExternalId, principalExternalId, stars]
154
+ properties:
155
+ tenantExternalId:
156
+ type: string
157
+ principalExternalId:
158
+ type: string
159
+ stars:
160
+ type: integer
161
+ minimum: 1
162
+ maximum: 5
163
+ comment:
164
+ type: string
165
+ nullable: true
166
+ PortalConfig:
167
+ type: object
168
+ required: [categories, aliases]
169
+ properties:
170
+ categories:
171
+ type: array
172
+ items:
173
+ type: object
174
+ required: [id, name]
175
+ properties:
176
+ id:
177
+ type: string
178
+ name:
179
+ type: string
180
+ aliases:
181
+ type: array
182
+ items:
183
+ $ref: "#/components/schemas/Alias"
184
+ UploadInitRequest:
185
+ type: object
186
+ required: [tenantExternalId, principalExternalId, ticketId, files]
187
+ properties:
188
+ tenantExternalId:
189
+ type: string
190
+ principalExternalId:
191
+ type: string
192
+ ticketId:
193
+ type: string
194
+ files:
195
+ type: array
196
+ minItems: 1
197
+ maxItems: 5
198
+ items:
199
+ type: object
200
+ required: [filename, mime, sizeBytes, sha256]
201
+ properties:
202
+ filename:
203
+ type: string
204
+ mime:
205
+ type: string
206
+ sizeBytes:
207
+ type: integer
208
+ maximum: 5242880
209
+ sha256:
210
+ type: string
211
+ UploadCompleteRequest:
212
+ type: object
213
+ required: [tenantExternalId, principalExternalId, ticketId, uploads]
214
+ properties:
215
+ tenantExternalId:
216
+ type: string
217
+ principalExternalId:
218
+ type: string
219
+ ticketId:
220
+ type: string
221
+ messageId:
222
+ type: string
223
+ nullable: true
224
+ uploads:
225
+ type: array
226
+ minItems: 1
227
+ items:
228
+ type: object
229
+ required: [uploadId, sizeBytes, sha256]
230
+ properties:
231
+ uploadId:
232
+ type: string
233
+ sizeBytes:
234
+ type: integer
235
+ sha256:
236
+ type: string
237
+ CreateTicketRequest:
238
+ type: object
239
+ required: [tenantExternalId, principalExternalId, title, body, clientMessageId]
240
+ properties:
241
+ tenantExternalId:
242
+ type: string
243
+ principalExternalId:
244
+ type: string
245
+ categoryId:
246
+ type: string
247
+ nullable: true
248
+ title:
249
+ type: string
250
+ maxLength: 2048
251
+ body:
252
+ type: string
253
+ maxLength: 65535
254
+ clientMessageId:
255
+ type: string
256
+ notifyEmail:
257
+ type: string
258
+ format: email
259
+ nullable: true
260
+ description: Customer email to notify when agent responds
261
+ TicketEvent:
262
+ type: object
263
+ required: [id, ticketId, eventType, payload, createdAt]
264
+ properties:
265
+ id:
266
+ type: string
267
+ ticketId:
268
+ type: string
269
+ eventType:
270
+ type: string
271
+ payload:
272
+ type: object
273
+ createdAt:
274
+ type: integer
275
+ CreateMessageRequest:
276
+ type: object
277
+ required: [tenantExternalId, principalExternalId, body, clientMessageId]
278
+ properties:
279
+ tenantExternalId:
280
+ type: string
281
+ principalExternalId:
282
+ type: string
283
+ body:
284
+ type: string
285
+ maxLength: 65535
286
+ clientMessageId:
287
+ type: string
288
+ CreateIntegrationRequest:
289
+ type: object
290
+ required: [name, platform]
291
+ properties:
292
+ name:
293
+ type: string
294
+ platform:
295
+ type: string
296
+ Integration:
297
+ type: object
298
+ required: [id, name, platform, status, createdAt]
299
+ properties:
300
+ id:
301
+ type: string
302
+ name:
303
+ type: string
304
+ platform:
305
+ type: string
306
+ status:
307
+ type: string
308
+ enum: [active, disabled]
309
+ createdAt:
310
+ type: integer
311
+ CreatedKey:
312
+ type: object
313
+ required: [keyId, secret, createdAt]
314
+ properties:
315
+ keyId:
316
+ type: string
317
+ secret:
318
+ type: string
319
+ createdAt:
320
+ type: integer
321
+ RagScope:
322
+ type: string
323
+ enum: [shopify_common, app_specific]
324
+ RagSeverity:
325
+ type: string
326
+ enum: [critical, normal]
327
+ RagSource:
328
+ type: object
329
+ required: [id, ragScope, integrationId, url, type, status, lastFetchedAt]
330
+ properties:
331
+ id:
332
+ type: string
333
+ ragScope:
334
+ $ref: "#/components/schemas/RagScope"
335
+ integrationId:
336
+ type: string
337
+ nullable: true
338
+ url:
339
+ type: string
340
+ type:
341
+ type: string
342
+ status:
343
+ type: string
344
+ lastFetchedAt:
345
+ type: integer
346
+ nullable: true
347
+ RagGoldenTest:
348
+ type: object
349
+ required: [id, ragScope, integrationId, question, expectedPoints, severity, isActive]
350
+ properties:
351
+ id:
352
+ type: string
353
+ ragScope:
354
+ $ref: "#/components/schemas/RagScope"
355
+ integrationId:
356
+ type: string
357
+ nullable: true
358
+ question:
359
+ type: string
360
+ expectedPoints:
361
+ nullable: true
362
+ severity:
363
+ $ref: "#/components/schemas/RagSeverity"
364
+ isActive:
365
+ type: boolean
366
+ RagGoldenRunSummary:
367
+ type: object
368
+ required: [total, criticalFailures, avgCandidateScore, avgBaselineScore, avgDrop, threshold]
369
+ properties:
370
+ total:
371
+ type: integer
372
+ criticalFailures:
373
+ type: integer
374
+ avgCandidateScore:
375
+ type: number
376
+ avgBaselineScore:
377
+ type: number
378
+ avgDrop:
379
+ type: number
380
+ threshold:
381
+ type: number
382
+ AnalyticsStatusCount:
383
+ type: object
384
+ required: [status, count]
385
+ properties:
386
+ status:
387
+ $ref: "#/components/schemas/TicketStatus"
388
+ count:
389
+ type: integer
390
+ AnalyticsModeCount:
391
+ type: object
392
+ required: [mode, count]
393
+ properties:
394
+ mode:
395
+ type: string
396
+ enum: [manual, semi, auto]
397
+ count:
398
+ type: integer
399
+ AnalyticsBucketCount:
400
+ type: object
401
+ required: [bucketStart, count]
402
+ properties:
403
+ bucketStart:
404
+ type: integer
405
+ count:
406
+ type: integer
407
+ AnalyticsFirstResponseByPriority:
408
+ type: object
409
+ required: [priority, count, avgSeconds]
410
+ properties:
411
+ priority:
412
+ type: string
413
+ nullable: true
414
+ enum: [low, medium, high]
415
+ count:
416
+ type: integer
417
+ avgSeconds:
418
+ type: number
419
+ AnalyticsFirstResponseByCategory:
420
+ type: object
421
+ required: [categoryId, categoryName, count, avgSeconds]
422
+ properties:
423
+ categoryId:
424
+ type: string
425
+ nullable: true
426
+ categoryName:
427
+ type: string
428
+ count:
429
+ type: integer
430
+ avgSeconds:
431
+ type: number
432
+ AnalyticsDistributionPoint:
433
+ type: object
434
+ required: [stars, count]
435
+ properties:
436
+ stars:
437
+ type: integer
438
+ count:
439
+ type: integer
440
+ AnalyticsCategoryPoint:
441
+ type: object
442
+ required: [categoryId, categoryName, count]
443
+ properties:
444
+ categoryId:
445
+ type: string
446
+ nullable: true
447
+ categoryName:
448
+ type: string
449
+ count:
450
+ type: integer
451
+ AnalyticsModeTimelinePoint:
452
+ type: object
453
+ required: [bucketStart, mode, count]
454
+ properties:
455
+ bucketStart:
456
+ type: integer
457
+ mode:
458
+ type: string
459
+ enum: [manual, semi, auto]
460
+ count:
461
+ type: integer
462
+ AnalyticsRagOutcomePoint:
463
+ type: object
464
+ required: [bucketStart, status, count]
465
+ properties:
466
+ bucketStart:
467
+ type: integer
468
+ status:
469
+ type: string
470
+ enum: [running, passed, declined, error]
471
+ count:
472
+ type: integer
473
+ AnalyticsRagVersion:
474
+ type: object
475
+ required:
476
+ [
477
+ id,
478
+ ragScope,
479
+ integrationId,
480
+ vectorizeIndexName,
481
+ status,
482
+ createdAt,
483
+ promotedAt,
484
+ deprecatedAt,
485
+ declineReason
486
+ ]
487
+ properties:
488
+ id:
489
+ type: string
490
+ ragScope:
491
+ $ref: "#/components/schemas/RagScope"
492
+ integrationId:
493
+ type: string
494
+ nullable: true
495
+ vectorizeIndexName:
496
+ type: string
497
+ status:
498
+ type: string
499
+ enum: [candidate, active, deprecated, declined]
500
+ createdAt:
501
+ type: integer
502
+ promotedAt:
503
+ type: integer
504
+ nullable: true
505
+ deprecatedAt:
506
+ type: integer
507
+ nullable: true
508
+ declineReason:
509
+ type: string
510
+ nullable: true
511
+ GdprDeletionStats:
512
+ type: object
513
+ required:
514
+ [tenants, principals, tickets, messages, events, attachments, agentRuns, aliasRatings]
515
+ properties:
516
+ tenants:
517
+ type: integer
518
+ principals:
519
+ type: integer
520
+ tickets:
521
+ type: integer
522
+ messages:
523
+ type: integer
524
+ events:
525
+ type: integer
526
+ attachments:
527
+ type: integer
528
+ agentRuns:
529
+ type: integer
530
+ aliasRatings:
531
+ type: integer
532
+ GdprSelectorInput:
533
+ type: object
534
+ properties:
535
+ integrationId:
536
+ type: string
537
+ nullable: true
538
+ tenantExternalId:
539
+ type: string
540
+ nullable: true
541
+ shopDomain:
542
+ type: string
543
+ nullable: true
544
+ shop_domain:
545
+ type: string
546
+ shop_id:
547
+ oneOf:
548
+ - type: string
549
+ - type: integer
550
+ GdprCustomerInput:
551
+ type: object
552
+ properties:
553
+ id:
554
+ oneOf:
555
+ - type: string
556
+ - type: integer
557
+ email:
558
+ type: string
559
+ GdprCustomerSelectorInput:
560
+ allOf:
561
+ - $ref: "#/components/schemas/GdprSelectorInput"
562
+ - type: object
563
+ properties:
564
+ principalExternalId:
565
+ type: string
566
+ customer:
567
+ $ref: "#/components/schemas/GdprCustomerInput"
568
+ paths:
569
+ /v1/tickets:
570
+ post:
571
+ security:
572
+ - SchrodingerSignedHeaders: []
573
+ operationId: createTicket
574
+ requestBody:
575
+ required: true
576
+ content:
577
+ application/json:
578
+ schema:
579
+ $ref: "#/components/schemas/CreateTicketRequest"
580
+ responses:
581
+ "201":
582
+ description: Ticket created
583
+ content:
584
+ application/json:
585
+ schema:
586
+ $ref: "#/components/schemas/Ticket"
587
+ default:
588
+ description: Error
589
+ content:
590
+ application/json:
591
+ schema:
592
+ $ref: "#/components/schemas/ErrorResponse"
593
+ get:
594
+ security:
595
+ - SchrodingerSignedHeaders: []
596
+ operationId: listTickets
597
+ parameters:
598
+ - name: tenantExternalId
599
+ in: query
600
+ required: true
601
+ schema:
602
+ type: string
603
+ - name: status
604
+ in: query
605
+ required: false
606
+ schema:
607
+ $ref: "#/components/schemas/TicketStatus"
608
+ responses:
609
+ "200":
610
+ description: Ticket list
611
+ content:
612
+ application/json:
613
+ schema:
614
+ type: object
615
+ required: [items]
616
+ properties:
617
+ items:
618
+ type: array
619
+ items:
620
+ $ref: "#/components/schemas/Ticket"
621
+ /v1/tickets/{ticketId}:
622
+ get:
623
+ security:
624
+ - SchrodingerSignedHeaders: []
625
+ operationId: getTicket
626
+ parameters:
627
+ - $ref: "#/components/parameters/TicketId"
628
+ - name: tenantExternalId
629
+ in: query
630
+ required: true
631
+ schema:
632
+ type: string
633
+ responses:
634
+ "200":
635
+ description: Ticket
636
+ content:
637
+ application/json:
638
+ schema:
639
+ $ref: "#/components/schemas/Ticket"
640
+ "404":
641
+ description: Not found
642
+ content:
643
+ application/json:
644
+ schema:
645
+ $ref: "#/components/schemas/ErrorResponse"
646
+ /v1/tickets/{ticketId}/history:
647
+ get:
648
+ security:
649
+ - SchrodingerSignedHeaders: []
650
+ operationId: getTicketHistory
651
+ parameters:
652
+ - $ref: "#/components/parameters/TicketId"
653
+ - name: tenantExternalId
654
+ in: query
655
+ required: true
656
+ schema:
657
+ type: string
658
+ responses:
659
+ "200":
660
+ description: Ticket history events
661
+ content:
662
+ application/json:
663
+ schema:
664
+ type: object
665
+ properties:
666
+ items:
667
+ type: array
668
+ items:
669
+ $ref: "#/components/schemas/TicketEvent"
670
+ default:
671
+ description: Error
672
+ content:
673
+ application/json:
674
+ schema:
675
+ $ref: "#/components/schemas/ErrorResponse"
676
+ /v1/tickets/{ticketId}/messages:
677
+ post:
678
+ security:
679
+ - SchrodingerSignedHeaders: []
680
+ operationId: createMessage
681
+ parameters:
682
+ - $ref: "#/components/parameters/TicketId"
683
+ requestBody:
684
+ required: true
685
+ content:
686
+ application/json:
687
+ schema:
688
+ $ref: "#/components/schemas/CreateMessageRequest"
689
+ responses:
690
+ "201":
691
+ description: Message created
692
+ content:
693
+ application/json:
694
+ schema:
695
+ $ref: "#/components/schemas/Message"
696
+ /v1/tickets/{ticketId}/close:
697
+ post:
698
+ security:
699
+ - SchrodingerSignedHeaders: []
700
+ operationId: closeTicket
701
+ parameters:
702
+ - $ref: "#/components/parameters/TicketId"
703
+ requestBody:
704
+ required: true
705
+ content:
706
+ application/json:
707
+ schema:
708
+ type: object
709
+ required: [tenantExternalId]
710
+ properties:
711
+ tenantExternalId:
712
+ type: string
713
+ responses:
714
+ "200":
715
+ description: Ticket updated
716
+ content:
717
+ application/json:
718
+ schema:
719
+ $ref: "#/components/schemas/Ticket"
720
+ /v1/tickets/{ticketId}/archive:
721
+ post:
722
+ security:
723
+ - SchrodingerSignedHeaders: []
724
+ operationId: archiveTicket
725
+ parameters:
726
+ - $ref: "#/components/parameters/TicketId"
727
+ requestBody:
728
+ required: true
729
+ content:
730
+ application/json:
731
+ schema:
732
+ type: object
733
+ required: [tenantExternalId]
734
+ properties:
735
+ tenantExternalId:
736
+ type: string
737
+ responses:
738
+ "200":
739
+ description: Ticket updated
740
+ content:
741
+ application/json:
742
+ schema:
743
+ $ref: "#/components/schemas/Ticket"
744
+ /v1/tickets/{ticketId}/reopen:
745
+ post:
746
+ security:
747
+ - SchrodingerSignedHeaders: []
748
+ operationId: reopenTicket
749
+ parameters:
750
+ - $ref: "#/components/parameters/TicketId"
751
+ requestBody:
752
+ required: true
753
+ content:
754
+ application/json:
755
+ schema:
756
+ type: object
757
+ required: [tenantExternalId]
758
+ properties:
759
+ tenantExternalId:
760
+ type: string
761
+ responses:
762
+ "200":
763
+ description: Ticket updated
764
+ content:
765
+ application/json:
766
+ schema:
767
+ $ref: "#/components/schemas/Ticket"
768
+ /v1/tickets/{ticketId}/ratings:
769
+ post:
770
+ security:
771
+ - SchrodingerSignedHeaders: []
772
+ operationId: rateTicket
773
+ parameters:
774
+ - $ref: "#/components/parameters/TicketId"
775
+ requestBody:
776
+ required: true
777
+ content:
778
+ application/json:
779
+ schema:
780
+ $ref: "#/components/schemas/RatingRequest"
781
+ responses:
782
+ "200":
783
+ description: Ticket rating accepted
784
+ content:
785
+ application/json:
786
+ schema:
787
+ type: object
788
+ required: [ok]
789
+ properties:
790
+ ok:
791
+ type: boolean
792
+ /v1/messages/{messageId}/ratings:
793
+ post:
794
+ security:
795
+ - SchrodingerSignedHeaders: []
796
+ operationId: rateMessage
797
+ parameters:
798
+ - name: messageId
799
+ in: path
800
+ required: true
801
+ schema:
802
+ type: string
803
+ requestBody:
804
+ required: true
805
+ content:
806
+ application/json:
807
+ schema:
808
+ $ref: "#/components/schemas/RatingRequest"
809
+ responses:
810
+ "200":
811
+ description: Message rating accepted
812
+ content:
813
+ application/json:
814
+ schema:
815
+ type: object
816
+ required: [ok, aliasRated]
817
+ properties:
818
+ ok:
819
+ type: boolean
820
+ aliasRated:
821
+ type: boolean
822
+ /v1/categories:
823
+ get:
824
+ security:
825
+ - SchrodingerSignedHeaders: []
826
+ operationId: listCategories
827
+ responses:
828
+ "200":
829
+ description: Categories
830
+ content:
831
+ application/json:
832
+ schema:
833
+ type: object
834
+ required: [items]
835
+ properties:
836
+ items:
837
+ type: array
838
+ items:
839
+ $ref: "#/components/schemas/PublicCategory"
840
+ /v1/portal-config:
841
+ get:
842
+ security:
843
+ - SchrodingerSignedHeaders: []
844
+ operationId: getPortalConfig
845
+ responses:
846
+ "200":
847
+ description: Portal configuration
848
+ content:
849
+ application/json:
850
+ schema:
851
+ $ref: "#/components/schemas/PortalConfig"
852
+ /v1/uploads/init:
853
+ post:
854
+ security:
855
+ - SchrodingerSignedHeaders: []
856
+ operationId: initUploads
857
+ requestBody:
858
+ required: true
859
+ content:
860
+ application/json:
861
+ schema:
862
+ $ref: "#/components/schemas/UploadInitRequest"
863
+ responses:
864
+ "200":
865
+ description: Upload sessions initialized
866
+ content:
867
+ application/json:
868
+ schema:
869
+ type: object
870
+ required: [uploads]
871
+ properties:
872
+ uploads:
873
+ type: array
874
+ items:
875
+ type: object
876
+ required: [uploadId, attachmentId, filename, putUrl]
877
+ properties:
878
+ uploadId:
879
+ type: string
880
+ attachmentId:
881
+ type: string
882
+ filename:
883
+ type: string
884
+ putUrl:
885
+ type: string
886
+ /v1/uploads/complete:
887
+ post:
888
+ security:
889
+ - SchrodingerSignedHeaders: []
890
+ operationId: completeUploads
891
+ requestBody:
892
+ required: true
893
+ content:
894
+ application/json:
895
+ schema:
896
+ $ref: "#/components/schemas/UploadCompleteRequest"
897
+ responses:
898
+ "200":
899
+ description: Upload completion accepted
900
+ content:
901
+ application/json:
902
+ schema:
903
+ type: object
904
+ required: [completed, scanStatus]
905
+ properties:
906
+ completed:
907
+ type: integer
908
+ scanStatus:
909
+ type: string
910
+ enum: [pending]
911
+ /v1/uploads/{uploadId}/data:
912
+ put:
913
+ security: []
914
+ operationId: uploadAttachmentData
915
+ parameters:
916
+ - name: uploadId
917
+ in: path
918
+ required: true
919
+ schema:
920
+ type: string
921
+ - name: expires
922
+ in: query
923
+ required: true
924
+ schema:
925
+ type: integer
926
+ - name: sig
927
+ in: query
928
+ required: true
929
+ schema:
930
+ type: string
931
+ requestBody:
932
+ required: true
933
+ content:
934
+ application/octet-stream:
935
+ schema:
936
+ type: string
937
+ format: binary
938
+ responses:
939
+ "200":
940
+ description: Upload accepted
941
+ content:
942
+ application/json:
943
+ schema:
944
+ type: object
945
+ required: [ok]
946
+ properties:
947
+ ok:
948
+ type: boolean
949
+ /admin/integrations:
950
+ get:
951
+ security:
952
+ - AdminBearer: []
953
+ operationId: listIntegrations
954
+ responses:
955
+ "200":
956
+ description: Integration list
957
+ content:
958
+ application/json:
959
+ schema:
960
+ type: object
961
+ required: [items]
962
+ properties:
963
+ items:
964
+ type: array
965
+ items:
966
+ $ref: "#/components/schemas/Integration"
967
+ post:
968
+ security:
969
+ - AdminBearer: []
970
+ operationId: createIntegration
971
+ requestBody:
972
+ required: true
973
+ content:
974
+ application/json:
975
+ schema:
976
+ $ref: "#/components/schemas/CreateIntegrationRequest"
977
+ responses:
978
+ "201":
979
+ description: Integration created
980
+ content:
981
+ application/json:
982
+ schema:
983
+ $ref: "#/components/schemas/Integration"
984
+ /admin/integrations/{id}/keys:
985
+ get:
986
+ security:
987
+ - AdminBearer: []
988
+ operationId: listIntegrationKeys
989
+ parameters:
990
+ - name: id
991
+ in: path
992
+ required: true
993
+ schema:
994
+ type: string
995
+ responses:
996
+ "200":
997
+ description: Keys list
998
+ content:
999
+ application/json:
1000
+ schema:
1001
+ type: object
1002
+ required: [items]
1003
+ properties:
1004
+ items:
1005
+ type: array
1006
+ items:
1007
+ type: object
1008
+ required: [keyId, createdAt]
1009
+ properties:
1010
+ keyId:
1011
+ type: string
1012
+ createdAt:
1013
+ type: integer
1014
+ revokedAt:
1015
+ type: integer
1016
+ nullable: true
1017
+ post:
1018
+ security:
1019
+ - AdminBearer: []
1020
+ operationId: createIntegrationKey
1021
+ parameters:
1022
+ - name: id
1023
+ in: path
1024
+ required: true
1025
+ schema:
1026
+ type: string
1027
+ responses:
1028
+ "201":
1029
+ description: Key created
1030
+ content:
1031
+ application/json:
1032
+ schema:
1033
+ $ref: "#/components/schemas/CreatedKey"
1034
+ /admin/integrations/{id}/manual-categories:
1035
+ put:
1036
+ security:
1037
+ - AdminBearer: []
1038
+ operationId: updateManualCategories
1039
+ parameters:
1040
+ - name: id
1041
+ in: path
1042
+ required: true
1043
+ schema:
1044
+ type: string
1045
+ requestBody:
1046
+ required: true
1047
+ content:
1048
+ application/json:
1049
+ schema:
1050
+ type: object
1051
+ required: [manualCategoryIds]
1052
+ properties:
1053
+ manualCategoryIds:
1054
+ type: array
1055
+ items:
1056
+ type: string
1057
+ responses:
1058
+ "200":
1059
+ description: Updated
1060
+ content:
1061
+ application/json:
1062
+ schema:
1063
+ type: object
1064
+ properties:
1065
+ ok:
1066
+ type: boolean
1067
+ /admin/integrations/{id}/categories:
1068
+ get:
1069
+ security:
1070
+ - AdminBearer: []
1071
+ operationId: listAdminCategories
1072
+ parameters:
1073
+ - name: id
1074
+ in: path
1075
+ required: true
1076
+ schema:
1077
+ type: string
1078
+ responses:
1079
+ "200":
1080
+ description: Categories
1081
+ content:
1082
+ application/json:
1083
+ schema:
1084
+ type: object
1085
+ required: [items]
1086
+ properties:
1087
+ items:
1088
+ type: array
1089
+ items:
1090
+ $ref: "#/components/schemas/Category"
1091
+ post:
1092
+ security:
1093
+ - AdminBearer: []
1094
+ operationId: createCategory
1095
+ parameters:
1096
+ - name: id
1097
+ in: path
1098
+ required: true
1099
+ schema:
1100
+ type: string
1101
+ requestBody:
1102
+ required: true
1103
+ content:
1104
+ application/json:
1105
+ schema:
1106
+ type: object
1107
+ required: [name]
1108
+ properties:
1109
+ name:
1110
+ type: string
1111
+ responses:
1112
+ "201":
1113
+ description: Category created
1114
+ content:
1115
+ application/json:
1116
+ schema:
1117
+ $ref: "#/components/schemas/Category"
1118
+ /admin/integrations/{id}/aliases:
1119
+ get:
1120
+ security:
1121
+ - AdminBearer: []
1122
+ operationId: listAliases
1123
+ parameters:
1124
+ - name: id
1125
+ in: path
1126
+ required: true
1127
+ schema:
1128
+ type: string
1129
+ responses:
1130
+ "200":
1131
+ description: Aliases
1132
+ content:
1133
+ application/json:
1134
+ schema:
1135
+ type: object
1136
+ required: [items]
1137
+ properties:
1138
+ items:
1139
+ type: array
1140
+ items:
1141
+ $ref: "#/components/schemas/Alias"
1142
+ post:
1143
+ security:
1144
+ - AdminBearer: []
1145
+ operationId: createAlias
1146
+ parameters:
1147
+ - name: id
1148
+ in: path
1149
+ required: true
1150
+ schema:
1151
+ type: string
1152
+ requestBody:
1153
+ required: true
1154
+ content:
1155
+ application/json:
1156
+ schema:
1157
+ type: object
1158
+ required: [department, displayName]
1159
+ properties:
1160
+ department:
1161
+ type: string
1162
+ displayName:
1163
+ type: string
1164
+ avatarUrl:
1165
+ type: string
1166
+ nullable: true
1167
+ toneStyle:
1168
+ type: object
1169
+ additionalProperties: true
1170
+ isActive:
1171
+ type: boolean
1172
+ responses:
1173
+ "201":
1174
+ description: Alias created
1175
+ content:
1176
+ application/json:
1177
+ schema:
1178
+ $ref: "#/components/schemas/Alias"
1179
+ /admin/aliases/{aliasId}:
1180
+ patch:
1181
+ security:
1182
+ - AdminBearer: []
1183
+ operationId: updateAlias
1184
+ parameters:
1185
+ - name: aliasId
1186
+ in: path
1187
+ required: true
1188
+ schema:
1189
+ type: string
1190
+ requestBody:
1191
+ required: true
1192
+ content:
1193
+ application/json:
1194
+ schema:
1195
+ type: object
1196
+ properties:
1197
+ department:
1198
+ type: string
1199
+ displayName:
1200
+ type: string
1201
+ avatarUrl:
1202
+ type: string
1203
+ nullable: true
1204
+ toneStyle:
1205
+ type: object
1206
+ additionalProperties: true
1207
+ isActive:
1208
+ type: boolean
1209
+ responses:
1210
+ "200":
1211
+ description: Alias updated
1212
+ delete:
1213
+ security:
1214
+ - AdminBearer: []
1215
+ operationId: deleteAlias
1216
+ parameters:
1217
+ - name: aliasId
1218
+ in: path
1219
+ required: true
1220
+ schema:
1221
+ type: string
1222
+ responses:
1223
+ "200":
1224
+ description: Alias deactivated
1225
+ /admin/integrations/{id}/macros:
1226
+ get:
1227
+ security:
1228
+ - AdminBearer: []
1229
+ operationId: listMacros
1230
+ parameters:
1231
+ - name: id
1232
+ in: path
1233
+ required: true
1234
+ schema:
1235
+ type: string
1236
+ responses:
1237
+ "200":
1238
+ description: Macros
1239
+ content:
1240
+ application/json:
1241
+ schema:
1242
+ type: object
1243
+ required: [items]
1244
+ properties:
1245
+ items:
1246
+ type: array
1247
+ items:
1248
+ $ref: "#/components/schemas/Macro"
1249
+ post:
1250
+ security:
1251
+ - AdminBearer: []
1252
+ operationId: createMacro
1253
+ parameters:
1254
+ - name: id
1255
+ in: path
1256
+ required: true
1257
+ schema:
1258
+ type: string
1259
+ requestBody:
1260
+ required: true
1261
+ content:
1262
+ application/json:
1263
+ schema:
1264
+ type: object
1265
+ required: [title, bodyTemplate]
1266
+ properties:
1267
+ categoryId:
1268
+ type: string
1269
+ nullable: true
1270
+ title:
1271
+ type: string
1272
+ bodyTemplate:
1273
+ type: string
1274
+ isActive:
1275
+ type: boolean
1276
+ responses:
1277
+ "201":
1278
+ description: Macro created
1279
+ content:
1280
+ application/json:
1281
+ schema:
1282
+ $ref: "#/components/schemas/Macro"
1283
+ /admin/macros/{macroId}:
1284
+ patch:
1285
+ security:
1286
+ - AdminBearer: []
1287
+ operationId: updateMacro
1288
+ parameters:
1289
+ - name: macroId
1290
+ in: path
1291
+ required: true
1292
+ schema:
1293
+ type: string
1294
+ requestBody:
1295
+ required: true
1296
+ content:
1297
+ application/json:
1298
+ schema:
1299
+ type: object
1300
+ properties:
1301
+ categoryId:
1302
+ type: string
1303
+ nullable: true
1304
+ title:
1305
+ type: string
1306
+ bodyTemplate:
1307
+ type: string
1308
+ isActive:
1309
+ type: boolean
1310
+ responses:
1311
+ "200":
1312
+ description: Macro updated
1313
+ delete:
1314
+ security:
1315
+ - AdminBearer: []
1316
+ operationId: deleteMacro
1317
+ parameters:
1318
+ - name: macroId
1319
+ in: path
1320
+ required: true
1321
+ schema:
1322
+ type: string
1323
+ responses:
1324
+ "200":
1325
+ description: Macro deleted
1326
+ /admin/tickets/{ticketId}/pause:
1327
+ post:
1328
+ security:
1329
+ - AdminBearer: []
1330
+ operationId: pauseTicketAutomation
1331
+ parameters:
1332
+ - $ref: "#/components/parameters/TicketId"
1333
+ requestBody:
1334
+ required: false
1335
+ content:
1336
+ application/json:
1337
+ schema:
1338
+ type: object
1339
+ properties:
1340
+ pausedBy:
1341
+ type: string
1342
+ reason:
1343
+ type: string
1344
+ responses:
1345
+ "200":
1346
+ description: Ticket automation paused
1347
+ /admin/tickets/{ticketId}/resume:
1348
+ post:
1349
+ security:
1350
+ - AdminBearer: []
1351
+ operationId: resumeTicketAutomation
1352
+ parameters:
1353
+ - $ref: "#/components/parameters/TicketId"
1354
+ requestBody:
1355
+ required: false
1356
+ content:
1357
+ application/json:
1358
+ schema:
1359
+ type: object
1360
+ properties:
1361
+ resumedBy:
1362
+ type: string
1363
+ responses:
1364
+ "200":
1365
+ description: Ticket automation resumed
1366
+ /admin/tickets/{ticketId}/escalate:
1367
+ post:
1368
+ security:
1369
+ - AdminBearer: []
1370
+ operationId: escalateTicket
1371
+ parameters:
1372
+ - $ref: "#/components/parameters/TicketId"
1373
+ requestBody:
1374
+ required: false
1375
+ content:
1376
+ application/json:
1377
+ schema:
1378
+ type: object
1379
+ properties:
1380
+ escalatedBy:
1381
+ type: string
1382
+ reason:
1383
+ type: string
1384
+ responses:
1385
+ "200":
1386
+ description: Ticket escalated
1387
+ /admin/tickets/{ticketId}/draft:
1388
+ post:
1389
+ security:
1390
+ - AdminBearer: []
1391
+ operationId: createTicketDraft
1392
+ parameters:
1393
+ - $ref: "#/components/parameters/TicketId"
1394
+ requestBody:
1395
+ required: false
1396
+ content:
1397
+ application/json:
1398
+ schema:
1399
+ type: object
1400
+ properties:
1401
+ requestedBy:
1402
+ type: string
1403
+ responses:
1404
+ "200":
1405
+ description: Draft prepared
1406
+ content:
1407
+ application/json:
1408
+ schema:
1409
+ type: object
1410
+ required: [draftBody]
1411
+ properties:
1412
+ draftBody:
1413
+ type: string
1414
+ /admin/tickets/{ticketId}/respond:
1415
+ post:
1416
+ security:
1417
+ - AdminBearer: []
1418
+ operationId: respondTicketManually
1419
+ parameters:
1420
+ - $ref: "#/components/parameters/TicketId"
1421
+ requestBody:
1422
+ required: true
1423
+ content:
1424
+ application/json:
1425
+ schema:
1426
+ type: object
1427
+ required: [body]
1428
+ properties:
1429
+ responder:
1430
+ type: string
1431
+ body:
1432
+ type: string
1433
+ responses:
1434
+ "200":
1435
+ description: Ticket response sent
1436
+ /admin/gdpr/shop-redact:
1437
+ post:
1438
+ security:
1439
+ - AdminBearer: []
1440
+ operationId: gdprShopRedact
1441
+ requestBody:
1442
+ required: true
1443
+ content:
1444
+ application/json:
1445
+ schema:
1446
+ $ref: "#/components/schemas/GdprSelectorInput"
1447
+ responses:
1448
+ "200":
1449
+ description: Shop data redaction accepted
1450
+ content:
1451
+ application/json:
1452
+ schema:
1453
+ type: object
1454
+ required: [ok, matchedTenants, deleted]
1455
+ properties:
1456
+ ok:
1457
+ type: boolean
1458
+ matchedTenants:
1459
+ type: integer
1460
+ deleted:
1461
+ $ref: "#/components/schemas/GdprDeletionStats"
1462
+ /admin/gdpr/customer-redact:
1463
+ post:
1464
+ security:
1465
+ - AdminBearer: []
1466
+ operationId: gdprCustomerRedact
1467
+ requestBody:
1468
+ required: true
1469
+ content:
1470
+ application/json:
1471
+ schema:
1472
+ $ref: "#/components/schemas/GdprCustomerSelectorInput"
1473
+ responses:
1474
+ "200":
1475
+ description: Customer data redaction accepted
1476
+ content:
1477
+ application/json:
1478
+ schema:
1479
+ type: object
1480
+ required: [ok, matchedTenants, matchedPrincipals, deleted]
1481
+ properties:
1482
+ ok:
1483
+ type: boolean
1484
+ matchedTenants:
1485
+ type: integer
1486
+ matchedPrincipals:
1487
+ type: integer
1488
+ deleted:
1489
+ $ref: "#/components/schemas/GdprDeletionStats"
1490
+ /admin/gdpr/data-request:
1491
+ post:
1492
+ security:
1493
+ - AdminBearer: []
1494
+ operationId: gdprDataRequest
1495
+ requestBody:
1496
+ required: true
1497
+ content:
1498
+ application/json:
1499
+ schema:
1500
+ $ref: "#/components/schemas/GdprCustomerSelectorInput"
1501
+ responses:
1502
+ "200":
1503
+ description: Customer data package
1504
+ content:
1505
+ application/json:
1506
+ schema:
1507
+ type: object
1508
+ required: [ok, found, data]
1509
+ properties:
1510
+ ok:
1511
+ type: boolean
1512
+ found:
1513
+ type: boolean
1514
+ data:
1515
+ type: object
1516
+ required:
1517
+ [tenants, principals, tickets, messages, events, attachments, aliasRatings]
1518
+ properties:
1519
+ tenants:
1520
+ type: array
1521
+ items:
1522
+ type: object
1523
+ required: [id, integrationId, externalTenantId, shopDomain]
1524
+ properties:
1525
+ id:
1526
+ type: string
1527
+ integrationId:
1528
+ type: string
1529
+ externalTenantId:
1530
+ type: string
1531
+ shopDomain:
1532
+ type: string
1533
+ nullable: true
1534
+ principals:
1535
+ type: array
1536
+ items:
1537
+ type: object
1538
+ required:
1539
+ [
1540
+ id,
1541
+ tenantId,
1542
+ externalPrincipalId,
1543
+ email,
1544
+ displayName,
1545
+ createdAt,
1546
+ lastSeenAt
1547
+ ]
1548
+ properties:
1549
+ id:
1550
+ type: string
1551
+ tenantId:
1552
+ type: string
1553
+ externalPrincipalId:
1554
+ type: string
1555
+ email:
1556
+ type: string
1557
+ nullable: true
1558
+ displayName:
1559
+ type: string
1560
+ nullable: true
1561
+ createdAt:
1562
+ type: integer
1563
+ lastSeenAt:
1564
+ type: integer
1565
+ nullable: true
1566
+ tickets:
1567
+ type: array
1568
+ items:
1569
+ type: object
1570
+ required: [id, tenantId, principalId, status, title, createdAt, updatedAt]
1571
+ properties:
1572
+ id:
1573
+ type: string
1574
+ tenantId:
1575
+ type: string
1576
+ principalId:
1577
+ type: string
1578
+ status:
1579
+ type: string
1580
+ title:
1581
+ type: string
1582
+ createdAt:
1583
+ type: integer
1584
+ updatedAt:
1585
+ type: integer
1586
+ messages:
1587
+ type: array
1588
+ items:
1589
+ type: object
1590
+ required: [id, ticketId, authorType, isPublic, bodyPlain, createdAt]
1591
+ properties:
1592
+ id:
1593
+ type: string
1594
+ ticketId:
1595
+ type: string
1596
+ authorType:
1597
+ type: string
1598
+ isPublic:
1599
+ type: boolean
1600
+ bodyPlain:
1601
+ type: string
1602
+ createdAt:
1603
+ type: integer
1604
+ events:
1605
+ type: array
1606
+ items:
1607
+ type: object
1608
+ required: [id, ticketId, eventType, payloadJson, createdAt]
1609
+ properties:
1610
+ id:
1611
+ type: string
1612
+ ticketId:
1613
+ type: string
1614
+ eventType:
1615
+ type: string
1616
+ payloadJson:
1617
+ type: string
1618
+ createdAt:
1619
+ type: integer
1620
+ attachments:
1621
+ type: array
1622
+ items:
1623
+ type: object
1624
+ required:
1625
+ [id, ticketId, messageId, filename, mime, sizeBytes, sha256, createdAt]
1626
+ properties:
1627
+ id:
1628
+ type: string
1629
+ ticketId:
1630
+ type: string
1631
+ messageId:
1632
+ type: string
1633
+ nullable: true
1634
+ filename:
1635
+ type: string
1636
+ mime:
1637
+ type: string
1638
+ sizeBytes:
1639
+ type: integer
1640
+ sha256:
1641
+ type: string
1642
+ createdAt:
1643
+ type: integer
1644
+ aliasRatings:
1645
+ type: array
1646
+ items:
1647
+ type: object
1648
+ required:
1649
+ [
1650
+ id,
1651
+ aliasId,
1652
+ tenantId,
1653
+ principalId,
1654
+ starsAvg,
1655
+ starsCount,
1656
+ lastStar,
1657
+ isBlockedForPrincipal
1658
+ ]
1659
+ properties:
1660
+ id:
1661
+ type: string
1662
+ aliasId:
1663
+ type: string
1664
+ tenantId:
1665
+ type: string
1666
+ principalId:
1667
+ type: string
1668
+ starsAvg:
1669
+ type: number
1670
+ starsCount:
1671
+ type: integer
1672
+ lastStar:
1673
+ type: integer
1674
+ nullable: true
1675
+ isBlockedForPrincipal:
1676
+ type: boolean
1677
+ /admin/analytics/summary:
1678
+ get:
1679
+ security:
1680
+ - AdminBearer: []
1681
+ operationId: getAnalyticsSummary
1682
+ parameters:
1683
+ - name: integrationId
1684
+ in: query
1685
+ required: false
1686
+ schema:
1687
+ type: string
1688
+ - name: from
1689
+ in: query
1690
+ required: false
1691
+ schema:
1692
+ type: integer
1693
+ - name: to
1694
+ in: query
1695
+ required: false
1696
+ schema:
1697
+ type: integer
1698
+ responses:
1699
+ "200":
1700
+ description: Analytics summary
1701
+ content:
1702
+ application/json:
1703
+ schema:
1704
+ type: object
1705
+ required: [window, tickets, csat, response, rag]
1706
+ properties:
1707
+ window:
1708
+ type: object
1709
+ required: [from, to]
1710
+ properties:
1711
+ from:
1712
+ type: integer
1713
+ to:
1714
+ type: integer
1715
+ tickets:
1716
+ type: object
1717
+ required: [opened, byStatus]
1718
+ properties:
1719
+ opened:
1720
+ type: integer
1721
+ byStatus:
1722
+ type: object
1723
+ required: [Active, InProgress, AwaitingResponse, Closed, Archived]
1724
+ properties:
1725
+ Active:
1726
+ type: integer
1727
+ InProgress:
1728
+ type: integer
1729
+ AwaitingResponse:
1730
+ type: integer
1731
+ Closed:
1732
+ type: integer
1733
+ Archived:
1734
+ type: integer
1735
+ csat:
1736
+ type: object
1737
+ required: [ticketAverage, messageAverage]
1738
+ properties:
1739
+ ticketAverage:
1740
+ type: number
1741
+ nullable: true
1742
+ messageAverage:
1743
+ type: number
1744
+ nullable: true
1745
+ response:
1746
+ type: object
1747
+ required: [avgFirstResponseSeconds]
1748
+ properties:
1749
+ avgFirstResponseSeconds:
1750
+ type: number
1751
+ nullable: true
1752
+ rag:
1753
+ type: object
1754
+ required: [runsTotal, running, passed, declined, error]
1755
+ properties:
1756
+ runsTotal:
1757
+ type: integer
1758
+ running:
1759
+ type: integer
1760
+ passed:
1761
+ type: integer
1762
+ declined:
1763
+ type: integer
1764
+ error:
1765
+ type: integer
1766
+ /admin/analytics/tickets:
1767
+ get:
1768
+ security:
1769
+ - AdminBearer: []
1770
+ operationId: getTicketAnalytics
1771
+ parameters:
1772
+ - name: integrationId
1773
+ in: query
1774
+ required: false
1775
+ schema:
1776
+ type: string
1777
+ - name: from
1778
+ in: query
1779
+ required: false
1780
+ schema:
1781
+ type: integer
1782
+ - name: to
1783
+ in: query
1784
+ required: false
1785
+ schema:
1786
+ type: integer
1787
+ - name: bucketSeconds
1788
+ in: query
1789
+ required: false
1790
+ schema:
1791
+ type: integer
1792
+ responses:
1793
+ "200":
1794
+ description: Ticket analytics
1795
+ content:
1796
+ application/json:
1797
+ schema:
1798
+ type: object
1799
+ required:
1800
+ [
1801
+ window,
1802
+ openedSeries,
1803
+ byStatus,
1804
+ avgFirstResponseByPriority,
1805
+ avgFirstResponseByCategory
1806
+ ]
1807
+ properties:
1808
+ window:
1809
+ type: object
1810
+ required: [from, to, bucketSeconds]
1811
+ properties:
1812
+ from:
1813
+ type: integer
1814
+ to:
1815
+ type: integer
1816
+ bucketSeconds:
1817
+ type: integer
1818
+ openedSeries:
1819
+ type: array
1820
+ items:
1821
+ $ref: "#/components/schemas/AnalyticsBucketCount"
1822
+ byStatus:
1823
+ type: array
1824
+ items:
1825
+ $ref: "#/components/schemas/AnalyticsStatusCount"
1826
+ avgFirstResponseByPriority:
1827
+ type: array
1828
+ items:
1829
+ $ref: "#/components/schemas/AnalyticsFirstResponseByPriority"
1830
+ avgFirstResponseByCategory:
1831
+ type: array
1832
+ items:
1833
+ $ref: "#/components/schemas/AnalyticsFirstResponseByCategory"
1834
+ /admin/analytics/csat:
1835
+ get:
1836
+ security:
1837
+ - AdminBearer: []
1838
+ operationId: getCsatAnalytics
1839
+ parameters:
1840
+ - name: integrationId
1841
+ in: query
1842
+ required: false
1843
+ schema:
1844
+ type: string
1845
+ - name: from
1846
+ in: query
1847
+ required: false
1848
+ schema:
1849
+ type: integer
1850
+ - name: to
1851
+ in: query
1852
+ required: false
1853
+ schema:
1854
+ type: integer
1855
+ responses:
1856
+ "200":
1857
+ description: CSAT analytics
1858
+ content:
1859
+ application/json:
1860
+ schema:
1861
+ type: object
1862
+ required:
1863
+ [window, ticketDistribution, messageDistribution, ticketAverage, messageAverage]
1864
+ properties:
1865
+ window:
1866
+ type: object
1867
+ required: [from, to]
1868
+ properties:
1869
+ from:
1870
+ type: integer
1871
+ to:
1872
+ type: integer
1873
+ ticketDistribution:
1874
+ type: array
1875
+ items:
1876
+ $ref: "#/components/schemas/AnalyticsDistributionPoint"
1877
+ messageDistribution:
1878
+ type: array
1879
+ items:
1880
+ $ref: "#/components/schemas/AnalyticsDistributionPoint"
1881
+ ticketAverage:
1882
+ type: number
1883
+ nullable: true
1884
+ messageAverage:
1885
+ type: number
1886
+ nullable: true
1887
+ /admin/analytics/categories:
1888
+ get:
1889
+ security:
1890
+ - AdminBearer: []
1891
+ operationId: getCategoryAnalytics
1892
+ parameters:
1893
+ - name: integrationId
1894
+ in: query
1895
+ required: false
1896
+ schema:
1897
+ type: string
1898
+ - name: from
1899
+ in: query
1900
+ required: false
1901
+ schema:
1902
+ type: integer
1903
+ - name: to
1904
+ in: query
1905
+ required: false
1906
+ schema:
1907
+ type: integer
1908
+ responses:
1909
+ "200":
1910
+ description: Category analytics
1911
+ content:
1912
+ application/json:
1913
+ schema:
1914
+ type: object
1915
+ required: [window, overall, perIntegration]
1916
+ properties:
1917
+ window:
1918
+ type: object
1919
+ required: [from, to]
1920
+ properties:
1921
+ from:
1922
+ type: integer
1923
+ to:
1924
+ type: integer
1925
+ overall:
1926
+ type: array
1927
+ items:
1928
+ $ref: "#/components/schemas/AnalyticsCategoryPoint"
1929
+ perIntegration:
1930
+ type: array
1931
+ items:
1932
+ type: object
1933
+ required: [integrationId, items]
1934
+ properties:
1935
+ integrationId:
1936
+ type: string
1937
+ items:
1938
+ type: array
1939
+ items:
1940
+ $ref: "#/components/schemas/AnalyticsCategoryPoint"
1941
+ /admin/analytics/modes:
1942
+ get:
1943
+ security:
1944
+ - AdminBearer: []
1945
+ operationId: getModeAnalytics
1946
+ parameters:
1947
+ - name: integrationId
1948
+ in: query
1949
+ required: false
1950
+ schema:
1951
+ type: string
1952
+ - name: from
1953
+ in: query
1954
+ required: false
1955
+ schema:
1956
+ type: integer
1957
+ - name: to
1958
+ in: query
1959
+ required: false
1960
+ schema:
1961
+ type: integer
1962
+ - name: bucketSeconds
1963
+ in: query
1964
+ required: false
1965
+ schema:
1966
+ type: integer
1967
+ responses:
1968
+ "200":
1969
+ description: Automation mode analytics
1970
+ content:
1971
+ application/json:
1972
+ schema:
1973
+ type: object
1974
+ required: [window, snapshot, timeline]
1975
+ properties:
1976
+ window:
1977
+ type: object
1978
+ required: [from, to, bucketSeconds]
1979
+ properties:
1980
+ from:
1981
+ type: integer
1982
+ to:
1983
+ type: integer
1984
+ bucketSeconds:
1985
+ type: integer
1986
+ snapshot:
1987
+ type: array
1988
+ items:
1989
+ $ref: "#/components/schemas/AnalyticsModeCount"
1990
+ timeline:
1991
+ type: array
1992
+ items:
1993
+ $ref: "#/components/schemas/AnalyticsModeTimelinePoint"
1994
+ /admin/analytics/rag:
1995
+ get:
1996
+ security:
1997
+ - AdminBearer: []
1998
+ operationId: getRagAnalytics
1999
+ parameters:
2000
+ - name: integrationId
2001
+ in: query
2002
+ required: false
2003
+ schema:
2004
+ type: string
2005
+ - name: from
2006
+ in: query
2007
+ required: false
2008
+ schema:
2009
+ type: integer
2010
+ - name: to
2011
+ in: query
2012
+ required: false
2013
+ schema:
2014
+ type: integer
2015
+ - name: bucketSeconds
2016
+ in: query
2017
+ required: false
2018
+ schema:
2019
+ type: integer
2020
+ responses:
2021
+ "200":
2022
+ description: RAG analytics
2023
+ content:
2024
+ application/json:
2025
+ schema:
2026
+ type: object
2027
+ required: [window, versions, outcomesTimeline, runStatus]
2028
+ properties:
2029
+ window:
2030
+ type: object
2031
+ required: [from, to, bucketSeconds]
2032
+ properties:
2033
+ from:
2034
+ type: integer
2035
+ to:
2036
+ type: integer
2037
+ bucketSeconds:
2038
+ type: integer
2039
+ versions:
2040
+ type: array
2041
+ items:
2042
+ $ref: "#/components/schemas/AnalyticsRagVersion"
2043
+ outcomesTimeline:
2044
+ type: array
2045
+ items:
2046
+ $ref: "#/components/schemas/AnalyticsRagOutcomePoint"
2047
+ runStatus:
2048
+ type: array
2049
+ items:
2050
+ type: object
2051
+ required: [status, count]
2052
+ properties:
2053
+ status:
2054
+ type: string
2055
+ enum: [running, passed, declined, error]
2056
+ count:
2057
+ type: integer
2058
+ /admin/rag/sources:
2059
+ get:
2060
+ security:
2061
+ - AdminBearer: []
2062
+ operationId: listRagSources
2063
+ parameters:
2064
+ - name: integrationId
2065
+ in: query
2066
+ required: false
2067
+ schema:
2068
+ type: string
2069
+ responses:
2070
+ "200":
2071
+ description: RAG sources list
2072
+ content:
2073
+ application/json:
2074
+ schema:
2075
+ type: object
2076
+ required: [items]
2077
+ properties:
2078
+ items:
2079
+ type: array
2080
+ items:
2081
+ $ref: "#/components/schemas/RagSource"
2082
+ post:
2083
+ security:
2084
+ - AdminBearer: []
2085
+ operationId: createRagSource
2086
+ requestBody:
2087
+ required: true
2088
+ content:
2089
+ application/json:
2090
+ schema:
2091
+ type: object
2092
+ required: [ragScope, url, type]
2093
+ properties:
2094
+ ragScope:
2095
+ $ref: "#/components/schemas/RagScope"
2096
+ integrationId:
2097
+ type: string
2098
+ nullable: true
2099
+ url:
2100
+ type: string
2101
+ type:
2102
+ type: string
2103
+ responses:
2104
+ "201":
2105
+ description: RAG source created
2106
+ content:
2107
+ application/json:
2108
+ schema:
2109
+ type: object
2110
+ required: [id, ragScope, integrationId, url, type, status]
2111
+ properties:
2112
+ id:
2113
+ type: string
2114
+ ragScope:
2115
+ $ref: "#/components/schemas/RagScope"
2116
+ integrationId:
2117
+ type: string
2118
+ nullable: true
2119
+ url:
2120
+ type: string
2121
+ type:
2122
+ type: string
2123
+ status:
2124
+ type: string
2125
+ "409":
2126
+ description: Source with the same URL already exists
2127
+ content:
2128
+ application/json:
2129
+ schema:
2130
+ $ref: "#/components/schemas/ErrorResponse"
2131
+ /admin/rag/sources/{sourceId}:
2132
+ patch:
2133
+ security:
2134
+ - AdminBearer: []
2135
+ operationId: updateRagSource
2136
+ parameters:
2137
+ - name: sourceId
2138
+ in: path
2139
+ required: true
2140
+ schema:
2141
+ type: string
2142
+ requestBody:
2143
+ required: true
2144
+ content:
2145
+ application/json:
2146
+ schema:
2147
+ type: object
2148
+ properties:
2149
+ url:
2150
+ type: string
2151
+ type:
2152
+ type: string
2153
+ status:
2154
+ type: string
2155
+ enum: [active, inactive]
2156
+ responses:
2157
+ "200":
2158
+ description: Source updated
2159
+ content:
2160
+ application/json:
2161
+ schema:
2162
+ type: object
2163
+ required: [ok]
2164
+ properties:
2165
+ ok:
2166
+ type: boolean
2167
+ "404":
2168
+ description: Source not found
2169
+ content:
2170
+ application/json:
2171
+ schema:
2172
+ $ref: "#/components/schemas/ErrorResponse"
2173
+ "409":
2174
+ description: Source with the same URL already exists
2175
+ content:
2176
+ application/json:
2177
+ schema:
2178
+ $ref: "#/components/schemas/ErrorResponse"
2179
+ delete:
2180
+ security:
2181
+ - AdminBearer: []
2182
+ operationId: deleteRagSource
2183
+ parameters:
2184
+ - name: sourceId
2185
+ in: path
2186
+ required: true
2187
+ schema:
2188
+ type: string
2189
+ responses:
2190
+ "200":
2191
+ description: Source deleted
2192
+ content:
2193
+ application/json:
2194
+ schema:
2195
+ type: object
2196
+ required: [ok]
2197
+ properties:
2198
+ ok:
2199
+ type: boolean
2200
+ "404":
2201
+ description: Source not found
2202
+ content:
2203
+ application/json:
2204
+ schema:
2205
+ $ref: "#/components/schemas/ErrorResponse"
2206
+ /admin/rag/build:
2207
+ post:
2208
+ security:
2209
+ - AdminBearer: []
2210
+ operationId: buildRagCandidate
2211
+ requestBody:
2212
+ required: true
2213
+ content:
2214
+ application/json:
2215
+ schema:
2216
+ type: object
2217
+ required: [ragScope]
2218
+ properties:
2219
+ ragScope:
2220
+ $ref: "#/components/schemas/RagScope"
2221
+ integrationId:
2222
+ type: string
2223
+ nullable: true
2224
+ responses:
2225
+ "201":
2226
+ description: RAG candidate version created
2227
+ content:
2228
+ application/json:
2229
+ schema:
2230
+ type: object
2231
+ required: [versionId, vectorizeIndexName, status]
2232
+ properties:
2233
+ versionId:
2234
+ type: string
2235
+ vectorizeIndexName:
2236
+ type: string
2237
+ status:
2238
+ type: string
2239
+ enum: [candidate]
2240
+ /admin/rag/golden/run:
2241
+ post:
2242
+ security:
2243
+ - AdminBearer: []
2244
+ operationId: runRagGoldenSuite
2245
+ requestBody:
2246
+ required: true
2247
+ content:
2248
+ application/json:
2249
+ schema:
2250
+ type: object
2251
+ required: [ragScope, candidateVersionId]
2252
+ properties:
2253
+ ragScope:
2254
+ $ref: "#/components/schemas/RagScope"
2255
+ integrationId:
2256
+ type: string
2257
+ nullable: true
2258
+ candidateVersionId:
2259
+ type: string
2260
+ baselineVersionId:
2261
+ type: string
2262
+ nullable: true
2263
+ judgeModel:
2264
+ type: string
2265
+ responses:
2266
+ "200":
2267
+ description: Golden test run completed
2268
+ content:
2269
+ application/json:
2270
+ schema:
2271
+ type: object
2272
+ required: [runId, status, summary]
2273
+ properties:
2274
+ runId:
2275
+ type: string
2276
+ status:
2277
+ type: string
2278
+ enum: [passed, declined]
2279
+ summary:
2280
+ $ref: "#/components/schemas/RagGoldenRunSummary"
2281
+ /admin/rag/promote/{versionId}:
2282
+ post:
2283
+ security:
2284
+ - AdminBearer: []
2285
+ operationId: promoteRagVersion
2286
+ parameters:
2287
+ - name: versionId
2288
+ in: path
2289
+ required: true
2290
+ schema:
2291
+ type: string
2292
+ responses:
2293
+ "200":
2294
+ description: Candidate promoted
2295
+ content:
2296
+ application/json:
2297
+ schema:
2298
+ type: object
2299
+ required: [ok, activatedVersionId, deprecatedVersionId]
2300
+ properties:
2301
+ ok:
2302
+ type: boolean
2303
+ activatedVersionId:
2304
+ type: string
2305
+ deprecatedVersionId:
2306
+ type: string
2307
+ nullable: true
2308
+ /admin/rag/deprecate/{versionId}:
2309
+ post:
2310
+ security:
2311
+ - AdminBearer: []
2312
+ operationId: deprecateRagVersion
2313
+ parameters:
2314
+ - name: versionId
2315
+ in: path
2316
+ required: true
2317
+ schema:
2318
+ type: string
2319
+ requestBody:
2320
+ required: false
2321
+ content:
2322
+ application/json:
2323
+ schema:
2324
+ type: object
2325
+ properties:
2326
+ reason:
2327
+ type: string
2328
+ responses:
2329
+ "200":
2330
+ description: Version deprecated
2331
+ content:
2332
+ application/json:
2333
+ schema:
2334
+ type: object
2335
+ required: [ok]
2336
+ properties:
2337
+ ok:
2338
+ type: boolean
2339
+ /admin/rag/golden/tests:
2340
+ get:
2341
+ security:
2342
+ - AdminBearer: []
2343
+ operationId: listRagGoldenTests
2344
+ parameters:
2345
+ - name: ragScope
2346
+ in: query
2347
+ required: true
2348
+ schema:
2349
+ $ref: "#/components/schemas/RagScope"
2350
+ - name: integrationId
2351
+ in: query
2352
+ required: false
2353
+ schema:
2354
+ type: string
2355
+ responses:
2356
+ "200":
2357
+ description: Golden tests list
2358
+ content:
2359
+ application/json:
2360
+ schema:
2361
+ type: object
2362
+ required: [items]
2363
+ properties:
2364
+ items:
2365
+ type: array
2366
+ items:
2367
+ $ref: "#/components/schemas/RagGoldenTest"
2368
+ post:
2369
+ security:
2370
+ - AdminBearer: []
2371
+ operationId: createRagGoldenTest
2372
+ requestBody:
2373
+ required: true
2374
+ content:
2375
+ application/json:
2376
+ schema:
2377
+ type: object
2378
+ required: [ragScope, question, expectedPoints, severity]
2379
+ properties:
2380
+ ragScope:
2381
+ $ref: "#/components/schemas/RagScope"
2382
+ integrationId:
2383
+ type: string
2384
+ nullable: true
2385
+ question:
2386
+ type: string
2387
+ expectedPoints:
2388
+ nullable: true
2389
+ severity:
2390
+ $ref: "#/components/schemas/RagSeverity"
2391
+ isActive:
2392
+ type: boolean
2393
+ responses:
2394
+ "201":
2395
+ description: Golden test created
2396
+ content:
2397
+ application/json:
2398
+ schema:
2399
+ type: object
2400
+ required: [id]
2401
+ properties:
2402
+ id:
2403
+ type: string
2404
+ /admin/rag/golden/tests/{testId}:
2405
+ patch:
2406
+ security:
2407
+ - AdminBearer: []
2408
+ operationId: updateRagGoldenTest
2409
+ parameters:
2410
+ - name: testId
2411
+ in: path
2412
+ required: true
2413
+ schema:
2414
+ type: string
2415
+ requestBody:
2416
+ required: true
2417
+ content:
2418
+ application/json:
2419
+ schema:
2420
+ type: object
2421
+ properties:
2422
+ question:
2423
+ type: string
2424
+ expectedPoints:
2425
+ nullable: true
2426
+ severity:
2427
+ $ref: "#/components/schemas/RagSeverity"
2428
+ isActive:
2429
+ type: boolean
2430
+ responses:
2431
+ "200":
2432
+ description: Golden test updated
2433
+ content:
2434
+ application/json:
2435
+ schema:
2436
+ type: object
2437
+ required: [ok]
2438
+ properties:
2439
+ ok:
2440
+ type: boolean
2441
+ delete:
2442
+ security:
2443
+ - AdminBearer: []
2444
+ operationId: deleteRagGoldenTest
2445
+ parameters:
2446
+ - name: testId
2447
+ in: path
2448
+ required: true
2449
+ schema:
2450
+ type: string
2451
+ responses:
2452
+ "200":
2453
+ description: Golden test deleted
2454
+ content:
2455
+ application/json:
2456
+ schema:
2457
+ type: object
2458
+ required: [ok]
2459
+ properties:
2460
+ ok:
2461
+ type: boolean
2462
+ security:
2463
+ - SchrodingerSignedHeaders: []