1---2name: openagentskills-betterskills-rest-api-design3description: REST API Design4---56# REST API Design78## Resource naming910- Nouns, plural collections: `/users`, `/users/{id}/orders`11- Actions as sub-resources when not CRUD: `/users/{id}/activate` (prefer state change via PATCH)12- Kebab-case paths; lowercase1314## HTTP methods1516| Method | Idempotent | Safe | Typical use |17|--------|------------|------|-------------|18| GET | Yes | Yes | Read |19| POST | No | No | Create, non-idempotent actions |20| PUT | Yes | No | Full replace |21| PATCH | No* | No | Partial update |22| DELETE | Yes | No | Remove |2324## Status codes (defaults)2526| Code | When |27|------|------|28| 200 | Success with body |29| 201 | Created (+ `Location` header) |30| 204 | Success, no body |31| 400 | Client validation error |32| 401 | Not authenticated |33| 403 | Authenticated, not allowed |34| 404 | Resource not found |35| 409 | Conflict (duplicate, state) |36| 422 | Semantic validation (optional) |37| 429 | Rate limited |38| 500 | Server error (no internal details) |3940## Error body (consistent shape)4142```json43{44 "error": {45 "code": "VALIDATION_ERROR",46 "message": "Human-readable summary",47 "details": [{ "field": "email", "issue": "invalid format" }]48 }49}50```5152## Pagination5354Prefer cursor-based for large sets:5556```json57{58 "data": [],59 "next_cursor": "opaque-token",60 "has_more": true61}62```6364Offset acceptable for admin or small tables; document limits (`limit` max 100).6566## Versioning6768- URL prefix (`/v1/`) or header (`Accept: application/vnd.company.v1+json`)69- Never break clients without a new version or deprecation window7071## Review checklist7273- [ ] Consistent naming and pluralization74- [ ] Correct status codes (not 200 for errors)75- [ ] Filtering/sorting documented76- [ ] Auth on every mutating route77- [ ] Idempotency keys for POST payments/bookings where needed7879---80> Source: [openagentskills/betterskills](https://github.com/openagentskills/betterskills) — distributed by [TomeVault](https://tomevault.io).81<!-- tomevault:4.0:skill_md:2026-06-15 -->
Run npx skillmds@latest add tomevault-io/openagentskills-betterskills-rest-api-design in your terminal (requires Node.js), paste this page's agent-chat prompt into Claude, Cursor, or any MCP-connected agent, or download the SKILL.md file and copy it into your agent's skills directory.
REST API Design It is listed under Integrations & APIs on SkillMD.
This skill has not completed SkillMD's automated safety review yet. Independent scanners report: SkillSpector: PASS, Skill Scanner: PASS. SkillMD never runs a skill's scripts for you; review the SKILL.md before installing.
This skill is tagged as working with Claude Code, Claude.ai, OpenAI Codex. SKILL.md is an open format, so most agents that read a skills directory can load it too.
Yes. Installing skills from SkillMD is free, and the skill stays under its author's original license.
tomevault-io (@tomevault-io) published this skill. Their other Agent Skills are listed on their SkillMD profile.