Skip to content

API Reference

Mason Batchelor edited this page Mar 6, 2026 · 1 revision

API Reference

REST API

All endpoints follow the RealWorld API Spec.

Authentication

Method Endpoint Auth Description
POST /api/users No Register
POST /api/users/login No Login
GET /api/user Yes Get current user
PUT /api/user Yes Update current user

Articles

Method Endpoint Auth Description
GET /api/articles Optional List articles (supports tag, author, favorited, limit, offset)
GET /api/articles/feed Yes Get feed (articles from followed users)
POST /api/articles Yes Create article
GET /api/articles/:slug Optional Get article
PUT /api/articles/:slug Yes Update article
DELETE /api/articles/:slug Yes Delete article

Comments

Method Endpoint Auth Description
GET /api/articles/:slug/comments Optional List comments
POST /api/articles/:slug/comments Yes Add comment
DELETE /api/articles/:slug/comments/:id Yes Delete comment

Profiles

Method Endpoint Auth Description
GET /api/profiles/:username Optional Get profile
POST /api/profiles/:username/follow Yes Follow user
DELETE /api/profiles/:username/follow Yes Unfollow user

Favorites

Method Endpoint Auth Description
POST /api/articles/:slug/favorite Yes Favorite article
DELETE /api/articles/:slug/favorite Yes Unfavorite article

GraphQL API

Available at /graphql. Schema defined in src/main/resources/schema/schema.graphqls.

Mutations

  • createUser(input) — Register
  • login(email, password) — Login
  • updateUser(changes) — Update profile
  • createArticle(input) — Create article
  • updateArticle(slug, changes) — Update article

Queries

  • articles(first, after, tag, author) — List with cursor pagination
  • article(slug) — Get single article
  • feed(first, after) — Followed users articles
  • profile(username) — User profile

Clone this wiki locally