Repository navigation
Expand file tree
/
Copy pathopenapi.yaml
More file actions
13449 lines (12851 loc) · 430 KB
/
Copy pathopenapi.yaml
File metadata and controls
13449 lines (12851 loc) · 430 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
# ============================================================
# Rythmify API — OpenAPI 3.0.3 Specification
# Version: 2.0 (Fixed — April 2026)
# ============================================================
openapi: '3.0.3'
info:
title: Rythmify API
description: API for the Rythmify music platform
version: '2.0'
servers:
- url: http://localhost:8080/api/v1
description: Local development server
- url: https://api.rythmify.com/api/v1
description: Production server
security:
- bearerAuth: []
tags:
- name: Auth
description: Registration, login, token refresh, and logout
- name: Users
description: User profiles, avatars, and account settings
- name: Tracks
description: Audio upload, metadata, and track management
- name: Playback
description: Playback, player state, queue, and listening-history endpoints.
- name: Playlists
description: Create and manage playlists and track ordering
- name: Comments
description: Track comments, replies, and comment management
- name: Feed
description: Activity feed — Following tab and Discover tab
- name: Home & Discovery
description: Personalized home page, stations, mixes, and trending content
- name: Genre Discovery
description: Genre page aggregator and paginated sub-endpoints
- name: Track Discovery
description: Track-level discovery — related tracks and contextual navigation
- name: Follow Discovery
description: Suggested users and artists to follow
- name: Messages
description: Direct messaging between users
- name: Notifications
description: Real-time alerts for social interactions
- name: Search
description: Global search across tracks, users, and playlists
- name: Follow
description: Follow, unfollow, followers, following, and suggested users
- name: Block
description: Block and unblock users
- name: Likes
description: Like and unlike tracks, playlists, and albums. List who liked items and view personal liked libraries.
- name: Reposts
description: Repost and remove reposts from tracks, playlists, and albums. List who reposted items and view personal reposted libraries.
- name: Insights
description: Creator analytics for uploaded tracks.
- name: Subscription
description: Subscription plans, mocked Stripe payments, premium entitlements, and free-plan usage limits.
- name: Subscriptions - Development Only
description: Local-development-only subscription testing utilities. These routes are only registered when NODE_ENV=development.
- name: Moderation
description: User-facing content reporting for copyright and inappropriate content flags
- name: Admin
description: Admin-only endpoints for moderation actions, account management, and platform analytics (requires Admin role)
# ============================================================
# PATHS
# ============================================================
paths:
# ==========================================================
# Module 1 — Authentication & User Management
# ==========================================================
/auth/register:
post:
tags: [Auth]
summary: Register a new user account
description: |
Creates a new user account.
- CAPTCHA is required to mitigate bot activity.
- The account role defaults to `listener`.
- Sends a verification email with a token.
operationId: registerUser
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthRegisterRequest'
responses:
'201':
description: Account created and verification email sent.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthRegisterResponse'
'400':
$ref: '#/components/responses/ValidationError'
'409':
description: Email already registered.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: AUTH_EMAIL_ALREADY_EXISTS
message: Email already registered.
'429':
$ref: '#/components/responses/RateLimited'
/auth/check-email:
post:
tags: [Auth]
summary: Check if an email is registered
description: |
Checks whether the provided email address is already registered in the system.
Returns a boolean indicating existence.
operationId: checkEmailExists
security: []
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- email
properties:
email:
type: string
format: email
description: The email address to check.
responses:
'200':
description: Email existence check successful.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
exists:
type: boolean
message:
type: string
'400':
$ref: '#/components/responses/ValidationError'
'429':
$ref: '#/components/responses/RateLimited'
/auth/verify-email:
post:
description: Confirms a user's email address using the token sent at registration.
tags: [Auth]
summary: Verify email address with token
operationId: verifyEmail
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthVerifyEmailRequest'
responses:
'200':
description: Email verified. Tokens issued.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthVerifyEmailResponse'
'400':
description: Invalid or expired token.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: AUTH_TOKEN_INVALID
message: Invalid or expired verification token
'429':
$ref: '#/components/responses/RateLimited'
/auth/resend-verification:
post:
description: Sends a new email verification token to an unverified account.
tags: [Auth]
summary: Resend email verification link
operationId: resendVerificationEmail
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthResendVerificationRequest'
responses:
'200':
description: Verification email resent (or no-op if not applicable).
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessMessage'
'400':
$ref: '#/components/responses/ValidationError'
'422':
$ref: '#/components/responses/UnprocessableEntity'
'429':
$ref: '#/components/responses/RateLimited'
/auth/login:
post:
tags: [Auth]
summary: Login with email or username
description: |
Authenticates a user and issues tokens.
Returns `access_token` in response body.
Sets `refresh_token` as HttpOnly cookie.
Login identifier can be email or username.
operationId: loginUser
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthLoginRequest'
responses:
'200':
description: Logged in successfully.
headers:
Set-Cookie:
schema:
type: string
content:
application/json:
schema:
$ref: '#/components/schemas/AuthLoginResponse'
'400':
$ref: '#/components/responses/ValidationError'
'401':
description: Invalid credentials.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: AUTH_INVALID_CREDENTIALS
message: Email/username or password incorrect
'422':
description: Email not verified.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: AUTH_EMAIL_NOT_VERIFIED
message: Email must be verified before login
'403':
description: Account suspended.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: AUTH_ACCOUNT_SUSPENDED
message: Account suspended by admin
'429':
$ref: '#/components/responses/RateLimited'
/auth/refresh:
post:
description: Issues a new access token using the HttpOnly refresh token cookie.
tags: [Auth]
summary: Refresh access token
operationId: refreshAccessToken
security: []
parameters:
- name: refresh_token
in: cookie
required: true
schema:
type: string
responses:
'200':
description: New access token issued.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthRefreshResponse'
'401':
description: Invalid/expired refresh token.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: AUTH_REFRESH_TOKEN_INVALID
message: Refresh token is missing, invalid, or expired
'403':
description: Account suspended.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
/auth/logout:
post:
description: Clears the refresh token cookie, ending the current session.
tags: [Auth]
summary: Logout (invalidate refresh token)
operationId: logoutUser
security: []
responses:
'200':
description: Logged out successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessMessage'
'429':
$ref: '#/components/responses/RateLimited'
/auth/forgot-password:
post:
description: Sends a password reset link to the provided email address.
tags: [Auth]
summary: Request password reset email
operationId: requestPasswordReset
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthForgotPasswordRequest'
responses:
'200':
description: Password reset email request processed.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthForgotPasswordResponse'
'400':
$ref: '#/components/responses/ValidationError'
'429':
$ref: '#/components/responses/RateLimited'
/auth/reset-password:
post:
description: Applies a new password using a valid password reset token.
tags: [Auth]
summary: Reset password using reset token
operationId: resetPassword
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthResetPasswordRequest'
responses:
'200':
description: Password reset successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessMessage'
'400':
$ref: '#/components/responses/ValidationError'
'422':
description: Token invalid/expired/used/revoked.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: AUTH_TOKEN_EXPIRED
message: Password reset token expired
'429':
$ref: '#/components/responses/RateLimited'
# UNVERIFIED — no matching route found in src/routes/ as of audit date
# This endpoint (POST /auth/change-password) is referenced in the disconnect flow
# but does not exist in auth.routes.js. The controller has no changePassword handler.
/auth/change-password:
post:
tags: [Auth]
summary: Change password for authenticated user
description: |
Changes the password for the authenticated user.
Required before disconnecting an OAuth provider if it is the only login method.
On success, all active sessions are invalidated (equivalent to logout_all=true).
operationId: changePassword
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthChangePasswordRequest'
responses:
'200':
description: Password changed successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessMessage'
example:
data:
success: true
message: Password changed successfully. Please log in again.
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'422':
description: Current password is incorrect.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: AUTH_INVALID_CREDENTIALS
message: Current password is incorrect
'429':
$ref: '#/components/responses/RateLimited'
/auth/change-email:
post:
description: Initiates an email change by sending a verification link to the new address.
tags: [Auth]
summary: Request email change
operationId: requestEmailChange
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthChangeEmailRequest'
responses:
'200':
description: Verification email sent to new address.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessMessage'
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'409':
description: Email already in use.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
/auth/verify-email-change:
post:
description: Applies a pending email change using the token sent to the new address.
tags: [Auth]
summary: Confirm email change using token
operationId: verifyEmailChange
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthVerifyEmailChangeRequest'
responses:
'200':
description: Email updated successfully.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthVerifyEmailChangeResponse'
'400':
$ref: '#/components/responses/ValidationError'
'409':
description: Email already in use.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Token invalid/expired/used.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
/auth/google:
post:
description: Authenticates or registers a user via a Google ID token.
tags: [Auth]
summary: Login / register with Google
operationId: googleLogin
security: []
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/AuthGoogleLoginRequest'
responses:
'200':
description: Logged in successfully with Google.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthGoogleLoginResponse'
'400':
$ref: '#/components/responses/ValidationError'
'401':
description: Google token invalid.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'403':
description: Account suspended.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
# GitHub OAuth — implemented in auth.routes.js (controllers/auth.controller.js)
/auth/oauth/github:
get:
description: |
Redirects the browser to the GitHub OAuth consent screen.
The server constructs the GitHub authorization URL and issues a 302 redirect.
tags: [Auth]
summary: Start GitHub OAuth authorization
operationId: startGithubOAuth
security: []
responses:
'302':
description: Redirect to GitHub consent screen.
'429':
$ref: '#/components/responses/RateLimited'
/auth/oauth/github/callback:
get:
description: |
Handles the GitHub OAuth redirect. Exchanges the code for a Rythmify access token
and refresh token, then redirects the browser to the frontend callback URL with
tokens and user data as query parameters.
tags: [Auth]
summary: GitHub OAuth callback
operationId: githubOAuthCallback
security: []
parameters:
- name: code
in: query
required: true
schema:
type: string
description: Authorization code from GitHub.
- name: state
in: query
required: true
schema:
type: string
description: CSRF state token.
- name: error
in: query
required: false
schema:
type: string
description: Present when the user denied access on GitHub.
responses:
'302':
description: |
Redirect to frontend callback URL. On success, query params include:
`access_token`, `expires_in`, `is_new_user`, `user_id`, `email`,
`display_name`, `role`, `is_verified`. On error, redirects with
`?error=github_denied` or `?error=invalid_params`.
'429':
$ref: '#/components/responses/RateLimited'
# UNVERIFIED — no matching route found in src/routes/ as of audit date
# SoundCloud OAuth does not exist in auth.routes.js; only GitHub OAuth is implemented.
/auth/oauth/soundcloud:
get:
description: Redirects the browser to the SoundCloud OAuth consent screen.
tags: [Auth]
summary: Start SoundCloud OAuth authorization
operationId: startSoundCloudOAuth
security: []
parameters:
- name: return_to
in: query
required: false
schema:
type: string
responses:
'302':
description: Redirect to SoundCloud consent screen.
/auth/oauth/soundcloud/callback:
get:
description: Handles the SoundCloud OAuth redirect and issues Rythmify tokens.
tags: [Auth]
summary: SoundCloud OAuth callback
operationId: soundCloudOAuthCallback
security: []
parameters:
- name: code
in: query
required: true
schema:
type: string
- name: state
in: query
required: true
schema:
type: string
- name: error
in: query
required: false
schema:
type: string
responses:
'200':
description: OAuth completed. Tokens issued.
content:
application/json:
schema:
$ref: '#/components/schemas/AuthLoginResponse'
'400':
description: Invalid callback parameters.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: OAuth exchange failed.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'429':
$ref: '#/components/responses/RateLimited'
# UNVERIFIED — no matching route found in src/routes/ as of audit date
# No disconnectOAuthProvider route exists in auth.routes.js.
/auth/connections/{provider}:
delete:
tags: [Auth]
summary: Disconnect a linked OAuth provider
description: |
Unlinks a connected OAuth provider. Returns 422 if this is the only
login method and no password is set. Set a password first via
`POST /auth/change-password` before disconnecting.
operationId: disconnectOAuthProvider
parameters:
- name: provider
in: path
required: true
schema:
type: string
enum: [google, facebook, apple]
responses:
'200':
description: Provider disconnected.
content:
application/json:
schema:
$ref: '#/components/schemas/SuccessMessage'
'401':
$ref: '#/components/responses/Unauthorized'
'404':
description: No connection found for this provider.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'422':
description: Cannot disconnect — only login method and no password set.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
example:
error:
code: BUSINESS_OPERATION_NOT_ALLOWED
message: Cannot disconnect the only login method. Set a password first.
'500':
$ref: '#/components/responses/InternalError'
# DELETE /auth/me — implemented in auth.routes.js → auth.controller.deleteAccount
/auth/me:
delete:
description: |
Permanently deletes the authenticated user's account.
Requires the user's current password as confirmation.
Clears both `refreshToken` and `refresh_token` cookies on success.
tags: [Auth]
summary: Delete own account
operationId: deleteAccount
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- password
properties:
password:
type: string
description: Current password, required as confirmation before deletion.
responses:
'200':
description: Account deleted successfully.
content:
application/json:
schema:
type: object
properties:
data:
type: object
properties:
success:
type: boolean
example: true
message:
type: string
example: Account deleted successfully.
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'429':
$ref: '#/components/responses/RateLimited'
# ==========================================================
# Module 2 — User Profile & Social Identity
# ==========================================================
# GET /users/by-id/{user_id} — alias path for getUserById; same controller as /{user_id}
/users/by-id/{user_id}:
get:
description: |
Returns the public profile for a given user by UUID. This is an alias for
`GET /users/{user_id}` that avoids ambiguity with slug-based lookup.
Optional authentication allows the service to apply privacy rules.
tags: [Users]
summary: Get a user profile by UUID (alias path)
operationId: getUserByIdAlias
security: []
parameters:
- $ref: '#/components/parameters/UserId'
responses:
'200':
description: User profile returned.
content:
application/json:
schema:
$ref: '#/components/schemas/PublicUserResponse'
'403':
description: Profile is private.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
/users/{user_id}:
get:
description: Returns the public profile for a given user, respecting privacy settings.
tags: [Users]
summary: Get a user profile by ID
operationId: getUserById
security: []
parameters:
- $ref: '#/components/parameters/UserId'
responses:
'200':
description: User profile returned.
content:
application/json:
schema:
$ref: '#/components/schemas/PublicUserResponse'
'403':
description: Profile is private.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
/users/{user_id}/liked-tracks:
get:
description: |
Returns a paginated list of tracks liked by the specified user.
Bearer authentication may be supplied optionally so private-profile visibility
and viewer personalization flags can be evaluated for the requester.
tags: [Users]
summary: List a user's liked tracks
operationId: getUserLikedTracks
security: []
parameters:
- $ref: '#/components/parameters/UserId'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Offset'
responses:
'200':
description: Paginated liked tracks list.
content:
application/json:
schema:
$ref: '#/components/schemas/TrackListResponse'
example:
data:
- id: e5f6a7b8-c9d0-1234-efab-567890abcdef
title: Summer Vibes
genre: Electronic
duration: 213
cover_image: https://cdn.rythmify.com/covers/track1.jpg
user_id: a1b2c3d4-e5f6-7890-abcd-ef1234567890
artist_name: DJ Karim
play_count: 4200
like_count: 312
comment_count: 47
repost_count: 19
stream_url: https://cdn.rythmify.com/tracks/e5f6a7b8/stream.mp3
audio_url: https://cdn.rythmify.com/tracks/e5f6a7b8/audio.mp3
pagination:
limit: 20
offset: 0
total: 45
message: User liked tracks fetched successfully
'400':
$ref: '#/components/responses/ValidationError'
'403':
description: Target user profile is private and the requester is not allowed to view it.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
$ref: '#/components/responses/NotFound'
'429':
$ref: '#/components/responses/RateLimited'
'500':
$ref: '#/components/responses/InternalError'
/users/{user_id}/web-profiles:
get:
description: |
Returns a paginated list of web profiles for the specified user.
Bearer authentication may be supplied optionally to access profiles that you
are permitted to view. Private profiles return 404 when the requester is not allowed.
tags: [Users]
summary: List a user's linked social / web profiles
operationId: getUserWebProfiles
security: []
parameters:
- $ref: '#/components/parameters/UserId'
- $ref: '#/components/parameters/Limit'
- $ref: '#/components/parameters/Offset'
responses:
'200':
description: Web profile list returned.
content:
application/json:
schema:
$ref: '#/components/schemas/WebProfileListResponse'
'400':
$ref: '#/components/responses/ValidationError'
'403':
description: Profile is private and requester is not allowed.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'404':
$ref: '#/components/responses/NotFound'
'500':
$ref: '#/components/responses/InternalError'
/users/me:
get:
description: Returns the full authenticated user profile including private fields.
tags: [Users]
summary: Get own profile (authenticated)
operationId: getMyProfile
responses:
'200':
description: Own profile returned.
content:
application/json:
schema:
$ref: '#/components/schemas/OwnProfileFullResponse'
'401':
$ref: '#/components/responses/Unauthorized'
'500':
$ref: '#/components/responses/InternalError'
patch:
description: Partially updates the authenticated user's public profile fields.
tags: [Users]
summary: Edit own profile
operationId: updateMyProfile
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/UpdateProfileRequest'
responses:
'200':
description: Profile updated.
content:
application/json:
schema:
$ref: '#/components/schemas/OwnProfileFullResponse'
'400':
$ref: '#/components/responses/ValidationError'
'401':
$ref: '#/components/responses/Unauthorized'
'409':
description: Username already taken.
content:
application/json:
schema:
$ref: '#/components/schemas/ErrorResponse'
'500':
$ref: '#/components/responses/InternalError'
/me/insights:
get:
description: |
Returns creator insight metrics for tracks uploaded by the authenticated user.
Buckets are generated in PostgreSQL with `generate_series`, so missing days or months
are returned with zero counts.
tags: [Insights]
summary: Get my creator insights
operationId: getMyCreatorInsights
parameters:
- name: range
in: query
required: false
schema:
type: string
enum: [7d, 30d, 12m]
default: 30d
description: Time range. `7d` and `30d` return daily buckets; `12m` returns monthly buckets.
- name: track_id
in: query
required: false
schema:
type: string
format: uuid
nullable: true
description: Optional owned track filter. Requests for tracks owned by another user return 403.
- name: timezone
in: query
required: false
schema:
type: string
default: UTC
example: UTC
description: IANA time zone used for bucket boundaries.
responses:
'200':
description: Creator insights returned.
content:
application/json:
schema: