Documentation

Complete guide to all available endpoints and methods

| Available Resources

All endpoints work with the following 10 built-in resource types:

Products
Blogs
Properties
Offers
Categories
Reviews
Restaurants
Events
Tours
FAQ

| Custom Endpoints

Create Your Own Endpoints!

You can now create up to 2 custom endpoints with your own collection names and CRUD operations.

How to create:
  1. Go to Manage Custom Endpoints
  2. Choose a collection name (e.g., "my_tasks", "notes", "inventory")
  3. Select which operations to enable (Create, Read, Update, Delete)
  4. Click "Create Endpoint" - Done! 🎉
Example URLs:
GET /api/custom/my_tasks
GET /api/custom/my_tasks/1
POST /api/custom/my_tasks
PUT /api/custom/my_tasks/1
DELETE /api/custom/my_tasks/1
Features:
  • Professional URLs using your collection name
  • Choose which CRUD operations to enable
  • Completely private - only you can see your endpoints
  • Max 2 endpoints per user (database limit)
  • Same authentication as built-in endpoints
  • Works exactly like products, blogs, etc.

Note: Custom endpoints work exactly like the built-in resources below, but with your own collection name!

| Authentication

All endpoints require authentication

Include your token in the request header:

Authorization: Bearer YOUR_TOKEN_HERE

Get your token from the main dashboard after logging in.

🔐 Auth Endpoints (New!)

POST /api/auth/create
Create Auth Credentials - Create new username/password credentials for the auth endpoint.
Request Body:
{ "username": "myusername", "password": "mypassword123" }
Response:
{ "success": true, "message": "Auth user created successfully", "data": { "username": "myusername" } }
Note: Password must be at least 6 characters. No authentication required to create.
POST /api/auth
Authenticate - Get a JWT token using your auth credentials.
Request Body:
{ "username": "myusername", "password": "mypassword123" }
Response:
{ "success": true, "message": "Authentication successful", "data": { "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...", "user": { "username": "myusername" } } }
Use Case: Perfect for testing authentication flows in your applications. The token expires in 30 days.

| Usage

Testing & Working with Data

After retrieving your endpoint URL, you'll need to use API testing tools to insert, update, or delete data:

Recommended Tools:
  • Postman - Popular API testing platform (recommended for beginners)
  • Thunder Client - VS Code extension for API testing
  • Insomnia - Alternative to Postman
  • cURL - Command-line tool for advanced users
  • Your Code - JavaScript fetch(), Axios, or any HTTP library
Quick Postman Guide:
  1. Download and install Postman
  2. Create a new request (GET, POST, PUT, or DELETE)
  3. Paste your endpoint URL (e.g., https://mock-api.com/api/products)
  4. Add your authorization header: Authorization: Bearer YOUR_TOKEN
  5. For POST/PUT: Add your JSON data in the "Body" tab (select "raw" and "JSON")
  6. Click "Send" to execute the request
Example JSON Body (for POST/PUT):
{ "title": "My Product", "price": 29.99, "description": "A great product", "category": "Electronics" }

💡 Tip: You can view your data anytime using GET requests in your browser or in the dashboard, but for creating, updating, or deleting data, you'll need to use tools like Postman.

| Available Methods

GET /api/{resource}
Get all items - Returns all your items from the specified resource. Example: GET /api/products returns all your products.
GET /api/{resource}/:id
Get single item - Returns one specific item by its ID. Example: GET /api/products/abc123 returns the product with ID "abc123".
POST /api/{resource}
Create new item - Creates a new item in the specified resource. Send item data in the request body. Example: POST /api/products with product data creates a new product.
PUT /api/{resource}/:id
Update item - Updates an existing item by its ID. Send updated data in the request body. Example: PUT /api/products/abc123 updates the product with ID "abc123".
DELETE /api/{resource}/:id
Delete ONE item - Safely deletes a single specific item by its ID. Example: DELETE /api/products/abc123 deletes only the product with ID "abc123".
Safe Operation

This only affects one item. Always use this when you want to delete a specific item.

DELETE /api/{resource}
Delete ALL items - Permanently deletes ALL your items from the specified resource. Example: DELETE /api/products deletes ALL your products.
DANGEROUS OPERATION

This will delete ALL your data from this endpoint:

  • No ID parameter required (that's the difference!)
  • Cannot be undone
  • Useful for clearing test data or resetting
  • Returns count of deleted items

Double-check before using! If you want to delete just one item, use DELETE /api/{resource}/:id instead.

| Quick Reference

How to know which DELETE to use?
  • Want to delete ONE specific item? → Use DELETE /api/products/YOUR_ITEM_ID
  • Want to delete ALL your items? → Use DELETE /api/products (no ID)
  • Not sure? → Always use DELETE with ID first. It's safer!

| Response Format

All endpoints return responses in this format:

{ "code": 1, // 1 = success, 0 = error "msg": "Success message", "time": 45, // Response time in milliseconds "data": { ... } // Your data or result }

For deleteAll operations, the response includes:

{ "code": 1, "msg": "Successfully deleted 15 products", "time": 120, "data": { "deletedCount": 15 // Number of items deleted } }

| Complete Examples

Example 1: Delete ONE product

DELETE /api/products/abc123 Authorization: Bearer your_token_here Response: { "code": 1, "msg": "Product deleted successfully", "time": 45, "data": null }

Example 2: Delete ALL products (DANGEROUS)

DELETE /api/products Authorization: Bearer your_token_here Response: { "code": 1, "msg": "Successfully deleted 42 products", "time": 120, "data": { "deletedCount": 42 } }

Example 3: Get all items

GET /api/blogs Authorization: Bearer your_token_here Response: { "code": 1, "msg": "Blogs retrieved successfully", "time": 35, "data": [ { "id": "123", "title": "My Blog", ... }, { "id": "456", "title": "Another Blog", ... } ] }