Skip to content

uploads

Track upload endpoints and background processing.

upload_track(request: Request, title: Annotated[str, Form()], background_tasks: BackgroundTasks, auth_session: AuthSession = Depends(require_artist_profile), album: Annotated[str | None, Form()] = None, features: Annotated[str | None, Form()] = None, tags: Annotated[str | None, Form(description='JSON array of tag names')] = None, support_gate: Annotated[str | None, Form(description='JSON object for supporter gating, e.g., {"type": "any"}')] = None, description: Annotated[str | None, Form(description='Track description (liner notes, show notes, etc.)')] = None, auto_tag: Annotated[str | None, Form(description='auto-apply recommended genre tags after classification')] = None, file: UploadFile = File(...), image: UploadFile | None = File(None)) -> UploadStartResponse

Upload a new track (requires authentication and artist profile).

Args:

  • title: Track title (required).
  • album: Optional album name/ID to associate with the track.
  • features: Optional JSON array of ATProto handles, e.g., [“user1.bsky.social”, “user2.bsky.social”].
  • support_gate: Optional JSON object for supporter gating. Requires atprotofans to be enabled in settings. Example: {“type”: “any”} - requires any atprotofans support.
  • file: Audio file to upload (required).
  • image: Optional image file for track artwork. Accepted formats: JPG, PNG, WebP, GIF. Max 20 MB. Square images (1:1) recommended — non-square images are center-cropped.
  • background_tasks: FastAPI background-task runner.
  • auth_session: Authenticated artist session (dependency-injected).

Returns:

  • A payload containing upload_id for monitoring progress via SSE.
upload_progress(upload_id: str) -> StreamingResponse

SSE endpoint for real-time upload progress.

response when upload is queued for processing.

all data needed to process an upload in the background.

result of audio validation phase.

result of audio storage phase.

raised when an upload phase fails with a user-facing message.

result of transcoding an audio file.

result of attempting to upload a blob to user’s PDS.