# REST API Design

> Reviews or designs a RESTful API following best practices Use when this capability is needed.

- Skill: `tomevault-io/rest-api-design-6` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx skillmds@latest add tomevault-io/rest-api-design-6`
- Raw SKILL.md: https://api.skillmd.com/api/skills/tomevault-io/rest-api-design-6/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Integrations & APIs
- Author: tomevault-io (https://skillmd.com/u/tomevault-io)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/tomevault-io/rest-api-design-6

---


## REST API Design

Resource / Scope: **$ARGUMENTS**

### If reviewing existing API:

1. Read route definitions:
```bash
grep -rn "router\.\|app\." src/ --include="*.ts" | grep -E "get|post|put|patch|delete" | head -30
```

Check for:
- Proper HTTP method usage (GET=read, POST=create, PUT/PATCH=update, DELETE=remove)
- Consistent URL naming (`/users` not `/getUsers`)
- Plural nouns for collections (`/users/123`)
- Nested resources for relationships (`/users/123/posts`)
- Query params for filtering/sorting/pagination, not URL segments
- Consistent response shapes
- Missing pagination on list endpoints
- HTTP status codes correct (201 for creation, 204 for delete, etc.)

### If designing new API:

Generate the complete route table:

```
GET    /resources          List (with pagination)
POST   /resources          Create
GET    /resources/:id      Get one
PUT    /resources/:id      Replace
PATCH  /resources/:id      Partial update
DELETE /resources/:id      Delete

GET    /resources/:id/related   Nested resource
```

Include request/response shapes and error codes for each endpoint.

---
> Source: [berkcangumusisik/claude-code-practices](https://github.com/berkcangumusisik/claude-code-practices) — distributed by [TomeVault](https://tomevault.io).
<!-- tomevault:4.0:skill_md:2026-06-15 -->

