Designing APIs

SkillMedia

Design clean, consistent APIs. Use when creating new endpoints, defining contracts, or improving API ergonomics. Covers REST, versioning, and error handling.

Available today. Use it from your connected AI after setup.

Connect ahel once, and every AI you use reads what you have installed.

Then ask your AI: use the Designing APIs skill

What this skill tells your AI

The instructions your AI receives, as published by nguyenhuuca/assessment in .claude/skills/architecture/designing-apis/SKILL.md and read by ahel’s review.

Workflows

  • Resources: Identify resources and relationships
  • Endpoints: Define URL structure and methods
  • Request/Response: Define payloads and schemas
  • Errors: Define error responses
  • Document: Create OpenAPI spec

REST Principles

Resource Naming

  • Use nouns, not verbs: /users not /getUsers
  • Use plural: /users not /user
  • Use kebab-case: /user-profiles not /userProfiles
  • Nest for relationships: /users/{id}/orders

HTTP Methods

MethodPurposeIdempotent
GETReadYes
POSTCreateNo
PUTReplaceYes
PATCHUpdateYes
DELETERemoveYes

Status Codes

CodeMeaning
200Success
201Created
204No Content
400Bad Request
401Unauthorized
403Forbidden
404Not Found
409Conflict
422Unprocessable Entity
500Internal Server Error

Error Response Format

{
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Request validation failed",
    "details": [
      {
        "field": "email",
        "message": "Invalid email format"
      }
    ]
  }
}

Versioning

URL Versioning (Recommended)

GET /api/v1/users
GET /api/v2/users

Header Versioning

GET /api/users
Accept: application/vnd.api+json;version=1

Pagination

{
  "data": [...],
  "pagination": {
    "page": 1,
    "per_page": 20,
    "total": 100,
    "total_pages": 5
  }
}

OpenAPI Example

openapi: 3.0.0
info:
  title: Users API
  version: 1.0.0
paths:
  /users:
    get:
      summary: List users
      responses:
        '200':
          description: Success
          content:
            application/json:
              schema:
                type: array
                items:
                  $ref: '#/components/schemas/User'

Signals

GitHub stars
34
Forks
25
Last commit
Sep 2026
Advanced
Catalog kind
skill
Gateway key
designing-apis-nguyenhuuca
Source
github.com/nguyenhuuca/assessment