api-design

Designs REST APIs with conventions for naming, status codes, pagination, filtering, and versioning.

Updated Mar 25, 2026
One-click install
npx skills add https://github.com/Femad-6/my-skills --skill api-design-femad-6
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/Femad-6/my-skills/tree/main/.github/skills/api-design
Command: npx skills add https://github.com/Femad-6/my-skills --skill api-design-femad-6

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Inconsistent REST API design leads to confusing endpoints, wrong HTTP status codes, missing pagination, and breaking changes that frustrate API consumers. This Skill provides a complete set of conventions and implementation patterns for building consistent, developer-friendly REST APIs. ## Core Features & Use Cases - Resource and URL Conventions: Enforces plural, kebab-case, noun-based resource naming with correct HTTP method semantics and status code usage (201 with Location header, 422 for validation, 429 for rate limits). - Pagination, Filtering, and Sorting: Covers offset-based and cursor-based pagination with guidance on when to use each, plus query parameter patterns for filtering, sorting, search, and sparse fieldsets. - Production Concerns: Includes standardized error response formats, authentication and authorization patterns, rate limiting headers and tiers, and a versioning strategy with deprecation timelines. - Use Case: When adding a new endpoint to a Next.js, Django REST Framework, or Go service, use this Skill to validate the request schema, return the correct status codes, and follow the API design checklist before shipping. ## Quick Start Review my new /api/v1/orders endpoint and check it against REST API design best practices for naming, status codes, pagination, and error responses.

Frequently Asked Questions about api-design

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I design REST API endpoints with proper naming conventions?

Use plural, lowercase, kebab-case nouns for resources like /api/v1/team-members, and nest sub-resources for ownership such as /api/v1/users/:id/orders. Avoid verbs in URLs except for non-CRUD actions like /api/v1/auth/login.

Cursor vs offset pagination: which should I use for my API?

Use offset pagination for admin dashboards and small datasets under 10K rows where users jump to page numbers. Use cursor pagination for infinite scroll, feeds, and large datasets since it performs consistently and stays stable with concurrent inserts.

What HTTP status code should a POST request return on success?

Return 201 Created with a Location header pointing to the new resource, such as Location: /api/v1/users/abc-123. Avoid returning 200 for created resources, and use 204 No Content for DELETE or updates without a response body.

How do I structure error responses in a REST API?

Return an error object with a machine-readable code, a human-readable message, and a details array of field-level errors for validation failures. Pair it with the correct HTTP status like 400 for malformed JSON or 422 for semantically invalid data.

When do I need to version my API and which approach is best?

Version only for breaking changes like removing fields, changing types, or altering authentication. URL path versioning like /api/v2/ is recommended because it is explicit and cacheable; maintain at most two active versions with a Sunset header for deprecation.

What rate limiting headers should a public API return?

Return X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset on responses. When the limit is exceeded, return 429 Too Many Requests with a Retry-After header and an error body explaining when to retry.