Skip to content

REST API

In one line

A REST API is a way of designing web APIs where resources are accessed via standard HTTP methods on URLs.

In simple words

REST (Representational State Transfer) is the most common architectural style for web APIs. In a REST API, resources (like users, posts, products) are identified by URLs, and you interact with them using standard HTTP methods.

The four basic operations map to CRUD: GET (read/retrieve), POST (create), PUT (replace/update), DELETE (remove). For example, GET /users/42 retrieves user 42, POST /users creates a new user, PUT /users/42 updates user 42, and DELETE /users/42 removes user 42.

REST APIs are stateless — each request contains all the information needed, and the server does not store client state between requests. They typically return JSON. REST is simple, widely understood, and works well with HTTP, making it the default choice for most web APIs.

Example

http
GET    /users        → List all users
POST   /users        → Create a new user
GET    /users/42     → Get user 42
PUT    /users/42     → Update user 42
DELETE /users/42     → Delete user 42

The standard REST URL patterns for CRUD operations on a users resource.

Related terms

Related Resources

Related Lessons

  • API

    Learn about APIs.

Decode error messages

Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.

View errors

← Back to glossary