-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
1029 lines (984 loc) · 24.2 KB
/
openapi.yaml
File metadata and controls
1029 lines (984 loc) · 24.2 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: Workplace Console API
description: API for managing email and workplace service subscriptions.
termsOfService: https://truehost.com/terms-of-service
contact:
email: support@truehost.cloud
version: v1
servers:
- url: https://workplace-console.truehost.cloud/api
description: Production server
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
schemas:
# DNS Related Schemas
DnsRecord:
type: object
required:
- host
- type
- value
- priority
- ttl
properties:
host:
type: string
description: DNS record host/name
type:
type: string
description: DNS record type (A, MX, TXT, etc.)
value:
type: string
description: DNS record value
priority:
type: string
description: DNS record priority (may be "N/A" for non-MX records)
ttl:
type: integer
description: DNS record TTL in seconds
FoundDnsRecords:
type: object
description: Found DNS records organized by type
properties:
NS:
type: array
items:
type: string
description: Name server records
A:
type: array
items:
type: string
description: IPv4 address records
AAAA:
type: array
items:
type: string
description: IPv6 address records
CNAME:
type: array
items:
type: string
description: Canonical name records
MX:
type: array
items:
type: string
description: Mail exchange records
TXT:
type: array
items:
type: string
description: Text records
SOA:
type: array
items:
type: string
description: Start of authority records
SRV:
type: array
items:
type: string
description: Service records
PTR:
type: array
items:
type: string
description: Pointer records
DnsInfoRequest:
type: object
required:
- domain
- client_id
- email
properties:
domain:
type: string
description: Domain name
client_id:
type: string
description: Client id
email:
type: string
description: Email
DnsInfoResponse:
type: object
required:
- domain
- score
- all_dns_score
- found
- total
- missing_dns
- other_missing_dns
- found_dns
properties:
domain:
type: string
description: The domain name that was checked
score:
type: number
description: DNS configuration score
all_dns_score:
type: number
description: Overall DNS score
found:
type: integer
description: Number of required DNS records found
total:
type: integer
description: Total number of required DNS records
missing_dns:
type: array
description: List of missing required DNS records
items:
$ref: '#/components/schemas/DnsRecord'
other_missing_dns:
type: array
description: List of other missing DNS records
items:
$ref: '#/components/schemas/DnsRecord'
found_dns:
$ref: '#/components/schemas/FoundDnsRecords'
# Subscription Related Schemas
SubscriptionDetails:
type: object
required:
- name
properties:
id:
type: integer
readOnly: true
name:
type: string
maxLength: 255
minLength: 1
mailbox:
type: integer
description: Number of mailboxes
maximum: 2147483647
minimum: -2147483648
quota:
type: integer
description: Allowed quota number per mailbox in GB
maximum: 2147483647
minimum: -2147483648
alias:
type: integer
description: Allowed number of aliases per mailbox
maximum: 2147483647
minimum: -2147483648
forward:
type: integer
description: Allowed number of forwarding rules per mailbox
maximum: 2147483647
minimum: -2147483648
platform:
type: string
enum:
- whmcs
- olitt
- others
price:
type: string
format: decimal
SubScriptionInfo:
type: object
required:
- domain
- subscription
properties:
domain:
type: string
minLength: 1
subscription:
type: integer
SubscriptionInfoResponse:
type: object
required:
- info
- emails
properties:
info:
$ref: '#/components/schemas/OrderDisplay'
emails:
type: array
items:
$ref: '#/components/schemas/EmailDisplay'
SubscriptionUsageResponse:
type: object
properties:
used-emails:
type: number
remaining-quota:
type: number
remaining-emails:
type: number
allowed-emails:
type: number
allowed-alias:
type: number
remaining-alias:
type: number
allowed-quota:
type: number
SubscriptionsReadResponse:
type: object
properties:
domain_context:
type: object
user_emails:
type: array
items:
type: object
email_aliases:
type: object
# Email Related Schemas
EmailDisplay:
type: object
required:
- name
properties:
id:
type: integer
readOnly: true
name:
type: string
format: email
maxLength: 254
minLength: 1
email_quota:
type: integer
description: Email quota in GB
maximum: 2147483647
minimum: -2147483648
max_quota:
type: integer
description: Max email quota in GB
maximum: 2147483647
minimum: -2147483648
used_quota:
type: integer
description: Used quota in GB
maximum: 2147483647
minimum: -2147483648
email_id:
type: integer
maximum: 2147483647
minimum: -2147483648
nullable: true
display_name:
type: string
maxLength: 255
nullable: true
order:
type: integer
nullable: true
UpdateEmailQuota:
type: object
required:
- email
- quota
- client_id
properties:
email:
type: string
format: email
minLength: 1
quota:
type: integer
client_id:
type: integer
minimum: 0
DeleteEmail:
type: object
required:
- email
- domain
- client_id
properties:
email:
type: string
format: email
minLength: 1
domain:
type: string
minLength: 1
client_id:
type: integer
minimum: 0
# Alias Related Schemas
EmailAlias:
type: object
required:
- email
- domain
- alias
- client_id
properties:
email:
type: string
format: email
minLength: 1
domain:
type: string
minLength: 1
alias:
type: string
format: email
minLength: 1
client_id:
type: integer
minimum: 0
DeleteAlias:
type: object
required:
- email
- alias
- domain
- client_id
properties:
email:
type: string
format: email
minLength: 1
alias:
type: string
format: email
minLength: 1
domain:
type: string
minLength: 1
client_id:
type: integer
minimum: 0
AliasDisplay:
type: object
required:
- name
properties:
id:
type: integer
readOnly: true
primary_email:
type: string
readOnly: true
minLength: 1
name:
type: string
format: email
maxLength: 254
minLength: 1
# Domain Related Schemas
Domain:
type: object
required:
- domain
properties:
domain:
type: string
minLength: 1
DomainAction:
type: object
required:
- action
- domain
properties:
action:
type: string
minLength: 1
domain:
type: string
minLength: 1
OrderDisplay:
type: object
required:
- domain
properties:
id:
type: integer
readOnly: true
context_id:
type: integer
maximum: 2147483647
minimum: -2147483648
nullable: true
domain:
type: string
maxLength: 255
minLength: 1
enabled:
type: boolean
synched_at:
type: string
format: date-time
nullable: true
average_size:
type: integer
maximum: 2147483647
minimum: -2147483648
filestore_id:
type: integer
maximum: 2147483647
minimum: -2147483648
filestore_name:
type: string
maxLength: 255
nullable: true
max_quota:
type: integer
maximum: 2147483647
minimum: -2147483648
context_name:
type: string
maxLength: 255
nullable: true
used_quota:
type: integer
maximum: 2147483647
minimum: -2147483648
gab_mode:
type: string
maxLength: 255
nullable: true
is_order_active:
type: boolean
updated_at:
type: string
format: date-time
readOnly: true
created_at:
type: string
format: date-time
readOnly: true
unallocated_quota:
type: integer
maximum: 2147483647
minimum: -2147483648
unallocated_alias:
type: integer
maximum: 2147483647
minimum: -2147483648
is_alias_calculated:
type: boolean
is_alias_synched:
type: boolean
last_dns_check:
type: string
format: date-time
nullable: true
is_dns_valid:
type: boolean
client_id:
type: integer
maximum: 2147483647
minimum: -2147483648
nullable: true
is_verified:
type: boolean
subscription:
type: integer
nullable: true
# Authentication Related Schemas
TokenObtainPair:
type: object
required:
- username
- password
properties:
username:
type: string
minLength: 1
password:
type: string
minLength: 1
TokenRefresh:
type: object
required:
- refresh
properties:
refresh:
type: string
minLength: 1
access:
type: string
readOnly: true
minLength: 1
ResetEmailPassword:
type: object
required:
- email
- password
- client_id
properties:
email:
type: string
format: email
minLength: 1
password:
type: string
minLength: 1
client_id:
type: integer
minimum: 0
# Account Creation Schemas
WorkplaceCreateEmails:
type: object
required:
- emails
- domain_name
- subscription
- new_subscription
- display_name
- user_password
- email_quota
- client_id
properties:
emails:
type: array
items:
type: string
format: email
minLength: 1
domain_name:
type: string
maxLength: 255
minLength: 1
subscription:
type: integer
minimum: 0
new_subscription:
type: boolean
display_name:
type: string
minLength: 1
user_password:
type: string
minLength: 1
email_quota:
type: integer
minimum: 0
client_id:
type: integer
minimum: 0
# Import Related Schemas
ImportRequest:
type: object
required:
- file
- domain
properties:
file:
type: string
format: binary
description: CSV or excel file containing email accounts
domain:
type: string
description: Domain to associate with emails
# Action Related Schemas
ServiceAction:
type: object
required:
- action
properties:
action:
type: string
minLength: 1
# Common Response Schemas
StandardResponse:
type: object
properties:
message:
type: string
error:
type: string
security:
- BearerAuth: []
paths:
/available-packages/:
get:
operationId: available-packages_list
summary: Get available subscriptions
description: Get available subscriptions
tags:
- available-packages
responses:
'200':
description: List of available subscription packages
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/SubscriptionDetails'
/change-quota/:
post:
operationId: update_email_quota
summary: Update email quota
description: Update email quota
tags:
- update-email-quota
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateEmailQuota'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StandardResponse'
/create-alias/:
post:
operationId: create_email_alias
summary: Create email alias
description: Create email alias
tags:
- create-alias
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/EmailAlias'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StandardResponse'
/delete-alias/:
post:
operationId: delete_email_alias
summary: Delete alias
description: Delete alias
tags:
- delete-alias
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteAlias'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StandardResponse'
/delete-email/:
post:
operationId: delete_email
summary: Delete email
description: Delete email
tags:
- delete-email
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DeleteEmail'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StandardResponse'
/dns-info/:
post:
operationId: dns-info_create
summary: Get DNS information
description: Get DNS configuration information for a domain
tags:
- dns-info
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DnsInfoRequest'
responses:
'200':
description: DNS information response
content:
application/json:
schema:
$ref: '#/components/schemas/DnsInfoResponse'
/domain-alias/:
post:
operationId: domain-alias_create
summary: Get domain alias list
description: Get domain alias list
tags:
- domain-alias
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Domain'
responses:
'200':
description: List of domain aliases
content:
application/json:
schema:
type: array
items:
$ref: '#/components/schemas/AliasDisplay'
/domain-info/:
post:
operationId: domain-info_create
summary: Get domain subscription details
description: Get domain subscription details and emails list
tags:
- domain-info
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubScriptionInfo'
responses:
'200':
description: Domain subscription information
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionInfoResponse'
/domain/:
post:
operationId: domain_create
summary: Update domain subscription status
description: Update domain subscription status, delete, suspend, unsuspend, etc...
tags:
- domain
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/DomainAction'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StandardResponse'
/get-token/:
post:
operationId: get-token_create
summary: Obtain authentication token
description: |-
Takes a set of user credentials and returns an access and refresh JSON web
token pair to prove the authentication of those credentials.
tags:
- get-token
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TokenObtainPair'
responses:
'201':
description: Token pair created
content:
application/json:
schema:
$ref: '#/components/schemas/TokenObtainPair'
/import/:
post:
operationId: import_create
summary: Bulk create emails
description: Bulk create emails via uploaded file and domain
tags:
- import
requestBody:
required: true
content:
multipart/form-data:
schema:
$ref: '#/components/schemas/ImportRequest'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StandardResponse'
/refresh-token/:
post:
operationId: refresh-token_create
summary: Refresh authentication token
description: |-
Takes a refresh type JSON web token and returns an access type JSON web
token if the refresh token is valid.
tags:
- refresh-token
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/TokenRefresh'
responses:
'201':
description: Token refreshed
content:
application/json:
schema:
$ref: '#/components/schemas/TokenRefresh'
/reset-password/:
post:
operationId: reset_email_password
summary: Reset subscription email password
description: Reset subscription email password
tags:
- reset-password
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/ResetEmailPassword'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StandardResponse'
/subscription-info/:
post:
operationId: subscription-info_create
summary: Get subscription usage info
description: Get subscription usage info
tags:
- subscription-info
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/SubScriptionInfo'
responses:
'200':
description: Subscription usage information
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionUsageResponse'
/subscriptions/:
get:
operationId: subscriptions_list
summary: List subscriptions
description: Get list of subscriptions
tags:
- subscriptions
responses:
'200':
description: List of subscriptions
content:
application/json:
schema:
type: object
post:
operationId: emails_create
summary: Create a new emails
description: |-
Create a new emails, it will also create a new subscription
for the domain if emails list is not empty and new_subscription is true
tags:
- subscriptions
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/WorkplaceCreateEmails'
responses:
'200':
description: Success
content:
application/json:
schema:
$ref: '#/components/schemas/StandardResponse'
/subscriptions/{context_id}/:
get:
operationId: subscriptions_read
summary: Get subscription details
description: Get subscription details
tags:
- subscriptions
parameters:
- name: context_id
in: path
required: true
schema:
type: string
responses:
'200':
description: Subscription details
content:
application/json:
schema:
$ref: '#/components/schemas/SubscriptionsReadResponse'
post:
operationId: update_subscription_status
summary: Update subscription status
description: Update subscription status, delete, suspend, unsuspend, etc...
tags:
- subscriptions
parameters:
- name: context_id
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema: