SynfraCore
Synfracore
Start Learning
Navigation

Academies

Platform

RoadmapsLabsCertificationsInterviewPYQsAI AssistantCareer
Start Learning Free Learning Roadmaps

REST API DesignCheatsheets

Quick reference — commands, syntax, and patterns

📄
Last updated Sep 2026
Expert Content

REST API Design Quick Reference

HTTP Methods

MethodPurposeIdempotent?Safe?Typical success code

|---|---|---|---|---|

GETRead a resourceYesYes (no side effects)200
POSTCreate a resource / trigger a non-idempotent actionNoNo201
PUTReplace a resource entirelyYesNo200 / 204
PATCHPartially update a resourceNot guaranteedNo200 / 204
DELETERemove a resourceYesNo204

Status Code Reference

CodeNameMeaningWhen to use

|---|---|---|---|

200OKGeneric successSuccessful GET/PUT/PATCH with a body to return
201CreatedResource was createdAfter a successful POST, often with Location header
204No ContentSuccess, nothing to returnAfter a successful DELETE, or a PUT/PATCH with no body needed
301/302RedirectResource movedRare in API design; more common for web pages
400Bad RequestMalformed requestInvalid JSON, missing required field structurally
401UnauthorizedNot authenticatedMissing or invalid credentials
403ForbiddenAuthenticated, not permittedValid credentials, insufficient permission
404Not FoundResource doesn't existRequested URL/resource ID not found
405Method Not AllowedMethod not supported on this resourcee.g. DELETE on a read-only endpoint
409ConflictRequest valid, conflicts with current stateDuplicate email, optimistic-lock version mismatch
422Unprocessable EntitySyntactically valid, semantically invalidFailed validation rules (bad email format, out-of-range value)
429Too Many RequestsRate limitedPair with Retry-After header
500Internal Server ErrorUnexpected server failureUnhandled exception, bug
503Service UnavailableServer temporarily can't handle requestsOverload, maintenance, dependency down — pair with Retry-After

Common URL Pattern Examples

http
GET    /users                    # list users
POST   /users                    # create a user
GET    /users/42                 # read user 42
PUT    /users/42                 # replace user 42
PATCH  /users/42                 # partially update user 42
DELETE /users/42                 # delete user 42

GET    /users/42/orders          # list user 42's orders (nested resource)
POST   /users/42/orders          # create an order under user 42
GET    /users/42/orders/991      # read a specific nested order

GET    /orders?status=pending&sort=-created_at&limit=25   # filter + sort + paginate
GET    /orders?cursor=eyJpZCI6NDJ9&limit=20                # cursor pagination

GET    /v1/users/42              # URL-path versioning
GET    /users/42                 # header-based versioning (Accept: ...v2+json)

Header Reference

HeaderDirectionPurpose

|---|---|---|

`Content-Type`Request & ResponseFormat of the body (e.g. `application/json`)
AcceptRequestFormat the client wants back
AuthorizationRequestCredentials (Bearer ) — never in the URL
LocationResponseURL of a newly created resource (with 201)
Idempotency-KeyRequestClient-supplied key to dedupe retried non-idempotent creates
Retry-AfterResponseSeconds to wait before retrying (used with 429, 503)
X-RateLimit-Limit / -Remaining / -ResetResponseRate-limit state — common but not standardized (needs verification — recheck against current source)
ETag / If-None-MatchResponse / RequestCaching / optimistic-concurrency validation
Share:
Join our Community
Daily tips, job alerts, interview help — join engineers learning together
Up Next
📝
REST API DesignNotes
Key takeaways, tips, and important points to remember
Also Worth Exploring
← Back to all REST API Design modules
CertificationNotes