| name | api-endpoint-builder |
| description | Builds production-ready REST API endpoints with validation, error handling, authentication, and documentation. Follows best practices for security and scalability. |
| type | skill |
| created | 2026-02-27T00:00:00.000Z |
| domain | security |
| category | app-security |
| risk | safe |
| source | community |
| tags | ["skill","security","app-security","api","endpoint","builder"] |
API Endpoint Builder
Build complete, production-ready REST API endpoints with proper validation, error handling, authentication, and documentation.
When to Use This Skill
- User asks to "create an API endpoint" or "build a REST API"
- Building new backend features
- Adding endpoints to existing APIs
- User mentions "API", "endpoint", "route", or "REST"
- Creating CRUD operations
What You'll Build
For each endpoint, you create:
- Route handler with proper HTTP method
- Input validation (request body, params, query)
- Authentication/authorization checks
- Business logic
- Error handling
- Response formatting
- API documentation
- Tests (if requested)
Endpoint Structure
1. Route Definition
router.post('/api/users', authenticate, validateUser, createUser);
fastify.post('/api/users', {
preHandler: [authenticate],
schema: userSchema
}, createUser);
2. Input Validation
Always validate before processing:
const validateUser = (req, res, next) => {
const { email, name, password } = req.body;
if (!email || !email.includes('@')) {
return res.status(400).json({ error: 'Valid email required' });
}
if (!name || name.length < 2) {
return res.status(400).({ : });
}
(!password || password. < ) {
res.().({ : });
}
();
};