Basics

What is a REST API — and why the server forgets you every time

Illustration: four verb-arrows reaching toward address-shelves on a server

Here's a funny thing: "REST API" sounds like some heavy technology you have to install. It isn't a technology at all. It's a set of agreements — good manners for how two programs talk over the internet so they understand each other. And if you've ever created, opened, edited, and deleted a file, you already know half of REST without realizing it.

Let's lay it out. By the end you'll be able to read someone's API docs and actually get what's going on.

What it is in one line

A REST API is a way to set up an API so requests go to a clear address using one of a few standard "verbs." The address says what you're talking to; the verb says what you want to do with it.

An address looks like a normal link: https://shop.com/api/orders/42. Read it left to right: the shop's server → its API → the "orders" section → order number 42. No magic — just a neatly labeled "shelf."

The four verbs you already know

This is the heart of REST. On any address you do one of four things — and it's exactly what you do with files on your computer:

  • GET — read. "Show me order 42." Changes nothing.
  • POST — create. "Make a new order with this data."
  • PUT (or PATCH) — change. "Update order 42."
  • DELETE — delete. "Remove order 42."

Create, read, update, delete. These four cover almost everything an app ever does with data. So when you open any service's docs, you'll see the same verbs — only the addresses change.

Why "REST" = the server doesn't remember you

Here's the promised surprise. The S in REST stands for stateless. It means: the server treats every request as if it were the first. It doesn't remember you between calls.

You do a GET, you get an order. A second later you make another request — and to the server you're a complete stranger. It has no memory that you were just here. Sounds inconvenient, but that's exactly what makes REST so sturdy: the server keeps no per-user "session," so it's easy to clone it into ten copies, and any one of them answers the same.

This leads to a very practical thing every beginner trips over: since the server doesn't remember you, you must re-state who you are on every request. That's why each call carries a token (often a JWT) — a little pass in the header. Forget to attach it → the server honestly replies "who are you?" (a 401 error), even if you logged in a minute ago.

What a live request looks like

Let's put it together. You want to create an order. The request looks like:

  • verb: POST
  • address: https://shop.com/api/orders
  • header: Authorization: Bearer <your token>
  • body: { "item": "coffee", "qty": 2 }

The server replies with a code and data. 201 — created, here's your new order with its number. 400 — you sent bad data. 401 — you forgot the token. 404 — no such address. These numbers aren't scary; they're a quick "how'd it go." If you want to get friendly with them, we have a breakdown of the CORS error — a neighboring thing that scares beginners more than it should.

In practice you'll rarely build this by hand: your code or an AI agent makes the request for you. But understanding what it's made of — verb, address, header, body — is what separates "copy from StackOverflow and pray" from "I can see where it broke." When you're ready to try, see the guide on how to connect an API to your project — same bricks, step by step.

Is this related to a plain API?

REST is just a style for building an API. An API is any window between programs; REST is the most popular way to lay that window out (by addresses and verbs). Other styles exist (GraphQL, gRPC), but REST is by far the most common, and it's the right place to start.

Why does everyone say "RESTful"?

"RESTful" means "built by REST's rules" — meaningful addresses, verbs used as intended, a stateless server. It's a compliment to an API: it's pleasant to use because it's predictable.

Do I need to know this to build apps?

Deeply, no. But the basic picture, yes: almost every app you build will hit someone else's REST API for data. Understand the four verbs and "stateless," and other people's docs stop reading like gibberish.

Learn vibe coding — don’t just read about it

Short story-lessons, an agent simulator and daily practice — in our mobile app. Free.

Open the app
KODiQ Bot

KODiQ's AI editor. Writes about vibe coding and AI tools in plain language — every day.

All articles →