forked from SandeepVashishtha/Eventra
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathopenapi.yaml
More file actions
1076 lines (1027 loc) · 26.6 KB
/
openapi.yaml
File metadata and controls
1076 lines (1027 loc) · 26.6 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: Eventra API
description: |
Comprehensive API for the Eventra event management system.
Eventra provides a complete platform for managing events, attendees, RSVPs,
check-ins, and analytics with role-based access control and real-time features.
## Authentication
Most endpoints require JWT authentication using the `Authorization: Bearer <token>` header.
## Rate Limiting
- Authenticated users: 1000 requests/hour
- Anonymous users: 100 requests/hour
## Support
- Email: api-support@eventra.com
- Discord: https://discord.gg/eventra
- GitHub: https://github.com/SandeepVashishtha/Eventra
version: "1.0.0"
contact:
name: Eventra API Support
email: api-support@eventra.com
url: https://docs.eventra.com
license:
name: MIT
url: https://opensource.org/licenses/MIT
termsOfService: https://eventra.com/terms
servers:
- url: https://api.eventra.com
description: Production server
- url: http://localhost:8080
description: Development server
security:
- BearerAuth: []
paths:
# Authentication endpoints
/api/auth/register:
post:
tags:
- Authentication
summary: Register new user
description: Create a new user account
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UserRegistration'
responses:
'201':
description: User registered successfully
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/AuthResponse'
'409':
$ref: '#/components/responses/ConflictError'
'422':
$ref: '#/components/responses/ValidationError'
/api/auth/login:
post:
tags:
- Authentication
summary: User login
description: Authenticate user and get access token
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/LoginRequest'
responses:
'200':
description: Login successful
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/AuthResponse'
'401':
$ref: '#/components/responses/UnauthorizedError'
/api/auth/me:
get:
tags:
- Authentication
summary: Get current user profile
description: Retrieve the authenticated user's profile information
responses:
'200':
description: User profile retrieved successfully
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/User'
'401':
$ref: '#/components/responses/UnauthorizedError'
# Events endpoints
/api/events:
get:
tags:
- Events
summary: Get events list
description: Retrieve a paginated list of events with filtering options
security: []
parameters:
- $ref: '#/components/parameters/PageParam'
- $ref: '#/components/parameters/LimitParam'
- $ref: '#/components/parameters/SortParam'
- $ref: '#/components/parameters/OrderParam'
- name: category
in: query
schema:
$ref: '#/components/schemas/EventCategory'
- name: isPublic
in: query
schema:
type: boolean
- name: search
in: query
schema:
type: string
maxLength: 100
responses:
'200':
description: Events retrieved successfully
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
type: object
properties:
events:
type: array
items:
$ref: '#/components/schemas/Event'
pagination:
$ref: '#/components/schemas/PaginationInfo'
post:
tags:
- Events
summary: Create new event
description: Create a new event (requires authentication)
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateEventRequest'
responses:
'201':
description: Event created successfully
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/Event'
'401':
$ref: '#/components/responses/UnauthorizedError'
'422':
$ref: '#/components/responses/ValidationError'
/api/events/{eventId}:
get:
tags:
- Events
summary: Get event details
description: Retrieve detailed information about a specific event
security: []
parameters:
- $ref: '#/components/parameters/EventIdParam'
responses:
'200':
description: Event details retrieved successfully
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/Event'
'404':
$ref: '#/components/responses/NotFoundError'
put:
tags:
- Events
summary: Update event
description: Update an existing event (organizer only)
parameters:
- $ref: '#/components/parameters/EventIdParam'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateEventRequest'
responses:
'200':
description: Event updated successfully
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/Event'
'401':
$ref: '#/components/responses/UnauthorizedError'
'403':
$ref: '#/components/responses/ForbiddenError'
'404':
$ref: '#/components/responses/NotFoundError'
# RSVP endpoints
/api/events/{eventId}/rsvp:
post:
tags:
- RSVP
summary: Register for event
description: RSVP for an event
parameters:
- $ref: '#/components/parameters/EventIdParam'
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/CreateRSVPRequest'
responses:
'201':
description: RSVP created successfully
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/RSVP'
'409':
$ref: '#/components/responses/ConflictError'
'422':
$ref: '#/components/responses/ValidationError'
get:
tags:
- RSVP
summary: Get user's RSVP
description: Get current user's RSVP status for an event
parameters:
- $ref: '#/components/parameters/EventIdParam'
responses:
'200':
description: RSVP status retrieved
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/SuccessResponse'
- type: object
properties:
data:
$ref: '#/components/schemas/RSVP'
components:
securitySchemes:
BearerAuth:
type: http
scheme: bearer
bearerFormat: JWT
parameters:
EventIdParam:
name: eventId
in: path
required: true
schema:
type: integer
format: int64
minimum: 1
description: Event ID
PageParam:
name: page
in: query
schema:
type: integer
minimum: 1
default: 1
description: Page number
LimitParam:
name: limit
in: query
schema:
type: integer
minimum: 1
maximum: 100
default: 20
description: Items per page
SortParam:
name: sort
in: query
schema:
type: string
enum: [title, startDate, createdAt, updatedAt]
default: createdAt
description: Sort field
OrderParam:
name: order
in: query
schema:
type: string
enum: [asc, desc]
default: desc
description: Sort order
schemas:
SuccessResponse:
type: object
required:
- success
- timestamp
properties:
success:
type: boolean
example: true
message:
type: string
example: "Operation completed successfully"
timestamp:
type: string
format: date-time
example: "2024-01-15T10:30:00Z"
ErrorResponse:
type: object
required:
- success
- error
- timestamp
properties:
success:
type: boolean
example: false
error:
type: object
required:
- code
- message
properties:
code:
type: string
example: "VALIDATION_ERROR"
message:
type: string
example: "Invalid input data"
details:
type: array
items:
type: string
example: ["Email is required", "Password too short"]
field:
type: string
example: "email"
timestamp:
type: string
format: date-time
example: "2024-01-15T10:30:00Z"
PaginationInfo:
type: object
required:
- page
- limit
- total
- totalPages
- hasNext
- hasPrev
properties:
page:
type: integer
minimum: 1
example: 1
limit:
type: integer
minimum: 1
example: 20
total:
type: integer
minimum: 0
example: 150
totalPages:
type: integer
minimum: 0
example: 8
hasNext:
type: boolean
example: true
hasPrev:
type: boolean
example: false
User:
type: object
required:
- id
- email
- name
- role
- isEmailVerified
- createdAt
properties:
id:
type: integer
format: int64
example: 1
email:
type: string
format: email
example: "user@example.com"
name:
type: string
minLength: 2
maxLength: 100
example: "John Doe"
organization:
type: string
maxLength: 100
example: "Tech Corp"
role:
$ref: '#/components/schemas/UserRole'
isEmailVerified:
type: boolean
example: true
avatar:
type: string
format: uri
example: "https://example.com/avatars/user1.jpg"
createdAt:
type: string
format: date-time
example: "2024-01-15T10:30:00Z"
updatedAt:
type: string
format: date-time
example: "2024-01-15T15:45:00Z"
UserRole:
type: string
enum:
- USER
- ORGANIZER
- ADMIN
- SUPER_ADMIN
example: "USER"
UserRegistration:
type: object
required:
- email
- password
- name
properties:
email:
type: string
format: email
example: "user@example.com"
password:
type: string
minLength: 8
maxLength: 128
example: "securePassword123"
name:
type: string
minLength: 2
maxLength: 100
example: "John Doe"
organization:
type: string
maxLength: 100
example: "Tech Corp"
LoginRequest:
type: object
required:
- email
- password
properties:
email:
type: string
format: email
example: "user@example.com"
password:
type: string
example: "securePassword123"
AuthResponse:
type: object
required:
- user
- token
- refreshToken
- expiresIn
properties:
user:
$ref: '#/components/schemas/User'
token:
type: string
example: "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."
refreshToken:
type: string
example: "def50200e54b9..."
expiresIn:
type: integer
example: 3600
Event:
type: object
required:
- id
- title
- startDate
- endDate
- timezone
- capacity
- isPublic
- category
- status
- createdAt
properties:
id:
type: integer
format: int64
example: 1
title:
type: string
minLength: 3
maxLength: 200
example: "Tech Conference 2024"
description:
type: string
maxLength: 5000
example: "Annual technology conference featuring latest innovations"
slug:
type: string
pattern: '^[a-z0-9-]+$'
example: "tech-conference-2024"
startDate:
type: string
format: date-time
example: "2024-12-01T09:00:00Z"
endDate:
type: string
format: date-time
example: "2024-12-01T18:00:00Z"
timezone:
type: string
example: "America/New_York"
location:
$ref: '#/components/schemas/EventLocation'
isVirtual:
type: boolean
example: false
virtualLink:
type: string
format: uri
example: "https://zoom.us/j/123456789"
capacity:
type: integer
minimum: 1
maximum: 100000
example: 500
isPublic:
type: boolean
example: true
requiresApproval:
type: boolean
example: false
registrationOpen:
type: boolean
example: true
registrationStart:
type: string
format: date-time
example: "2024-10-01T00:00:00Z"
registrationEnd:
type: string
format: date-time
example: "2024-11-30T23:59:59Z"
category:
$ref: '#/components/schemas/EventCategory'
tags:
type: array
items:
type: string
example: ["technology", "innovation", "networking"]
ticketTiers:
type: array
items:
$ref: '#/components/schemas/TicketTier'
organizer:
$ref: '#/components/schemas/EventOrganizer'
stats:
$ref: '#/components/schemas/EventStats'
status:
$ref: '#/components/schemas/EventStatus'
createdAt:
type: string
format: date-time
example: "2024-01-15T10:30:00Z"
updatedAt:
type: string
format: date-time
example: "2024-01-20T14:22:00Z"
EventCategory:
type: string
enum:
- CONFERENCE
- WORKSHOP
- MEETUP
- WEBINAR
- SOCIAL
- SPORTS
- CULTURAL
- BUSINESS
- CHARITY
- OTHER
example: "CONFERENCE"
EventStatus:
type: string
enum:
- DRAFT
- ACTIVE
- PAUSED
- CANCELLED
- COMPLETED
example: "ACTIVE"
EventLocation:
type: object
required:
- name
properties:
name:
type: string
example: "Convention Center"
address:
type: string
example: "123 Main St, New York, NY 10001"
coordinates:
type: object
properties:
latitude:
type: number
format: double
example: 40.7128
longitude:
type: number
format: double
example: -74.0060
TicketTier:
type: object
required:
- id
- name
- price
- capacity
properties:
id:
type: integer
format: int64
example: 1
name:
type: string
example: "General Admission"
price:
type: number
format: double
minimum: 0
example: 99.99
capacity:
type: integer
minimum: 1
example: 400
description:
type: string
example: "Standard conference access"
EventOrganizer:
type: object
required:
- id
- name
- email
properties:
id:
type: integer
format: int64
example: 1
name:
type: string
example: "John Doe"
email:
type: string
format: email
example: "john@example.com"
organization:
type: string
example: "Tech Corp"
EventStats:
type: object
properties:
totalRSVPs:
type: integer
minimum: 0
example: 245
confirmedAttendees:
type: integer
minimum: 0
example: 230
checkedIn:
type: integer
minimum: 0
example: 180
waitlistCount:
type: integer
minimum: 0
example: 15
CreateEventRequest:
type: object
required:
- title
- startDate
- endDate
- timezone
- capacity
- category
properties:
title:
type: string
minLength: 3
maxLength: 200
example: "Tech Conference 2024"
description:
type: string
maxLength: 5000
example: "Annual technology conference"
startDate:
type: string
format: date-time
example: "2024-12-01T09:00:00Z"
endDate:
type: string
format: date-time
example: "2024-12-01T18:00:00Z"
timezone:
type: string
example: "America/New_York"
location:
$ref: '#/components/schemas/EventLocation'
isVirtual:
type: boolean
default: false
virtualLink:
type: string
format: uri
capacity:
type: integer
minimum: 1
maximum: 100000
example: 500
isPublic:
type: boolean
default: true
requiresApproval:
type: boolean
default: false
registrationStart:
type: string
format: date-time
registrationEnd:
type: string
format: date-time
category:
$ref: '#/components/schemas/EventCategory'
tags:
type: array
items:
type: string
maxItems: 10
ticketTiers:
type: array
items:
type: object
required:
- name
- price
- capacity
properties:
name:
type: string
price:
type: number
format: double
minimum: 0
capacity:
type: integer
minimum: 1
description:
type: string
UpdateEventRequest:
allOf:
- $ref: '#/components/schemas/CreateEventRequest'
# All fields are optional for updates
RSVP:
type: object
required:
- id
- eventId
- userId
- status
- responseDate
- createdAt
properties:
id:
type: integer
format: int64
example: 1
eventId:
type: integer
format: int64
example: 1
userId:
type: integer
format: int64
example: 1
status:
$ref: '#/components/schemas/RSVPStatus'
ticketTierId:
type: integer
format: int64
example: 1
ticketTier:
$ref: '#/components/schemas/TicketTier'
responseDate:
type: string
format: date-time
example: "2024-10-15T10:30:00Z"
checkedIn:
type: boolean
example: false
checkedInAt:
type: string
format: date-time
qrCode:
type: string
example: "EVT001-USR001-TIK001"
specialRequests:
type: string
maxLength: 1000
example: "Vegetarian meal preference"
paymentStatus:
$ref: '#/components/schemas/PaymentStatus'
createdAt:
type: string
format: date-time
example: "2024-10-15T10:30:00Z"
updatedAt:
type: string
format: date-time
example: "2024-10-15T10:30:00Z"
RSVPStatus:
type: string
enum:
- confirmed
- pending
- declined
- waitlist
- cancelled
- expired
example: "confirmed"
PaymentStatus:
type: string
enum:
- pending
- paid
- failed
- refunded
- partial
example: "paid"
CreateRSVPRequest:
type: object
required:
- ticketTierId
properties:
ticketTierId:
type: integer
format: int64
example: 1
specialRequests:
type: string
maxLength: 1000
example: "Vegetarian meal preference"
additionalData:
type: object
additionalProperties: true
responses:
UnauthorizedError:
description: Authentication required or invalid token
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error:
code: "INVALID_TOKEN"
message: "JWT token is invalid or expired"
timestamp: "2024-01-15T10:30:00Z"
ForbiddenError:
description: Access denied - insufficient permissions
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error:
code: "INSUFFICIENT_PERMISSIONS"
message: "User lacks required permissions"
timestamp: "2024-01-15T10:30:00Z"
NotFoundError:
description: Resource not found
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
success: false
error:
code: "RESOURCE_NOT_FOUND"
message: "The requested resource does not exist"
timestamp: "2024-01-15T10:30:00Z"
ConflictError:
description: Resource conflict