openapi: 3.1.0 info: # Do not change the title, if the title changes, the import paths will be broken title: Api version: 0.1.0 description: Noted API — collaborative human-made music platform servers: - url: /api description: Base API path tags: - name: health - name: songs - name: rounds - name: commits - name: votes - name: versions - name: profiles - name: admin - name: stats paths: /healthz: get: operationId: healthCheck tags: [health] summary: Health check responses: "200": description: Healthy content: application/json: schema: { $ref: "#/components/schemas/HealthStatus" } /me: get: operationId: getCurrentUser tags: [profiles] summary: Current user profile (null if unauthenticated) responses: "200": description: Profile or null content: application/json: schema: { $ref: "#/components/schemas/CurrentUser" } patch: operationId: updateMe tags: [profiles] summary: Update the current user's preferences (e.g. email digest opt-out) requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/UpdateMeBody" } responses: "200": description: Updated profile content: application/json: schema: { $ref: "#/components/schemas/Profile" } /me/notifications: get: operationId: listMyNotifications tags: [notifications] summary: Recent notifications for the current user (auth required) responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/NotificationFeed" } /me/notifications/read-all: post: operationId: markAllNotificationsRead tags: [notifications] summary: Mark every unread notification as read responses: "204": description: Done /me/notifications/{id}/read: post: operationId: markNotificationRead tags: [notifications] summary: Mark a single notification as read parameters: - name: id in: path required: true schema: { type: string, format: uuid } responses: "204": description: Done /songs: get: operationId: listSongs tags: [songs] summary: List songs parameters: - in: query name: genre required: false schema: { type: string } - in: query name: status required: false schema: { type: string, enum: [draft, active, archived] } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Song" } /songs/featured: get: operationId: getFeaturedSong tags: [songs] summary: Get the currently featured song (landing page hero) responses: "200": description: Featured song with current round and current version content: application/json: schema: { $ref: "#/components/schemas/FeaturedSong" } /songs/{songId}: get: operationId: getSong tags: [songs] parameters: - $ref: "#/components/parameters/SongId" responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/SongDetail" } /songs/by-slug/{slug}: get: operationId: getSongBySlug tags: [songs] parameters: - in: path name: slug required: true schema: { type: string } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/SongDetail" } /songs/{songId}/files: get: operationId: listSongFiles tags: [songs] parameters: - $ref: "#/components/parameters/SongId" responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/SongFile" } /songs/{songId}/rounds: get: operationId: listRoundsForSong tags: [rounds] parameters: - $ref: "#/components/parameters/SongId" responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Round" } /songs/{songId}/versions: get: operationId: listVersionsForSong tags: [versions] parameters: - $ref: "#/components/parameters/SongId" responses: "200": description: Version history (oldest to newest) content: application/json: schema: type: array items: { $ref: "#/components/schemas/VersionWithMerges" } /credits: get: operationId: listAllCredits tags: [songs] summary: All third-party credits across every song (for the global /licenses page) responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/SongCreditWithSong" } /songs/{songId}/credits: get: operationId: listCredits tags: [versions] parameters: - $ref: "#/components/parameters/SongId" responses: "200": description: All merged contributors for this song content: application/json: schema: type: array items: { $ref: "#/components/schemas/CreditEntry" } /rounds/{roundId}: get: operationId: getRound tags: [rounds] parameters: - $ref: "#/components/parameters/RoundId" responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/Round" } /rounds/{roundId}/commits: get: operationId: listCommitsForRound tags: [commits] parameters: - $ref: "#/components/parameters/RoundId" - in: query name: sort required: false schema: { type: string, enum: [top, newest] } responses: "200": description: Commits for this round content: application/json: schema: type: array items: { $ref: "#/components/schemas/CommitSummary" } /commits: get: operationId: listCommits tags: [commits] summary: List commits (filter by round or song) parameters: - in: query name: songId schema: { type: string, format: uuid } - in: query name: roundId schema: { type: string, format: uuid } - in: query name: status schema: { type: string, enum: [pending, shortlisted, merged, rejected] } - in: query name: sort schema: { type: string, enum: [top, newest] } - in: query name: limit schema: { type: integer } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/CommitSummary" } /commits/rising: get: operationId: listRisingCommits tags: [commits] summary: Top rising commits across all open rounds (for discovery) parameters: - in: query name: limit schema: { type: integer, default: 6 } - in: query name: genre schema: { type: string } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/CommitSummary" } /commits/{commitId}: get: operationId: getCommit tags: [commits] parameters: - $ref: "#/components/parameters/CommitId" responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/CommitDetail" } /commits/submit: post: operationId: submitCommit tags: [commits] summary: Submit a new commit to an open round (after presigned upload) requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/SubmitCommitBody" } responses: "200": description: Created content: application/json: schema: { $ref: "#/components/schemas/CommitDetail" } /songs/{songId}/comments: get: operationId: listSongComments tags: [comments] summary: List comments on a song, newest first parameters: - $ref: "#/components/parameters/SongId" responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Comment" } post: operationId: postSongComment tags: [comments] summary: Post a comment on a song (auth required) parameters: - $ref: "#/components/parameters/SongId" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/PostCommentBody" } responses: "201": description: Created content: application/json: schema: { $ref: "#/components/schemas/Comment" } /comments/{commentId}: delete: operationId: deleteComment tags: [comments] summary: Delete a comment (author or admin) parameters: - name: commentId in: path required: true schema: { type: string, format: uuid } responses: "204": description: Deleted /comments/{commentId}/reports: post: operationId: reportComment tags: [comments] summary: Flag a comment for moderation (auth required, idempotent per user) parameters: - name: commentId in: path required: true schema: { type: string, format: uuid } requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/ReportCommentBody" } responses: "201": description: Reported content: application/json: schema: type: object required: [ok] properties: ok: { type: boolean } /storage/uploads/request-url: post: operationId: requestUploadUrl tags: [stats] summary: Request a presigned URL to upload a file directly to storage requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/RequestUploadUrlBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/RequestUploadUrlResponse" } /commits/drafts: get: operationId: listMyDrafts tags: [commits] summary: List the current user's commit drafts (notes saved before a round was open) responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/CommitDraft" } post: operationId: createDraft tags: [commits] summary: Save a Note as a draft (no round required) requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/CreateDraftBody" } responses: "200": description: Created content: application/json: schema: { $ref: "#/components/schemas/CommitDraft" } /commits/drafts/{draftId}: patch: operationId: updateDraft tags: [commits] summary: Edit a saved Note draft (any subset of fields) parameters: - in: path name: draftId required: true schema: { type: string, format: uuid } requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/UpdateDraftBody" } responses: "200": description: Updated content: application/json: schema: { $ref: "#/components/schemas/CommitDraft" } delete: operationId: deleteDraft tags: [commits] parameters: - in: path name: draftId required: true schema: { type: string, format: uuid } responses: "204": description: Deleted /commits/drafts/{draftId}/submit: post: operationId: submitDraft tags: [commits] summary: Promote a draft into a real commit on an open round parameters: - in: path name: draftId required: true schema: { type: string, format: uuid } requestBody: required: false content: application/json: schema: { $ref: "#/components/schemas/SubmitDraftBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/CommitDetail" } /commits/{commitId}/vote: post: operationId: voteOnCommit tags: [votes] summary: Cast an upvote on a commit (idempotent) parameters: - $ref: "#/components/parameters/CommitId" responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/VoteResult" } delete: operationId: unvoteCommit tags: [votes] summary: Remove an upvote parameters: - $ref: "#/components/parameters/CommitId" responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/VoteResult" } /downloads/log: post: operationId: logDownload tags: [stats] summary: Log a stem or file download (optional auth) requestBody: required: true content: application/json: schema: type: object required: [songId, fileId] properties: songId: { type: string, format: uuid } fileId: { type: string, format: uuid } responses: "200": description: Logged content: application/json: schema: type: object properties: ok: { type: boolean } required: [ok] /stats/public: get: operationId: getPublicStats tags: [stats] summary: Public platform stats for landing page responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/PublicStats" } /stats/admin: get: operationId: getAdminStats tags: [admin] summary: Admin dashboard stats responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/AdminStats" } /admin/songs: get: operationId: adminListSongs tags: [admin] responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/Song" } post: operationId: adminCreateSong tags: [admin] requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/CreateSongBody" } responses: "200": description: Created content: application/json: schema: { $ref: "#/components/schemas/Song" } /admin/songs/{songId}: patch: operationId: adminUpdateSong tags: [admin] parameters: - $ref: "#/components/parameters/SongId" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/UpdateSongBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/Song" } /admin/songs/{songId}/advance-phase: post: operationId: adminAdvanceSongPhase tags: [admin] parameters: - $ref: "#/components/parameters/SongId" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/AdvancePhaseBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/Song" } /admin/songs/{songId}/files: post: operationId: adminAddSongFile tags: [admin] parameters: - $ref: "#/components/parameters/SongId" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/AdminAddSongFileBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/SongFile" } /admin/rounds: post: operationId: adminCreateRound tags: [admin] requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/CreateRoundBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/Round" } /admin/rounds/{roundId}: patch: operationId: adminUpdateRound tags: [admin] parameters: - $ref: "#/components/parameters/RoundId" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/UpdateRoundBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/Round" } /admin/commits: get: operationId: adminListCommits tags: [admin] parameters: - in: query name: songId schema: { type: string, format: uuid } - in: query name: roundId schema: { type: string, format: uuid } - in: query name: status schema: { type: string, enum: [pending, shortlisted, merged, rejected] } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/CommitSummary" } /admin/commits/{commitId}/status: patch: operationId: adminSetCommitStatus tags: [admin] parameters: - $ref: "#/components/parameters/CommitId" requestBody: required: true content: application/json: schema: type: object required: [status] properties: status: type: string enum: [pending, shortlisted, merged, rejected] responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/CommitDetail" } /admin/songs/{songId}/credits: post: operationId: adminCreateSongCredit tags: [admin] parameters: - $ref: "#/components/parameters/SongId" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/CreateSongCreditBody" } responses: "200": description: Created content: application/json: schema: { $ref: "#/components/schemas/SongCredit" } /admin/songs/{songId}/credits/reorder: post: operationId: adminReorderSongCredits tags: [admin] parameters: - $ref: "#/components/parameters/SongId" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/ReorderSongCreditsBody" } responses: "200": description: OK content: application/json: schema: type: array items: { $ref: "#/components/schemas/SongCredit" } /admin/credits/{creditId}: patch: operationId: adminUpdateSongCredit tags: [admin] parameters: - $ref: "#/components/parameters/CreditId" requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/UpdateSongCreditBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/SongCredit" } delete: operationId: adminDeleteSongCredit tags: [admin] parameters: - $ref: "#/components/parameters/CreditId" responses: "204": description: Deleted /admin/versions: post: operationId: adminCreateVersion tags: [admin] summary: Publish a new official version with merged commits requestBody: required: true content: application/json: schema: { $ref: "#/components/schemas/AdminCreateVersionBody" } responses: "200": description: OK content: application/json: schema: { $ref: "#/components/schemas/VersionWithMerges" } /admin/versions/preview-mix: post: operationId: adminPreviewVersionMix tags: [admin] summary: Auto-mix a song's current version with selected commit stems description: | Layers the song's current official mix together with each selected commit's audio into a single mp3, uploads it to object storage, and returns the entity path. The returned `objectPath` can be used as `officialMixObjectPath` when publishing a new version. Curators can load the result in an `