What is a REST API? Endpoints, methods and status codes explained

By Sina Esfahani, OmniTechs · Published 30 November 2026

A REST API lets one piece of software offer its data to other software over HTTP, the protocol your browser uses. Each kind of data (orders, customers, invoices) has its own web address. Another program sends a request to that address with a method such as GET (read) or POST (create). The server answers with a three-digit status code and usually JSON data.

REST stands for Representational State Transfer: an architectural style Roy Fielding described in 2000, not a product or an official standard. "REST API" and "RESTful API" mean the same thing in everyday use.

Your first action: ask for the API documentation of the system you need, often an OpenAPI file. Its list of endpoints shows within minutes whether your data is available, and whether you can only read it or also change it.

Read any REST API call in this order:

  1. Endpoint: method plus address, for example GET /v1/orders/1042.

  2. Authentication: the key or token sent along, which decides what you may see.

  3. Request body: the data you send, only when creating or changing something.

  4. Status code: the first digit gives the outcome (2 success, 4 your mistake, 5 the server's problem).

  5. Response body: the data that comes back, usually JSON with named fields.

What an integration between two business systems does, and how you get a key, is covered in what an API integration is.

What makes an API RESTful?

Fielding defined REST as six constraints on how client and server talk. Together they let parts change independently, scale easily and cache responses.

The six REST constraints

Constraints from section 5.1 of Fielding's dissertation (2000); the buyer column is our explanation.
ConstraintWhat it meansWhat you notice as a buyer
Client-serverThe app that shows data and the server that stores it are separateYou can replace the app without rebuilding the server
StatelessEvery request carries everything needed to understand it; the server keeps no sessionThe key or token goes with every request, and any server in a cluster can answer
CacheResponses say whether they may be reusedFewer calls for data that rarely changes
Uniform interfaceEvery resource has an address and is handled with the same methods and codesOnce you know one REST API, the next looks familiar
Layered systemGateways and caches can sit in between unseenThe provider can add security or capacity without changing your connection
Code on demandThe server may send code for the client to runRare in business APIs; Fielding calls it optional

Strictly, Fielding also requires hypermedia: responses with links that tell the client what it can do next. In 2008 he complained that many APIs called REST skip this. Most APIs sold as REST today use addresses, methods, status codes and JSON without full hypermedia. For a buyer that is usually fine. What matters is documented, stable behaviour.

What is a REST API? (IBM Technology)

Resources and endpoints

A resource is anything the API lets you name. In Fielding's words: "Any information that can be named can be a resource." An order, a customer or a stock level can each be one.

An endpoint is a method plus an address. Good APIs use nouns for resources and plural nouns for collections, and put the major version in the address. The Dutch government's REST API Design Rules (version 2.2.2) require exactly this.

Example addresses for an order system (hypothetical)

Illustrative addresses following the NLGov REST API Design Rules 2.2.2 (nouns, plural collections, major version prefixed with v).
AddressPoints to
/v1/ordersAll orders
/v1/orders/1042Order 1042
/v1/customers/77/ordersThe orders of customer 77
/v1/orders?status=open&page=2A filtered, paged part of the list

The part after the question mark holds query parameters: filters, sorting and paging. Paging matters more than it looks, as the worked example shows.

HTTP methods: what each one does

The HTTP standard (RFC 9110, 2022; PATCH in RFC 5789) defines each method. Two properties matter when something fails. A safe method only reads. An idempotent method has the same effect whether you send it once or five times.

The five methods in REST APIs

Safe and idempotent from RFC 9110 sections 9.2.1 and 9.2.2 and RFC 5789; success codes are common choices, and each API documents its own.
MethodUseSafeIdempotentUsual success code
GETRead a resource or listYesYes200
POSTCreate something or start a processNoNo201
PUTReplace a resource completelyNoYes200 or 204
PATCHChange some fieldsNoNo200 or 204
DELETERemove a resourceNoYes204 or 200

Why this matters: networks time out. A GET or PUT can safely be sent again. A POST that timed out may already have created the order, so a blind retry can make a duplicate. Ask how the API prevents that; some accept a unique reference per request and ignore repeats. Testing one read-only flow first shows how to catch duplicate and silent processing before anything writes data.

Status codes: what the answer means

The first digit gives the class: 1xx information, 2xx success, 3xx redirection, 4xx client error, 5xx server error (RFC 9110, section 15). A client that does not know a code must treat it like the x00 code of its class.

The status codes you will see most

Meanings from RFC 9110, RFC 6585 (429) and MDN (last modified 17 September 2026); the advice column is general practice.
CodeMeaningWhat to do
200 OKSucceededCheck the content; 200 does not prove the data is complete
201 CreatedA new resource existsStore its address (Location header) or ID
204 No ContentDone, nothing to returnNothing
400 Bad RequestMalformed or invalid requestRead the error and fix what you send
401 UnauthorizedNot authenticatedCheck that the key or token is present, correct and not expired
403 ForbiddenKnown caller, access refusedAsk for the right permission; retrying will not help
404 Not FoundDoes not exist, or hidden from youCheck the ID and address
409 ConflictClashes with the current stateFetch the current state and decide again
422 Unprocessable ContentWell-formed but unusable valuesFix the values; some APIs use 400 instead
429 Too Many RequestsRate limit reachedWait (Retry-After, if sent) and slow down
500 Internal Server ErrorThe server brokeRetry later; report the time and request ID if it persists
503 Service UnavailableOverloaded or in maintenanceWait and retry

MDN notes that 401 really means unauthenticated, while with 403 the server knows who you are and still refuses. Good APIs also return a readable error body. RFC 9457 standardises one, called problem details, with fields such as type, title, status and detail; the Dutch government's rules prescribe it.

Worked example: one order, five calls

A hypothetical order API that a webshop talks to, written out as plain text.

Five calls to a hypothetical order API

Hypothetical calls; codes and headers behave as RFC 9110, RFC 6585 and RFC 9457 describe.
StepRequestResponseWhat it tells you
1GET /v1/orders/1042 with the header Authorization: Bearer plus the token200 OK, JSON: id 1042, status shipped, total 149.95, currency EURThe order exists and has shipped
2The same GET without a token401 Unauthorized with a WWW-Authenticate headerAnonymous calls are refused, as they should be
3PATCH /v1/orders/1042 with JSON: status cancelled409 Conflict, problem details: a shipped order cannot be cancelledThe business rule lives in the API, not only on screen
4POST /v1/orders with JSON: customer 77, product STAND-01, quantity 2201 Created, header Location: /v1/orders/1043Store reference 1043
5Many fast GET calls429 Too Many Requests, Retry-After: 30Wait 30 seconds

Now the arithmetic that often decides whether a connection works. Suppose the API allows 60 requests per minute and you need 5,000 orders (hypothetical figures).

  • One order per GET: 5,000 ÷ 60 = 83.3 minutes, about 1 hour 23 minutes per full sync.

  • A list endpoint with 100 orders per page: 5,000 ÷ 100 = 50 requests, under one minute.

Replace 60 and 100 with the limits in your API's documentation. If it states neither, ask before anyone builds.

Authentication: proving who is calling

Because REST is stateless, every request carries its own credentials.

Common ways to authenticate

Bearer tokens per RFC 6750; OAuth 2.0 per RFC 6749, whose example token lasts 3,600 seconds; API keys follow no single standard.
MethodHow it worksWatch out for
API keyA secret string sent in a header with every requestOften broad rights; ask for a read-only or limited key
Bearer tokenA token in the Authorization header; whoever holds it can use itTreat it like a password; tokens expire and must be renewed
OAuth 2.0An app gets limited access, often after a user approves it, and receives tokensMore set-up, but scoped and revocable without sharing a password

All three are only safe over HTTPS. RFC 6750 makes TLS mandatory for bearer tokens. The UK Government Digital Service requires TLS 1.2 or above and warns that basic and API key authentication are not secure without HTTPS. Ask for the smallest permission that works, one key per connection, and a way to revoke it. Where to create a key in a specific package is explained in how you get an API key.

REST, GraphQL or SOAP?

REST compared with GraphQL and SOAP

Fielding (2000), the GraphQL specification (September 2026 edition) and graphql.org's HTTP guide, and W3C SOAP 1.2 (second edition, 27 April 2007).
PointRESTGraphQLSOAP
What it isArchitectural style on HTTPQuery language with its own specificationW3C messaging protocol
AddressesOne per resourceUsually one endpoint, often /graphqlXML messages over a protocol such as HTTP
Who chooses the fieldsThe serverThe client asks for exactly what it needsThe service contract
ErrorsHTTP status codesOften 200 with an errors list on partial successA SOAP fault in the message

Choose REST when any developer and most tools should understand it. GraphQL suits apps that need many differently shaped views of linked data. SOAP is the older XML protocol: when an existing system only offers SOAP, you connect to it rather than choose it. Webhooks are not an alternative to REST but pushed messages when something changes, explained in API, webhook or export.

What to ask a developer or supplier

  1. Is there an OpenAPI description? A machine-readable list of endpoints, fields and errors. The UK government advises making it the first output of the design.

  2. Can access be limited and revoked per connection? Good answer: scoped keys or OAuth, one per consumer.

  3. What are the rate limits and page sizes? You need both for the arithmetic above.

  4. How are duplicates prevented when a POST is retried? Good answer: a unique reference per request or a documented check.

  5. What does an error look like? Good answer: correct codes and a readable body such as problem details.

  6. How are versions handled? Good answer: a version in the address and a stated period in which the old one keeps working.

  7. Is there a test environment with test data? Never try things out on live data first.

  8. Who owns and maintains the code and documentation after launch?

If a supplier cannot answer the first three, the API is not ready for a dependable connection. In the Netherlands, public bodies must apply the NLGov REST API Design Rules when they offer REST APIs (Forum Standaardisatie, comply-or-explain list). Private companies are not bound, but the rules make a good checklist.

When to stop and get help

Stop when the documentation is missing or contradicts what the API returns, when access only comes with full rights to live financial or customer data, or when there are no rate limits and no test environment. Then a developer should read the contract with you. Bring the documentation link, the data you need in each direction, how often it must move and the error responses you received.

If you need an API of your own for customers, partners or an app, see having a custom API built. OmniTechs designs the endpoints, access rights, validation and documentation, starting with a paid Solution Sprint of €1,250 excl. VAT.