The opposite of a REST API is a non-REST interface, most often an RPC-style API such as gRPC or a GraphQL endpoint. REST is an architectural style built on resources, HTTP verbs, and stateless requests. Its opposite is any design that abandons those conventions, usually by exposing actions or queries instead of resources. People ask this when they are comparing API styles, reading a job description, or deciding how two systems should talk.
What Counts as the Opposite of REST?
There is no single formal opposite, because REST is a style rather than a protocol. The clearest contrast is with remote procedure call (RPC) APIs, where the client calls named functions like createUser or getOrder rather than manipulating a resource at a URL. A REST call might look like POST /users and GET /users/42. An RPC call names the action directly. That difference is the heart of the contrast.
GraphQL is another common answer. In REST, the server decides what each endpoint returns. In GraphQL, the client sends a query describing exactly which fields it wants, and the server returns that shape. A REST client might call three endpoints to build one screen; a GraphQL client sends one query for the same data. Neither is better in every case, and both can coexist in the same system.
SOAP is an older style that also sits outside REST. It uses XML envelopes and a fixed contract, and it is common in enterprise and legacy systems. WebSockets and server-sent events are transport choices rather than API styles, but they are also non-REST because the connection stays open and the server pushes data. Event-driven designs, where services publish messages to a queue, are non-REST too: there is no request and response at all.
How Do REST and RPC APIs Differ in Practice?
REST treats everything as a resource with a stable address. A user is a resource, an order is a resource, and the HTTP verb says what to do with it. GET reads, POST creates, PUT replaces, PATCH updates, and DELETE removes. The server keeps no session state between calls, so each request carries the credentials and context it needs. That statelessness is what lets a REST API scale across many servers.
RPC treats the API as a set of operations. The client says what it wants done, and the method name carries the meaning. This often maps more directly onto internal code, where a function already exists. The trade-off is that RPC APIs tend to be more tightly coupled to a particular client, and adding or changing methods can be harder to do without breaking callers.
Here is a quick comparison of the same task in each style:
- REST:
GET /orders/1234returns the order resource. - RPC:
getOrder(orderId: 1234)returns the order. - GraphQL: a query asks for
order(id: 1234) { total, status }and gets only those fields.
Notice that the REST version puts the identifier in the path and relies on the verb. The RPC version puts the identifier in the method call. The GraphQL version lets the client choose the fields. Each choice shapes how the API evolves.
When Would You Choose a Non-REST API?
Choose RPC when the operations are actions rather than things. A payment capture, a password reset, or a batch recalculation is easier to express as a named method than as a resource. Choose GraphQL when clients need different slices of the same data and you want to avoid many round trips. Choose event-driven messaging when work should happen asynchronously, such as sending a confirmation email after an order is placed.
Choose REST when you want a simple, cacheable interface that many clients can use without a custom contract. REST works well for public APIs because the conventions are widely understood and HTTP tooling already supports caching, status codes, and content negotiation. A non-REST API is not a downgrade; it is a different fit for a different problem.
One practical rule: if you find yourself inventing endpoints like /doThing or /processOrder, you are drifting toward RPC while still using REST-shaped URLs. That is a sign to either commit to RPC or reframe the operation as a resource.
What Do the Related Terms Mean?
A few terms come up whenever this question is asked. Knowing them makes the comparison clearer.
- Endpoint: a URL the client calls, such as
/users. - Resource: the thing an endpoint represents, such as a user or an order.
- Stateless: the server keeps no memory of previous requests.
- Idempotent: repeating the same request has the same effect as sending it once.
- Schema: the formal description of what an API accepts and returns.
- Payload: the body of data sent or received.
REST and RPC are sometimes described as informal and formal registers of API design. REST is the common, public-facing style; RPC is often the internal, action-oriented style. Neither label is strict, and many systems mix both.
How Can You Tell Which Style an API Uses?
Look at the URLs and the verbs. If the paths are nouns and the HTTP verbs carry the action, it is probably REST. If the paths or method names are verbs, it is probably RPC. If there is a single endpoint and the client sends a query document, it is likely GraphQL.
Check the response shape. REST usually returns a full resource representation. GraphQL returns exactly the fields requested. RPC often returns a result object tied to the method. Check the error handling too: REST leans on HTTP status codes, while RPC and GraphQL often return errors inside a successful response body.
Ask how the API evolves. REST APIs tend to add new resources and fields. RPC APIs add new methods. GraphQL APIs add fields to the schema. The answer tells you what kind of change the maintainers expect.
What Goes Wrong When You Mix the Two?
The most common problem is a REST API that behaves like RPC. Endpoints named after actions, inconsistent status codes, and responses that vary by caller all make the API harder to cache and harder to learn. The fix is to pick one style and apply it consistently, or to document clearly where the boundary is.
A second problem is over-fetching. A REST endpoint returns a fixed resource, so a client that needs one field still receives the whole object. GraphQL solves this, but it adds complexity on the server. A third problem is under-fetching, where a client must call several endpoints to assemble one screen. That is a sign the resource boundaries are wrong.
If you are designing a new API, write down the main operations first. Group them into resources where possible. Name the rest as methods. That exercise usually shows which style fits, and it prevents the drift that makes APIs confusing later.
Common Questions About REST and Its Opposite
Is GraphQL the opposite of REST?
It is one of the closest contrasts. GraphQL lets the client ask for specific fields, while REST returns a fixed resource. Both are HTTP-based, but they differ in who decides the response shape.
Is SOAP still used?
Yes, mainly in older enterprise systems and some regulated industries. It is heavier than REST but offers a strict contract.
Can one system use both REST and RPC?
Yes. Many systems expose a REST API publicly and use RPC or messaging internally. The styles can coexist as long as each interface is consistent.
Does the opposite of REST mean SOAP?
Not exactly. SOAP is one non-REST style, but RPC, GraphQL, and event-driven designs are also non-REST. The opposite is any design that does not follow REST's resource-and-verb model.