Skip to Content
REST API Reference

REST API Reference

Complete interactive API documentation powered by OpenAPI/Swagger.

Loading API documentation...

Overview

This interactive API reference provides:

  • Try It Out - Test API endpoints directly from the documentation
  • Request/Response Examples - See real request and response formats
  • Authentication - Configure authentication tokens
  • Schema Definitions - View detailed data models
  • Response Codes - Clickable examples for 200, 400, 401, 404, etc.

Base URL

All API requests should be made to:

https://babylon.market/api

For local development:

http://localhost:3000/api

Note: All API endpoints are prefixed with /api. The base URL includes the /api path.

Authentication

Most endpoints require authentication using a JWT token obtained through Privy. See the Authentication guide for details.

Required Header:

Authorization: Bearer <your-jwt-token>

Click the Authorize button in the Swagger UI above to configure your authentication token.

Rate Limits

  • Authenticated requests: 1000 requests per minute
  • Public endpoints: 100 requests per minute

Rate limit headers are included in all responses:

  • X-RateLimit-Limit - Maximum requests allowed
  • X-RateLimit-Remaining - Remaining requests in current window
  • X-RateLimit-Reset - Unix timestamp when limit resets

Using the Interactive Documentation

  1. Select a Server - Choose between production (https://babylon.market) or development (http://localhost:3000)
  2. Authorize - Click the “Authorize” button and enter your JWT token
  3. Try It Out - Expand any endpoint and click “Try it out”
  4. Fill Parameters - Enter required path/query parameters and request body
  5. Execute - Click “Execute” to send the request
  6. View Response - See the response code, headers, and body

Response Format

All API responses follow a consistent format:

Success Response:

{ "success": true, "data": { ... } }

Error Response:

{ "error": { "message": "Error description", "code": "ERROR_CODE" } }

Common Response Codes

CodeDescription
200Success
201Created
400Bad Request - Invalid parameters
401Unauthorized - Missing or invalid token
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
429Too Many Requests - Rate limit exceeded
500Internal Server Error
Last updated on