Coding: API Endpoint
Specifying the full contract (method, route, auth, schema) upfront means the generated code matches your architecture. Requiring error handling and tests produces production-ready code.
Create a {{framework}} API endpoint for {{endpoint_purpose}}. Specifications: - Method: {{http_method}} - Route: {{route_path}} - Auth: {{auth_type}} (e.g., JWT, API key, none) - Request body: {{request_schema}} - Response: JSON with proper status codes (200, 400, 401, 404, 500) Requirements: - Input validation with descriptive error messages - Proper error handling (try/catch, don't expose internal errors) - TypeScript types for request and response - One integration test example using {{test_framework}} Add inline comments explaining non-obvious decisions.
Variables to customize
Why this prompt works
Specifying the full contract (method, route, auth, schema) upfront means the generated code matches your architecture. Requiring error handling and tests produces production-ready code.
What you get when you save this prompt
Your workspace unlocks powerful tools to iterate and improve.
AI Optimization
One-click improvement with structure analysis and pattern suggestions.
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
$ npm i -g @promptingbox/mcpUse Everywhere
Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.
Your prompts, organized
Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.