REST Patterns
5 min read
Resource expansion, bulk ops, async jobs, soft delete, singleton resources, and action sub-resources.
REST Design Patterns
# Resource expansion
GET /posts?include=author,tags
# Bulk operations
POST /users/bulk-create
{"users":[{"name":"Alice"},{"name":"Bob"}]}
# Async long-running tasks
POST /reports/generate
{"job_id":"job-abc","status":"pending"}
GET /jobs/job-abc
{"status":"completed","result_url":"/reports/xyz"}
# Soft delete
DELETE /posts/1 # sets deleted_at
GET /posts?include_deleted=true
# Singleton resource
GET /me # current user
PATCH /me # update current user
# Actions
POST /posts/42/publish
POST /users/1/ban