Skip to main content

API Reference

The BookWish API is a RESTful API that provides access to all platform features including books, wishlists, stores, inventory, social features, and more.

Base URL

All API requests should be made to:

https://api.bookwish.app

For local development:

http://localhost:3000

Authentication

Most endpoints require authentication using JWT (JSON Web Tokens). Include your access token in the Authorization header:

Authorization: Bearer YOUR_ACCESS_TOKEN

See Authentication for detailed information about obtaining and using tokens.

Request Format

  • Content-Type: application/json
  • Method: Standard HTTP methods (GET, POST, PUT, DELETE)
  • Body: JSON payload for POST/PUT requests

Example Request

curl -X POST https://api.bookwish.app/wishlists \
-H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
-H "Content-Type: application/json" \
-d '{"bookId": "123", "condition": "new"}'

Response Format

All responses are returned in JSON format with appropriate HTTP status codes.

Success Response

{
"user": {
"id": "123",
"displayName": "John Doe",
"email": "john@example.com"
}
}

Error Response

{
"error": "ValidationError",
"message": "Request validation failed",
"details": [
{
"path": "email",
"message": "Invalid email format"
}
]
}

See Errors for detailed error handling information.

Pagination

List endpoints support pagination using query parameters:

ParameterTypeDefaultDescription
pageinteger1Page number (1-indexed)
limitinteger20Items per page (max 100)

Example Paginated Request

GET /wishlists?page=2&limit=50

Pagination Response

{
"data": [...],
"pagination": {
"page": 2,
"limit": 50,
"total": 250,
"totalPages": 5
}
}

Rate Limiting

The API implements rate limiting to ensure fair usage and system stability. Rate limits vary by endpoint and user tier.

  • Rate limit information is returned in response headers
  • Exceeded limits return 429 Too Many Requests
  • Free tier users have monthly content creation limits

See Rate Limiting for specific limits and best practices.

Endpoint Categories

CategoryBase PathDescription
Authentication/authUser signup, login, token refresh
Users/usersUser profiles, preferences, followers
Books/booksBook search and information
Wishlists/wishlistsUser wishlists and book wants
Stores/storesBookstore profiles and inventory
Orders/ordersOrder management and fulfillment
Cart/cartShopping cart operations
Checkout/checkoutCheckout and payment processing
Inventory/stores/:id/inventoryStore inventory management
POS/posPoint-of-sale operations
Lines/linesSocial feed posts (scribbles)
Reviews/reviewsBook reviews
Notes/notesPrivate book notes
Feed/feedSocial content feed
Search/searchGlobal search across content
Follows/followsFollow relationships
Clubs/clubsBook clubs
Challenges/challengesReading challenges
Notifications/notificationsUser notifications
Billing/billingSubscription management
Moderation/reports, /adminContent moderation

Health Check

The API provides a health check endpoint for monitoring:

GET /health

Response:

{
"status": "ok",
"timestamp": "2025-12-08T10:30:00.000Z"
}

Versioning

The API is currently in version 1. Future versions will be indicated in the base path (e.g., /v2/).

Support

For API support and questions: