Task prompt · Coding
Write an API endpoint with validation
by Agent Yard TeamProduction-ready endpoint with input checks and errors.
Use cases
- Production-ready endpoint with input checks and errors.
- Reuse it as often as you like: fill in the blanks (framework; method and path; what it does) with new details and copy again.
- With Cursor, Claude Code, Codex and more, the AIs that support what this prompt needs.
Featured in: Best Claude prompts for coding, Best Claude prompts for essays and writing.
How to use it
- Open Cursor or Claude Code in your terminal (or another AI listed here).
- Fill in the highlighted blanks ([FRAMEWORK], [METHOD AND PATH], [WHAT IT DOES]…) below, or edit them after pasting.
- Copy the prompt, paste it into the chat and send.
Fill in the blanks (optional)
Prompt
Write a [FRAMEWORK] API endpoint: [METHOD AND PATH] that [WHAT IT DOES]. Input: [FIELDS AND RULES]. Include: input validation with clear 400 errors, auth check, correct status codes, idempotency if it creates something, structured logging, and tests for success and failure cases. Return the code and an example curl request.
One email a week
The Weekly is presented byyour brandSponsored · openThe best new prompts and personas, nothing else.