Skip to main content
Mock API Builder
LearnAboutContact
Learning Center/Endpoints & Resources
Core Concepts

Endpoints & Resources

Create and configure REST API endpoints with full CRUD operations

What is an Endpoint?

An endpoint is a specific URL path combined with an HTTP method that responds to requests. In Mock API Builder, each endpoint represents a single operation (like "GET /api/users" or "POST /api/users").

Anatomy of an Endpoint

GET https://www.mockapibuilder.io/api/users/123

Method: GET (retrieve data)

Base URL: https://www.mockapibuilder.io

Path: /api/users/123

Resource ID: 123

Key Concept: Single-Method Endpoints

In Mock API Builder, each endpoint is tied to one specific HTTP method. When you create a resource, the system automatically generates 5 separate endpoints:

GET/api/users- List all users
POST/api/users- Create new user
GET/api/users/:id- Get single user
PUT/api/users/:id- Update user
DELETE/api/users/:id- Delete user

Each endpoint can be configured independently with its own schema, validation rules, and mock data. You can delete unwanted methods if you only need specific operations.

HTTP Methods (CRUD Operations)

Each HTTP method corresponds to a specific type of operation. When you create a resource in Mock API Builder, each method becomes its own independent endpoint:

GET
Read / Retrieve

Fetch data from the server (list all or get by ID)

GET /api/users

Returns all users

GET /api/users/123

Returns user with ID 123

Use case: Displaying data, search, filtering
POST
Create

Create new resources on the server

POST /api/users

Creates a new user

json
Use case: Forms, registration, adding items
PUT
Update (Full Replace)

Replace entire resource with new data

PUT /api/users/123

Updates user 123 (all fields)

json
Use case: Edit forms, profile updates
PATCH
Update (Partial)

Update only specific fields of a resource

PATCH /api/users/123

Updates only specified fields

json
Use case: Toggle settings, update single field
DELETE
Delete

Remove resources from the server

DELETE /api/users/123

Deletes user with ID 123

Use case: Remove items, cancel subscriptions

Creating Endpoints

You have multiple ways to create endpoints in Mock API Builder:

Add to Existing Project (Recommended)

Add endpoints to an existing project through the Settings dialog

Steps:

  1. Open your project page
  2. Click the "Settings" button in the top-right
  3. Go to the "General" tab
  4. Click "Add Endpoint" button
  5. Enter endpoint name (e.g., "posts", "comments")
  6. Add description (optional)
  7. Choose contract format (Manual Fields or JSON)
  8. Define your data structure
  9. Set mock data count (1-100 records)
  10. Click "Create Endpoint"

Automatic Endpoint Generation: When you add an endpoint, the system creates 5 separate database records (one for each CRUD method). Each can be independently configured or deleted.

Create New Project

Start fresh with a new project and add endpoints during setup

Steps:

  1. Go to "Create New Project" page
  2. Enter project name and description
  3. Set base URL (e.g., "/api")
  4. Define your first endpoint resource
  5. Configure response structure
  6. Generate mock data
Template-Based

Use pre-built templates for common use cases

Available Templates:

  • • User Management (users, profiles, auth)
  • • E-commerce (products, orders, cart)
  • • Blog/CMS (posts, authors, comments)
  • • Task Management (tasks, projects)
OpenAPI Import

Import from existing OpenAPI/Swagger specifications

Benefits:

  • • Instant endpoint creation from spec
  • • Automatically generates schemas
  • • Preserves data types and validation
  • • Imports descriptions and examples

Endpoint Configuration

Endpoint Path

The URL path for your resource (plural nouns recommended):

Good examples:

  • /api/users
  • /api/products
  • /api/blog-posts

Avoid:

  • /api/user (use plural)
  • /api/getUsers (don't include verb)
  • /api/Users (use lowercase)

Note: When you specify a path like /api/users, the system creates both collection endpoints (/api/users) and item endpoints (/api/users/:id) automatically.

Response Structure

Define what data your endpoint returns:

Single Resource (GET by ID)
json
Collection (GET all)
json

Status Codes

Automatically handled based on the operation:

200Success (GET, PUT, PATCH)
201Created (POST)
204No Content (DELETE)
404Not Found (invalid ID)
500Server Error

URL Parameters & Query Strings

Path Parameters

Used to identify specific resources:

/api/users/:id

Example: /api/users/123 retrieves user with ID 123

Query Parameters

Used for filtering, sorting, and pagination:

Filtering:

/api/users?role=admin&status=active

Sorting:

/api/products?sort=price&order=desc

Pagination:

/api/posts?page=2&limit=20

Best Practices

Use Nouns, Not Verbs

/api/users

/api/getUsers

Use Plural Names

/api/products

/api/product

Be Consistent

Use the same naming patterns across all endpoints

Keep URLs Simple

Maximum 2-3 levels deep for readability

Previous: Projects & OrganizationNext: Data Schemas & Contracts
Mock API Builder

Built for developers, by developers

LearnSupport / ContactPrivacy PolicyTerms of Service

© 2026 Mock API Builder. All rights reserved.

Learning Center
← Back to Dashboard
Learning Center
← Back to Dashboard