api-endpoint Skill
Create production-ready RESTful API endpoints with validation, error handling, and proper responses.
Overview#
The api-endpoint skill generates complete API endpoint code following REST best practices.
Usage#
Use the api-endpoint skill to create a POST /api/posts endpoint for creating blog posts.
Parameters#
| Parameter | Type | Required | Description |
|---|---|---|---|
method | string | Yes | HTTP method: GET, POST, PUT, PATCH, DELETE |
path | string | Yes | Endpoint path |
resource | string | No | Resource name (inferred from path) |
fields | array | No | Fields for request body |
auth | boolean | No | Require authentication (default: true) |
Generated Output#
GET Endpoint (List)#
Loading code block...
POST Endpoint (Create)#
Loading code block...
GET Endpoint (Single)#
Loading code block...
PUT/PATCH Endpoint (Update)#
Loading code block...
DELETE Endpoint#
Loading code block...
Features Included#
- Authentication check
- Input validation with Zod
- Proper HTTP status codes
- Pagination support
- Error handling
- Type safety
Customization Options#
Use the api-endpoint skill with:
- method: "POST"
- path: "/api/posts"
- auth: false (for public endpoints)
- fields: [
{ name: "title", type: "string", required: true },
{ name: "content", type: "string", required: true }
]
Related Skills#
- validation - Advanced validation patterns
- error-handling - Error management
- prisma-crud - Database operations