api-design

Designs REST APIs with conventions for naming, status codes, pagination, and error responses.

1|Updated Oct 11, 2025
One-click install
npx skills add https://github.com/ibytechaos/claude --skill api-design-ibytechaos
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/ibytechaos/claude/tree/main/plugins/everything-claude-code/skills/api-design
Command: npx skills add https://github.com/ibytechaos/claude --skill api-design-ibytechaos

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Inconsistent REST API design leads to confusing endpoints, wrong HTTP status codes, missing pagination, and error responses that leak internals or confuse consumers. This Skill provides a complete set of conventions and implementation patterns for building consistent, developer-friendly APIs. ## Core Features & Use Cases - Resource & URL Conventions: Enforces plural, kebab-case, noun-based URLs with correct HTTP method semantics and status codes (201 with Location header, 422 for validation, 429 for rate limits). - Pagination, Filtering & Sorting: Covers offset-based and cursor-based pagination, bracket-notation filtering, multi-field sorting, and sparse fieldsets. - Error Responses, Auth & Versioning: Standard error envelope with field-level details, Bearer token and API key auth patterns, rate limit headers, and URL path versioning 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 code, and format errors consistently before shipping. ## Quick Start Review my new POST /api/v1/users endpoint and check it against REST API design best practices for status codes, validation, 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 /users/:id/orders. Avoid verbs in URLs except for non-CRUD actions like /auth/login.

What HTTP status codes should a REST API return?

Return 200 for successful reads, 201 with a Location header for creations, 204 for deletions, 400 or 422 for validation failures, 404 for missing resources, 409 for conflicts, and 429 for rate limiting. Never return 200 with an error payload.

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

Use offset pagination for admin dashboards and small datasets where jumping to a page matters. Use cursor pagination for infinite scroll, feeds, and large datasets since it performs consistently and stays stable with concurrent inserts.

How do I format REST API error responses?

Return a structured error object with a machine-readable code, a human-readable message, and a details array containing field-level errors with field name, message, and code. Pair this with the correct HTTP status code such as 422 for validation failures.

When should I version my API and which versioning approach works best?

Start with /api/v1/ and only add a new version for breaking changes like removing fields or changing types. URL path versioning is recommended because it is explicit, easy to route, and cacheable; maintain at most two active versions.