api-design

Define RESTful API resource naming, HTTP semantics, and response contracts.

Updated Mar 28, 2026
One-click install
npx skills add https://github.com/akirschke15-cmd/Cato-Registry --skill api-design-akirschke15-cmd
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: api-design
Source: https://github.com/akirschke15-cmd/Cato-Registry/tree/main/.claude/skills/api-design
Command: npx skills add https://github.com/akirschke15-cmd/Cato-Registry --skill api-design-akirschke15-cmd

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill prevents inconsistent and brittle REST APIs by guiding teams to define clear resource structures, predictable HTTP semantics, and reliable response patterns that clients can integrate with confidently.

Core Features & Use Cases

  • Resource Naming & Hierarchy: Uses plural, kebab-case paths and recommends relationship nesting limits while favoring query parameters for filtering.
  • HTTP Methods & Status Codes: Maps operations to GET/POST/PATCH/PUT/DELETE and standardizes success and error responses (e.g., 201 with Location, 204 for deletes, 400/401/403/404/409/422/429).
  • Pagination, Filtering, and Sorting: Chooses offset vs cursor pagination, supports exact filtering vs search, and uses safe sorting with whitelists.
  • Response Shape & Versioning: Standardizes success/error payload structures and recommends versioning via URL paths (with a deprecation timeline).
  • Rate Limiting & API Security Best Practices: Establishes header-based rate limiting and baseline security controls like validation, parameterized queries, and non-leaking errors.

Quick Start

Ask the Skill to draft a REST API design for your new service endpoints, including resource paths, HTTP methods, pagination choice, filtering/sorting rules, versioning approach, and a consistent response/error contract.

Frequently Asked Questions about api-design

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

FAQPage Schema
How do I design a REST API with consistent resource naming and HTTP semantics?

To design a REST API with consistent resource naming, use plural, kebab-case paths and map operations to standard HTTP methods like GET, POST, PATCH, PUT, and DELETE. This ensures predictable client interactions and reliable long-term maintainability.

When should I use offset versus cursor pagination in my API?

Choose offset versus cursor pagination based on dataset size and navigation needs. Offset pagination works for smaller, random-access datasets, while cursor pagination handles large, dynamically changing collections more efficiently without skipping records.

What HTTP status codes should I use for REST API success and error responses?

Map REST API responses to standard HTTP status codes like 201 with a Location header for resource creation, 204 for deletes, and 400, 401, 403, 404, 409, 422, or 429 for specific client errors to standardize response contracts.

What is the best way to version a REST API and manage deprecation timelines?

The best way to version a REST API is via URL paths combined with a clear deprecation timeline. This approach standardizes response shapes and allows clients to migrate smoothly while maintaining backward compatibility.

How do I implement secure query parameter filtering and sorting for API endpoints?

Implement secure API filtering and sorting by using query parameters for exact filtering versus search, and apply safe sorting with field whitelists. This prevents unauthorized data exposure and query injection risks.

How do I establish header-based rate limiting and baseline security for public REST APIs?

Establish header-based rate limiting for public REST APIs by returning 429 status codes when limits are exceeded, and enforce baseline security controls including input validation, parameterized queries, and non-leaking error messages.