A REST API design guide with best practices for URL structure, HTTP methods, status codes, versioning, and pagination. Enter a resource name to generate example REST endpoints following industry conventions.

REST Endpoint Generator

URL Structure

GOOD
GET /users
GET /users/123
GET /users/123/orders
POST /users
AVOID
GET /getUsers
GET /user/123
GET /getUserOrders/123
POST /createUser
  • Use nouns not verbs — HTTP method IS the verb
  • Use plural resource names consistently (/users not /user)
  • Use lowercase and hyphens for multi-word (/user-profiles not /userProfiles)
  • Keep URLs resource-oriented — hierarchy shows relationships
  • Avoid nesting deeper than 2 levels (/users/123/orders, not /users/123/orders/456/items/789)

HTTP Methods

GET
Retrieve resource(s). Safe and idempotent — no side effects. Use for listing (/users) and fetching (/users/123). Never modify state with GET.
POST
Create a new resource or trigger an action. Not idempotent — calling twice creates two resources. Return 201 Created with Location header.
PUT
Replace a resource completely. Idempotent — calling twice has the same effect. Must include all fields; omitted optional fields default to null.
PATCH
Partially update a resource. Send only the fields to change. Preferred over PUT for most updates — more bandwidth-efficient and explicit.
DELETE
Delete a resource. Idempotent — deleting a non-existent resource should return 404 or 204. Return 204 No Content on success.