-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathswagger.yaml
More file actions
3586 lines (3459 loc) · 103 KB
/
swagger.yaml
File metadata and controls
3586 lines (3459 loc) · 103 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
openapi: 3.0.3
info:
title: Metatavu Home lambdas
description: Metatavu Home lambdas
version: 1.0.0
security:
- bearerAuth: []
paths:
"/slack-avatar":
get:
operationId: getSlackUserAvatarByEmail
summary: Get user's slack avatar by email
description: Fetches user's avatar from Slack by email
tags:
- Slack
parameters:
- name: email
in: query
required: true
schema:
type: string
responses:
"200":
description: Returns the user's Slack avatar URL or error information if unavailable
content:
application/json:
schema:
$ref: '#/components/schemas/SlackAvatarResponse'
"/coach/answer":
post:
operationId: createCoachBotAnswer
summary: Log a user's answer for a coach bot quiz question
description: Records a single user's answer for a quiz question, along with metadata for analytics.
tags:
- Coach
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/CoachAnswer"
responses:
"200":
description: Coach bot answer logged successfully
content:
application/json:
schema:
$ref: "#/components/schemas/CoachAnswerResponse"
"400":
description: Invalid request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"409":
description: User has already answered today's question
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/coach/user-details/{userId}":
get:
operationId: getCoachUserDetails
summary: Get Slack ID, role, and difficulty for a user
description: Fetches the user from Keycloak, retrieves their streak, and calculates the difficulty level for the next coach question.
tags:
- Coach
parameters:
- name: userId
in: path
description: Keycloak user ID
required: true
schema:
type: string
responses:
"200":
description: User quiz details successfully retrieved
content:
application/json:
schema:
$ref: "#/components/schemas/CoachUserDetailsResponse"
"400":
description: Bad request - Invalid user ID
content:
application/json:
schema:
type: object
properties:
error:
type: string
example: Missing path parameter
"404":
description: User not found
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"500":
description: Internal server error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/pipedrive/salesLeads":
get:
operationId: listSalesLeads
summary: Lists all Leads from Pipedrive
description: |
Lists Leads from Pipedrive
**This endpoint is deprecated and will be removed in a future version.**
deprecated: true
tags:
- Pipedrive
responses:
"200":
description: Lists Leads from Pipedrive
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/Lead"
"/pipedrive/salesDeals/{status}":
get:
operationId: listSalesDeals
summary: Lists all Deals from Pipedrive
description: |
Lists open Deals from Pipedrive
**This endpoint is deprecated and will be removed in a future version.**
deprecated: true
tags:
- Pipedrive
parameters:
- name: status
in: path
required: true
schema:
type: string
description: Pipedrive Deal status
responses:
"200":
description: Lists Deals from Pipedrive
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/Deal"
"/pipedrive/getLeadById/{leadId}":
get:
operationId: getLeadById
summary: List lead data by id from Pipedrive
tags:
- Pipedrive
description: |
Get more data of a lead by id from Pipedrive
**This endpoint is deprecated and will be removed in a future version.**
deprecated: true
parameters:
- name: leadId
in: path
required: true
schema:
type: string
description: Lead Id used to identify a pipedrive lead
responses:
"200":
description: Successful operation
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/Lead"
"/pipedrive/getDealById/{dealId}":
get:
operationId: getDealById
summary: List deal data by id from Pipedrive
tags:
- Pipedrive
description: |
Get more data of a deal by id from Pipedrive
**This endpoint is deprecated and will be removed in a future version.**
deprecated: true
parameters:
- name: dealId
in: path
required: true
schema:
type: integer
description: Deal Id used to identify a pipedrive deal
responses:
"200":
description: Successful operation
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/Deal"
"/pipedrive/addDealInterest/{dealId}":
put:
summary: Add interest to a Pipedrive deal
description: |
Updates string where deal interests are stored in Pipedrive
**This endpoint is deprecated and will be removed in a future version.**
deprecated: true
tags:
- Pipedrive
parameters:
- name: dealId
in: path
required: true
schema:
type: integer
description: Deal Id used to identify a deal where the interest is updated
responses:
"200":
description: Successful operation
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/Interest"
"/pipedrive/addLeadInterest/{leadId}":
patch:
summary: Add interest to a Pipedrive lead
description: |
Updates string where lead interests are stored in Pipedrive
**This endpoint is deprecated and will be removed in a future version.**
deprecated: true
tags:
- Pipedrive
parameters:
- name: leadId
in: path
required: true
schema:
type: string
description: LeadId used to identify a lead where the interest is updated
responses:
"200":
description: Successful operation
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/Interest"
"/pipedrive/removeDealInterest/{dealId}":
put:
summary: Remove interest to a Pipedrive deal
description: |
Updates string where intrests are stored in Pipedrive
**This endpoint is deprecated and will be removed in a future version.**
deprecated: true
tags:
- Pipedrive
parameters:
- name: dealId
in: path
required: true
schema:
type: integer
description: Deal Id used to identify a deal where the interest is updated
responses:
"200":
description: Successful operation
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/Interest"
"/pipedrive/removeLeadInterest/{leadId}":
patch:
summary: Remove interest to a Pipedrive lead
description: |
Updates string where intrests are stored in Pipedrive
**This endpoint is deprecated and will be removed in a future version.**
deprecated: true
tags:
- Pipedrive
parameters:
- name: leadId
in: path
required: true
schema:
type: string
description: LeadId used to identify a lead where the interest is updated
responses:
"200":
description: Successful operation
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/Interest"
"/on-call":
get:
operationId: listOnCallData
summary: Lists on call personnel data from DynamoDB
description: Lists on call personnel data from DynamoDB for a given year.
tags:
- On call
parameters:
- name: year
in: query
required: true
schema:
type: string
description: Selected year for on call entries
responses:
"200":
description: A list of on call personnel for a selected year
content:
application/json;charset=utf-8:
schema:
type: array
items:
$ref: "#/components/schemas/OnCall"
"204":
description: No on-call data found for the selected year
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: No content
"400":
description: Missing or invalid year parameter
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"default":
description: Unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/update-paid":
post:
operationId: updatePaid
summary: Updates payment status for an on call period
description: Updates the paid status for a specific on-call week and year.
tags:
- On call
requestBody:
description: On-call week status to update
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/OnCallPaid"
responses:
"200":
description: Paid status updated successfully
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: Paid status updated
"400":
description: Invalid request (invalid year, week, or paid status)
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"404":
description: On-call entry not found for the specified year and week
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"default":
description: Unexpected error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/on-call/import-json":
post:
operationId: importOnCallJson
summary: Import on-call data from JSON
description: |
Imports on-call data (week number and username) into DynamoDB for the specified year.
The year must be provided as a query parameter (`year`). Each imported record will include the year, week, and username.
Only admin users are allowed to use this endpoint.
tags:
- On call
parameters:
- name: year
in: query
required: true
schema:
type: integer
description: Year for the on-call entries to be created (e.g. 2025)
requestBody:
description: Array of on-call entries to import
required: true
content:
application/json:
schema:
type: array
items:
type: object
required:
- Week
- Person
properties:
Week:
type: integer
description: Week number for the on-call entry (1-52)
Person:
type: string
description: Username for the on-call entry
responses:
"200":
description: All entries imported successfully
content:
application/json:
schema:
type: object
properties:
imported:
type: integer
description: Number of imported entries
errors:
type: array
items:
type: object
properties:
entry:
type: object
description: The entry that failed to import
error:
type: string
description: Error message
"207":
description: Some entries failed to import
content:
application/json:
schema:
type: object
properties:
imported:
type: integer
description: Number of successfully imported entries
errors:
type: array
items:
type: object
properties:
entry:
type: object
description: The entry that failed to import
error:
type: string
description: Error message
"400":
description: Invalid request (missing or invalid year, invalid JSON, or body is not an array)
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: Access denied. Admin privileges required.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/software":
get:
operationId: listSoftware
summary: Get all software entries
description: Retrieve a list of all software entries in the registry.
tags:
- Software
responses:
"200":
description: A list of software entries
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/SoftwareRegistry"
post:
operationId: createSoftware
summary: Register new software
description: Register a new software entry in the registry.
tags:
- Software
requestBody:
description: Software entry to register
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SoftwareRegistry"
responses:
"201":
description: Software entry created successfully
content:
application/json:
schema:
$ref: "#/components/schemas/SoftwareRegistry"
"default":
description: Bad request, software entry already exists or invalid data
"/software/{id}":
get:
operationId: getSoftwareById
summary: Get software by ID
description: Retrieve a software entry by its unique identifier.
tags:
- Software
parameters:
- name: id
in: path
required: true
description: ID of the software entry to retrieve
schema:
type: string
responses:
"200":
description: Software entry retrieved successfully
content:
application/json:
schema:
$ref: "#/components/schemas/SoftwareRegistry"
"default":
description: Software entry not found
put:
operationId: updateSoftwareById
summary: Update software entry
description: Update an existing software entry in the registry.
tags:
- Software
parameters:
- name: id
in: path
required: true
description: ID of the software entry to update
schema:
type: string
requestBody:
description: Updated software entry
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SoftwareRegistry"
responses:
"200":
description: Software entry updated successfully
content:
application/json:
schema:
$ref: "#/components/schemas/SoftwareRegistry"
"default":
description: Bad request, invalid data
delete:
operationId: deleteSoftwareById
summary: Delete software entry
description: Delete a software entry from the registry.
tags:
- Software
parameters:
- name: id
in: path
required: true
description: ID of the software entry to delete
schema:
type: string
responses:
"204":
description: Software entry deleted successfully
"default":
description: Software entry not found
"/users":
get:
operationId: listUsers
summary: Get list of keycloak users.
description: Get list of keycloak users.
tags:
- Users
responses:
"200":
description: Get list of keycloak users
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/User"
"default":
description: Invalid request was sent to the server.
"/severa/users/flextime":
get:
operationId: listUsersFlextime
summary: Get flextime for multiple users who have opted in
description: |
Retrieve flextime data for users who have opted in to Severa integration.
This endpoint is protected and can only be used by Admin users.
tags:
- Severa
responses:
"200":
description: List of users with their flextime data
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/UserFlextime"
"default":
description: Invalid request was sent to the server.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/severa/users/{severaUserId}/workdays":
get:
operationId: listWorkdaysForUser
summary: Lists user's workdays for a specific time period
description:
Lists a user's workdays from Severa for the given date range.
Each returned record includes data about the date, user GUID, expected hours, entered hours, and whether the day is a holiday.
tags:
- Severa
parameters:
- name: severaUserId
in: path
required: true
description: The unique Severa user ID (must match logged-in user)
schema:
type: string
- name: startDate
in: query
required: false
description: Optional start date for the time period.
schema:
type: string
format: date
- name: endDate
in: query
required: false
description: Optional end date for the time period.
schema:
type: string
format: date
responses:
"200":
description: Successful response with user's workdays
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/listWorkdaysForUser"
"401":
description: Missing or invalid Severa user ID.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"403":
description: Authenticated user attempted to access another user's data.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"500":
description: Internal server error.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/users/{userId}":
get:
operationId: findUser
summary: Find user by keycloak id
description: Finds user by keycloak id in keycloak.
tags:
- Users
parameters:
- name: userId
in: path
required: true
description: Users ID in Keycloak
schema:
type: string
format: uuid
responses:
"200":
description: Found User information.
content:
application/json:
schema:
$ref: "#/components/schemas/User"
"default":
description: Invalid request was sent to the server.
"/users/{id}/attributes/{attributeName}":
put:
operationId: updateUserAttribute
summary: Update user attribute
description: Updates a user's attribute based on provided data.
tags:
- Users
parameters:
- name: id
in: path
required: true
description: The Keycloak id of the user whose attributes are to be updated.
schema:
type: string
format: uuid
- name: attributeName
in: path
required: true
description: The name of the attribute to be updated. Allowed attributes 'isSeveraOptin'.
schema:
type: string
requestBody:
description: Email of the user whose attribute is being updated.
required: true
content:
application/json:
schema:
type: object
required:
- email
properties:
email:
type: string
description: Email of the user whose attribute is being updated.
responses:
"200":
description: User attribute updated successfully.
content:
application/json:
schema:
$ref: "#/components/schemas/UpdateUserAttribute"
"default":
description: Invalid request was sent to the server.
"/users/{userId}/severa-opt-in":
put:
operationId: addSeveraOptIn
summary: Add Severa opt-in for user
description: Add the user's Severa opt-in status to both severa and keycloak.
tags:
- Users
parameters:
- name: userId
in: path
required: true
description: The Keycloak ID of the user to add Severa opt-in for.
schema:
type: string
format: uuid
security:
- bearerAuth: []
responses:
"200":
description: Opt-in completed
content:
application/json:
schema:
type: object
properties:
message:
type: string
"default":
description: Invalid request was sent to the server.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
delete:
operationId: removeSeveraOptIn
summary: Remove Severa opt-in for user
description: Remove the user's Severa opt-in status.
tags:
- Users
parameters:
- name: userId
in: path
required: true
description: The Keycloak ID of the user to remove Severa opt-in for.
schema:
type: string
format: uuid
security:
- bearerAuth: []
responses:
"200":
description: Opt-out completed
content:
application/json:
schema:
type: object
properties:
message:
type: string
"default":
description: Invalid request was sent to the server.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/users/{userId}/vacationDays":
put:
operationId: updateUserVacation
summary: Update user vacation days
description: Update vacation days for a specific user by year.
tags:
- Users
parameters:
- name: userId
in: path
required: true
description: The Keycloak ID of the user to update vacation for
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
type: object
properties:
vacationDays:
type: object
description: Vacation days by year (e.g., "2024", "2025")
additionalProperties:
$ref: "#/components/schemas/YearlyVacationDays"
example:
"2024":
total: 22
remaining: 4
"2025":
total: 22
remaining: 4
required:
- vacationDays
responses:
"200":
description: Successfully updated the vacation days
content:
application/json:
schema:
$ref: "#/components/schemas/User"
"default":
description: Invalid request was sent to the server.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/users/{userId}/status":
put:
operationId: updateUserStatus
summary: Update user active status
description: Updates the isActive attribute of a user in Keycloak.
tags:
- Users
parameters:
- name: userId
in: path
required: true
description: The keycloak user ID used to identify the user.
schema:
type: string
format: uuid
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- isActive
properties:
isActive:
type: boolean
description: Whether the user is active or not
responses:
"200":
description: User status updated successfully
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: User status updated
"400":
description: Invalid request
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"500":
description: Internal server error
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
"/questionnaires":
get:
operationId: listQuestionnaires
summary: List questionnaires
description: Retrieve a list of all questionnaires in the registry.
tags:
- Questionnaires
responses:
"200":
description: A list of questionnaires
content:
application/json:
schema:
type: array
items:
$ref: "#/components/schemas/Questionnaire"
"default":
description: Invalid request was sent to the server.
content:
application/json:
schema:
$ref: "#/components/schemas/Error"
post:
operationId: createQuestionnaires
summary: Register new questionnaire
description: Register a new questionnaire in the registry.
tags:
- Questionnaires
requestBody:
description: Questionnaire entry to register
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/Questionnaire"
responses:
"201":
description: Questionnaire entry created successfully
content:
application/json:
schema:
$ref: "#/components/schemas/Questionnaire"
"default":
description: Invalid request was sent to the server.
content: