API Design Principles
Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable APIs.
Use this skill when
- •Designing new REST or GraphQL APIs
- •Refactoring existing APIs for better usability
- •Establishing API design standards for your team
- •Reviewing API specifications before implementation
- •Migrating between API paradigms
- •Creating developer-friendly API documentation
Do not use this skill when
- •You only need implementation guidance for a specific framework
- •You are doing infrastructure-only work without API contracts
- •You cannot change or version public interfaces
Instructions
- •Define consumers, use cases, and constraints.
- •Choose API style and model resources or types.
- •Specify errors, versioning, pagination, and auth strategy.
- •Validate with examples and review for consistency.
REST Best Practices
- •Use nouns for resources (e.g.,
/users,/orders) - •Use HTTP methods correctly (GET, POST, PUT, DELETE, PATCH)
- •Return appropriate status codes
- •Implement proper pagination
- •Version your APIs
GraphQL Best Practices
- •Design schema-first
- •Use meaningful type names
- •Implement proper error handling
- •Consider query complexity limits
- •Use DataLoader for N+1 problems