API Design Skill

When designing or reviewing an API (REST, RPC, or library), follow these principles:

1. Understand the Consumer

2. Naming Conventions

3. Input Design

4. Output Design

5. Error Handling

6. Versioning & Evolution

7. Documentation

For each endpoint or method, document:

  1. Purpose (one sentence).
  2. Input parameters with types and constraints.
  3. Output shape with example.
  4. Error codes and when they occur.
  5. Authentication/authorization requirements.
  6. Rate limits if applicable.