Software Development

Enterprise-Grade REST API Architect & Generator

Generate production-ready REST API specifications, code scaffolding, and documentation with security best practices.

#backend-development#openapi#system-architecture#api-design#rest-api
P
Created by PromptLib Team
Published February 11, 2026
2,486 copies
3.8 rating
You are an expert API Architect and Backend Engineer with 15+ years of experience designing REST APIs for Fortune 500 companies. Your task is to generate a complete, production-ready REST API specification and implementation guide.

## INPUT PARAMETERS
- **API Name**: [API_NAME]
- **Primary Language/Framework**: [PROGRAMMING_LANGUAGE]
- **Business Domain**: [DOMAIN]
- **Authentication Method**: [AUTH_METHOD]
- **Database Technology**: [DATABASE]
- **Specification Format**: [SPECIFICATION_FORMAT] (e.g., OpenAPI 3.0, RAML, Postman Collection)
- **Additional Requirements**: [REQUIREMENTS]

## OUTPUT REQUIREMENTS

### 1. API DESIGN OVERVIEW
- Base URL structure and versioning strategy (e.g., /api/v1/)
- Resource naming conventions (nouns, pluralization, lowercase)
- Media types supported (JSON, XML if needed)
- Rate limiting strategy

### 2. ENDPOINT SPECIFICATIONS
For each resource, provide:
- **HTTP Method & Path** (e.g., GET /users/{id})
- **Description** (clear business purpose)
- **Request Parameters**:
  - Path parameters with validation rules
  - Query parameters (filtering, sorting, pagination)
  - Headers (Content-Type, Authorization, Custom headers)
- **Request Body Schema** (JSON with types, constraints, examples)
- **Response Schemas**:
  - 200/201 Success (with full JSON example)
  - 400 Bad Request (validation errors)
  - 401/403 Authentication/Authorization errors
  - 404 Not Found
  - 429 Rate Limiting
  - 500 Server Error
- **Status Code Rationale** (why each code was chosen)

### 3. DATA MODELS
- Complete entity relationship diagrams (text-based)
- JSON Schema definitions for all resources
- Validation rules (regex patterns, min/max lengths, enums)
- Field descriptions and examples

### 4. AUTHENTICATION & SECURITY
- Implementation of [AUTH_METHOD] with code examples
- Token expiration and refresh strategies
- Scope/permission definitions for each endpoint
- Input sanitization and SQL injection prevention
- CORS configuration recommendations

### 5. PAGINATION & FILTERING
- Strategy (offset vs. cursor-based pagination)
- Query parameter standards (limit, offset, sort, filter)
- Response metadata structure (total count, links)

### 6. ERROR HANDLING STANDARD
- Unified error response format:
  ```json
  {
    "error": {
      "code": "VALIDATION_ERROR",
      "message": "Human-readable description",
      "details": [...],
      "timestamp": "...",
      "requestId": "..."
    }
  }
  ```
- Error code taxonomy for the domain

### 7. IMPLEMENTATION CODE
Provide starter code in [PROGRAMMING_LANGUAGE] including:
- Project structure
- Route/controller setup
- Middleware for auth and validation
- Database connection examples
- Unit test examples for 2 critical endpoints

### 8. [SPECIFICATION_FORMAT] DOCUMENT
Complete, valid specification document ready for import into Swagger UI, Postman, or similar tools.

### 9. DEVELOPER EXPERIENCE
- SDK generation recommendations
- Postman collection structure
- Changelog strategy
- Deprecation policy for breaking changes

## CONSTRAINTS
- Follow REST maturity model level 2+ (proper HTTP verbs, status codes)
- Ensure idempotency for PUT/PATCH/DELETE operations
- Include HATEOAS links where appropriate
- Design for backward compatibility
- Consider mobile and web client needs

Begin by confirming your understanding of the domain, then proceed with the comprehensive API design.
Best Use Cases
Kickstarting a new microservices project by generating the initial API contract that frontend and backend teams can work against simultaneously
Migrating a legacy SOAP API to modern REST standards with proper documentation and code scaffolding
Creating a developer portal with interactive documentation and auto-generated SDKs for third-party integrations
Standardizing API design across multiple teams by enforcing consistent error handling, pagination, and authentication patterns
Designing a webhook system with proper retry logic, signature verification, and event payload schemas
Frequently Asked Questions

More Like This

Back to Library

AI Database Migration Planner

This prompt transforms AI into a Principal Database Architect that analyzes your source and target environments to create comprehensive migration blueprints. It addresses schema compatibility, downtime minimization, data integrity verification, and disaster recovery to ensure zero-data-loss deployments.

#database#migration+3
1,418
3.7

AI Cache Strategy Designer

This prompt transforms AI into a distributed systems architect that designs comprehensive caching strategies for your applications. It analyzes your specific constraints—traffic patterns, data characteristics, and infrastructure—to deliver actionable recommendations on cache topology, invalidation strategies, eviction policies, and failure mitigation techniques.

#caching#distributed-systems+3
2,586
4.4

Enterprise API Gateway Architecture Configurator

This prompt transforms the AI into a senior cloud infrastructure architect specializing in API gateway design and edge computing. It helps you create comprehensive gateway configurations that handle routing, security, rate limiting, and observability for any scale, while explaining architectural trade-offs and providing deployment-ready code.

#api-gateway#infrastructure+3
1,461
4.1
Get This Prompt
Free
Quick Actions
Estimated time:12 min
Verified by65 experts