Skip to content

[Contests] Add GET /v1/users/{id}/contests endpoint#791

Merged
dylanjeffers merged 1 commit intomainfrom
claude/artist-contests-endpoint
May 7, 2026
Merged

[Contests] Add GET /v1/users/{id}/contests endpoint#791
dylanjeffers merged 1 commit intomainfrom
claude/artist-contests-endpoint

Conversation

@dylanjeffers
Copy link
Copy Markdown
Contributor

Summary

  • Add per-user remix-contests endpoint at GET /v1/users/{id}/contests (and /v1/users/handle/{handle}/contests), filtered server-side by host userId.
  • Mirrors the response shape of GET /events/remix-contests (data + related users / tracks / entry_counts) so callers can keep the same primer code path.
  • Unblocks the profile Contests tab, which currently fetches the global list and filters client-side, paginating up to 5 pages to avoid false-empty rendering when an artist's contests sit beyond page 1.

Endpoint

  • Path: /users/{id}/contests (also /users/handle/{handle}/contests)
  • Query params: limit (1-100, default 25), offset (default 0), status (active|ended|all, default all)
  • Ordering: active first by soonest-ending end_date, then ended by most-recently-ended.
  • Documented in api/swagger/swagger-v1.yaml.

Test plan

  • go test ./api/ -run TestGetUserContests -v — 8 subtests pass (ordering, by-id and by-handle resolution, status filters, pagination, related primer, empty state).
  • Pair with the apps PR (AudiusProject/apps#claude/artist-contests-endpoint) to verify the profile tab renders end-to-end against this branch.

🤖 Generated with Claude Code

The profile Contests tab was fetching the global remix-contests list
and filtering client-side by host userId, paginating up to 5 pages
to avoid false-empty rendering for hosts whose contests sat past
the first page. Add a dedicated per-user endpoint that filters
server-side, mirroring the artist tracks/albums pattern.

Reuses the response shape from /events/remix-contests
(data + related users / tracks / entry_counts) so the web tab can
keep the same primer code path. Documented in swagger and registered
on both the handle and userId routes.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@dylanjeffers dylanjeffers merged commit 35626ea into main May 7, 2026
5 checks passed
@dylanjeffers dylanjeffers deleted the claude/artist-contests-endpoint branch May 7, 2026 17:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant