The API Design Checklist: 10 Things Every Great API Has (And Bad Ones Don’t)
Published by Onclick Innovations · Software Development · June 2026 · 8 min read
A well-designed API is invisible. Developers consume it, build on top of it, and ship products faster because of it — without ever thinking about the API itself. A poorly designed API is the opposite. It generates support tickets, causes production incidents, and eventually gets rewritten by the team inheriting it.
After building over 350 production software products across fintech, healthcare, e-commerce and enterprise SaaS, we have seen what separates APIs that scale gracefully from APIs that become someone else’s most expensive maintenance problem.
This is the checklist we use internally at Onclick Innovations. Save it. Share it. Use it.
1. Versioning From Day One
Every API should be versioned from the first line of code. Not from the moment you need to make a breaking change — from day one.
The correct pattern is simple: /api/v1/users not /api/users. When you need to introduce a breaking change, /api/v2/ exists without disrupting any client currently integrated against /api/v1/.
Teams that skip versioning always face the same moment: the first time they need to change a response structure, they discover they cannot do it without breaking every client integration simultaneously. At that point the cost of adding versioning retroactively is significantly higher than it would have been from the start.
Versioning is the most important decision you make when designing an API. Everything else is recoverable. Versioning is not.
2. Consistent, Structured Error Responses
Every error your API returns should follow the same structure. Every single one. Without exception.
A well-structured error response contains at minimum:
- An HTTP status code that accurately reflects what happened
- A machine-readable error code (e.g.
USER_NOT_FOUND,INVALID_EMAIL_FORMAT) - A human-readable message that explains what went wrong
- A unique request ID for debugging and support correlation
What a bad API returns: 500 Internal Server Error with no body, or a generic message that gives the consuming developer no actionable information.
Consistent error responses are not just a developer experience concern. They directly reduce your support overhead. When every error contains a request ID, your support team can trace any reported issue in seconds instead of hours.
3. Rate Limiting on Every Endpoint
An API without rate limiting is one script away from being taken offline. Whether the cause is a well-intentioned developer running a loop, a misconfigured client retrying infinitely, or a deliberate attack — the result is the same: your API goes down for everyone.
Implement per-user and per-endpoint rate limits. When a limit is exceeded, return 429 Too Many Requests with a Retry-After header telling the client exactly when they can try again.
Good rate limiting strategy includes different tiers for different endpoint types. A read endpoint can be more generous than a write endpoint. A search endpoint with expensive database operations needs tighter limits than a simple lookup. Apply limits intentionally, not uniformly.
4. Authentication Done Right
There are three authentication patterns that cover the vast majority of API use cases in 2026:
- JWT (JSON Web Tokens) — for stateless authentication where the server does not need to store session state. Ideal for microservices and distributed systems.
- OAuth 2.0 — for third-party integrations where users grant your API access to resources in another system. The correct choice for any social login or third-party service integration.
- API Keys — for server-to-server communication where a trusted system is calling your API directly. Simple, auditable and effective for this specific use case.
The rule that matters most: never roll your own authentication. Cryptographic implementations have subtle edge cases that are extremely difficult to get right and catastrophic when you get wrong. Use established libraries and protocols. The cost of a security vulnerability in authentication code vastly exceeds the cost of using a well-maintained library.
5. Pagination on Every List Endpoint
No list endpoint should ever return an unbounded result set. Every endpoint that returns multiple records needs pagination implemented before it goes to production.
The two common approaches are offset-based pagination (?page=2&limit=20) and cursor-based pagination (?cursor=eyJ1c2VySWQiOjEwMH0). For most production use cases, cursor-based pagination is the superior choice. It performs consistently regardless of dataset size, handles records being added or deleted between pages correctly, and does not degrade as users page deeper into results.
Offset-based pagination is simpler to implement but degrades at scale. When a user requests page 500 of a 10,000-record dataset, the database must skip 9,980 records before returning 20. Cursor-based pagination retrieves only the records that need to be returned, regardless of position.
6. Idempotency Keys for Mutating Operations
Any endpoint that creates a resource, initiates a transaction or triggers an irreversible action should accept an idempotency key.
An idempotency key is a unique identifier sent by the client with their request. If the same request is submitted twice with the same idempotency key — due to a network timeout, a retry logic bug, or a double-click — the server returns the result of the first request instead of performing the operation twice.
This pattern is used by Stripe for every payment operation. It is used by every financial services API that handles money movement. It is the correct default for any operation that should not be duplicated.
Without idempotency keys, a client that retries a failed request due to a timeout may create duplicate records, charge a customer twice, or trigger duplicate notifications. The cost of implementing idempotency keys is small. The cost of not implementing them is measured in production incidents and customer complaints.
7. Request Validation With Specific Error Messages
Validate all input at the API layer before it touches your database or business logic. This means checking types, formats, required fields, value ranges and cross-field constraints.
When validation fails, return exactly what failed and why. Not 400 Bad Request. Not "Invalid input". Something like:
{"field": "email", "error": "INVALID_FORMAT", "message": "The email address provided is not a valid format."}
Specific validation errors eliminate entire categories of back-and-forth between developers integrating your API and your support team. They also reduce incorrect data reaching your database, which prevents a much larger class of downstream problems.
8. Comprehensive Documentation
If a developer needs to read your source code to understand how to use your API, your API has failed. Full stop.
Great API documentation includes:
- An OpenAPI or Swagger specification that is always up to date and generated from the code itself
- A working example for every single endpoint
- Authentication setup instructions that a developer can follow without prior context
- A clear explanation of every error code the API can return
- A changelog that documents what changed between versions and why
Documentation that is maintained separately from the codebase goes out of date. The correct approach is to generate documentation automatically from the code — tools like Swagger UI, Redoc and Stoplight all support this pattern. When the code changes, the documentation changes with it.
9. Logging and Observability
You cannot debug what you cannot see. Every API request should produce a structured log entry containing at minimum: timestamp, user or API key identifier, endpoint called, HTTP method, response status code, response time in milliseconds, and the request ID that appears in any error responses.
Beyond basic logging, production APIs need distributed tracing for requests that span multiple services, metrics on response time percentiles (p50, p95, p99 — not just averages), and alerting on error rate thresholds.
The teams that build observability in from the start spend dramatically less time debugging production incidents. The teams that treat it as something to add later find themselves flying blind at the worst possible moment.
10. Graceful Degradation
In a distributed system, dependencies fail. Third-party services go down. Databases become temporarily unavailable. Internal microservices return unexpected errors.
A well-designed API handles these failures gracefully. When a non-critical dependency fails, the API returns a partial response rather than a complete failure. When a cache is unavailable, the API falls back to the database with a performance warning rather than returning an error. When a downstream service is degraded, the API returns cached data with a staleness indicator rather than a 500.
The pattern to implement is the circuit breaker: monitor failure rates on dependencies, and when they exceed a threshold, stop sending requests to the failing service temporarily and return a cached or degraded response instead. This prevents one failing service from cascading into a complete system outage.
Graceful degradation is the difference between an incident that users notice and an incident that your monitoring catches before users do.
The Pattern Behind Every Item on This List
Every item on this checklist follows the same logic: the cost of implementing it correctly from the start is small, and the cost of not implementing it is paid repeatedly and unpredictably over the lifetime of the API.
The APIs we have inherited that had none of these things always came with the same story: “We built it fast and planned to fix it later.”
Later never comes. Instead, the team inheriting the API spends six months firefighting rather than building new features. The product stagnates. The technical debt compounds. Eventually someone makes the case for a full rewrite — at ten times the cost of building it correctly the first time.
“Fixing a bad API costs 5× more than building a good one. We have seen this enough times to know it is not an exaggeration.”
How Onclick Innovations Builds APIs
Every API we build at Onclick Innovations ships with all ten of these properties as a baseline. Not as extras. Not as a premium tier. As the standard.
Versioning is designed into the routing from the first commit. Error responses follow a consistent schema defined at project kickoff. Rate limiting is configured before the first endpoint goes to production. Authentication uses established protocols, not custom implementations. Documentation is generated automatically from the OpenAPI spec and kept in sync with the codebase.
We have built APIs for fintech platforms handling millions of transactions, healthcare systems managing sensitive patient data, e-commerce platforms processing high-volume order flows, and enterprise SaaS products serving thousands of concurrent users across multiple regions.
The pattern is consistent across all of them: APIs built with these ten properties require dramatically less maintenance, generate fewer support escalations, and support faster feature development than APIs that treat these properties as optional.
📩 Get in touch → www.onclickinnovations.com
📍 Based in Mohali, India · Serving clients globally across 10+ countries
Frequently Asked Questions
What is API versioning and why does it matter?
API versioning is the practice of including a version identifier in your API’s URL structure (e.g. /api/v1/) so that breaking changes can be introduced in a new version without disrupting existing client integrations. It matters because APIs, once consumed by external clients, become contracts. Without versioning, any breaking change breaks every client simultaneously.
What is an idempotency key in API design?
An idempotency key is a unique identifier sent by a client with a mutating API request. If the same request is submitted multiple times with the same idempotency key, the server returns the result of the first successful request rather than performing the operation again. This prevents duplicate records, double charges and duplicate notifications caused by network timeouts and retry logic.
What is the difference between offset and cursor-based pagination?
Offset pagination uses a page number and page size to determine which records to return (e.g. skip 40, take 20). Cursor-based pagination uses a pointer to the last record seen to determine the next page. Cursor-based pagination performs consistently at scale and handles records being added or deleted between pages correctly, making it the preferred approach for production APIs with large datasets.
What authentication method should my API use?
The right authentication method depends on your use case. Use JWT for stateless authentication in single-service or microservices architectures. Use OAuth 2.0 when users need to grant your API access to resources in a third-party system. Use API keys for server-to-server communication. Never implement custom cryptographic authentication — use established libraries and protocols.
How does Onclick Innovations approach API design?
We build all ten of these properties into every API from day one as a baseline standard. We use OpenAPI specifications to keep documentation in sync with the codebase automatically, implement cursor-based pagination on all list endpoints, and use established authentication protocols across all integrations. Contact us at onclickinnovations.com to discuss your API requirements.
