REST API

API Documentation

MySocialSaves exposes a REST API that powers both the web client and is ready for a future mobile app.

Interactive Swagger UI

The API project ships with Swagger UI (OpenAPI). When running locally, navigate to the API server to browse and test all endpoints interactively.

http://localhost:5120/swagger

Replace the host and port with wherever the API is deployed.

Authentication

Most endpoints require an authenticated session. The API uses cookie-based authentication.

  1. POST /api/auth/login with your email and password to receive a session cookie.
  2. Include that cookie on all subsequent requests.
  3. Admin endpoints additionally require either the Admin role or an X-Admin-Api-Key header.
Key endpoints
Method Path Description
GET/api/savedpostsList saved posts (paginated, filterable)
GET/api/savedposts/{id}Get a single post by ID
DELETE/api/savedposts/{id}Delete a post
GET/api/savedposts/exportExport all posts as CSV
POST/api/auth/registerRegister a new account
POST/api/auth/loginSign in
POST/api/auth/magic-linkRequest a magic link email
POST/api/admin/importTrigger a Reddit import (admin)
Rate limits
  • Auth endpoints (login, register, magic link): 5 requests / minute
  • All other authenticated endpoints: 30 requests / minute

Full schema and request/response examples are available in Swagger UI. The OpenAPI spec is auto-generated from the API source code.