API Design Principles

Master REST and GraphQL API design principles to build intuitive, scalable, and maintainable…

A design-standards reference for building REST and GraphQL APIs that developers love to consume and teams can maintain for years. It grounds every choice in contract-first design, idempotency, least astonishment, and layered defense: covering resource modeling, pagination, error formats, versioning, and the N+1 problem with worked examples in both paradigms.

$15 one-time
Add to a kit →

Prices include 20% VAT. · Forged on real agency work · one-time, no lock-in

  • Type Skill
  • Category Development
  • Delivery Email · instant
  • License One-time
Run preview
forgehouse, api-design-principles

Inside the run · no black box

See the actual work before you buy it.

The contract comes before the code. An OpenAPI spec or GraphQL schema gets locked first, and every endpoint is then held to the same shapes and semantics:

  1. Contract first: the OpenAPI 3.1 spec (or GraphQL schema) is written before code. Request and response shapes, status codes and the error format are locked, so frontend and backend teams build against the same contract in parallel.
  2. Models resources as nouns with HTTP verbs doing the work: GET/POST /api/users, nested /users/{id}/orders. Action-verb endpoints like /createUser or /getUserById are rejected at review.
  3. Standardizes the repeating contracts: one pagination pattern (page and page_size with totals, or Relay-style cursors in GraphQL), one error envelope with error, message and details, and consistent status code semantics across every endpoint.
  4. Adds idempotency keys to mutations following the Stripe model and picks a versioning strategy up front; a breaking change means a major version with a minimum 90-day sunset notice.
  5. On the GraphQL side works schema-first: typed connections for pagination, mutation payloads that carry structured errors, and every relationship resolver routed through a DataLoader to kill N+1 queries.
  6. Closes with the defense-in-depth review: auth middleware, per-IP rate limiting, field-level input validation and output encoding checked as four independent layers that fail separately.
Use cases · what happens when you plug it in

One power source. 6 lines out.

api-design-principles · core

core active · 6 lines

  1. Designing a new REST or GraphQL API before any code is written

    ✓ designing a new rest or
  2. Establishing API design standards and conventions for a team

    ✓ establishing api design
  3. Reviewing an API specification before implementation begins

    ✓ reviewing an api specifi…
  4. Choosing and implementing an API versioning strategy

    ✓ choosing and implementing
  5. Designing cursor-based pagination and consistent error responses

    ✓ designing cursor-based p…
  6. Preventing the N+1 problem in GraphQL resolvers with DataLoaders

    ✓ preventing the n+1 problem
Benefits · what you walk away with

Yours to keep.

Drag time forward. Watch what stays.

Forever

That's what owning means.

The rented stack

ai writing tool: subscription

expired · access lost

analytics suite: subscription

expired · access lost

design platform: subscription

expired · access lost

(nothing left)

Your forge

  1. APIs that feel intuitive, cutting integration friction and support tickets

    license: perpetual
  2. Fewer breaking changes thanks to contract-first specs and versioning discipline

    license: perpetual
  3. Consistent error and pagination contracts across every endpoint

    license: perpetual
  4. Reliable mutations via idempotency keys on critical operations

    license: perpetual

subscriptions expire · deeds don't

What's included · the full manifest

Everything in the box.

Pick a piece up. Watch it work.

REST resource-collection design with correct HTTP method semantics

part 01 of 06 · in the box

6 parts · one working system · ships instantly by email

Who it's for

This wasn't forged for everyone.

  • Not for you if you'd rather rent a tool than own one.
  • Not for you if you want someone else to run your stack.
  • Not for you if you're happy guessing.
Still here? Good.

API designers, backend leads, and architects setting the standards that other developers will build against.

then this was forged for you.

Works with

Universal by design: these run in any AI. Delivered in the open Agent Skills + MCP format (native in Claude); ChatGPT, Gemini, Cursor and Copilot adapt the same files their own way.

  • Claude Native format
  • ChatGPT Adapts via open standards
  • Gemini Adapts via open standards
  • Cursor Adapts via open standards
  • Copilot Adapts via open standards
Questions · still in the air

Catch what's on your mind.

the air is clear. nothing between you and the forge.
catch a spark: the forge will answer

  1. We're split between REST and GraphQL, does this only help one of them?

    It covers both paradigms and the choices each forces: resource modeling, pagination, error formats, versioning. The shared principles (contract-first design, idempotency, least astonishment) apply whichever you pick.

  2. Is this just one team's opinion on naming, or decisions I can defend?

    Every convention is tied back to a reason: least astonishment for consumers, layered defense for safety, idempotency for retries. You're not adopting taste, you're adopting trade-offs you can explain in a review.

  3. Does it produce my OpenAPI spec or schema?

    No, it's a design-time reference for making the decisions before code, not a generator. It tells you what a good contract looks like; writing and serving that contract stays on your side.

  4. How is it delivered?

    By email right after purchase: ready to run, downloaded instantly, no setup wait.

  5. One-time or subscription?

    A one-time purchase; no subscription or hidden fees. VAT (20%) is included.

  6. Can I get a refund?

    As a digital product, it can’t be refunded once downloaded. That’s why we show exactly what’s inside and who it’s for, right here.