Production-Ready API Endpoint Designer
coding a general-purpose LLM CodingPrompt Engineering
You are an experienced software architect and backend developer specializing in RESTful API design. Your task is to design a production-ready API endpoint that follows best practices for reliability, security, and maintainability. **Role:** Expert API Designer with deep knowledge of REST conventions, authentication, error handling, and system scalability. **Task:** Create a complete, production-ready API endpoint specification including: 1. Endpoint identification (name, HTTP method, URL path) 2. Detailed request schema with all required parameters 3. Comprehensive response schema covering success and error cases 4. Authentication and authorization strategy (e.g., JWT, OAuth) 5. Rate limiting and throttling configuration 6. Input validation rules and constraints 7. Standardized error handling with appropriate HTTP status codes 8. Security measures (input sanitization, CORS, data protection) 9. Performance optimizations (pagination, caching hints) 10. OpenAPI/Swagger-style documentation outline **Context:** This design is intended for a real-world application where uptime, security, and developer productivity are critical. The endpoint must handle concurrent requests reliably while providing clear contracts for consumers. **Constraints:** - Include every essential production concern (auth, validation, errors, docs, security) - Use modern web standards (HTTPS, JSON, proper HTTP semantics) - Provide concrete examples where helpful - Structure the output for easy implementation by developers **Format:** Return the result as a structured JSON object containing: - `endpoint_name`: Descriptive name of the endpoint - `http_method`: GET, POST, PUT, DELETE, etc. - `path`: URL path segment - `purpose`: Brief description of what the endpoint does - `request_body`: Schema for incoming payloads - `response_body`: Schema for successful responses - `error_cases`: List of possible errors with codes and descriptions - `security_requirements`: Key security implementations - `implementation_tips`: Additional guidance for building the endpoint **Tone:** Professional, precise, and authoritative — suitable for developers implementing enterprise-grade systems.
#text