GET (Retrieve)
GET /api/v1/users
GET /api/v1/users?page=2
GET /api/v1/users?limit=20
GET /api/v1/users?role=admin
GET /api/v1/users?active=true
GET /api/v1/users?search=john
GET /api/v1/users/123
POST (Create)
POST /api/v1/users
{
"name": "John Doe",
"email": "john@example.com",
"password": "secret123",
"role": "user"
}
PATCH (Partial Update)
PATCH /api/v1/users/123
{
"name": "John Smith"
}
PATCH /api/v1/users/123
{
"email": "john.smith@example.com",
"active": true
}
PUT (Full Update)
PUT /api/v1/users/123
{
"name": "John Doe",
"email": "john@example.com",
"role": "admin",
"active": true
}
DELETE
Summary
| Method |
Endpoint |
Body |
Purpose |
GET |
/api/v1/users |
❌ |
List users |
GET |
/api/v1/users?search=john&page=2 |
❌ |
Filter/search/paginate users |
GET |
/api/v1/users/{id} |
❌ |
Get a single user |
POST |
/api/v1/users |
✅ JSON |
Create a user |
PATCH |
/api/v1/users/{id} |
✅ JSON |
Partially update a user |
PUT |
/api/v1/users/{id} |
✅ JSON |
Replace/update a user completely |
DELETE |
/api/v1/users/{id} |
❌ |
Delete a user |
GET (Retrieve)
POST (Create)
PATCH (Partial Update)
PUT (Full Update)
DELETE
Summary
GET/api/v1/usersGET/api/v1/users?search=john&page=2GET/api/v1/users/{id}POST/api/v1/usersPATCH/api/v1/users/{id}PUT/api/v1/users/{id}DELETE/api/v1/users/{id}