Definition
What it is
An endpoint is where traffic lands. In a REST API, an endpoint is (method, URL): GET /users/42 and DELETE /users/42 are two different endpoints that share a URL. In a TCP service, an endpoint is a host:port pair. In a Unix service, an endpoint is a socket path. In WebSocket, an endpoint is the URL plus the upgrade handshake.
An endpoint is not the same as a URL. A URL names a resource (/users/42). An endpoint names a way to act on it (GET /users/42, DELETE /users/42). Two endpoints may share the same URL. One endpoint may answer a URL range (/users/{id}).
Why it matters
Every public API is a set of endpoints. The discovery question ("what can I do with this service?") is answered by the endpoint list. The documentation question ("how do I call this?") is answered by the endpoint signature. The monitoring question ("is the service healthy?") is answered by the endpoint's availability and latency. Every change to an endpoint is a change to the contract.
Endpoint vs URL vs route vs path
Example | Role | |
|---|---|---|
URL |
| Full locator |
Path |
| URL without host and scheme |
Route |
| Server's matching rule |
Endpoint |
| Method + URL, the callable unit |
Where an endpoint sits in the request path
graph LR C[Client] --> DNS[DNS resolve] DNS --> LB[Load balancer] LB --> GW[API gateway] GW --> R[Router] R --> EP[Endpoint handler] EP --> R R --> GW GW --> LB LB --> C style EP fill:#E8F5E9
How to design endpoints that age well
Designing REST endpoints
Nouns, not verbs
POST /orderscreates an order.POST /createOrderis RPC pretending to be REST.Methods for actions
GET reads, POST creates, PUT replaces, PATCH updates, DELETE removes. When a route has a verb in its name, the design is fighting HTTP.
Stable identifiers in the path
/users/42, not/users/current-user-with-name-ana. The path is the address; the body is the data.Version the contract
/v1/users/42lets you break the shape without breaking clients. Silent changes to endpoints are silent outages.
Common failures
Origin
In the 1970s, an endpoint was one of the two vertices of a network connection: a host plus a port, or a socket. TCP/IP formalized it: a socket address is (IP, port), and each connection has two endpoints. When HTTP and REST arrived in the 1990s, the term was borrowed: an endpoint was the addressable unit of an API, the URL plus the method. The metaphor survived: an endpoint is a place where traffic lands.
An HTTP endpoint is a URL that identifies a resource on a server, combined with an HTTP method that defines what operation is performed on that resource.
— adapted from RFC 9110, 2022
Evidence
FAQ
- Endpoint vs URL?
A URL is the address of a resource. An endpoint is a method plus URL — the callable unit. Two endpoints can share one URL.
- Endpoint vs route?
A route is the server's matching rule. An endpoint is the concept the client calls. The route implements the endpoint.
- How many endpoints?
Enough to model the resources, no more. Every endpoint is a contract and a maintenance cost.
- How to version?
In the URL (
/v1/), in a header (Accept: application/vnd.api+json;version=1), or not at all if the change is backwards compatible. Pick one and document it.
Connections
Fielding, R., Nottingham, M. & Reschke, J. (2022). RFC 9110: HTTP Semantics. https://www.rfc-editor.org/rfc/rfc9110
OpenAPI Initiative (2024). OpenAPI Specification 3.1. https://spec.openapis.org/oas/v3.1.0
MDN Web Docs (2024). HTTP overview. https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview
Etymology
Origin: compound
end(noun): Old English ende, "boundary, extremity"point(noun): Latin punctum, "a small hole, a dot"
Semantic network
● broader ● narrower ● related
Used in the garden
- Unlock Real-Time Power: Vanilla JS & SSE for Elite Dashboards (4×)
- From Script to Microservice: Scaling Reporting Automation to 10K Daily Requests (3×)
Sources
Fielding, R., Nottingham, M. & Reschke, J. (2022). RFC 9110. https://www.rfc-editor.org/rfc/rfc9110
OpenAPI Initiative (2024). OpenAPI Specification 3.1. https://spec.openapis.org/oas/v3.1.0
MDN Web Docs (2024). HTTP overview. https://developer.mozilla.org/en-US/docs/Web/HTTP/Overview