What is a REST API
The architectural style that made the web's APIs feel like the web itself.
REST is an architectural style, not a protocol. It treats everything as a resource with a URL, uses standard HTTP verbs to act on those resources, and keeps the server stateless so any request carries everything it needs. Those constraints — plus cacheability and a uniform interface — made REST simple, scalable, and the default for web APIs.
Client-server separation
REST starts by splitting the system into a client that handles the user interface and a server that owns data and logic, talking only over a defined interface. Because neither knows the other's internals, a web app, a mobile app, and a third-party script can all hit the same API, and either side can be rebuilt without touching the other. This separation of concerns is the foundation everything else rests on.
Statelessness
Each request must carry everything the server needs to fulfill it — identity, parameters, context — because the server keeps no memory of previous requests. There is no server-side session tying you to one machine, which means any server in a pool can handle any request. That property is precisely what makes a REST API so easy to scale horizontally behind a load balancer.
Uniform interface: verbs to CRUD
REST insists on a uniform way of interacting: the same standard HTTP methods work across every resource. POST creates, GET reads, PUT and PATCH update, and DELETE removes — a clean mapping onto the four CRUD operations. Because the verbs are fixed and universal, once you know how to act on one resource you know how to act on them all.
Resources & representations
Everything in REST is a resource — a user, an order, a photo — identified by a URL like /orders/42. The server never hands you the raw internal object; it returns a representation of that resource's current state, almost always as JSON. The same resource could be represented as JSON, XML, or HTML, but JSON's simplicity is why it dominates the modern web.
Cacheable
Responses can declare themselves cacheable, so clients and intermediaries are free to reuse them without asking the server again. Because GETs are safe and self-contained, a CDN or browser can store the result and serve it instantly on the next identical request. Caching layered on top of statelessness is a big part of why RESTful systems scale and feel fast.
Why REST won
Put together, these constraints made REST simple, scalable, and built entirely on the HTTP infrastructure the web already had — no new protocol, no heavy tooling. Compared to the verbose, complex SOAP that preceded it, REST was dramatically easier to learn, debug with ordinary tools, and cache at the edge. That pragmatic simplicity is why REST became the default style for public and internal web APIs for two decades.
What REST actually is
REST stands for Representational State Transfer, and the single most important thing to understand is that it is an architectural style, not a protocol or a standard. Roy Fielding defined it in his 2000 doctoral dissertation, and he did it by describing a set of *constraints*. If a system's interface obeys those constraints, it is "RESTful." There is no REST specification to implement and no REST library you must import — REST is a way of using the HTTP that already underpins the web.
That framing matters because it explains why REST feels so natural on the web: it isn't bolted on, it's a description of how the web was already designed to work. You browse the web by requesting resources at URLs and getting back representations of them; REST simply applies that same discipline to machine-to-machine APIs. The constraints Fielding laid out — client-server, statelessness, cacheability, a uniform interface, and a layered system — each solve a specific scaling or evolution problem, and together they produce APIs that are simple to build, easy to reason about, and able to grow to enormous scale.
Client-server and statelessness
The first constraint is client-server separation. The client — a browser app, a mobile app, a third-party integration — is responsible for the user interface and experience. The server is responsible for data storage and business logic. They communicate only through a defined interface, and neither depends on the other's internals. This separation of concerns is what lets a single API serve a web frontend, an iOS app, and an external partner's script all at once, and it lets each side be rewritten independently as long as the contract holds.
The second constraint, and the one interviewers love, is statelessness. The server stores no client context between requests. Every request must be self-contained, carrying all the information the server needs — authentication, parameters, and any relevant state — to understand and fulfill it on its own. The server does not remember that you asked for page one a moment ago; if you want page two, your request says so.
The payoff is scalability. Because no request depends on a session living in one particular server's memory, any server in a fleet can handle any request. You can put a load balancer in front of a hundred identical, interchangeable servers and route freely, add capacity during a spike, and survive any single server dying — none of which is possible if the server hoards per-client state.
Resources, representations, and the uniform interface
At the heart of REST is the idea that everything is a resource: a user, an order, a photo, a comment — any noun in your domain. Each resource is identified by a URL, its unique address, like /users/42 or /orders/42/items. This is why RESTful URLs are structured as nouns rather than actions.
Crucially, when you request a resource the server does not hand you its raw internal object. It returns a representation of that resource's current state — a snapshot, formatted for transfer. In principle a resource could be represented as JSON, XML, or HTML; in modern practice it is almost always JSON, whose lightweight, human-readable structure is a big part of why REST displaced its heavier predecessors.
Tying it together is the uniform interface constraint, and its most visible expression is the mapping of standard HTTP methods onto CRUD operations:
POST→ Create a new resourceGET→ Read a resource or collection (safe, no side effects)PUT/PATCH→ Update an existing resource (replace or partially modify)DELETE→ Delete a resource
Because the verbs are fixed and universal, the API becomes predictable: once you understand how to create, read, update, and delete one kind of resource, you understand how to do it for every kind. That uniformity is what makes REST APIs so quick to learn.
Cacheability and the layered system
Two more constraints round out the style and directly serve performance and scale.
Cacheability requires that responses declare whether they can be reused. When a response is marked cacheable, the client — or any intermediary between client and server, like a CDN or a proxy — is free to store it and serve it directly on the next identical request, without bothering the origin. Because GET requests are safe and self-contained, they cache beautifully, and this layer of caching, sitting on top of statelessness, is a major reason RESTful systems feel fast and shed load so effectively.
The layered system constraint says a client cannot tell whether it is connected directly to the end server or to an intermediary along the way. This invisibility is what makes it safe to insert load balancers, caches, gateways, and security layers between client and server without the client needing to know or care. Each layer does its job — spreading traffic, caching responses, enforcing policy — and the client just sees a single uniform endpoint. Together, cacheability and layering are how a simple request-response style scales up to serve the entire internet.
Why REST won, and where it bends
REST became the default architecture for web APIs for a deeply pragmatic reason: it was radically simpler than what came before. Its main predecessor, SOAP, was a heavyweight, XML-based protocol wrapped in strict schemas and elaborate tooling — powerful but verbose and painful to work with. REST threw that out. It required no new protocol, rode entirely on the HTTP the web already spoke, returned lightweight JSON, and could be explored and debugged with nothing more than a browser or curl. A developer could understand a REST API in minutes.
That simplicity, combined with the scalability that statelessness and caching provide, made REST the obvious choice for two decades of public and internal APIs. It is not perfect: because each resource lives at its own endpoint, clients sometimes have to make many round-trips to assemble a screen, or receive more data than they need — the "over-fetching and under-fetching" problem that motivated newer styles like GraphQL and high-performance internal protocols like gRPC. But for the vast majority of APIs, REST's blend of simplicity, scalability, and universal HTTP tooling remains the right default, which is exactly why "what is a REST API" is still one of the first questions any backend developer needs to answer well.
REST is a set of constraints, not a standard: client-server, statelessness, cacheability, uniform interface, layered system.
Everything is a resource identified by a URL; the server returns a representation of it, usually JSON.
The client and server are separated so each can evolve independently.
Statelessness means every request is self-contained — the server keeps no session between calls, which makes scaling trivial.
HTTP verbs map onto CRUD: POST=create, GET=read, PUT/PATCH=update, DELETE=delete.
Quick quiz
What does it mean for a REST API to be stateless?
How do HTTP verbs map to CRUD in REST?
REST vs GraphQL
Two ways to shape an API — resources and endpoints, or one flexible query.
API design best practices
The conventions that make an API feel obvious instead of hostile.
Common HTTP status codes
Three digits that tell you, at a glance, exactly how a request went.
The structure of a URL
Every address on the web is a packed little instruction set — decode it once and read it forever.