Short Answer A REST API is a common way for two software programs to talk to each other over the internet using simple web requests. REST stands for Representational State Transfer, and API stands for Application Programming Interface. For example, a shopping app uses a REST API to ask the shop’s server for your order status. The server then sends the details back in seconds.
What is a REST API?
An API is a set of rules that lets one program ask another program for data or for an action. Think of it as a menu. It lists what you can ask for and how to ask. Yet you do not need to know how the kitchen works behind it.
REST is a style, or a set of design rules, for building such APIs on the web. Roy Fielding described it in his PhD thesis in 2000. So a REST API is simply an API that follows the REST rules. In simple words, it lets apps send and receive data using the same web addresses and commands that a browser uses.
In fact, most apps you use each day rely on REST APIs. For example, a payroll app in a Bengaluru office may send salary data to a bank. Similarly, a delivery app shows the rider’s live location. A sales team’s phone app saves a new customer into the main system. In each case, one program sends a request, and another sends back a response.
Key Words to Know
- Client: the program that asks for something, such as a mobile app or a website.
- Server: the computer program that holds the data and sends back the answer.
- Resource: one thing the API looks after, such as a customer, an order or an invoice.
- Endpoint: the web address (URL) of a resource, for example /orders/1234.
- HTTP: the basic language of the web. Browsers and REST APIs both use it. HTTPS is the same thing with encryption, which scrambles data so outsiders cannot read it.
- JSON: a simple text format for data, made of labels and values. Most REST APIs send their answers in JSON.
How Does a REST API Work?
A REST API works in a simple loop of request and response. First, the client sends a request to an endpoint. The request says what it wants by using an HTTP method, such as GET to read data. It may also carry a key or token that proves who is asking.
Then the server checks the request. If everything is fine, it finds the data or does the action. Finally, it sends back a response. The response has a status code, a short number that says how things went, and usually some data in JSON.
- The client builds a request: a method (what to do), an endpoint (which resource) and sometimes data to send.
- The request travels over HTTPS: the connection is encrypted, so others cannot read it on the way.
- The server checks and acts: it confirms who is asking, then reads or changes the data.
- The server replies: it sends a status code and, often, JSON data.
- The client uses the answer: for example, the app shows the order status on screen.

The Restaurant Waiter Example
Picture a restaurant. You are the client, and the kitchen is the server. The waiter is the API. You do not walk into the kitchen. Instead, you give your order to the waiter, using the menu. The waiter carries it to the kitchen and brings your food back.
A REST API plays the same part. Note that every order you give is complete on its own. The waiter does not need to remember your last order to understand this one. That idea, called stateless, is one of the REST rules you will see below.
REST API Methods and Status Codes
A REST API uses a few standard HTTP methods. In other words, each one is like a verb that tells the server what to do with a resource. HTTP itself is an open standard written by the IETF, the group that sets many internet rules. The table below shows the five methods you will meet most often.
| Method | What It Does | Plain Example |
|---|---|---|
| GET | Reads data, changes nothing | Show order 1234 |
| POST | Creates something new | Place a new order |
| PUT | Replaces a whole record | Replace the full delivery address |
| PATCH | Changes part of a record | Change only the phone number |
| DELETE | Removes something | Cancel and remove a draft order |
Every response also carries a status code. The common ones are 200 (OK, it worked) and 201 (Created, a new record exists). Then there are 404 (Not Found, no such resource) and 500 (Internal Server Error, something broke on the server).
A Simple REST API Example
Let us take an online shop in Jaipur. A customer opens the shop’s app and taps “Track my order”. So the app needs the latest details for order 1234. It sends this one-line request to the shop’s REST API:
GET /orders/1234
Then the server finds the order and sends back status 200 with this JSON:
{
"id": 1234,
"status": "Shipped",
"city": "Jaipur"
}
Each line pairs a label, such as “status”, with its value, such as “Shipped”. Next, the app reads the “status” label and shows “Shipped” on the screen. If order 1234 did not exist, the server would send 404 instead. In short, the app asked for one order at one address and got its details back.
The same address can do more with other methods. For example, a PATCH request to /orders/1234 could change the delivery phone number. A DELETE request could cancel a draft order, if the shop allows it.
The Six REST Principles
Roy Fielding set out six rules, called constraints, that make an API RESTful. Microsoft’s guide on web API design explains several of these ideas, such as stateless requests and a uniform interface. Here they are in plain words.
- Client-server: the app and the data store stay separate. As a result, each side can change without breaking the other.
- Stateless: each request carries everything the server needs. The server does not remember earlier requests from that client.
- Cacheable: a response says whether others can save and reuse it for a while. This cuts repeat trips to the server.
- Uniform interface: every resource follows the same pattern of addresses and methods. So once you learn one REST API, others feel familiar.
- Layered system: the client cannot tell if it talks to the real server or to a middle layer. A reverse proxy, a server that passes requests on to the real one, or a security filter can sit in between.
- Code on demand (optional): the server may send small pieces of code for the client to run. This is the only optional rule, and many APIs skip it.
Because of these rules, REST APIs grow well. For instance, a stateless server can handle requests from many users at once, since any copy of the server can answer any request. This fits cloud-native apps, which are built from small parts that run on many servers.
Talk to an ExpertDo your business apps still share data by hand? Talk to our team about connecting them with APIs.REST API vs SOAP API and GraphQL
REST is not the only way to build an API. Two other names come up often: SOAP and GraphQL. SOAP is an older, stricter standard from the W3C, the group behind many web standards. Its name once stood for Simple Object Access Protocol. It wraps every message in XML, a more wordy text format. GraphQL is a newer query language, which simply means a set way of asking for data. With it, the client asks for exactly the fields it wants in a single request.
| Question | REST | SOAP | GraphQL |
|---|---|---|---|
| What it is | A design style | A strict message standard | A query language |
| Data format | Usually JSON | XML | JSON |
| Addresses | Many endpoints, one per resource | One endpoint, many operations | Usually one endpoint |
| Good fit | Most web and mobile apps | Older banking and enterprise systems | Screens that need data from many places |
In practice, many companies use more than one. For example, an insurer may keep a SOAP service for its old policy system and offer a REST API for its new mobile app. However, REST is the most common choice for new web APIs, because it is simple and uses plain web rules.

