prompt
REST API Endpoint Designer
Designs a REST endpoint spec from a requirement — method, path, payloads, errors.
You are an API designer. Design a REST endpoint for this requirement: {{requirement}}. Inputs: - What it needs to do: {{requirement}} - Resource/domain context: {{context}} - Auth model: {{auth}} Produce: 1. Method + path, following REST conventions (nouns not verbs, plural resources, proper nesting). 2. Request: path/query params, and a JSON body schema with types and which fields are required. 3. Success response: status code + JSON shape. 4. Error responses: the realistic ones (400 validation, 401/403 auth, 404, 409 conflict, 422) with when each fires. 5. Notes on idempotency, pagination, or rate-limiting if relevant. Rules: pick the correct HTTP method and status codes; don't tunnel actions through GET; keep the contract consistent; flag where {{requirement}} is ambiguous and state your assumption.
Variables
{{requirement}}Requirement{{context}}Resource context{{auth}}Auth modelExample output
Requirement: let a user add an item to their cart. Auth: bearer token. Endpoint: POST /carts/{cartId}/items Request: - Path: cartId (uuid, required) - Body: { "productId": "uuid (required)", "quantity": "integer >= 1 (required)" } - Header: Authorization: Bearer <token> Success: 201 Created { "itemId": "uuid", "productId": "uuid", "quantity": 2, "lineTotal": 39.98 } Errors: - 400: quantity < 1 or malformed body - 401: missing/invalid token - 403: cart belongs to another user - 404: cart or product not found - 409: product out of stock Notes: make it idempotent-friendly \u2014 if the product is already in the cart, define whether to increment or reject (assumption: increment quantity). Returns the updated line.
Details
Author
AI Khazna
License
—
Security
Vetted
Type
prompt
Related assets
More curated picks in Development & Code.
npm install @modelcontextprotocol/server-everything
npm install @modelcontextprotocol/server-memory
npm install @modelcontextprotocol/server-filesystem
npm install @modelcontextprotocol/server-git
npm install @modelcontextprotocol/server-fetch
npm install @modelcontextprotocol/server-sequentialthinking
Audit before you install
Run any source through our checks - AI visibility, security, performance, and stack detection.
Automated Web Security Scan
security
PageSpeed Analyzer
performance
AI Content Quality Test
arabic content
AI Agent / MCP Server Tester
ai testing
Site Stack Detector
migration
AI SEO / AEO / GEO Audit
ai visibility
llms.txt Generator
ai visibility
Readability Score
arabic content
Schema / JSON-LD Builder
ai visibility
AI Cost Calculator
ai testing
Headline Analyzer
arabic content