# REST API (Representational State Transfer API)

URL: https://softwaredictionary.org/terms/rest-api
Category: Backend & APIs
Last updated: 2026-09-29

In short: A REST API is a web API that exposes data as resources identified by URLs and lets clients read or change them using standard HTTP methods.

## What is a REST API?

A REST API organizes an application's data into resources, such as users, orders, or products, and gives each one its own URL. Clients work with those resources by sending HTTP requests, and the server usually responds with data in `JSON` format. REST stands for Representational State Transfer, an architectural style described by Roy Fielding in 2000.

The HTTP method tells the server what to do: `GET` reads a resource, `POST` creates one, `PUT` or `PATCH` updates it, and `DELETE` removes it. Status codes in the response, such as `200 OK`, `201 Created`, or `404 Not Found`, report the result. Each request is stateless, meaning it carries everything the server needs, such as an authentication token, so the server does not have to remember earlier requests.

Think of a REST API like a library catalog: every book has a fixed shelf address, and a small set of standard actions (look up, add, update, remove) works the same way for every book. This predictability is why REST is the most common style for public web APIs and for communication between a frontend and its backend.

REST is often compared with GraphQL. A REST API has many endpoints that each return a fixed shape of data, while a GraphQL API usually has a single endpoint where the client describes exactly which fields it wants. REST is simpler to cache and reason about, while GraphQL can reduce the number of requests for complex, nested data.

## Key takeaways

- REST is an architectural style, not a protocol or a formal standard.
- Resources are identified by URLs, such as `/users/42`.
- HTTP methods (`GET`, `POST`, `PUT`, `PATCH`, `DELETE`) describe the action.
- Requests are stateless: each one carries all the information the server needs.
- Responses usually contain JSON and an HTTP status code.

## Example: Calling a REST API with curl

```bash
# Read a list of users
curl https://api.example.com/users

# Read one user by ID
curl https://api.example.com/users/42

# Create a new user by sending JSON
curl -X POST https://api.example.com/users \
  -H "Content-Type: application/json" \
  -d '{"name": "Ada"}'

# Delete a user
curl -X DELETE https://api.example.com/users/42
```

## Frequently asked questions

**What is the difference between REST and RESTful?**

They mean practically the same thing. REST is the architectural style, and an API described as RESTful is one that follows its principles, such as resource URLs, standard HTTP methods, and stateless requests.

**What is the difference between a REST API and GraphQL?**

A REST API exposes many endpoints that each return a fixed data shape, while GraphQL usually exposes one endpoint where the client asks for exactly the fields it needs. REST is simpler and easier to cache; GraphQL is more flexible for complex, nested data.

**What is the difference between PUT and PATCH?**

`PUT` replaces the whole resource with the data you send, while `PATCH` updates only the fields you include. Many APIs use `PATCH` for partial updates and `PUT` for full replacement.

## Sources

- [Roy Fielding: Representational State Transfer (REST), Chapter 5 of his dissertation](https://ics.uci.edu/~fielding/pubs/dissertation/rest_arch_style.htm)

---

Software Dictionary: https://softwaredictionary.org/ · https://softwaredictionary.org/llms.txt
