api-design

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

Updated Mar 22, 2026
One-click install
npx skills add https://github.com/diazMelgarejo/orama-system --skill api-design-diazmelgarejo
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/diazMelgarejo/orama-system/tree/main/.cursor/.agents/skills/api-design
Command: npx skills add https://github.com/diazMelgarejo/orama-system --skill api-design-diazmelgarejo

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 client developers. This Skill provides a complete set of conventions so every endpoint follows the same predictable patterns. ## Core Features & Use Cases - Resource and 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, and Sorting: Covers offset-based and cursor-based pagination, bracket-notation filters, multi-field sorting, and sparse fieldsets. - Standardized Error and Response Envelopes: Defines JSON response shapes for success, collections, and field-level validation errors, plus rate-limit headers and versioning strategy. - Use Case: When adding a new endpoint to a Next.js, Django REST Framework, or Go service, apply the checklist to validate naming, status codes, auth, and rate limiting before shipping. ## Quick Start Use the api-design skill to review my new /api/v1/orders endpoint and check it against REST conventions.

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 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.

Should I use cursor or offset pagination 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 because it performs consistently and stays stable with concurrent inserts.

How do I version a REST API without breaking clients?

Start with URL path versioning like /api/v1/ and maintain at most two active versions. Adding fields or optional parameters is non-breaking, but removing fields, changing types, or altering URLs requires a new version with a Sunset header and deprecation notice.

What should a REST API error response look like?

Return a JSON object with an error key containing a machine-readable code, a human-readable message, and a details array of field-level errors with field, message, and code. Pair it with the correct HTTP status such as 422 for validation failures.