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#

ParameterTypeRequiredDescription
methodstringYesHTTP method: GET, POST, PUT, PATCH, DELETE
pathstringYesEndpoint path
resourcestringNoResource name (inferred from path)
fieldsarrayNoFields for request body
authbooleanNoRequire 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 } ]