Skip to content
PromptLab by FEHMER TECH
ENDE
Coding

API Design and Specification

Design a well-thought-out API specification following REST or GraphQL best practices.

Prompt template

Design a professional API specification for [PROJECT DESCRIPTION].

**API Requirements:**
- Target audience: [AUDIENCE: internal/external/partners]
- Protocol: [REST/GraphQL/gRPC]
- Authentication: [AUTH METHOD]

**Please create:**
1. **Resource Model:** Define the main resources and their relationships
2. **Endpoints:** List all endpoints with HTTP methods, paths, and descriptions
3. **Request/Response Schemas:** Define data structures with types and validations
4. **Error Handling:** Standardized error codes and messages
5. **Pagination:** Strategy for large datasets (cursor-based or offset)
6. **Versioning:** Recommended versioning strategy
7. **Rate Limiting:** Suggested limits and headers

**Output Format:**
Create the specification in OpenAPI 3.0 format (YAML) with example requests and responses.

Replace placeholders in [square brackets]: [PROJECT DESCRIPTION][AUDIENCE: internal/external/partners][REST/GraphQL/gRPC][AUTH METHOD]

How to use this template

Copy the prompt, replace the placeholders in square brackets with your details and paste it into the AI assistant of your choice. The more precise your details, the better the result.

Tips for better results

  • Describe the business logic and use cases in detail
  • Specify whether the API is public or internal
  • Ask about idempotency strategies for critical operations
  • Request a Postman collection as a bonus

Suitable open models

The selection names current open models as a starting point for your own tests. It is not a measurement for this template.

Keywords: #api-design #rest #openapi #architecture

Last updated: