# Consistent API naming convention

- **Pattern:** `ab-002167` (`saas-api-design.api-consistency.consistent-naming`)
- **Severity:** high
- **Lifecycle:** active
- **Last modified:** 2026-04-18
- **Canonical URL:** https://auditbuffet.com/patterns/ab-002167
- **License:** CC-BY-4.0 — attribute to AuditBuffet Pattern Catalog (https://auditbuffet.com/patterns/ab-002167)

## Why it matters

Inconsistent API naming erodes maintainability (ISO-25010:2011 maintainability.modifiability): a mix of kebab-case, camelCase, and plural/singular resource names forces every developer to read each route individually rather than predicting it. Client codebases accumulate one-off special cases for each naming quirk, and search-and-replace migrations become unreliable. When AI generates new routes or a second engineer adds an endpoint, the inconsistency compounds — each addition makes the surface harder to audit and the refactor more expensive.

## Severity rationale

High because naming fragmentation raises change cost on every future API modification and integration, violating ISO-25010:2011 maintainability.modifiability at the structural level.

## Remediation

Pick one convention — lowercase kebab-case with plural resource names is the REST standard — and rename every route directory or file to match. In Next.js App Router, route names are directory names, so the rename is mechanical:

```
app/api/v1/users/route.ts
app/api/v1/user-profiles/route.ts
app/api/v1/billing-invoices/route.ts
```

Update every client-side fetch call in the same commit. Add a one-paragraph convention note to your README or an `api-conventions.md` file so contributors don't reintroduce drift. Internal-namespace routes (e.g., `/api/cron/`) are fine as a separate prefix only when that separation is documented.

## Detection

**The detection method for this pattern is part of AuditBuffet Pro.**

The full method (what to look for, pass and fail conditions, and how results get reported) ships inside the [API Design Audit](https://auditbuffet.com/audits/saas-api-design). The pattern definition, severity rationale, and remediation remain openly licensed under CC-BY-4.0.

## External references

- iso-25010 maintainability.modifiability

Taxons: code-quality

HTML version: https://auditbuffet.com/patterns/ab-002167
