REST API Endpoint

General Productivitybolt-ai-promptsresource_namerequired_fields

Defines every route, validation rule, and response format so Bolt builds a complete CRUD API. The 'do not modify' boundary prevents unintended side effects.

Prompt
Add a RESTful API endpoint for {{resource_name}}.\n\nRoutes:\n- GET /api/{{resource_name}} — list all with pagination (page, limit query params)\n- GET /api/{{resource_name}}/:id — get single by ID\n- POST /api/{{resource_name}} — create new (validate required fields: {{required_fields}})\n- PUT /api/{{resource_name}}/:id — update existing\n- DELETE /api/{{resource_name}}/:id — soft delete (set deleted_at timestamp)\n\nInclude:\n- Input validation with descriptive error messages\n- Try/catch with proper HTTP status codes (400, 404, 500)\n- Response format: { success: boolean, data: T, error?: string }\n\nDo not modify any existing routes or the frontend.

Variables to customize

{{resource_name}}{{required_fields}}

Why this prompt works

Defines every route, validation rule, and response format so Bolt builds a complete CRUD API. The 'do not modify' boundary prevents unintended side effects.

What you get when you save this prompt

Your workspace unlocks powerful tools to iterate and improve.

AI OPTIMIZE

AI Optimization

One-click improvement with structure analysis and pattern suggestions.

VERSION DIFF

Version History

Track every edit. Compare versions side-by-side with word-level diffs.

ORGANIZE
Development
Code Review
Testing
Marketing

Folders & Tags

Organize your library with nested folders, tags, and drag-and-drop.

MCP
$ npm i -g @promptingbox/mcp
Claude · Cursor · ChatGPT

Use 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.