Skip to content
Intermediate
api
backend

Design a REST endpoint

Well-structured API routes. Tuned for v0.

Prompt

Design a REST endpoint in [LANGUAGE/FRAMEWORK] to [PURPOSE]. Include route, method, request validation, response shape, error codes, and an example test. Data model: [MODEL].

Use React, Tailwind and shadcn/ui components.

Replace the [HIGHLIGHTED] parts with your own details.

Example output

A typed handler with validation, 200/400/404 responses and a test file.

Tips

  • Specify your validation library to match your stack.

Related prompts