Skip to content
BENIBIX Learn

Endpoint vs REST Resource

People think an endpoint and a resource are the same, and they are not. A resource is a thing with an address, such as /orders/42. An endpoint is a method plus a path, such as GET /orders/42. So one resource usually has several endpoints, one for each thing you can do to it.

Development🔌 APIs

API Endpoint

One address in an API, plus its method, like GET /users/42.

An endpoint is one address in an API where you can send a request for one kind of job. It is a method plus a path, like GET /users/42 or POST /orders. Each endpoint takes certain inputs and gives back a certain answer. An API is often described as a list of its endpoints. Changing an endpoint can break every app that uses it.

Example
Jack's app uses three endpoints. GET /products lists items, POST /orders buys, and GET /orders/1042 tracks a parcel.
Why it matters
Endpoints are what other people's code is written against. A clear, stable list makes an API easy to use.
Full entry
Development🔌 APIs

REST Resource

One thing a REST API offers, like an order. It has its own address.

A resource is one thing a REST API lets you work with, like a user or an order. Each resource has its own address, such as /orders/42. You use HTTP methods on that address. GET reads it, POST adds one, PUT or PATCH changes it and DELETE removes it. Good resource names are nouns, not verbs.

Example
Jack's API has /orders for all orders and /orders/42 for one. To cancel order 42, he sends DELETE to /orders/42.
Why it matters
Clear resources make an API easy to guess. Users can work out new endpoints alone.
Full entry

In one line

API Endpoint
One address in an API, plus its method, like GET /users/42.
REST Resource
One thing a REST API offers, like an order. It has its own address.