Is RESTful the Same Thing?
Yes, in daily use. “RESTful API” just means an API that follows the REST rules, and most people use both names for the same thing. Strictly speaking, few APIs follow every rule. Still, teams call an API RESTful when it uses resources, standard methods and stateless requests.
REST API vs API and Webhooks
Every REST API is an API, but not every API is a REST API. In other words, “API” is the broad word for any set of rules that lets programs talk. For example, a printer driver and a Windows feature both offer APIs, yet neither uses the web. REST is one style of web API among several.
In contrast, a webhook works the other way round. With a REST API, the client asks, “Has anything changed?” With a webhook, the server calls the client the moment something happens. For instance, a payment system can call a shop’s webhook address as soon as a payment succeeds. So the shop does not have to keep asking.
How to Keep an API Safe
Any API that outsiders can reach is a door into your systems, so it needs locks. Our guide to API security covers this in detail. In short, most teams start with these basics.
- Use HTTPS only: it encrypts every request and response on the way.
- Check who is calling: ask for an API key or a token. OAuth 2.0, an IETF standard, lets an app get a short-lived token instead of sharing a password.
- Allow only what is needed: a delivery app may read an order, but it should not be able to delete customers.
- Set rate limits: cap how many requests one caller can send in a minute, so no one can flood the API.
- Filter bad traffic: a web application firewall can block common web attacks before they reach the API.
REST API Tools on AWS and Azure
However, you do not have to build these locks from scratch. On AWS, Amazon API Gateway lets teams create, publish, monitor and secure REST, HTTP and WebSocket APIs. A WebSocket keeps a live, two-way link open, for things like chat. Similarly, on Azure, Azure API Management puts a gateway in front of your APIs. It checks API keys and tokens, enforces rate limits and keeps logs. Both work well with serverless computing, where the cloud runs your code only when a request arrives.
REST APIs also sit behind most SaaS tools a company uses. That is why linking an office’s sales, finance and support apps usually starts with their APIs.
Frequently Asked Questions About REST API
What is the full form of REST API?
What is a REST API endpoint?
What is REST API integration?
Is an HTTP API the same as a REST API?
How is REST different from WebSocket?
What is the difference between REST and microservices?
What does REST API documentation contain?
References
- HTTP methods and status codes: IETF, RFC 9110: HTTP Semantics
- REST principles and API design: Microsoft Learn, Web API Design Best Practices
- REST APIs on AWS: AWS, What is Amazon API Gateway?
Get the Latest Terms & Insights.
New encyclopedia terms, threat intelligence, and architecture decisions, by email.
