A REST API is an interface designed around Representational State Transfer, an architectural style described by Roy Fielding. It models resources with identifiers and exchanges representations through a uniform interface. On the web, HTTP supplies the standard methods and message semantics. REST itself is an architectural description rather than a particular data format or a requirement to use JSON. Many services called REST APIs adopt only some of the constraints, so the label alone does not establish how an interface behaves.
Resources and Representations
Fielding defines a resource as a conceptual mapping to a set of entities, not the entity itself at any one moment. A resource such as the customer with identifier 1042 keeps its identity while its data changes over time. RFC 9110 uses the same model for HTTP: the target of a request is a resource, usually identified by a URI, and HTTP places no restriction on what a resource can be, only on how it is interacted with.
A resource representation is what actually travels over the wire. RFC 9110 describes it as information intended to reflect a past, current or desired state of a resource, consisting of the bytes plus metadata that describes them, such as the media type. One resource can have several representations: the same order might be available as JSON for a mobile app, as XML for a legacy integration and as a PDF invoice for a human. Content negotiation, driven by request headers, selects among them. The distinction is useful when designing the interface: the URI names the thing, the media type names the form, and the two are deliberately decoupled.
A client can change state by sending a representation, such as an updated customer record with PUT, or submit content for processing with POST. REST does not mean every action is a full replacement. Its uniform-interface constraints cover resource identification, manipulation through representations, self-descriptive messages and hypermedia controls that describe available transitions.
Stateless Requests and HTTP Methods
Statelessness
A stateless API makes each request understandable without relying on a remembered sequence of previous requests from that client. Session context is carried by the client; persistent resource data can remain on the server. This reduces dependence on one server instance and simplifies recovery, but it does not guarantee that any failed operation is safe to retry. Authentication, authorization and database checks still happen server-side. Clients may repeat tokens, cursors or other context instead of assuming a prior conversation is remembered.
Statelessness concerns session state, not resource state. A REST server certainly stores data; the rule is that it does not keep per-client conversational memory such as which step of a wizard a particular client has reached.
The uniform interface of HTTP methods
HTTP implementations of REST use the standard methods as their verbs, relying on the semantics RFC 9110 assigns to each.
| Method | Semantics (RFC 9110) | Safe | Idempotent |
|---|---|---|---|
| GET | Transfer a current representation of the target resource | Yes | Yes |
| HEAD | Same as GET without the content | Yes | Yes |
| PUT | Replace the resource's state with the enclosed representation | No | Yes |
| DELETE | Remove the association between the target URI and its functionality | No | Yes |
| POST | Process the enclosed representation according to the resource's own semantics | No | No |
Safe means the client neither requests nor expects a state change on the server, so automated retrieval should not intentionally trigger operations such as deleting an account. Logging and other incidental effects may still occur. Idempotent means repeating the request has the same intended effect as sending it once, which is what allows a client to retry a PUT or DELETE after a timeout without intentionally applying the operation twice; response codes and incidental logging can still differ. POST is neither, which is why a retried POST can create two orders. Clients should not assume they can retry it unless the API documents an appropriate guarantee, such as an idempotency mechanism. PATCH, for partial updates, is defined in a separate specification rather than in RFC 9110. A design that pushes every operation through POST to a single URI discards these guarantees, and often indicates an operation-oriented design rather than a resource-oriented uniform interface.
What Makes an API RESTful
A RESTful API is one that honours the constraints rather than one that merely uses HTTP and JSON. Fielding lists them: client-server separation, statelessness, cacheability of responses, a layered system in which each component sees only its neighbour, the uniform interface described above, and optional code-on-demand. Of these, the uniform interface is what most distinguishes REST, and its hypermedia element is the one most frequently dropped. In a fully RESTful system a client starts from an entry URI and discovers what it can do from links and forms in the responses, in the same way a browser user navigates a website without a manual. Most APIs described as REST instead publish fixed URI templates in documentation and expect clients to construct them. They are resource-oriented HTTP APIs, which is a sensible design, but they stop short of the full style. Whether that matters depends on the goal: hypermedia buys loose coupling and independent evolution, at the price of more complex clients.
REST vs RPC and Other API Styles
Remote procedure call (RPC) styles expose operations. A client calls getCustomer or cancelOrder, typically by POSTing a message to an endpoint whose name is the operation, and the message format defines parameters and results. gRPC and JSON-RPC are examples, and many so-called REST APIs are RPC in practice. The contrast with REST is where the vocabulary lives: RPC has many verbs and few nouns, REST has few verbs and many nouns. RPC can be more compact and more natural for actions that do not map cleanly to resource state; REST gives intermediaries, caches and generic tooling a shared understanding of every request.
GraphQL lets clients select fields from a schema, usually through one HTTP endpoint. It can reduce unwanted response fields and combine related retrievals. It does not inherently eliminate HTTP caching: query operations can use GET, while mutations must not. Cache design depends on the operation, transport and authorization. Streaming channels and webhooks solve other communication needs; a webhook commonly delivers an event through an ordinary HTTP request. These mechanisms can coexist with REST endpoints rather than forcing one exclusive style.
Common Uses and Limitations
REST suits public web services where many independent clients, written in different languages, need a predictable interface that ordinary HTTP tooling can exercise: payment gateways, cloud infrastructure control planes, content management back ends and the data layers behind single-page applications and mobile apps. Its reliance on standard methods and status codes means that proxies, CDNs, browsers and command-line tools understand its traffic without special support, and that caching can be applied at the HTTP layer.
Its limitations are equally structural. Resource modelling can be awkward for workflows and bulk operations that are not naturally a single resource's state. Fetching a graph of related objects can require many round trips or ad hoc expansion parameters. Statelessness pushes repeated metadata into every request. REST specifies no standard for authentication, versioning, error bodies or pagination, so each API makes its own choices and clients must learn them. And because the label is applied loosely, a developer cannot infer from the word REST alone whether responses are cacheable, whether PUT is really idempotent, or whether hypermedia links exist. The documentation, not the name, settles those questions.