api-design

Defines REST API conventions for resource naming, status codes, pagination, and error responses.

Updated Mar 18, 2026
One-click install
npx skills add https://github.com/freedom909/real-estate-saas --skill api-design-freedom909
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/freedom909/real-estate-saas/tree/main/.trae/skills/api-design
Command: npx skills add https://github.com/freedom909/real-estate-saas --skill api-design-freedom909

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Teams building REST APIs often ship inconsistent endpoints with wrong status codes, ad-hoc error formats, and missing pagination, which creates confusion for API consumers and costly breaking changes later. ## Core Features & Use Cases - Resource and URL Conventions: Enforces plural kebab-case resource naming, correct HTTP method semantics, and semantic status codes (201 with Location, 422 for validation, 429 for rate limits). - Pagination, Filtering, and Sorting: Provides offset-based and cursor-based pagination patterns with guidance on when to use each, plus query parameter conventions for filtering, sorting, and sparse fieldsets. - Standard Response Formats: Defines success, collection, and error response envelopes with field-level validation details, plus rate limiting headers and versioning strategy. - Use Case: When adding a new orders endpoint to a FastAPI or Next.js backend, apply the checklist to return 201 with a Location header on creation, cursor-paginate the list endpoint, and emit structured validation errors. ## Quick Start Use the api-design skill to review my new /api/v1/orders endpoints and fix the status codes, pagination, and error response format.

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 correct 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 /orders/:id/cancel.

What HTTP status codes should a REST API return?▼

Return 200 for reads, 201 with a Location header for creation, 204 for deletes, 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 users jump to page numbers. Use cursor pagination for infinite scroll, feeds, and large datasets because 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 validation errors. Pair it with the correct HTTP status code such as 422 for semantic validation failures.

When should I version my REST API?▼

Start with /api/v1/ and only add a new version for breaking changes like removing fields, changing types, or altering authentication. Adding fields, optional parameters, or new endpoints is non-breaking and needs no new version.