What Is an API Endpoint?
An API endpoint is a specific URL that accepts HTTP requests and returns a response. It is the point of entry into a service or application — the address you send a request to in order to read data, create a record, update it, or delete it.
Think of an API as a restaurant. The menu lists what is available, and the waiter takes your order. An API endpoint is like the waiter — you tell it what you want, and it brings back a response.
For example:
GET https://api.example.com/v1/products
This is an API endpoint. When you send a GET request to this URL, the API returns a list of products in JSON format.
Anatomy of an API Endpoint URL
Let's break down the URL https://api.example.com/v1/users/42:
- https:// — The protocol (HTTPS for secure communication)
- api.example.com — The host (the server your request goes to)
- /v1 — The API version prefix
- /users — The resource collection
- /42 — The resource identifier (user with ID 42)
HTTP Methods: What Each One Does
| Method | Action | Example |
|---|---|---|
| GET | Read data | GET /products — list all products |
| POST | Create data | POST /products — create a new product |
| PUT | Replace data | PUT /products/5 — replace product 5 |
| PATCH | Update data | PATCH /products/5 — update product 5 fields |
| DELETE | Delete data | DELETE /products/5 — delete product 5 |
What Does an API Response Look Like?
API responses typically include:
- An HTTP status code (200 means success; 404 means not found; 500 means server error)
- Response headers (metadata like content type and rate limit info)
- A response body (usually JSON data)
Example response from GET /users/1:
HTTP/1.1 200 OK
Content-Type: application/json
{
"id": 1,
"name": "Alice Johnson",
"email": "alice@example.com",
"createdAt": "2025-03-01T10:00:00Z"
}
How to Test an API Endpoint
Using a Browser
For GET requests, you can simply paste the URL into a browser address bar. The JSON response will display in the browser window.
Using cURL
curl -X GET https://api.example.com/v1/users \
-H "Authorization: Bearer your-token-here"
Using Postman
Postman provides a graphical interface for building and sending API requests. It is the most popular API testing tool among developers and is available free.
Using a Mock API
If the real API does not exist yet, you can create a mock endpoint with a tool like Mockable. The mock endpoint behaves exactly like a real API, returning the JSON response you define.
API Endpoint vs. API vs. Web Service: What Is the Difference?
- API (Application Programming Interface) — The entire interface contract that defines how one system communicates with another.
- Web service — An API accessible over the internet via HTTP.
- API endpoint — A single, specific URL within an API that performs a particular action.
An API may have dozens or hundreds of endpoints. For example, the GitHub API has endpoints for repositories, issues, pull requests, users, notifications, and much more.
How to Create Your Own API Endpoint
If you want to experiment with API endpoints before building a backend, the fastest approach is to create a mock API endpoint. Mockable lets you define an endpoint path, choose a method, write a JSON response, and get a live URL in under two minutes — no server, no code.
Once you understand how endpoints work in theory, you can build real endpoints using frameworks like:
- Node.js — Express.js or Fastify
- Python — FastAPI or Django REST Framework
- PHP — Laravel or Slim
- Go — Gin or Echo
- Ruby — Rails API mode
Conclusion
An API endpoint is simply a URL that your application can call to get, create, update, or delete data. Understanding endpoints is fundamental to modern web development — whether you are building a REST API, consuming a third-party service, or testing a mobile app.
The best way to learn is by doing. Create a free mock API endpoint on Mockable and send your first HTTP request today.