Skip to content
Back to skills

Api Endpoint Design

ASecurity

REST API design standards for FanHub's Express backend. Use when creating or modifying API endpoints to ensure consistency.

  • 2 stars
  • 0 votes
  • 0 copies
  • 0 views
  • Added September 27, 2026
developmentjavascriptjavaexpressapibackend

Works with

  • api

Security analysis

A100/100

Pro scans all 4 files and shows the line behind each finding

Scanned September 27, 2026

npx -y skills add David-Li0406/meta-skill-evloving --skill api-endpoint-design --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Api Endpoint Design?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Api Endpoint Design
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/david-li0406-api-endpoint-design/badge)](https://www.skillsdirectory.com/skills/david-li0406-api-endpoint-design)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: api-endpoint-design
description: REST API design standards for FanHub's Express backend. Use when creating or modifying API endpoints to ensure consistency.
---

# FanHub API Design Standards

## URL Conventions

- Use lowercase, hyphenated paths: `/api/tv-shows`, not `/api/tvShows`
- Use plural nouns for collections: `/api/characters`, not `/api/character`
- Use nested routes for relationships: `/api/shows/:showId/episodes`
- Version the API: `/api/v1/...`

## HTTP Methods

| Method | Use Case | Example |
|--------|----------|---------|
| GET | Retrieve resource(s) | GET /api/characters |
| POST | Create new resource | POST /api/characters |
| PUT | Replace entire resource | PUT /api/characters/:id |
| PATCH | Partial update | PATCH /api/characters/:id |
| DELETE | Remove resource | DELETE /api/characters/:id |

## Response Format

All responses follow this structure:

```json
{
  "success": true,
  "data": { ... },
  "meta": {
    "total": 100,
    "page": 1,
    "limit": 20
  }
}
```

Error responses:
```json
{
  "success": false,
  "error": {
    "code": "VALIDATION_ERROR",
    "message": "Character name is required",
    "details": [...]
  }
}
```

## Status Codes

- 200: Success (GET, PUT, PATCH)
- 201: Created (POST)
- 204: No Content (DELETE)
- 400: Bad Request (validation errors)
- 401: Unauthorized
- 404: Not Found
- 500: Internal Server Error

## Endpoint Template

```javascript
router.get('/characters', async (req, res, next) => {
  try {
    const { page = 1, limit = 20, show_id } = req.query;
    
    const characters = await CharacterService.list({
      page: parseInt(page),
      limit: parseInt(limit),
      showId: show_id ? parseInt(show_id) : undefined
    });
    
    res.json({
      success: true,
      data: characters.items,
      meta: {
        total: characters.total,
        page: characters.page,
        limit: characters.limit
      }
    });
  } catch (error) {
    next(error);
  }
});
```

Files in this skill

  • SKILL.md1.9 KB
  • example-endpoints/get-character.js978 B
  • example-endpoints/get-episode.js1.2 KB
  • openapi-schema.yaml2.2 KB

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

Comments

Loading comments…