api-design

Standardize REST API responses, URL versioning, pagination, and error mapping.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Menyediakan standar tunggal untuk bentuk response, versioning, konvensi URL, pagination, dan penanganan error sehingga klien dan tim backend memiliki ekspektasi yang konsisten dan mudah ditrace.

Core Features & Use Cases

  • Response wrapper yang konsisten: semua sukses mengembalikan data dan semua kegagalan mengembalikan error, disertai meta.requestId dan meta.timestamp untuk traceability.
  • URL dan versioning: versi wajib di path (/api/v1/), resource dalam bentuk plural dan kebab-case, serta nested resource maksimal dua level untuk menjaga kesederhanaan.
  • Pagination, filter, dan status code standar: list endpoint wajib paginasi dengan parameter page/limit/sort/order, dukungan filter/search, dan pemetaan HTTP status code yang konsisten (200/201/202/204, 4xx, 5xx).
  • Use case: buat spesifikasi API untuk layanan pengguna dan produk yang diperlukan oleh tim frontend agar integrasi, dokumentasi, dan observability (requestId) langsung konsisten.

Quick Start

Design endpoints for the users resource using URL-based versioning, plural kebab-case paths, a data-or-error wrapper with meta.requestId and timestamp, and paginated list responses.

Frequently Asked Questions about api-design

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

FAQPage Schema
How do I standardize REST API response formats for consistent client behavior?

Standardize REST API responses by using a data-or-error wrapper that returns `data` for successes and `error` for failures, always including `meta.requestId` and `meta.timestamp` for traceability. This ensures predictable client behavior across all endpoints.

What is the best way to handle pagination and filtering in REST API list endpoints?

Handle pagination in REST API list endpoints by mandating page, limit, sort, and order parameters, while supporting filter and search capabilities. This enforces consistent data retrieval and prevents unbounded query responses.

How does URL-based versioning work for REST API endpoints?

URL-based versioning for REST API endpoints works by embedding the version directly in the path, such as `/api/v1/`. This approach requires plural kebab-case resources and limits nested resources to two levels to maintain structural simplicity.

How do I map HTTP status codes and errors consistently across a REST API?

Map HTTP status codes consistently by using 200, 201, 202, and 204 for successful operations, and standard 4xx and 5xx codes for client and server errors. All failures return an `error` object within the standard response wrapper.

Can I use this API design standard for internal backend services and public APIs?

Yes, you can apply this API design standard to backend web services, internal APIs, and public API design. It enforces consistent endpoint conventions, response formats, and traceability suitable for frontend integration and documentation tasks.

Why do I need a requestId and timestamp in every API response wrapper?

You need a `meta.requestId` and `meta.timestamp` in every API response wrapper to ensure full traceability. This allows backend teams and clients to track, debug, and observe specific requests across distributed systems and logs.