A comprehensive enterprise API design guide for engineering teams across the UK, US, Canada, Europe, and Australia — covering protocol selection, security, versioning, documentation, and cost.
TL;DR
Representational State Transfer (REST) is an architectural style, not a protocol. Defined by Roy Fielding in 2000, it describes a set of constraints for building networked applications over HTTP. REST remains by far the most widely used API style in 2026 — powering everything from UK government open data APIs to Australian fintech integrations and US SaaS platforms.
URLs represent resources (nouns), not actions (verbs). HTTP methods define the action.
GET /users — list all usersGET /users/123 — get user 123POST /users — create a new userPUT /users/123 — replace user 123 entirelyPATCH /users/123 — partially update user 123DELETE /users/123 — delete user 123Never return unbounded collections. Implement pagination from day one.
GET /orders?cursor=eyJpZCI6MX0&limit=20 — best for real-time data and large datasetsGET /orders?page=2&per_page=20 — simpler, fine for static datasets under 10k recordsGET /orders?status=pending&created_after=2026-01-01GET /orders?sort=-created_at,amount (prefix - for descending)total_count, next_cursor, has_moreGraphQL is a query language for APIs developed by Facebook (now Meta) and open-sourced in 2015. Unlike REST's multiple endpoints, GraphQL exposes a single endpoint where the client specifies exactly what data it needs — no more, no less.
Key GraphQL Concepts
The N+1 Problem — GraphQL's Main Pitfall
When a GraphQL query fetches a list of N entities and then resolves a related field for each one, it can trigger N+1 database queries (one for the list, one per item). This is the most common performance issue in GraphQL implementations. The solution is the DataLoader pattern — batching and caching database calls across all resolvers in a single request cycle. Always implement DataLoader before going to production with GraphQL.
gRPC (Google Remote Procedure Call) is a high-performance, open-source RPC framework that uses Protocol Buffers for serialisation and HTTP/2 for transport. It's the backbone of internal service-to-service communication at Google, Netflix, and many large-scale platform teams in the US, UK, and Europe.
| Dimension | REST | GraphQL | gRPC |
|---|---|---|---|
| Learning curve | Low — familiar to all developers | Medium — requires understanding schema, resolvers, DataLoader | Medium-High — Protocol Buffers and HTTP/2 concepts required |
| Browser support | Native — standard HTTP/1.1 | Native — HTTP POST to single endpoint | Limited — requires gRPC-Web proxy for browser clients |
| Performance | Good — JSON over HTTP/1.1 | Good — can reduce round trips but queries can be heavy | Excellent — binary Protocol Buffers, HTTP/2 multiplexing, up to 7x smaller payload |
| Real-time support | Via WebSockets or SSE (separate concern) | Native subscriptions via WebSocket | Native bidirectional streaming via HTTP/2 |
| Type safety | Optional — OpenAPI schema provides types | Strong — schema is the contract, code generation available | Strict — Protocol Buffer definitions are the single source of truth |
| Caching | Excellent — HTTP caching works out of the box with GET | Harder — queries are POST, requires persisted queries or CDN config | Limited — not HTTP-cache friendly |
| Tooling ecosystem | Mature — Postman, Insomnia, Swagger UI, thousands of libraries | Good and growing — GraphiQL, Apollo Studio, Hasura | Good within ecosystem — gRPC UI, BloomRPC, Buf CLI |
| Best use case | Public APIs, CRUD services, mobile/browser clients | Complex data graphs, multiple client types, BFF (Backend for Frontend) | Internal microservice communication, high-throughput services, streaming |
OAuth 2.0 is the industry standard for delegated authorisation, used by every major platform from UK government APIs to US enterprise SaaS. Use the Authorization Code Flow with PKCE for user-facing applications and the Client Credentials Flow for machine-to-machine API access. JWT (JSON Web Tokens) are the standard format for access tokens — encode the user's identity and permissions, sign with RS256 or ES256, and keep lifetimes short (15 minutes for access tokens, 7 days for refresh tokens).
Implement rate limiting at the API gateway level to protect against abuse, denial-of-service, and credential stuffing. Common strategies include fixed window (e.g., 1,000 requests per hour per client), sliding window, and token bucket. Return 429 Too Many Requests with a Retry-After header. Expose rate limit headers: X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset. This is a GDPR-relevant consideration for APIs operating in the UK and Europe — logging who hit rate limits can be personal data.
Validate every input on the server side, regardless of client-side validation. Use schema validation libraries (Pydantic for Python, Zod for TypeScript, Jakarta Bean Validation for Java). Parameterise all database queries to prevent SQL injection. For GraphQL, implement query depth limits and query complexity scoring to prevent resource exhaustion attacks from deeply nested queries.
API versioning is one of the most consequential decisions you'll make — getting it wrong breaks your clients. The three main strategies:
| Strategy | Example | Pros / Cons |
|---|---|---|
| URL path versioning | /api/v1/users |
Most common, explicit, easy to route and document. Recommended for public APIs. |
| Header versioning | API-Version: 2026-01-01 |
Clean URLs, date-based. Used by Stripe and GitHub. Harder to test in a browser. |
| Query param versioning | /users?version=2 |
Least recommended — pollutes URLs, breaks caching. |
Deprecation Policy Best Practice: For public APIs serving clients in the UK, US, Canada, Australia and Europe, provide a minimum 12-month deprecation window. Announce deprecations in API response headers (Deprecation: true, Sunset: Sat, 31 Dec 2027 00:00:00 GMT), via email to registered developers, and in your changelog. Never silently remove endpoints.
Good API documentation is not optional — it's a product. Undocumented APIs have higher support burden, slower adoption, and more integration bugs.
The OpenAPI Specification (OAS) is the de-facto standard for describing REST APIs. Write your API spec in YAML or JSON, and tools like Swagger UI, Redoc, or Scalar automatically generate interactive documentation. Benefits: automatic client SDK generation in 40+ languages, validation tooling, contract testing. Define your OAS spec first (design-first) before writing any code — this forces cleaner API design and enables parallel frontend/backend development.
Publish Postman collections alongside your OpenAPI spec. A developer portal (built on tools like Mintlify, ReadMe, or Stoplight) with live API explorers, authentication guides, and code examples in multiple languages dramatically reduces integration time for clients in the US, Canada, Australia and Europe. Treat your API docs as a first-class product — assign ownership, keep them current, and include real request/response examples.
Webhooks are the event-driven counterpart to REST APIs — instead of clients polling for changes, your server pushes notifications to client-provided URLs when events occur. Used by Stripe, GitHub, Shopify, and virtually every major SaaS platform.
Simple REST API (CRUD + Auth): £15,000–£30,000
A well-designed REST API with authentication, rate limiting, documentation, and a basic developer portal. Timeline: 8–14 weeks. Suitable for internal tools, simple integrations, and SaaS MVP backends for UK or Canadian startups.
Enterprise API Platform (REST + GraphQL + Webhooks): £35,000–£60,000
Includes an API gateway, multiple API protocols, comprehensive documentation portal, webhook system with retry logic, analytics, and developer onboarding flows. Timeline: 16–24 weeks. Appropriate for high-growth SaaS platforms serving enterprise clients across US, UK, Europe, and Australia.
REST uses multiple fixed endpoints where the server determines the data shape. GraphQL uses a single endpoint where the client specifies exactly what data it needs. REST is simpler to cache and more familiar; GraphQL eliminates over-fetching and under-fetching and is better for complex, interconnected data needs with multiple client types.
Use GraphQL when you have multiple client types (web, iOS, Android) with different data needs; your data is highly interconnected; you're experiencing over-fetching or under-fetching; or you want a flexible API that can evolve without versioning. REST remains the better default for simple CRUD APIs or when HTTP caching is critical.
gRPC is a high-performance RPC framework using Protocol Buffers and HTTP/2. It's better than REST for internal service-to-service communication where performance is critical, for real-time bidirectional streaming, and in polyglot environments where strict schema contracts via Protocol Buffers are valuable. It's generally not suitable for public browser-facing APIs without a gRPC-Web proxy layer.
Use URL path versioning (/v1/, /v2/) with a minimum 12-month deprecation window. Announce deprecations via Deprecation and Sunset response headers, email, and your changelog. For GraphQL, use schema evolution — add fields freely, never remove existing ones. Maintain at least two concurrent versions. Communicate all breaking changes to registered developers well in advance.
Layer your defences: (1) OAuth 2.0 with short-lived JWT tokens for authentication; (2) rate limiting per client at the API gateway; (3) input validation and sanitisation to prevent injection attacks; (4) HTTPS/TLS everywhere; (5) minimal scopes enforcing least-privilege access; (6) full audit logging of all API calls; (7) API gateway for centralised policy enforcement. For GDPR compliance in the UK and Europe, ensure audit logs treat API call metadata as personal data where applicable.
SpiderHunts Technologies builds custom AI and software solutions for businesses across the UK, US, Canada, Europe, and Australia. Tell us what you need and we'll come back with a proposal within 24 hours.
Get Your Free Consultation