# Routebase > Design, mock, test, and document APIs from one living spec. A full test runner is built in, with suites, ten auth schemes, and a CLI for CI. No OpenAPI needed. ## The API lifecycle in one platform - **API Design** — Design the contract first: Design OpenAPI specs in a visual editor with endpoints, schemas, and versions, so nobody hand-edits YAML. ([details](https://routebase.dev/api-design.md)) - **API Mocking** — Start frontend work on day one: Spin up realistic mocks straight from the spec. Frontend and backend build in parallel, not in sequence. ([details](https://routebase.dev/api-mocking.md)) - **API Testing** — Prove reality against the spec: Run requests and automated suites against any environment. The spec defines what passing means. ([details](https://routebase.dev/api-testing.md)) - **API Documentation** — Publish docs that never drift: A published docs portal is generated from the spec, so when you change the contract, the docs already know. ([details](https://routebase.dev/api-documentation.md)) - **API Monitoring** — Watch production against the contract: Monitors check live responses against the published version on a schedule, so a field that drifts shows up as a diff before a consumer sees it. ([details](https://routebase.dev/api-monitoring.md)) - **MCP Server** — Let your agent design, test and publish: Every workspace ships an MCP server. Agents discover, call, and test your APIs under your team's permissions. ([details](https://routebase.dev/mcp-server.md)) ## Why Routebase ### Your APIs become agent tools Routebase ships an MCP server out of the box, so agents design, lint, and test through the same interface your team uses without any glue code. - The full feature set, exposed as MCP tools - Agents create endpoints, run test suites, and lint specs - Lint the spec against your style guide, straight from the agent ### Catch drift before your consumers do Scheduled monitors validate live responses against your spec and flag every divergence, from missing fields and type mismatches to undocumented additions. - Live responses validated against the spec, continuously - Breaking changes flagged with field-level diffs - Every divergence classified, from missing fields to type mismatches ### Branch, review, and merge your specs Draft on a spec branch, open a merge request, ship what survives review. Breaking-change checks built in. - Spec branches isolate work in progress - Merge requests with review and approval flow - Conflict and breaking-change detection before merge ## Frequently asked questions ### What is Routebase? Routebase is an API design, testing, and documentation platform built on one living OpenAPI spec. You design the contract in a visual editor, and the mock server, the test suites, and the published docs derive from that same spec, so they stay in sync when the API changes. A built-in MCP server lets agents work the same spec under your team's permissions. ### Do I still need Routebase if I use AI coding agents? Yes, because an agent makes it cheap to change an API, so the docs, mocks, and tests drift apart faster than anyone can check by hand. A generated test or doc page reads plausibly, but it doesn't tell you whether it still matches the API that's live. Routebase keeps one living spec as the single source of truth, and a contract test turns red when your live API stops matching it. Your agents run those tests themselves through the built-in MCP server, so they see what failed and fix it before anyone reviews the change. Because every docs portal also serves llms.txt and Markdown, the agents that call your API read the same contract as your team. ### How does the 14-day Pro trial work? Every new account starts on a full Pro trial — all features unlocked for 14 days. No credit card and no plan selection; the trial starts the moment you sign up. ### What happens when the trial ends? Your workspace automatically moves to the Free plan. Nothing is deleted — projects, specs, and history are retained, and you can upgrade any time to pick up where you left off. ### Do I need a credit card to get started? No. You only enter payment details when you choose a paid plan. ### Where is my data stored? You choose EU or US data residency when you sign up, and your workspace stays in that region. Both regions run on Microsoft Azure. [How data residency works](https://routebase.dev/data-residency/) ### What if I don't have an OpenAPI spec? You don't need one to start. Create an empty specification and add endpoints in the visual editor, or begin from a CRUD or auth template — Routebase writes the OpenAPI for you as you go. Testing needs no spec at all: a test case is a plain HTTP request, and linking it to an endpoint is optional. Most APIs arrive here undocumented; the spec is what you leave with, not what you bring. ### Can I import my existing APIs? Yes — import OpenAPI specs directly, or bring collections from Postman or Insomnia; example request bodies become schemas on the way in. No file at all? Start from an empty spec or a template. From there, your spec is the single source of truth. ### Can Routebase replace Postman for API testing? Yes. A test case is a plain HTTP request with the auth scheme the endpoint needs — ten schemes, from Bearer and API key to OAuth2 and AWS SigV4. Assertions are declarative: six types (status, body, header, JSON path, latency, schema) with ten operators, so there are no test scripts to maintain when the team changes. Chain cases into scenarios that pass extracted values downstream, run a suite once per row of a data set, put it on a cron schedule, or gate CI with the CLI and GitHub Action. OWASP API Top 10 scanning ships alongside, with a CI gate of its own. A Postman or Insomnia collection imports as a specification, and one click generates a test case per endpoint from it. None of it requires an OpenAPI spec to begin with. ### How do AI agents connect to Routebase? Every workspace exposes a built-in MCP server. Agents like Claude or Cursor discover your APIs as tools and can design, lint, and test specs — under the same permissions as your team. ### Is Enterprise really self-service? Yes. Enterprise starts at 25 seats and you subscribe directly in the app — SAML SSO, SCIM, and audit log export included. No sales call required. ### Can I buy Routebase through Microsoft Marketplace? Yes. Starter, Pro, and Enterprise are listed on Microsoft Marketplace at the same USD list prices, billed by Microsoft on your existing account and shown in your local currency. Starter and Pro include the 14-day free trial there too; the Free plan is available directly on routebase.dev. [How buying through Microsoft works](https://routebase.dev/microsoft-marketplace/) ### Can I cancel anytime? Yes, in one click. Your plan stays active until the end of the billing period, then the workspace downgrades to Free with all data retained. --- # API design that starts with the contract — Routebase > Routebase is an API design tool with a visual OpenAPI editor for the whole contract, so endpoints, schemas, and versions get the workflow of code. Canonical page: https://routebase.dev/api-design/ API design usually starts in a YAML file that only one person on the team can read, so reviews happen late and the contract drifts before anyone builds against it. Routebase turns API design into visual work in an OpenAPI editor, so the whole team can shape endpoints, parameters, and schemas without touching the syntax. Every change stays real OpenAPI 3.0, 3.1 or 3.2 underneath, which means you can import the spec you already have and export it again at any time. Spec branches and merge requests give the contract the same review flow as code, while built-in lint rules and breaking-change checks keep every version on your style guide. Because the published spec also drives your mocks, tests, and docs, good API design pays off across the whole lifecycle. ## API design without the YAML Endpoints, parameters, and responses in a structured editor — the spec stays valid OpenAPI underneath. - Three-panel editor: tree, form, live preview - Path, query, header, and cookie parameters - Undo/redo, keyboard shortcuts, auto-save ## Model schemas once, reuse everywhere Nested objects, arrays, enums, and references — with examples generated as you type. - Visual JSON Schema builder with validation rules - Reusable components via $ref - Auto-generated examples per schema ## Branch, review, merge Draft on a spec branch, open a merge request, ship what survives review. - Spec branches isolate work in progress - Merge requests with review and approval flow - Conflict and breaking-change detection before merge ## Governance built in Lint rules keep every spec on your style guide while you design, breaking-change checks classify every version, and blocking a publish is a switch you turn on. - Built-in style guide rules, with one-click fixes on some of them - 21 breaking-change rules across versions - Tag-based endpoint grouping with descriptions ## OpenAPI in, OpenAPI out Import existing specs, export anytime. No lock-in — the spec is yours. - OpenAPI 3.0, 3.1 and 3.2, YAML or JSON - Validation against the spec schema on import - Tag grouping preserved on export ## Frequently asked questions ### Is Routebase an OpenAPI editor? Yes. Routebase is a visual OpenAPI editor for API design. You model endpoints, parameters, responses, and JSON Schema components in a three-panel editor with a live preview, and the document underneath stays valid OpenAPI 3.0, 3.1 or 3.2 at every step. ### Can I import an existing OpenAPI spec? Yes. Import OpenAPI 3.0, 3.1 or 3.2 in YAML or JSON, and Routebase validates it against the spec schema on the way in. Export works at any time in the same formats, with tag grouping preserved, so there is no lock-in. ### How do teams review API design changes? Every change happens on a spec branch. You open a merge request, reviewers approve it, and conflict and breaking-change detection run before the merge, so the published contract only moves through review. ### Does Routebase enforce an API style guide? Yes. Built-in lint rules keep every spec on your style guide while you design, breaking-change rules classify every version, and custom rules extend the set for conventions of your own. Blocking a publish on error-level findings is a switch you turn on when the team is ready. --- # API mocking that starts frontend work on day one — Routebase > Routebase generates realistic mock APIs from the spec on a stable URL, so API mocking starts before the backend exists. Canonical page: https://routebase.dev/api-mocking/ API mocking is the step most teams skip, because keeping a hand-written mock in sync with a changing backend costs more than it saves. Routebase generates the mock server from your OpenAPI spec instead, so the frontend gets a stable mock URL on day one. Rules generated from a draft follow it as you edit, and rules pinned to a published version flag every change in the spec for review. The responses use realistic synthetic data rather than placeholder strings, and stateful rules carry what one request wrote into the next one until you reset them. You can also rehearse the bad days with latency, error, and timeout simulation, while proxy mode forwards the routes you have not mocked to the real API. Because the same spec runs your tests and docs, an API mock in Routebase is never a second copy of the contract that someone has to maintain. ## API mocking straight from the spec Generating from a specification creates one rule per endpoint, and each rule answers with the success response the spec documents, filled with generated data. Every project gets one mock server on its own address under routebasemock.dev, with CORS and preflight requests handled for the browser. Generating again skips the rules that already exist. - One rule per endpoint, editable rule by rule - Static, dynamic, fixture and Smart Mock response bodies - An optional access token for the mock URL ## Data that looks real Placeholders fill a response with realistic values in English, German, French or Spanish, and a response can echo what the request sent. A stateful rule stores what one call wrote, so the next call returns it until you reset the state. - {{faker.*}} placeholders for names, emails, addresses and more - Request values like {{request.body.name}} - State kept per rule until you reset it - Fixtures as response bodies, with pipes like where, pluck and random ## Rehearse the bad days Each rule can add a fixed delay plus a random extra, fail at a probability you set, or enforce a rate limit. A failure is a 500, 502, 503 or 504, a timeout that holds the connection for 30 seconds, or a reset connection. Over the limit, the mock answers 429 with Retry-After and rate limit headers, which is exactly what your client has to handle. - Fixed delay plus a random extra per rule - 500, 502, 503, 504, timeouts and connection resets at a set probability - Limits per second, minute or hour, answered with 429 and Retry-After ## Proxy what you don't mock On Starter and above, proxy mode forwards every request that matches no rule to the real API, so you mock the new endpoint and let the rest pass through. Rules match on method, path, query and headers, and the highest priority wins when several match. The live request log shows each call the mock received and keeps it for 30 days. - Proxy mode for unmatched requests, on Starter and above - Matching on method, path, query and headers, highest priority first - Live request log, kept for 30 days ## Frequently asked questions ### How does API mocking work in Routebase? Routebase generates mock rules from the endpoints in your OpenAPI spec and serves them on one address per project. Rules generated from a draft follow it as you edit, and rules pinned to a published version flag a changed spec so you can review and sync them. Nobody maintains a hand-written mock server on the side. ### Can I mock an API before the backend exists? Yes, that is the point. The frontend builds against the mock URL from day one, with realistic synthetic data in every response, and switches to the real API when it ships. ### Can the mock simulate errors and slow responses? Yes. A fixed delay plus a random extra, failures as 500, 502, 503 or 504, timeouts, connection resets and per-rule rate limits let you rehearse the failures your frontend must survive before they happen in production. ### What happens to endpoints I have not mocked? On Starter and above, proxy mode forwards any request that matches no rule to the real API, so a partly mocked API still answers every route. The live request log shows every call the mock received. --- # API testing that proves reality against the spec — Routebase > Routebase builds API testing on your OpenAPI contract, so test suites, security scans, and CI automation all enforce the same spec. Canonical page: https://routebase.dev/api-testing/ API testing breaks down when the tests live in scripts that nobody updates, so they keep passing while the API quietly changes underneath them. Routebase treats your OpenAPI spec as the contract to enforce, so API tests are declarative suites of chained requests with assertions on status, headers, body, JSON paths, latency, and schema. The same suite runs against staging and production with ten auth schemes resolved per environment, and fixtures, seeds, and snapshots put the API in a known state before every run. Security is part of API testing as well, with OWASP API Top 10 scans and multi-identity personas beside the functional suites. From there, the CLI, cron schedules, and signed webhooks run the suites where your pipeline already lives. ## API test suites that assert everything Suites of chained requests — assert on status, JSON paths, headers, body, latency, and schema with 10 operators. - 6 assertion types with 10 operators, drag-and-drop suites - Chained requests: extract values, reuse them downstream - Pre-request and post-response JavaScript ## Auth like production Ten auth schemes resolved per environment — run the same suite against staging and prod. - OAuth2, Bearer, API Key, JWT, AWS SigV4, and more - Environment variables in requests and assertions ## Test data, managed Fixtures, seeds, and snapshots put the API in a known state before every run. - Fixtures with per-suite scope control - Pre/post-run seeds with loops and captures - Logical snapshots restore known state ## Security is a test, too OWASP API Top 10 scanning with multi-identity personas, finding triage, and a security score. - 13 scanners: BOLA, broken auth, SSRF, fuzzing, and more - Personas for multi-identity access testing - Triage workflow with audit trail and score dashboard ## API testing in your pipeline CLI for CI, API triggers, schedules, and signed webhooks — testing that fits your pipeline. - CLI runner with CI exit codes - Cron schedules and API-key triggers - HMAC-signed webhooks on completion ## Frequently asked questions ### Do I need an OpenAPI spec for API testing in Routebase? No. A test case is a plain HTTP request with assertions, and linking it to an endpoint is optional. If you do have a spec, schema assertions check every response against the contract. ### Which assertions and auth schemes are supported? Assertions cover status, headers, body, JSON paths, latency, and schema with ten operators, and requests chain by extracting values for later steps. Auth resolves per environment across ten schemes, from Bearer and API key to OAuth2, JWT, and AWS SigV4. ### Can I run API tests in CI? Yes. The CLI and the GitHub Action run suites with CI exit codes and JUnit or SARIF output, cron schedules run them unattended, API-key triggers start them from your own pipeline, and HMAC-signed webhooks report completion. ### Does API testing include security scanning? Yes. OWASP API Top 10 scans run beside the functional suites, with personas for multi-identity access testing, a triage workflow with an audit trail, and a security score. --- # API documentation that never drifts — Routebase > Routebase generates your API documentation from the spec as a branded, searchable docs portal that humans and agents can read. Canonical page: https://routebase.dev/api-documentation/ API documentation goes stale the moment the contract changes, because the docs are usually a copy that someone has to remember to update. Routebase generates the API docs from a published version of your OpenAPI spec, so the reference pages, the code examples and the try-it console describe exactly that contract. A newer version shows up as an update you review and publish, never as a silent change. The portal carries your name rather than your vendor's, with your branding and a custom domain that gets its SSL certificate automatically. Readers search across the portal and try requests with their own credentials, and agents read the same content through the llms.txt every published docs site serves. Because the spec also drives your mocks and tests, the API documentation is one output of the contract instead of a second thing to maintain. ## API documentation as a portal, not a PDF A portal build turns a published documentation version into a static site served through Azure Front Door. The API reference comes from a snapshot of a published spec version, so a newer spec shows an update banner in the editor instead of changing live docs. The site carries your branding, and on Pro it runs on your own domain. - Nine themes, your logo, colors and fonts, plus custom CSS - A subdomain under docs.routebase.dev, or your own domain with a managed SSL certificate on Pro - Sitemap with lastmod, canonical tags and structured data on every page ## Readers can try it Every endpoint page carries a try-it console that sends the request straight from the reader's browser. It offers the environments you choose to publish, falls back to the servers in the spec, and prefills authentication from the security scheme. Code examples sit next to it in nine languages, and you choose which ones appear. - Bearer, Basic and API key authentication, in a header, query or cookie - Code examples in cURL, HTTPie, JavaScript, Python, C#, Go, Java, Ruby and PHP ## Findable and structured Search runs in the browser over an index built with the portal, and it opens from the keyboard with Cmd+K or Ctrl+K. Pages use components for the structures documentation keeps repeating, and a snippet written once is resolved into every page at build time. - Client-side search with keyboard navigation - Callouts, tabs, steps, accordions, code groups, cards and Mermaid diagrams - Snippets that nest and take arguments ## Ready for AI agents Every published portal answers AI agents in the format they read best, so an agent that asks for Markdown gets the Markdown version of the page at the same URL. Each build also emits an llms.txt index, an llms-full.txt export and a Markdown twin of every page, and a build that is missing them fails. An Agent Readiness check scores the published portal against the open Agent-Friendly Docs Spec and shows which open checks your content decides and which ones Routebase already handles. - Markdown at the same URL for any agent that asks for it - llms.txt, llms-full.txt and a Markdown twin of every page - An Agent Readiness score per portal, on every plan - Copy as Markdown, Open in ChatGPT and Open in Claude on every page - Portal pages as an MCP resource for your team's agents ## Learn from your readers Readers rate a page with a thumbs up or down and can add a comment, and their IP address is stored only as a hash. Analytics counts page views and visitors, records what people searched for, and lists the searches that found nothing as content gaps. - Page feedback with an optional comment, rate-limited per reader - Top pages, top search terms and zero-result searches ## Frequently asked questions ### How is the API documentation generated? The API reference is generated from a published version of your OpenAPI spec, so every endpoint, parameter and response field appears with its type and description. When the spec moves on, the editor shows an update banner, and the docs change once you take the update and publish a new documentation version. ### Can I host the API docs on my own domain? Yes, on the Pro plan and above. Connect a custom domain and Routebase provisions the SSL certificate, and the portal carries your logo, colors and fonts rather than a vendor's branding. Every portal also gets a subdomain under docs.routebase.dev. ### Can readers try requests from the docs? Yes. Every endpoint page has a try-it console that sends the request from the reader's browser with Bearer, Basic or API key authentication. Code examples sit next to it in cURL, HTTPie, JavaScript, Python, C#, Go, Java, Ruby and PHP. ### Can AI agents read the documentation? Yes. Every published portal serves an llms.txt index, an llms-full.txt export and a Markdown version of every page, and an agent that asks for Markdown receives it at the same URL as the HTML page. An Agent Readiness check in the portal settings scores the portal against the open Agent-Friendly Docs Spec and points to anything your content still needs. Your own team's agents also reach the pages through the Routebase MCP server. --- # An MCP server that lets your agent design, test and publish your API — Routebase > Your workspace ships a built-in MCP server. Describe the API you want, and your agent designs the spec, writes the tests, and runs them under your team's permissions. Canonical page: https://routebase.dev/mcp-server/ Most agent integrations stop at reading the API, because the agent gets a description and nothing it is allowed to change. Routebase ships a built-in MCP server in every workspace, so an agent like Claude or Cursor works the same OpenAPI spec as your team. Describe the API you want, and the agent designs the spec, writes the test suites, and runs them, all under the permissions your team already has. The MCP server covers the full feature set of the product, from design and mocking to testing and docs, and prompts and resources package whole workflows so a session stays lean. Because everything lands in your workspace rather than in a chat transcript, the result is reviewable, versioned, and ready to publish. ## Describe the API. Get the spec — and the tests. Two shipped prompts carry the whole job: design_api builds the contract, generate_tests turns it into a suite that runs. - design_api walks it call by call: create_spec, create_schema, create_endpoint, add_response, validate_spec - Your organization's style guide is loaded as context first, so the draft arrives already linted - generate_tests covers happy path, 400, 401, 403, 404, response schema, latency, and edge cases - run_test_suite executes the suite and reports which assertion failed, on which case - The agent works on a draft version — nothing reaches consumers until someone publishes ## What comes back is your workspace, not a transcript No wall of YAML to paste. Every call creates a real object in Routebase — one your team can open, diff, and review. - Endpoints, schemas, and folders land in the visual editor - Agent work can run on a spec branch and arrive as a merge request - validate_spec has a dry-run mode: same errors and counts, nothing written - publish_version is the one step that freezes an immutable OpenAPI snapshot ## The rest of the lifecycle, same session Design is where it starts. Mocks, monitors, security triage, and docs run over the same connection, so the full feature set is one tool surface. - generate_rules_from_spec turns the new endpoints into a running mock - generate_monitors_from_spec puts the same contract under monitoring - Testing covers suites, scenarios, runs, results, and schedules - Monitoring, Security, and Mock Server are fully agent-reachable, enforced by a CI coverage ratchet ## Context and whole workflows, prepackaged Beyond tools: 12 read-only resources hand agents context without spending a call, and 13 prompts package multi-step work into one invocation. - Resources: spec as OpenAPI YAML, changelog, validation report, test summary, style guide - Design prompts: design_api, review_spec, fix_violations, generate_schema - Operations prompts: analyze_test_failures, triage_security_findings, triage_incidents, run_deprecation - Structured logs and usage metrics per session ## A lean session by default A tool list that covers the full feature set would fill a context window before the agent does anything. A session that has not authenticated yet therefore starts with the core toolsets only. - Five core toolsets: context, navigation, projects, specs, endpoints - Only those definitions reach the context window, so the agent starts with room to work - enable_toolset adds what the task needs, mid-session - A scoped API key or an OAuth sign-in skips the staging entirely - Hidden is never disabled — a tool stays callable by name ## Agents under governance An agent is a user, not a backdoor. Every call runs through the same RBAC your team already has — once at discovery, again at execution. - Agents only see tools their permissions allow - OAuth 2.1 sign-in or a scoped API key - Billing and org access stay read-only: an agent explains a limit, it never grants a role or spends money - 200 requests per minute per user, separate from the REST API - EU or US region — the same choice as the app ## Connect the MCP server in a minute, or with nothing installed Claude adds the server as a custom connector and signs you in. Every other client is one command. - Remote connector at mcp.routebase.dev for Claude web, desktop, and mobile — OAuth, no API key, nothing on disk - Claude Code, Cursor, and VS Code talk to the hosted endpoint over streamable HTTP - npx routebase-mcp init writes the config for your IDE - stdio bridge with self-contained binaries for macOS, Windows, and Linux ## Frequently asked questions ### Do I need an API key to try this? Not with Claude. Add https://mcp.routebase.dev as a custom connector in Claude web, desktop, or mobile and sign in with your Routebase account — the agent gets exactly your permissions, and nothing is stored on disk. Claude Code, Cursor, and VS Code use an API key with the scopes you choose. ### Will the full tool list blow up my context window? No. A session that has not authenticated yet starts with the five core toolsets covering context, navigation, projects, API specs and endpoints, and the agent enables further toolsets when a task needs them. If you connect with a scoped API key or sign in with OAuth, the first tools/list already shows exactly what that credential allows, so there is no staging to work through. Hidden is never disabled either, because a tool stays callable by name before its toolset is advertised. ### Can an agent break something? It can do exactly what the person or key behind it can do, and no more: permissions are checked when tools are listed and again when one is called. Billing and organization administration are read-only over MCP, specs stay drafts until someone publishes a version, and every step is an object you can review or revert. ### What does the agent actually produce? Real objects in your workspace — spec versions, endpoints, schemas, mock rules, test suites and their runs — not a chat transcript to copy out. You review them in the editor, optionally as a merge request on a spec branch, and export the spec as OpenAPI whenever you want. ### Where does the data live? In the region your organization chose, EU or US — the MCP endpoint follows the same choice as the app. Connectors select it with a query parameter, the CLI with an environment variable. --- # API monitoring that catches drift before your consumers do — Routebase > Routebase builds API monitoring on your published OpenAPI contract, so every scheduled check validates the live response against the version your environment is pinned to. Canonical page: https://routebase.dev/api-monitoring/ API monitoring usually stops at the pulse, so every check stays green while a field quietly changes type and the first person to notice is a consumer with a broken integration. Routebase treats the published OpenAPI contract as the thing to monitor. A scheduled check therefore asks whether the endpoint answered and whether the response still matches the version that environment is pinned to. A deviation that keeps showing up becomes a drift event with a first-seen date, an observation count and a field-level diff, and it stays out of your uptime figure because nothing went down. Alert policies with cooldowns, incidents and maintenance windows carry the operational side, while monitors generated from the spec wait for a deployment instead of paging anyone. Because the same contract also drives your docs, mocks and tests, API monitoring closes the loop after the release. ## Every check validates the response against the contract A monitor linked to a documented endpoint validates each response against the version its environment is pinned to, and it falls back to the latest published version where nothing is pinned. - Missing required field, type mismatch, extra field and format mismatch, each with a severity - Warn mode records the drift and keeps the check green, Strict mode fails the check - The version checked against is recorded per check, so a re-pin never relabels history ## Drift is a record you can act on, not an incident A deviation that keeps appearing becomes a drift event with a first-seen date, an observation count and a lifecycle you acknowledge and close, and it resolves itself when a later check matches again. - Field, change, expected and received for every deviation, with not present instead of null - The failing request and the first 4 KB of the response are kept with the event - Credentials never reach that record, because secret variables are not substituted into it - A drifting endpoint still answers with a 200, so it never counts against your uptime ## Alerts that reach the right people without the noise An alert policy holds up to four rules for downtime, latency, error rate and schema drift, each with its own cooldown, and the most specific assignment wins. - Assign a policy to an environment, a specification or a single monitor - Incidents open after consecutive failures and name the policy that triggered them - Maintenance windows keep the checks running while no incident opens - Slack and Microsoft Teams as first-class targets, plus email and the in-app center ## Monitors that come from the spec and wait for the deploy A four-step wizard generates monitors from the endpoints of a specification and skips the ones already covered, and a coverage card shows which endpoints still have none. - A monitor whose endpoint has never answered waits, raises no alert and stays out of the uptime figure - Environment variables and auth apply to every check automatically, from Bearer to OAuth2 - Promote a version to an environment from your pipeline, and its monitors validate against it ## Frequently asked questions ### What is contract drift and how does API monitoring catch it? Contract drift is what happens between two deploys, when your specification still promises one shape and production has started returning another while every uptime check stays green. Every monitor check that gets a response validates it against the contract the environment is pinned to. A deviation that keeps showing up becomes a drift event with a field-level diff. ### Which spec version do the monitors validate against? A monitor validates against the version its environment is pinned to, which is the contract that environment is expected to fulfil. Where nothing is pinned, for an unpinned environment or a monitor pointed at a raw URL, validation falls back to the latest published version. The version used is recorded at check time, so a later re-pin does not relabel history. ### Does a drifting endpoint count as downtime? No. A drifting endpoint still answers with a 200, so counting it against uptime would hollow out the number you publish to your customers. Drift events have their own lighter lifecycle with acknowledge and resolve. The exception is a monitor in Strict mode, where error-severity drift fails the check itself and can open an incident. ### Can I run API monitoring from CI? Monitors run hosted on their own schedule, from every 30 seconds to once a day, so nothing in your pipeline has to stay alive for them. Your pipeline promotes a version to an environment with the CLI or the GitHub Action after a deploy, and the monitors of that environment validate against the new contract from the next check. The tests that belong in CI cover the time before the release. --- # API-first development where the contract is the first deliverable — Routebase > Routebase turns API-first development into one workflow, so you review the OpenAPI contract like code, and frontend, QA, backend and agents build against the same published version without waiting for each other. Canonical page: https://routebase.dev/api-first-development/ In many teams the API contract is written last, as an export of whatever the code ended up doing. So the frontend waits for the backend, QA tests a moving target, and the review that would have caught the awkward endpoint comes after a week of implementation. API-first development turns that order around. The contract is designed and agreed before anyone writes a handler, and from that moment every team builds against it at once. Whether you call it design-first or API-first, the order is the point, and Routebase is built around it. Here the contract is a versioned OpenAPI spec with branches and merge requests, and publishing freezes a version that nothing reopens. The mock server answers from that version on a stable URL, test suites report pending rather than red until the endpoints land, and the docs portal is generated from the same version. An agent reads that version over MCP as well, under the same permissions as the team. ## The contract comes first, in an editor built for it You design endpoints, schemas and responses in a visual OpenAPI editor, and the spec you leave with is the artifact that everything downstream reads. - Visual OpenAPI 3.x editor with reusable schemas, parameters and response components - Start from a template, an imported spec or a Postman collection, or from an empty spec - Style guide findings appear in the editor while you design, before a review is opened - Versions move from draft through review to published, so everyone knows which contract is settled ## Reviewed like code before anyone builds on it A change to the contract is a diff a reviewer can judge in minutes, so Routebase gives it branches, merge requests and a merge policy instead of a comment thread. - Spec branches from a draft version, with merge requests and at least one required reviewer - 21 breaking-change rules classify the diff, and a breaking branch needs an Admin or Owner approval - Rebase shows every conflict with both sides next to each other, before the merge rather than after - Reviewing and merging are separate permissions, so Members propose and Admins decide what lands ## API-first development means nobody waits for the backend The moment a version is published, the mock answers from it, the suites run against it, and an agent reads it over MCP, so every team starts on the same day. - Mock rules generated from the spec on a stable URL per project, following the draft while you design - Test cases imported from the spec, one per endpoint with the contract assertions filled in - Pending instead of red while an endpoint is not implemented yet, so the first real failure stands out - Monitors created before the service ships wait for deployment instead of paging anyone ## Ship it, and let the contract say what is live Routebase never deploys your service, so your pipeline reports which version an environment runs, and the contract tests verify that claim against the live API. - Releasing freezes the version into an immutable snapshot, and a frozen contract never changes - One command in the deploy job, routebase promote, pins the environment to what actually shipped - Contract tests and monitors validate against the pinned version, and a pin that fell behind is flagged - Roll back moves the pin, and the promotion history says who set it and whether the pipeline reported it ## Frequently asked questions ### What is API-first development? API-first development writes and agrees the API contract before the implementation, as an OpenAPI spec that the mock server, the tests and the documentation derive from. The backend then implements the contract rather than defining it, and the teams that consume the API build against the agreed version in parallel. The order is the whole idea, because a contract that exists first can be reviewed, mocked and tested before a line of handler code is written. ### Is API-first the same as design-first? In practice, yes. Design-first describes the same order from the perspective of the person writing the contract, while API-first describes it from the perspective of an organization that treats the API as a product. Routebase supports both readings with the same workflow, so the spec is the artifact that gets designed, reviewed, published and built against. [Design-first vs. code-first, the argument in full](https://routebase.dev/blog/design-first-vs-code-first/) ### What happens to my tests before the backend exists? They report pending rather than failed. A case whose endpoint refuses the connection or answers 404 on a path the contract describes is marked pending, with its own counter next to the run summary, and pending never fails the run. As the endpoints land, cases move from pending to passed one by one, and the day a case goes red it means the service answered wrongly. [Contract tests against an unbuilt endpoint](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) ### Which plan do I need for this workflow? The Free plan has one seat and covers the whole loop for one person, from the editor to the mock server, the tests and the docs portal. Starter adds unlimited users and the test import from the spec, which is what a team building in parallel needs. Pro adds spec branches, merge requests, the style guide and monitoring, and every new workspace starts on a 14-day Pro trial without a credit card. [Compare the plans](https://routebase.dev/pricing/) ### Can an AI agent take part in an API-first workflow? Yes, over the MCP server every workspace ships. An agent reads the published version, drafts endpoints on a branch, generates a test suite and runs it against an environment, all under the permissions of the person whose key it uses. Publishing still needs the publish permission, which Members do not hold, so an agent working on a Member's key cannot release a contract nobody reviewed. [The MCP server, in detail](https://routebase.dev/mcp-server/) --- # API governance set once, and inherited by every spec you ship — Routebase > Routebase turns API governance into organization settings, so style guide rules, shared components and header policies cascade to every project, and enforcement is a separate switch you turn on when the team is ready. Canonical page: https://routebase.dev/api-governance/ A standard that lives in a wiki decays the day after it is written, and a review board that reads every change turns into a waiting line nobody wants to join. Either way the tenth API drifts from the first while everyone believes they agreed. API governance in Routebase is a set of organization settings that sit next to the specifications they apply to. A decision is made once, inherited by every project, and visible wherever it does not hold yet. Style guide rules carry a severity per rule, set for the organization and overridden per project with a column that says where each value came from. Custom rules add your own conventions from a target, a field and a condition. A shared library and header policies make the agreed shape the easiest one to build. And enforcement on publish is its own switch, off until you decide the team is ready for it. ## The standard is a table with a severity per rule Every built-in rule sits at error, warning, info or off, so the guide records not only what you decided but how much it may cost the person who runs into it. - Severity set per rule for the organization, overridden per project with a source column reading custom, org or default - Path naming convention as a choice between kebab-case, camelCase, PascalCase and lowercase, so an existing API keeps the check - Custom rules from a target, a field and a condition, validated before they are saved and listed with a custom badge - Rules changed from their default carry an override badge and a one-click reset ## API governance checks run where the work happens Violations appear in the API Designer while you edit, grouped by rule and filterable by severity, and the publish dialog lists whatever is left before a version goes out. - An issues panel, a header badge and tree badges in the designer, so a finding is visible next to the endpoint it belongs to - One-click fixes on some rules, such as renaming a path to the convention you set - The publish dialog lists remaining issues, and with enforcement switched on, error-level findings block the release - An agent working over MCP sees the same rules, and design_api loads your style guide before it drafts a single endpoint ## Reuse removes the violation instead of reporting it A shared definition makes the agreed shape the easiest one to build, so the library and the header policies remove whole classes of findings before a rule ever fires. - Organization-wide schemas and responses, linked into any spec and versioned on every save - Linked specs keep the version they linked, and accept a newer one with a single action - A schema that proved itself in one spec can be promoted into the library instead of being rewritten - Header policies apply a set of response headers by status code, cascading from the organization down, with per-response exclusions ## Roll it out in the order that keeps the team shipping The guide measures from the day it is switched on, enforcement is a separate switch, and the quality score shows which spec is furthest from the standard you set. - Enforce on Publish starts off, so the rules report for as long as you need before anything blocks - A quality score per spec across style guide, documentation, security and consistency, with weights you set - Thresholds for quality score and documentation coverage raise alerts, with a live preview of how many specs fall below - Alerts on breaking changes and on drafts left untouched, and a deprecation policy that sets the floor for every sunset date ## Frequently asked questions ### What is API governance in Routebase? It is the set of organization settings that decide how every API in the workspace is designed. That covers the style guide and its severities, the shared library, the header policies, the quality score and the deprecation policy. All of them cascade from the organization to the project and the spec, so a decision is made once and inherited. Nothing here is a review board, because the checks run where the work happens and a person only decides the exceptions. ### Do I need an API governance tool if I already run a linter? A linter checks one document at a time and stops there. API governance tools add what happens around the check. Routebase sets severities for the organization with exceptions per project, removes whole classes of findings through shared components, scores every spec against the same standard and governs deprecations with a policy. Two limits are worth knowing. The configuration lives in the organization rather than in a file in your repository, and rule sets from other linters are expressed again rather than imported. [What to look for in an API governance tool](https://routebase.dev/guides/api-governance/api-governance-tools/) ### Does the style guide block publishing? Only when you switch enforcement on, and it starts off. With Enforce on Publish enabled, error-level violations block a release and the publish dialog says how many have to be fixed, while warnings never block and can be published after a confirmation. A project can lower the severity of any rule for its own specs, so a legacy API keeps the check without stopping every release. ### Can I add rules of our own? Yes. A custom rule targets an endpoint, a schema or the specification, names one field such as the path or the description, and tests it with a regex, a contains, an equals or an exists condition. It carries the category and the severity you choose and sits in the same table as the built-in rules with a custom badge. Anything beyond one field and one condition is not expressible, which is the trade that keeps every rule readable by the next person. [Rules of your own, the chapter](https://routebase.dev/guides/api-governance/custom-api-rules/) ### Which plan includes API governance? The style guide, the governance dashboard with its score and alerts, custom roles and the audit log are part of the Pro plan. Every new workspace starts on a 14-day Pro trial without a credit card. The shared library and header policies are available on every plan, so a standard shape for errors and headers costs nothing to start with. [Compare the plans](https://routebase.dev/pricing/) --- # Agent-ready APIs that an agent can call without guessing — Routebase > Routebase makes the descriptions, examples and errors in your OpenAPI spec the interface an agent reads, serves llms.txt from every docs portal, and lets agents work the same contract over MCP. Canonical page: https://routebase.dev/agent-ready-apis/ An AI agent decides in milliseconds, from your contract alone, whether and how to call an endpoint, and a description that repeats the name turns that decision into a guess. Agent-ready APIs close that gap without a second artifact, because the spec your team already writes is what the agent reads. In Routebase the description of an operation is a full editor rather than a text box, and enum values carry labels and meanings that travel into the export. One shared error component tells a caller what went wrong and what would fix it. Every published docs portal serves an llms.txt index, a full Markdown export and a Markdown twin per page, so an agent reads the reference as text instead of scraping a rendered page. And because every workspace ships an MCP server, the agent that consumes your API can also help design, test and document it under your team's permissions. ## Agent-ready APIs start with the description The description of an operation is where the schema stops and the protocol begins, so Routebase gives it an editor and carries every word into the export. - Callouts, tables and sequence diagrams in the description, rendered in the portal and exported as Markdown - Enum values with a label and a meaning per value, exported as x-enumNames and x-enumDescriptions - Tag descriptions that introduce a group of endpoints and export as the OpenAPI tag description - Style guide rules that list every operation, parameter, schema and response without a description, on Pro ## Errors that tell the agent what to do next A human meeting an unstructured error reads your docs, while an agent does whatever the error body suggests, so the body has to suggest the recovery. - One error response defined as a component and referenced from every operation that returns it - An organization-wide shared library for the error shape several projects should answer with - Style guide rules for declared 4xx responses and for application/problem+json as the error media type - Room in the component for a stable type and an actionable detail, so a 403 can name the scope it needs ## Docs an agent can read without scraping Every published portal serves its content as text next to the HTML, and a build fails rather than ship a portal without those files. - An llms.txt index of every content and reference page, and llms-full.txt as one Markdown document - A Markdown twin of every page, with endpoint pages generated from the spec and references resolved - A robots.txt that points at the sitemap and the index, so an agent starting at the root finds them - Page actions for readers, from Copy as Markdown to Open in Claude or ChatGPT ## Agents work the contract, under your permissions Every workspace ships an MCP server that covers the full feature set, so the agent that consumes your API can also help build it, and the tests it writes are the honest check. - 13 prompts and 12 resources package whole workflows, and design_api loads your style guide before drafting - generate_tests builds the suite and run_test_suite reports which assertion failed on which case - Permissions checked when tools are listed and again when one is called, billing and roles stay read-only - A remote connector for Claude over OAuth, and one command for Claude Code, Cursor, VS Code and Codex ## Frequently asked questions ### What makes an API agent-ready? An agent reads your contract and nothing else. An agent-ready API therefore says in its descriptions what an operation does, when to use it instead of its neighbours, what has to be true first and what comes back. It returns errors with a stable type and an actionable detail, and it publishes its documentation as text an agent can fetch. None of that needs a new artifact, because all of it lives in the OpenAPI spec and the portal built from it. ### Do I need MCP to make my API agent-ready? No. Descriptions, error bodies and llms.txt make your API usable by any agent, whichever client it runs in. The MCP server is how an agent works inside Routebase, where it can draft descriptions, generate the test suite and publish a version under your team's permissions. ### What is llms.txt, and does my docs portal serve it? It is a proposed file at the root of a site that gives an agent a short description and a curated list of links to Markdown versions of the pages that matter. Every Routebase portal build emits it, together with llms-full.txt and a Markdown twin of every page, and a build that cannot produce them fails. Our own documentation runs on the same portal, so the files are open to check. [What an agent can read from a published portal](https://routebase.dev/guides/api-documentation/api-documentation-for-ai-agents/) ### Can an agent test my API? Yes. Over MCP an agent reads the spec, creates a suite with a case per endpoint and its assertions, runs it against an environment and reads the structured results back, including JUnit output for CI. It works under a scoped key, so its reach is set by the credential rather than by the prompt. [Testing an API with an AI agent over MCP](https://routebase.dev/guides/api-testing/testing-with-an-agent-over-mcp/) ### Does Routebase check whether a description is good? The style guide finds the missing ones, on every operation, parameter, schema, response and tag, and reports them at the severity you set. Whether a description is useful is a judgement no linter makes, so the honest test is to hand the endpoint to an agent and read every guess it has to make. Over MCP the agent can then propose the rewrite as a diff you approve. --- # Migrate from Postman without rebuilding your tests by hand — Routebase > Routebase turns a Postman collection into an OpenAPI specification with a preview before anything is written, generates test cases from that spec, and lets an agent rebuild the assertions. Canonical page: https://routebase.dev/migrate-from-postman/ Most teams migrate from Postman later than they want to, because the estimate reads as weeks of retyping requests and rewriting test scripts with no feature at the end. Routebase reads a Postman collection or an Insomnia export natively and turns it into an OpenAPI specification in minutes. A preview counts the endpoints, folders and schemas it would create and lists the warnings with their location, so you read the result before you confirm it. Request bodies and saved responses become schemas, which the import marks as inferred from examples so nobody mistakes a first draft for a finished contract. From the specification, one click generates a test case per endpoint, and an agent working over MCP rebuilds the assertions your scripts used to carry. The specification exports back to Postman, Insomnia, YAML or JSON at any time. ## What a Postman collection becomes The importer maps the collection onto the structure your team will keep, and it reports what it inferred rather than pretending it was declared. - Folders become tags that the import can turn into designer folders, request names become endpoint summaries - Path segments like :id and {{orderId}} become path parameters, query strings and headers become parameters - JSON request bodies and saved responses become schemas, with formats such as uuid, email and date-time recognized - Bearer, Basic and API key auth become security schemes, at collection level and per request - Duplicate requests merge into one endpoint, and the preview says which ## What the import cannot know, and says so A collection records calls that worked, so a few things have no place in a contract, and the preview names the ones it recognises before anything is written. - Pre-request and test scripts stay behind, because assertions were never part of the contract - Collection variables beyond the base URL are not imported, so secrets are never copied - A schema inferred from one example marks every present field as required and cannot see enums - OAuth2 and other advanced auth flows are set up in the environment afterwards, not carried over ## From collection to test suite The tests are the part everyone dreads, and they come back in two steps, one click for the cases and an agent for the assertions. - Import from API Spec creates a test case per endpoint with assertions pre-filled, from the Starter plan - pm.test checks become status, jsonPath and header assertions, pm.environment.set becomes a response extraction - Chained requests become scenarios, shared logic becomes a reusable script snippet - An agent connected over MCP imports, corrects the inferred schemas, rebuilds the assertions and runs the suite ## Insomnia, and the way back out Insomnia Export v4 is read natively, and every frozen version of the specification exports again, so the door swings both ways. - Request groups become tags that the import can turn into designer folders, JSON bodies become schemas, Bearer and Basic auth become security schemes - Insomnia exports carry no saved responses and no environments, so responses and variables are added in Routebase - Export a frozen version as Postman, Insomnia, YAML or JSON, with requests and examples but never credentials ## Frequently asked questions ### How long does it take to migrate from Postman? That depends on the collection, and we won't invent a number for yours. Start with a dozen requests as a pilot, run the preview, read the warnings and let the first suite run against your API. That afternoon tells you more than an estimate. ### Which Postman and Insomnia versions can I import? Postman Collection v2.1 and Insomnia Export v4, both as JSON files, through the specification wizard inside a project. The newer Insomnia v5 format is not supported yet, so export as v4 first. The dashboard import dialog reads OpenAPI only. ### What happens to my pm.test scripts? They are not imported, because assertions were never part of the OpenAPI contract, but each kind has a destination. Status and body checks become declarative assertions, token stashing becomes a response extraction, and chained requests become scenarios. The walkthrough in our blog shows the mapping request by request. [Read the migration walkthrough](https://routebase.dev/blog/migrating-from-postman-to-openapi-first/) ### What about environments and variables? The base URL variable becomes the server URL of the specification, and other collection variables and Insomnia environments are not imported, which the preview says in a warning. You recreate the environments in Routebase, and secrets are entered there rather than copied from a file. An agent can import variables from a .env or JSON file with a preview of the keys that look like secrets. ### Do I need an OpenAPI specification before I migrate? No. The collection becomes the specification, and Routebase builds the OpenAPI as you go. If you already have a specification, import it directly and use the collection only for the requests it knows that the specification does not. ### Can I export the specification again? Yes. Every frozen version exports as OpenAPI YAML or JSON, as a Postman collection or as an Insomnia export, with your requests, examples and descriptions. Credentials are never part of an export, so the file is safe to hand to a consumer. --- # Data residency you choose at signup, on every plan — Routebase > Routebase keeps your workspace data in the region you pick when the workspace is created, the European Union or the United States, on every plan from Free to Enterprise. Canonical page: https://routebase.dev/data-residency/ Data residency tends to show up late, as a line in a procurement questionnaire or a customer contract, and many tools answer it with an enterprise tier and a sales call. Routebase asks the question once, when you create the workspace. You pick the European Union or the United States, and the workspace stays in that region for as long as it exists, on the Free plan as much as on Enterprise. Each region is a separate deployment with its own database, file storage, background jobs and monitoring, so a spec, a test run or an uploaded file never crosses to the other side. Published docs portals and mock servers are served from the same region, and the MCP endpoint follows your workspace as well. Because the choice is a setting rather than a contract, residency stops being a reason to wait. ## One decision, made when the workspace is created You choose the region on the Set up your workspace page, before anything is provisioned, and Routebase records it permanently against that organization. - European Union in Frankfurt, Germany, or United States in Phoenix, Arizona, both on Microsoft Azure - Both regions cost the same and ship the same features - One sign-in address for everyone, app.routebase.dev routes you to your region - Changing the region later is a scheduled migration by our support team, not a setting ## What lives in the region Each region runs its own database, file storage, background jobs and monitoring, and workspace data is never shared between the two. - Projects, specifications, versions, test data and uploaded files - Published docs portals, served from the region on their own hostnames and custom domains - Mock servers with a regional hostname, so consumers call the region you chose - Backups stay in the region, spread across availability zones ## Data residency on every plan, enterprise controls on top Residency is not a tier at Routebase, so a Free workspace picks its region exactly like an Enterprise one, and the identity and audit controls come with the plan that needs them. - SAML SSO, SCIM provisioning and audit log export on Enterprise, self-service from 25 seats - Routebase GmbH is a German company based in Berlin - Buy through the Microsoft Marketplace and choose the region on the activation page ## Every client reaches the right region The browser app routes itself, and the desktop app, the CLI and the MCP server carry the region with them, so a US workspace never has to remember a second address. - The desktop app sends your region with every request - The CLI takes the region once with routebase config set-region us, or per pipeline with ROUTEBASE_REGION - MCP connectors for a US workspace add ?region=us to the endpoint, EU workspaces need nothing ## Frequently asked questions ### Can I change the region of a workspace later? Not as a setting. An organization lives in exactly one region, and moving it is a scheduled migration by our support team. It usually takes a few business days and a maintenance window during which the organization is read-only. Write to support@routebase.dev with the organization name and the target region. ### Where exactly are the two regions? The European Union region runs in Frankfurt, Germany, and the United States region in Phoenix, Arizona, both on Microsoft Azure. The United States region keeps its file storage in Washington state, and either region can span more than one Azure data centre, so the country is the promise and the data centre an operational detail. ### What runs outside the workspace region? Your workspace data stays in the region, but a few shared services sit in front of it. Sign-in is operated by Auth0 on one tenant for both regions, transactional email is sent through one Azure Communication Services resource located in Europe, and the global edge network terminates requests close to the visitor. The safeguards for each processor are listed in the privacy policy for the application. [Privacy policy for the application](https://routebase.dev/privacy/app/) ### Do you offer self-hosting? No. Routebase is a hosted service in the EU or the US, and there is no on-premise edition. The region choice is how we answer residency requirements, and it applies to every plan without an enterprise contract. ### Does the region change the price or the features? No. Both regions cost the same and run the same product, and the Enterprise plan adds SAML SSO, SCIM provisioning and audit log export in either region. Only the hostnames of mock servers and published docs portals carry the region. --- # The Postman alternative that runs your tests and everything around them — Routebase > Your collections, auth, assertions, and chained requests move into test suites that run from the UI, on a schedule, or in CI. The same workspace designs, mocks, documents, and monitors the API from one living OpenAPI spec, with your data in the region you choose. Canonical page: https://routebase.dev/postman-alternative/ Routebase vs Postman ## Why teams switch from Postman Most teams land on this page for one of four reasons. The free tier stopped covering team collaboration, or EU data residency turned out to be an enterprise negotiation. Specs, collections, mocks, and monitors drifted apart one time too many, or the documentation they wanted to hand a partner never quite materialised. If that sounds familiar, here is what switching gets you, and for the detail-minded, the full row-by-row comparison further down. - Routebase replaces the collection: requests, auth, assertions, and chained scenarios become test suites you run from the UI, on a schedule, or in CI - One governed OpenAPI spec instead of specs, collections, and monitors kept in sync - Docs rendered from that spec — schemas, examples, and error responses included, because the spec has them - EU or US data residency on every plan — not an enterprise upgrade ## Design the spec visually, not as YAML Postman's Spec Hub edits OpenAPI as YAML/JSON code, helped by autocomplete and snippets. Routebase gives the whole contract a visual editor for endpoints, parameters, and schemas in structured forms, while the file underneath stays valid OpenAPI 3.0, 3.1 or 3.2. - Three-panel editor: tree, form, live preview — no YAML wrangling - Visual JSON Schema builder with validation rules and generated examples - Spec branches and merge requests with breaking-change detection ## A test engine, not test scripts In Postman, assertions are JavaScript you write per request (pm.test, pm.expect, Chai). Routebase tests are declarative, so you pick assertion types and operators, attach auth schemes, feed fixtures and seeds, and add OWASP API Top 10 scanning on top. No scripting is required, and there is nothing to maintain when the team changes. - 6 assertion types with 10 operators, 10 auth schemes - Fixtures, seeds, and snapshots for reproducible test data - OWASP API Top 10 security scanning built in - Runs from the UI, on schedules, or via CLI in CI ## Docs that inherit the contract, not the transcript Postman generates its documentation from a collection, and a collection is a record of calls. Anything it never recorded, whether a schema, an error response, or a field description, has nothing to render from. Routebase publishes from the spec, where all of them live by construction, because the document that defines the contract is the document that renders the portal. - Schemas, examples, and error responses appear because the spec carries them - Static, CDN-delivered portal with your branding — on your own domain from Pro - Try-it console on every endpoint, with code examples in nine languages - Full-text search, versioned pages, and an llms.txt for agents ## Scheduling and monitoring without a shared budget On Postman's paid plans, scheduled collection runs and monitors draw from one pool of 10,000 requests per team per month. A single monitor checking one endpoint from one region every 5 minutes uses about 8,640 of them, which is nearly the whole team's budget before any scheduled test has run. In Routebase, scheduled runs (from Starter) and monitoring (from Pro) are separate capabilities, not one metered quota. - Scheduled test runs included from Starter - Uptime and check monitoring with alert policies from Pro - No shared request pool between testing and monitoring ## One artifact, not four kept in sync In Postman, specs, collections, mocks, and monitors are separate objects you link and keep aligned. In Routebase there is only the spec, and mocks, tests, and docs derive from it directly, so a change lands everywhere at once. - Design endpoints and schemas once, in one place - Mocks, tests, and docs generated from the same spec - Spec branches and merge requests instead of duplicated artifacts ## EU hosting without an Enterprise contract Pick EU or US when you create your workspace, on every plan, and your data stays in that region on Microsoft Azure. At Postman, the EU instance is an Enterprise purchase through sales. And for teams with European customers, Routebase is built by a German company, so GDPR compliance and a DPA come without detours. - EU or US region on every plan, chosen at signup - Same features in both regions - German vendor — GDPR and DPA without an enterprise negotiation ## Built for the agent era Every Routebase workspace ships a built-in MCP server that covers the full feature set. Claude, Cursor, and other agents work your real spec, so they design, lint, and test under the same role-based permissions as your team. - MCP server included on every plan - Agents operate under your workspace's RBAC - llms.txt output for your published docs ## Let an agent do the migration The reason teams postpone this is the estimate of hundreds of requests, years of test scripts, and a quarter of work with no feature at the end. But a migration contains no hard decisions, only thousands of well-defined transformations, and every one of them is a tool call on our MCP server. Connect Claude, Cursor, or your agent of choice, point it at your collection, and it runs the whole loop. It imports, corrects the inferred schemas, rebuilds the assertions, runs the suite, and fixes what fails. - Dry run first — see every warning and what would be created, before anything is written - Collections are detected automatically; folders become tags, saved responses become schemas - pm.test assertions become declarative checks; token stashing becomes response extraction; chained requests become scenarios - The agent runs the suites it built and fixes what fails — it verifies its own work - It works under your roles and permissions, and every change is a diff you review - Postman and Insomnia import, full OpenAPI 3.0, 3.1 or 3.2 export anytime — the spec is yours ## The full comparison, row by row | Capability | Routebase | Postman | |------------|-----------|---------------| | Spec-first API design | Yes — Visual OpenAPI editor with spec branches and merge requests, built-in style guide rules and 21 breaking-change checks before publish | Yes — Spec Hub edits OpenAPI/AsyncAPI as YAML/JSON code with autocomplete — no visual designer documented | | Docs portal with custom domain | Yes — Branded portal generated from the spec: WYSIWYG editor, reusable snippets, page revisions, versioned pages, try-it and search; custom domain on Pro | Partial — Docs generated from collections; full portal branding via a Fern integration | | Hosted mock servers | Yes — Spec-driven mock servers with realistic generated data, stateful flows, latency and failure simulation, and proxy mode | Yes — Cloud mock servers, unlimited on current plans (120 req/min rate limit) | | API test execution | Yes — Declarative test engine — 6 assertion types, 10 operators, 10 auth schemes, multi-step scenarios with chaining, fixtures and snapshots; no scripting required | Yes — Collection runner and CLI; assertions written as JavaScript (pm.test, Chai) | | Scheduled test runs | Yes — Included from Starter — independent of monitoring limits | Partial — Cloud-scheduled runs draw from the shared monitoring quota (see next row) | | API monitoring | Yes — Uptime and contract checks generated from the spec, with alert policies, incidents and maintenance windows, from Pro | Partial — Capped at 1k (Free) / 10k (paid) requests per team/month, shared with scheduled runs; extra volume is a paid add-on | | API security scanning | Yes — Active OWASP API Top 10 scanning against a running environment — 8 scanners, auth personas for access-control tests, findings with severity, remediation guidance and a security score | Partial — API Security rules based on the OWASP API Top 10, checked statically against the API definition; CI enforcement on Enterprise | | MCP server for AI agents | Yes — Built-in MCP server covering the full feature set, plus 13 prompts and 12 resources; zero-install OAuth connector, RBAC-scoped on every plan | Partial — AI features with plan-based credits; no workspace MCP server documented | | Data residency choice | Yes — EU or US region chosen at signup, on every plan — German vendor, Azure-hosted | Partial — US cloud by default; EU instance on Enterprise only, via sales | | Pricing model | Yes — Per user: free plan, then $9–$39/user/mo (annual) — every feature of a tier included | Yes — Free is single-user (no teams); Solo $9, Team $19, Enterprise $49/user/mo (annual) | *Comparison as of July 2026, based on the vendor's public pricing and documentation pages. All third-party names and marks belong to their respective owners; Routebase is not affiliated with or endorsed by them. Spotted something outdated? Email us and we'll correct it.* ## Frequently asked questions ### Can I import my Postman collections into Routebase? Yes, and you don't have to do it by hand. Import collections from Postman or Insomnia, or OpenAPI specs directly. The format is detected for you, and a dry run shows every warning and what would be created before anything is written. Because the same operations are available as MCP tools, you can also hand the whole migration to an agent. It imports the collection, corrects the schemas the importer had to guess at, rebuilds your assertions, runs the suites, and fixes what fails. From there, the spec is the single source of truth for mocks, tests, and docs. [How the migration works, step by step](https://routebase.dev/migrate-from-postman/) ### What happens to my pm.test scripts? They don't import, because assertions were never part of the OpenAPI contract, but each kind has a destination. Response checks become declarative assertions (six types, ten operators). Saving a token with pm.environment.set becomes a response extraction rule that later steps read as a variable. Requests chained through a folder become an explicit multi-step scenario. Collection variables become environment variables and auth schemes, with secrets marked as secrets. Genuinely computational logic, such as signing a request or computing an HMAC, stays code, as a reusable pre-request or post-response snippet instead of the same block copy-pasted into forty requests. Translating them is mechanical, which is exactly why an agent with our MCP server can do the bulk of it and leave you reviewing a diff. [Read the full migration walkthrough](https://routebase.dev/blog/migrating-from-postman-to-openapi-first/) ### How long does migrating from Postman actually take? That depends on the collection, and we won't invent a number for yours. What we'd suggest instead is to export one folder you know well, about a dozen requests, and let an agent run the full loop on it. You'll have a governed spec, working test suites, and a mock server for that folder in an afternoon, plus a grounded estimate for the rest. Migrating folder by folder also means the work never blocks delivery. ### Is Routebase an API client like Postman? Routebase covers what teams use Postman for. It sends requests with the auth an endpoint needs, organises them into suites, asserts on the response, chains steps into scenarios, and runs everything on a schedule or in CI. Requests live in test cases rather than in a loose collection, so every call is repeatable and the CLI can run it. A Postman collection imports as a specification, from which test cases are generated. Beyond that, the same workspace designs, mocks, documents, and monitors the API. ### How do Routebase tests work without writing scripts? Tests are declarative, so you pick an assertion type (status, body, header, JSON path, latency, schema) and one of ten operators, point it at a response field, and attach the auth scheme the endpoint needs. Cases chain into scenarios that pass extracted values downstream, and a suite can run once per row of a test data set. Test data comes from fixtures, seeds, and snapshots. Where logic is genuinely computational, such as signing a request or computing an HMAC, a reusable pre-request or post-response snippet holds it. The whole suite runs from the UI, on a schedule, or in CI via the CLI. ### Where is my data hosted? You choose EU or US data residency at signup and your workspace stays in that region, on every plan. Both regions run on Microsoft Azure, and Routebase is a German company, so GDPR compliance and a DPA come without detours. ### What does Routebase cost compared to Postman? The sticker price is identical, at $19 per user/month billed annually for Routebase Pro and Postman's Team plan. The difference is what's inside. On Postman, scheduled runs and monitoring share one pool of 10,000 requests per team/month (a single 5-minute monitor uses ~8,640 of them) with extra volume as a paid add-on. Full docs portal branding runs through a Fern integration. Routebase Pro includes monitoring, scheduled test runs, the branded docs portal with custom domain, and the MCP server, with EU or US data residency on every plan. Every account starts with a 14-day Pro trial, no credit card required. ### Am I locked in? No. Your specs export as standard OpenAPI 3.0, 3.1 or 3.2 (YAML or JSON) at any time, so what you import is what you can take with you. --- # The Stoplight alternative that runs the whole lifecycle — Routebase > Stoplight made design-first mainstream with Studio, Prism, and Spectral. Routebase picks up where it stops, so the same spec also runs your tests, monitors your endpoints, and serves your agents, with data residency you choose. Canonical page: https://routebase.dev/stoplight-alternative/ Routebase vs Stoplight ## Why teams move on from Stoplight Stoplight earned its place, because Studio shaped how teams design OpenAPI, and Prism and Spectral are open-source staples. Most teams land on this page for one of three reasons. The design work is done and the spec still has to be tested and watched somewhere else, or the docs feature they need sits two price tiers up. Or the 2023 SmartBear acquisition has them wondering where the product is headed, because the portfolio is being consolidated into SmartBear's separate Swagger platform, where automated testing lives as separately priced modules. Here is what Routebase adds, with the full row-by-row comparison further down. - Design-first workflow like Studio — plus what comes after design - Real-time editing and merge-request reviews in the same project - One platform instead of design here, tests and monitoring elsewhere - Prism and Spectral are good tools — keep them if they serve you. This page is about what comes after the spec is designed ## The lifecycle doesn't end at the docs page Stoplight documents a Try It console, Prism mocks, and Spectral linting, but no automated test runner, and SmartBear sells contract and functional testing as modules of its separate Swagger platform. Routebase runs it all from the same spec, with executable test suites against real environments, scheduled runs, and endpoint monitoring with alerts. - Test suites with assertions, auth schemes, and CI runs - Uptime and check monitoring with alert policies - Hosted spec-driven mocks with failure simulation ## Real-time editing and reviews, together In Stoplight you choose, because web projects get real-time collaboration but no review Proposals, and Git projects get Proposals but work commit-and-push. In Routebase the same project has both, so you see who's editing which endpoint live, and you ship changes through spec branches and merge requests with review. - Live presence: see teammates' edits as they happen, down to the field - Spec branches and merge requests with approval flow - Breaking-change detection before anything merges ## Governance built in, not bolted on What Spectral does with custom rulesets, Routebase ships as a first-class workflow, with style-guide rules that carry a severity each, breaking-change detection across versions, and merge requests with review. - Built-in style guide rules, with one-click fixes on some of them - 21 breaking-change rules across spec versions - Spec branches, merge requests, and review flow ## Mocks that rehearse the bad day, not just the happy path Prism serves examples from the spec, so the response you documented is returned faithfully. That covers the case where everything works. The failures your frontend has to survive, and the flows that only make sense with state, need more than a faithful example. Routebase mocks carry both, with realistic synthetic data, session state, and deliberate failure. - Realistic generated data — names, emails, addresses — not the same placeholder on every call - Stateful mocks that keep state per rule until you reset it, plus request variables like {{request.body.name}} - Fixed or random latency, 5xx responses, timeouts, connection resets, per-rule rate limiting - Proxy mode: mock the new endpoint, forward everything else to the real API ## Docs without the price ladder On Stoplight's pricing page, docs versioning and custom domains start at $113 per month, and removing Stoplight branding requires the $362 Pro Team tier. In Routebase, the branded portal with custom domain and auto-SSL is part of Pro at $19 per user, and the free plan already includes two projects. - Custom domain with auto-SSL on Pro ($19/user/mo) - Versioned docs published from spec versions - Free plan includes 2 projects (Stoplight's free plan: 1) ## EU or US hosting from the first workspace Pick EU or US when you create your workspace, on every plan, on Microsoft Azure. Stoplight publishes no data-residency options. For teams with European customers that is not a cosmetic difference, because Routebase is built by a German company, so GDPR compliance and a DPA come without an enterprise negotiation. - EU or US region on every plan, chosen at signup - Same features in both regions - GDPR and DPA from a German vendor — no sales call ## Built for the agent era Every Routebase workspace ships a built-in MCP server that covers the full feature set. Claude, Cursor, and other agents work your real spec, so they design endpoints, run the linter, and execute suites through the same interface your team uses, under the same role-based permissions. - MCP server included on every plan, not an add-on - Agents operate under your workspace's RBAC — an agent can do what its key allows, nothing more - Design a whole spec and its test suites by prompt - llms.txt output for your published docs ## The specs move in an afternoon, and an agent does the rest Moving the specs is the easy half, because Stoplight works on standard OpenAPI, so does Routebase, and an import is an import. The half that usually stalls a migration is everything the spec does not carry, meaning the test suites, the mock rules, and the monitors. None of that involves a hard decision, only a lot of well-defined work, and every piece of it is a tool call on our MCP server. Point an agent at an imported spec and it builds them. - OpenAPI 3.0, 3.1 and 3.2 import, YAML or JSON — Studio projects are standard OpenAPI underneath - Governance rules apply from the first import on the Pro plan, with one-click fixes on some findings - An agent generates test suites from the endpoints, runs them, and fixes what fails - Mock rules and monitors generated from the same spec, not rebuilt by hand - Everything the agent does runs under your roles and lands as a diff you review - Full OpenAPI export anytime — no lock-in ## The full comparison, row by row | Capability | Routebase | Stoplight | |------------|-----------|---------------| | Spec-first API design | Yes — Visual OpenAPI editor with spec branches and merge requests, built-in style guide rules and 21 breaking-change checks before publish | Yes — Studio's form-based visual editor with code view — the design-first pioneer | | Real-time collaboration with review | Yes — Live presence and instant updates, combined with spec branches and merge requests | Partial — Real-time only on Stoplight-hosted web projects; reviews (Proposals) require Git projects, which are commit-and-push | | Docs portal with custom domain | Yes — Branded portal generated from the spec: WYSIWYG editor, reusable snippets, page revisions, versioned pages, try-it and search; custom domain on Pro | Yes — Hosted docs; versioning and custom domains from Startup ($113/mo), branding removal from Pro Team ($362/mo) | | Hosted mock servers | Yes — Spec-driven mock servers with realistic generated data, stateful flows, latency and failure simulation, and proxy mode | Yes — Instant Prism-based mock servers | | API test execution | Yes — Declarative test engine — 6 assertion types, 10 operators, 10 auth schemes, multi-step scenarios with chaining, fixtures and snapshots; no scripting required | No — No test runner documented; automated testing is a separately priced module of SmartBear's Swagger platform | | API monitoring | Yes — Uptime and contract checks generated from the spec, with alert policies, incidents and maintenance windows, from Pro | No — No uptime or endpoint monitoring listed on any plan | | API security scanning | Yes — Active OWASP API Top 10 scanning against a running environment — 8 scanners, auth personas for access-control tests, findings with severity, remediation guidance and a security score | Partial — OWASP Top 10 2023 Spectral style guide, enabled per workspace — rules run against the OpenAPI definition | | MCP server for AI agents | Yes — Built-in MCP server covering the full feature set, plus 13 prompts and 12 resources; zero-install OAuth connector, RBAC-scoped on every plan | No — No MCP server documented | | Data residency choice | Yes — EU or US region chosen at signup, on every plan — German vendor, Azure-hosted | No — No data-residency options published | | Pricing model | Yes — Per user: free plan, then $9–$39/user/mo (annual) — every feature of a tier included | Partial — Free limited to 1 project; team tiers $44–$362/mo plus per-user fees | *Comparison as of July 2026, based on the vendor's public pricing and documentation pages. All third-party names and marks belong to their respective owners; Routebase is not affiliated with or endorsed by them. Spotted something outdated? Email us and we'll correct it.* ## Frequently asked questions ### Can I import my Stoplight projects? Stoplight projects are standard OpenAPI under the hood, so you export your specs and import them into Routebase as 3.0, 3.1 or 3.2 YAML or JSON. Your design-first workflow carries over. ### What about Prism and Spectral? Both are open-source tools, and you can keep using them. Routebase covers the same ground without extra moving parts, with hosted spec-driven mock servers, and built-in lint rules plus breaking-change checks, with one-click fixes on some findings. ### What happens to our Spectral rulesets? They do not import as files, because Routebase governance is not Spectral under the hood. What they encode, though, has a destination. The rules you wrote as a ruleset become style-guide rules in the workspace. There, the built-in rules already cover the common ground of naming, completeness, best practice, security, and structure, and custom rules cover the rest. In daily use a flagged rule shows up in the editor while you design and, with enforcement switched on, blocks the publish, instead of failing a CLI step someone has to interpret. If you would rather keep Spectral in CI alongside, nothing stops you. [What belongs in a style guide, and how to roll it out](https://routebase.dev/guides/api-governance/) ### Can we hand the migration to an agent? Yes, and that is the part worth handing over. The spec import itself takes minutes, because both tools speak standard OpenAPI. What takes time is building the test suites and monitors that Stoplight does not offer, along with the mock rules, and that work is mechanical. It reads an endpoint, writes the assertions it implies, runs them, and fixes what fails. Connect Claude, Cursor, or your agent of choice to the workspace MCP server and point it at an imported spec. It runs that loop under your permissions, leaving you a diff to review rather than a quarter of typing. [How the agent-driven migration works](https://routebase.dev/blog/migrating-from-postman-to-openapi-first/) ### Does Routebase run tests, not just lint specs? Yes, and that is a core difference. Routebase executes test suites against real environments, with assertions, auth schemes, fixtures, scheduled runs, and CI/CLI integration. Linting is the starting point, not the end. ### Can several people design the same API at once? Yes. Routebase shows live presence, so you see who is editing which endpoint, down to the field, and it broadcasts changes to everyone instantly. Structured work still goes through spec branches and merge requests in the same project, so you don't have to choose between real-time editing and a review workflow. ### Where is my data hosted? You choose EU or US data residency at signup, and both regions run on Microsoft Azure. Routebase is a German company, so GDPR compliance and a DPA come without an enterprise negotiation. ### What does Routebase cost? Pricing is per user, with a free plan, then $9–$39 per user/month billed annually, and every feature of a tier included, with Enterprise self-service from 25 seats. Every account starts with a 14-day Pro trial, no credit card required. --- # The ReadMe alternative where docs are just the beginning — Routebase > You're probably here because the docs bill grows with every API, or because docs, testing, and monitoring each live in a different tool. Routebase publishes the same kind of branded portal from your OpenAPI spec, priced per user with unlimited projects, and the spec also runs your mocks, tests, and monitoring. Canonical page: https://routebase.dev/readme-alternative/ Routebase vs ReadMe ## Why teams switch from ReadMe Most teams land on this page for one of two reasons. One is ReadMe's per-project pricing, at $250 per month for each documented API, with multiple projects reserved for Enterprise at $3,000+. The other is the sprawl of docs here, with testing and monitoring elsewhere. If docs should be one output of the API lifecycle rather than the product you assemble everything around, here is the comparison. - Per-user pricing with unlimited projects on Pro — not $250/month per API - A branded developer portal from your spec — try-it, search, changelog - The same spec drives mocks, tests, and monitoring ## Docs as an output, not the whole product In Routebase the portal is generated from the spec that also runs your mocks, tests, and monitors. Publish a version and the docs follow, with no second system to feed and no drift between reference and reality. - Branded portal with try-it playground and search - Custom domain with auto-SSL on Pro - Versioned docs published from spec versions ## Per-user pricing, not per-project Documenting ten APIs shouldn't cost ten subscriptions. On ReadMe's published pricing, each documented project is $250 per month, and running several requires an Enterprise plan from $3,000. Routebase Pro includes unlimited projects and specs at $19 per user, so you pay for the people on your team, not for every API they document. - Unlimited projects and specs on Pro - Free plan to start, 14-day Pro trial included - Enterprise self-service from 25 seats — no sales call ## The reference writes itself from the contract In ReadMe the OpenAPI file is an upload, so you author the spec somewhere else, sync it in, and the hub renders it. That works until the two drift, and the place you fix it is never the place you noticed it. In Routebase the document that renders the portal is the document you edit, in a visual editor with branches and review. There is no sync step because there are not two copies. - Three-panel visual editor: endpoint tree, structured forms, live preview - Schemas, examples, and error responses render because the spec carries them - Spec branches and merge requests with breaking-change detection before publish - Publish a version and the portal follows — no second system to feed ## Mocks and tests out of the same file ReadMe documents an API, and it does not exercise one. That means the mock server your frontend needs and the suite that proves the endpoint still matches its documentation live in other tools. Those come with their own subscriptions and more places for the contract to drift. In Routebase both come from the spec that already renders your docs. - Spec-driven mock servers with realistic data, session state, and failure simulation - Declarative test suites: 6 assertion types, 10 operators, 10 auth schemes — no scripting - Scheduled runs and CI via CLI, plus OWASP API Top 10 scanning - Uptime and check monitoring with alert policies from Pro ## Docs hosted in the EU when your readers are there ReadMe's documentation states that data is stored in the US (AWS in Virginia), with no EU option published. Routebase asks the question at signup, so you pick EU or US, on every plan, and the workspace stays in that region on Microsoft Azure. If your readers are in Europe, so is your documentation. - EU or US region on every plan, chosen at signup - Same features in both regions - GDPR and DPA from a German vendor — no enterprise negotiation ## Ready for readers with agents Published portals ship llms.txt so AI tools can read your docs the way you wrote them, and your own team's agents connect to the workspace through the built-in MCP server. - llms.txt output for published docs portals - Built-in MCP server covering the full feature set - Docs search that covers reference and guides ## Your OpenAPI spec is the migration If your reference docs come from an OpenAPI file today, you already have everything Routebase needs, because that file is the migration, and importing it takes minutes. What takes longer is the guide content around the reference, because pages move over as pages, and that is manual work proportional to how much you wrote. The upside is what arrives with the import, which is design, mocks, tests, and monitoring on the same spec, without a second subscription. - OpenAPI 3.0, 3.1 and 3.2 import, YAML or JSON — the reference is there immediately - Portal, try-it console, code examples, and full-text search generated from the spec - Custom domain with auto-SSL on Pro, so the URL your readers know keeps working - Guide pages are authored in Routebase docs pages — long-form content moves by hand - An agent over the MCP server can do the mechanical part of that move under your permissions - Full OpenAPI export anytime — no lock-in ## The full comparison, row by row | Capability | Routebase | ReadMe | |------------|-----------|---------------| | Spec-first API design | Yes — Visual OpenAPI editor with spec branches and merge requests, built-in style guide rules and 21 breaking-change checks before publish | No — OpenAPI upload and sync; no spec design editor | | Docs portal with custom domain | Yes — Branded portal generated from the spec: WYSIWYG editor, reusable snippets, page revisions, versioned pages, try-it and search; custom domain on Pro | Yes — Core product — polished hubs, custom domain from the free plan | | Hosted mock servers | Yes — Spec-driven mock servers with realistic generated data, stateful flows, latency and failure simulation, and proxy mode | No — No mock servers offered | | API test execution | Yes — Declarative test engine — 6 assertion types, 10 operators, 10 auth schemes, multi-step scenarios with chaining, fixtures and snapshots; no scripting required | No — No test execution offered | | Scheduled test runs | Yes — Included from Starter — independent of monitoring limits | No — No test runner, so nothing to schedule | | API monitoring | Yes — Uptime and contract checks generated from the spec, with alert policies, incidents and maintenance windows, from Pro | Partial — API metrics from real traffic — analytics, not uptime checks | | API security scanning | Yes — Active OWASP API Top 10 scanning against a running environment — 8 scanners, auth personas for access-control tests, findings with severity, remediation guidance and a security score | No — No security scanning of your API | | MCP server for AI agents | Yes — Built-in MCP server covering the full feature set, plus 13 prompts and 12 resources; zero-install OAuth connector, RBAC-scoped on every plan | Partial — AI docs assistant and Ask AI (paid add-on); no workspace MCP server documented | | Data residency choice | Yes — EU or US region chosen at signup, on every plan — German vendor, Azure-hosted | No — Docs state US storage (AWS Virginia); no EU option published | | Pricing model | Yes — Per user: free plan, then $9–$39/user/mo (annual) — every feature of a tier included | Partial — Per project: free tier, then $250/mo per project; multiple projects on Enterprise ($3,000+/mo) | *Comparison as of July 2026, based on the vendor's public pricing and documentation pages. All third-party names and marks belong to their respective owners; Routebase is not affiliated with or endorsed by them. Spotted something outdated? Email us and we'll correct it.* ## Frequently asked questions ### Can Routebase replace our ReadMe docs hub? If your hub is OpenAPI-reference-centric, yes. Import the spec and publish a branded portal with try-it, search, and a custom domain (Pro). Long-form guide content is authored in Routebase's docs pages. ### How is Routebase priced compared to ReadMe? Routebase is per user with unlimited projects on Pro ($19/user/month billed annually). ReadMe prices per documented project, with a free tier, then $250 per month per project, and multiple projects on Enterprise from $3,000/month. With several APIs, per-user pricing usually wins by a wide margin, and with one API and many readers, compare both. ### Can we write guides and tutorials the way we do in ReadMe? Yes, though this is the place to be honest about the difference. Routebase has a full docs editor for guide pages, with rich text, code blocks, images, snippets, versioning, and search across guides and reference together. What ReadMe has built over years is a deeper content product, with recipes, richer personalisation, and a larger set of authoring conveniences. If long-form developer content is the centre of your product and the API reference is a supporting act, that gap is worth weighing. If the reference is the centre and guides surround it, Routebase covers both from one spec. ### What happens to our custom domain? It points at the Routebase portal instead. Custom domains with automatic SSL are part of Pro, so you add the domain, set the DNS record we show you, and the certificate is issued for you. Readers keep the URL they had. ReadMe offers a custom domain from its free plan, so this is a place where Routebase asks for a paid tier and ReadMe does not, and the trade is what else Pro carries. ### Does Routebase have API analytics like ReadMe's metrics? Routebase focuses on active monitoring, meaning scheduled checks against your endpoints with alerting, plus docs portal insights. ReadMe's metrics analyze your production traffic, so if passive traffic analytics is your main need, that difference matters. ### Where is my data hosted? You choose EU or US data residency at signup, and both regions run on Microsoft Azure. Routebase is a German company, so GDPR compliance and a DPA come without detours. ### Am I locked in? No. Specs export as standard OpenAPI 3.0, 3.1 or 3.2 anytime, and published portals are generated, so nothing is trapped in a proprietary format. --- # The Swagger alternative that runs the whole lifecycle — Routebase > Swagger UI and Swagger Editor are where most API teams start. They are also where most teams stop, because nothing is hosted, nobody collaborates, and no test ever runs. Routebase takes the same OpenAPI file and runs your docs portal, mocks, tests, and monitoring from it. Canonical page: https://routebase.dev/swagger-alternative/ Routebase vs Swagger ## Why teams look past Swagger "Swagger" means two different things, and people arrive here from both. Some are running the open-source tools, with Editor to write the YAML and UI to render it, and have hit the wall where a spec file in a repo stops being enough. There is no hosted portal, no review workflow, and no way to prove the API still matches. Others are on SwaggerHub and have met a limit, such as 50 test executions a month, a portal that carries SmartBear's branding, or a feature that turns out to be a per-user add-on. Both problems have the same shape, and the row-by-row comparison further down is against SwaggerHub, since that is where the numbers are. - Everything that has to happen around a spec file: hosting, review, and proof that the API still matches - One spec drives the portal, the mocks, the tests, and the monitors - Every capability of a tier is included — no per-user add-on for the portal or the test runner - EU or US data residency chosen at signup, on every plan ## Where the open-source tools stop Swagger Editor validates a file. Swagger UI renders one. Neither hosts anything, neither has a second person in it, and neither runs a test. So the toolchain ends and the glue code starts the moment a team needs a portal on its own domain. The same happens when it needs a review before a breaking change ships, or proof that the deployed API still matches the document. Routebase is that missing middle, and it reads the same OpenAPI file you already have. - A hosted, branded portal instead of a static UI bundle you deploy yourself - Spec branches and merge requests with breaking-change detection before publish - Live presence — see who is editing which endpoint, down to the field - Import your existing 3.0, 3.1 or 3.2 spec unchanged; export it unchanged any time ## SwaggerHub's 50 test executions a month This is the number worth doing the arithmetic on. SwaggerHub's Individual and Team plans include 50 test executions per month, Enterprise 100, and the pricing page defines the unit precisely, because a suite counts each test individually. A modest suite of 30 tests, run once a day, is 900 executions a month. Against an allowance of 50, the second day of the month is where it stops. SmartBear sells a Test Pro add-on at EUR 27.92 per user/month, and the pricing page does not state what allowance it carries. In Routebase, a run counts the whole suite rather than each test, so that suite is 30 runs a month, well inside Starter's 2,000, and Pro has no monthly cap at all. - A run counts the whole suite, not each test inside it - 6 assertion types with 10 operators, 10 auth schemes — declarative, no scripting - Fixtures, seeds, and snapshots for reproducible data; OWASP API Top 10 scanning - Scheduled runs from Starter and CLI runs in CI, with no monthly cap on Pro ## A portal that carries your name, not your vendor's On SwaggerHub, the published portal comes with SmartBear branding on Individual, Team, and Enterprise alike. A custom domain and a portal without that branding are Enterprise Plus, which is a conversation with sales. The tiers also cap how many API products you can publish at 1, 2, and 5. In Routebase the branded portal with your own domain and automatic SSL is part of Pro at $19 per user, and there is no limit on how many APIs you document. - Your domain with auto-SSL on Pro — no vendor branding, no seat class - Unlimited projects and specs; publish as many APIs as you have - Try-it console on every endpoint, code examples in nine languages, full-text search - Versioned pages and llms.txt output for agents ## Design the contract visually, review it like code SwaggerHub puts a form editor beside the code editor. What it does not put below Enterprise is the linting that keeps a growing spec consistent, because validation with custom rulesets starts there. Routebase puts the whole contract in structured forms on every plan, and its style guide runs on every change you make from the Pro plan, without an enterprise contract. - Three-panel editor: endpoint tree, structured forms, live preview - Visual JSON Schema builder with validation rules and generated examples - Built-in style guide rules from the Pro plan, with one-click fixes on some of them - 21 breaking-change rules checked across spec versions ## Mocks that rehearse the bad day SwaggerHub's automocking starts at the Team tier and serves what the spec documents. That is the happy path. The failures a frontend has to survive, such as a 500 at the wrong moment, a request that hangs, or a rate limit, need a mock that can do more than echo an example. So do the flows that only make sense with state. - Realistic generated data: names, emails, addresses, not one placeholder repeated - Stateful mocks that keep state until you reset it, plus request variables like {{request.body.name}} - Fixed or random latency, 5xx responses, timeouts, connection resets, rate limiting - Proxy mode: mock the new endpoint, forward the rest to the real API ## One price instead of a stack of add-ons SwaggerHub's list price is the start of the bill. Portal Pro is EUR 27.50 per user/month, Test Pro EUR 27.92, Contract Testing Pro EUR 21.80, and Enterprise SSO EUR 5.58, each per user and each on top. A Team seat that needs a decent portal and real test volume is EUR 32.34 plus EUR 55.42 in add-ons before anyone counts executions. Routebase Pro is $19 per user with the portal, the custom domain, the test engine, monitoring, and the MCP server inside it. - Every feature of a tier is included — nothing is a per-user add-on - Free plan to start; $9 Starter, $19 Pro, $39 Enterprise per user/mo (annual) - Enterprise is self-service from 25 seats — SSO, SCIM, and audit log export included - 14-day Pro trial on every account, no credit card ## Data residency as a dropdown, not an installation SwaggerHub answers residency with deployment, meaning SaaS, or on-premise if your requirements are strict, and on-premise is a sales conversation and an installation. Routebase answers it with a dropdown. Pick EU or US when you create the workspace, on any plan, and it stays there on Microsoft Azure, with the same features either way. - EU or US region on every plan, chosen at signup — no migration project - Same features in both regions - GDPR and DPA from a German vendor, without an enterprise negotiation ## Your spec is already the migration Whichever Swagger you are on, the artifact is a standard OpenAPI file, and that is the thing Routebase runs on. Import it and the portal, the mock server, and the linting exist immediately. What does not come across is the part the spec never held, which is the test suites. That work is mechanical rather than difficult, which is exactly what an agent over our MCP server is for. - OpenAPI 3.0, 3.1 and 3.2 import, YAML or JSON — from a repo file or a SwaggerHub export - Portal, try-it console, and search generated from the spec on import - Style guide rules apply from the first import on the Pro plan, with one-click fixes on some findings - An agent generates test suites from the endpoints, runs them, and fixes what fails - Everything the agent does runs under your roles and lands as a diff you review - Full OpenAPI export any time — the spec is yours, it always was ## The full comparison, row by row | Capability | Routebase | SwaggerHub | |------------|-----------|---------------| | Spec-first API design | Yes — Visual OpenAPI editor with spec branches and merge requests, built-in style guide rules and 21 breaking-change checks before publish | Yes — Form editor and code editor; validation with custom linting (Spectral) from Enterprise | | Docs portal with custom domain | Yes — Branded portal generated from the spec: WYSIWYG editor, reusable snippets, page revisions, versioned pages, try-it and search; custom domain on Pro | Partial — 1 / 2 / 5 public products by tier, all with SmartBear branding; custom domain and branding removal on Enterprise Plus | | Hosted mock servers | Yes — Spec-driven mock servers with realistic generated data, stateful flows, latency and failure simulation, and proxy mode | Partial — Automocking from the Team tier; not on Individual | | API test execution | Yes — Declarative test engine — 6 assertion types, 10 operators, 10 auth schemes, multi-step scenarios with chaining, fixtures and snapshots; no scripting required | Partial — 50 test executions per month on Individual and Team, 100 on Enterprise — suites count each test individually | | Scheduled test runs | Yes — Included from Starter — independent of monitoring limits | Partial — Test automation is included, but every scheduled run draws from the same monthly execution allowance | | API monitoring | Yes — Uptime and contract checks generated from the spec, with alert policies, incidents and maintenance windows, from Pro | No — No uptime or endpoint monitoring listed on the pricing page or the tools documentation | | API security scanning | Yes — Active OWASP API Top 10 scanning against a running environment — 8 scanners, auth personas for access-control tests, findings with severity, remediation guidance and a security score | Partial — OWASP Top Ten standardization rules via Spectral against the definition; runtime security testing is a separate SmartBear product (ReadyAPI) | | MCP server for AI agents | Yes — Built-in MCP server covering the full feature set, plus 13 prompts and 12 resources; zero-install OAuth connector, RBAC-scoped on every plan | Yes — MCP server and callable AI tools documented; RBAC from the Enterprise tier | | Data residency choice | Yes — EU or US region chosen at signup, on every plan — German vendor, Azure-hosted | Partial — SaaS or on-premise for strict residency requirements — on-premise runs through sales, no region choice at signup | | Pricing model | Yes — Per user: free plan, then $9–$39/user/mo (annual) — every feature of a tier included | Partial — EUR 21.20 / 32.34 / 54.68 per user/mo (annual); Portal Pro, Test Pro, Contract Testing Pro and SSO are separate per-user add-ons | *Comparison as of August 2026, based on SwaggerHub's public pricing page and the Swagger tools documentation. SwaggerHub figures are the EUR prices shown on that page with annual billing selected; Routebase prices are USD (the same amounts in EUR for European customers). All third-party names and marks belong to their respective owners; Routebase is not affiliated with or endorsed by SmartBear. Spotted something outdated? Email us and we'll correct it.* ## Frequently asked questions ### Is Routebase a replacement for Swagger UI? Yes, and it removes the work that usually surrounds one. Routebase publishes a branded portal from your spec, with a try-it console, full-text search, code examples, versioned pages and your own domain with automatic SSL. That replaces a bundle you host, style, secure and keep in step with the spec by hand. Everything Swagger UI renders, your consumers still get, and the difference is that nobody on your team maintains the deployment. ### We use the free Swagger Editor. What do we gain? A second person, mainly. The Editor is a single-user window onto a file, with no presence, no review, and no history beyond your Git log. In Routebase the same spec is a shared object, with live presence down to the field being edited and spec branches with merge requests. Breaking-change detection runs before a merge, and a style guide runs on every change. The file stays valid OpenAPI throughout, so nothing about this is a one-way door. [Where the two names come from](https://routebase.dev/guides/openapi/openapi-vs-swagger/) ### How many test executions do I get? In Routebase a run counts the whole suite rather than each test, whether you start it from the UI, on a schedule or from CI. Starter includes 2,000 suite runs a month, and Pro and Enterprise have no monthly cap. This is the sharpest difference in the table. SwaggerHub includes 50 test executions per month on Individual and Team and 100 on Enterprise, and its pricing page notes that suites count each test individually. A 30-test suite run daily would therefore exceed the Team allowance on the second day of the month. ### Does SwaggerHub not have an MCP server too? It documents one, so the question is what an agent reaches through it. Routebase exposes its full feature set, from design and mocking to testing, documentation and monitoring, which is enough for an agent to build a specification and its test suites, not only read them. Every call is scoped by the same role-based permissions as your team, with RBAC on every plan rather than from a specific tier. ### Can I import a SwaggerHub API? Yes. Export it as OpenAPI 3.0, 3.1 or 3.2, as YAML or JSON, and import that file. A dry run shows every warning and exactly what would be created before anything is written. Because the same operations exist as MCP tools, an agent can run the import and then build the test suites the spec does not carry, under your permissions, leaving you a diff. ### Does this replace Swagger Codegen? No, and it does not need to, because the two sit at different points in the chain. Codegen turns a contract into server stubs and client SDKs, while Routebase is where that contract is designed, governed, mocked, tested and published. A valid OpenAPI export from Routebase feeds your existing Codegen pipeline exactly as today's file does, so the generation step you already run keeps working unchanged. ### Where is my data hosted? You choose EU or US at signup and the workspace stays in that region, on every plan. Both run on Microsoft Azure. Routebase is a German company, so GDPR compliance and a DPA come without an enterprise negotiation or an on-premise installation. ### Am I locked in? No. Your specs export as standard OpenAPI 3.0, 3.1 or 3.2 in YAML or JSON at any time, so what you import is what you can take with you. That was true of your Swagger file too, and it is the property worth protecting. --- # The Insomnia alternative that covers what comes after the request — Routebase > Insomnia sends requests beautifully and syncs them through Git. What it does not do is publish a portal your consumers read, watch the API at three in the morning, or hold a review before a breaking change ships. Routebase runs that whole span from the same OpenAPI file, and it imports your Insomnia export to get there. Canonical page: https://routebase.dev/insomnia-alternative/ Routebase vs Insomnia ## Why teams look past Insomnia The question on this page is scope. Kong's product documentation lists Documents, Collections, Mock Servers, Environments and the Inso CLI, which is a client with a spec editor attached. What it does not list is a documentation portal or any form of monitoring, and that is where the second toolchain starts. There is one tool for calling the API, another for publishing it, yet another for watching it, and a spec file drifting away from every one of them. Routebase is the single place all of that comes from. - One OpenAPI spec drives the portal, the mocks, the tests and the monitors - Spec branches with merge requests and breaking-change detection before publish - A hosted, branded docs portal on your own domain — not a second product - EU or US data residency chosen at signup, on every plan ## Docs your consumers read, not a collection you share This is the gap with the clearest edges. Insomnia's documentation covers Documents, Collections, Mock Servers, Environments, Inso CLI and Storage, and there is no portal in it. So the API gets documented somewhere else, in a README, a static Swagger UI bundle, or a docs site maintained by someone who was not in the room when the schema changed. Routebase publishes the portal from the spec itself, which means the field descriptions, the error responses and the examples are the ones the contract actually carries. - Branded portal with try-it console, full-text search and code examples - Your own domain with automatic SSL on Pro - Versioned pages, so a consumer on v1 keeps reading v1 - llms.txt output, so agents read the docs as cheaply as humans do ## Review before the break, not after the incident A collection in Git gives you a diff. What it does not give you is a judgement about whether that diff breaks somebody. Removing a required field and renaming an enum value look identical in a JSON diff, and neither shows up as a problem until a consumer's build goes red. Routebase treats the spec as a reviewable object, with branches, merge requests, and 21 breaking-change rules that run before a version is published. - Spec branches with merge requests and required reviewers - 21 breaking-change rules checked across versions before publish - Built-in style guide rules from the Pro plan, with one-click fixes on some of them - Live presence — see who is editing which endpoint, down to the field ## Someone watching at three in the morning No monitoring is listed anywhere in Insomnia's product documentation, which is a reasonable place for a client to stop. It does mean the question "is the API up and still returning what it promised" belongs to a different tool and a different bill. In Routebase the monitors are generated from the endpoints you already designed, so they check the contract rather than a URL. - Uptime and endpoint checks generated from the spec, from Pro - Alert policies across environments, specs or individual monitors - Incidents and maintenance windows, so a planned deploy is not a page - Scheduled test suites from Starter — independent of the monitoring limits ## Agents that build the spec, not just read it Both products let an agent in. Kong documents the Koh CLI so agents can work with collections, requests and specs, and the table says so. The difference is the surface. Routebase exposes its full feature set, so an agent designs endpoints, writes schemas, generates and runs test suites, configures mocks and publishes a version. Every call is scoped by the same role-based permissions your team has, on every plan. - The full feature set as tools, plus 13 prompts and 12 resources - Zero-install remote connector over OAuth, or stdio for local agents - Every agent action runs under your roles and lands as a reviewable diff - RBAC on every plan, not from a specific tier ## The parts that never fit in a collection A collection describes calls. A specification describes a contract, and the difference shows up in the work nobody enjoys. That work is reusable schemas instead of copied JSON bodies, shared response components, a governance ruleset, and an environment matrix that does not live in one laptop. Routebase keeps those as first-class objects, which is what makes the portal, the mocks and the tests derive from one place rather than several. - Visual JSON Schema builder with reusable components and generated examples - Shared response and header libraries across specs and projects - Fixtures, seeds and snapshots for reproducible test data - Active OWASP API Top 10 scanning against a running environment, with remediation guidance ## Your Insomnia export is a supported import format This is the shortest migration of any page in this comparison family, because Routebase reads Insomnia Export v4 directly, alongside OpenAPI 3.0 to 3.2 and Postman Collection v2.1. Export from Insomnia, import here, and a dry run shows every warning and exactly what would be created before anything is written. And because the exporter works in both directions, leaving again is the same one-click operation, which is the property worth checking before any migration, including this one. - Native Insomnia Export v4 import — not a converter script you maintain - Or import the OpenAPI file directly if your specs already live in Documents - Dry run first: every warning and every object listed before it is written - Export back to Insomnia v4 or to standard OpenAPI at any time - An agent can run the import over MCP and build the test suites afterwards - Environments are recreated in Routebase; the import names them in a warning and never copies secrets ## The full comparison, row by row | Capability | Routebase | Insomnia | |------------|-----------|---------------| | Spec-first API design | Yes — Visual OpenAPI editor with spec branches and merge requests, built-in style guide rules and 21 breaking-change checks before publish | Partial — Documents: OpenAPI spec editing with custom linting rules; no spec branches or merge requests documented | | Docs portal with custom domain | Yes — Branded portal generated from the spec: WYSIWYG editor, reusable snippets, page revisions, versioned pages, try-it and search; custom domain on Pro | No — No documentation portal listed in the product documentation or on the pricing page | | Hosted mock servers | Yes — 1,000 free / 10,000 Starter / 100,000 Pro requests per month, unlimited on Enterprise — stateful and failure modes included | Yes — 1,000 free / 10,000 Pro requests per month, unlimited on Enterprise; dynamic data via Liquid templates and faker variables | | API test execution | Yes — Declarative test engine — 6 assertion types, 10 operators, 10 auth schemes, multi-step scenarios with chaining, fixtures and snapshots; no scripting required | Yes — Collections with automated tests; unlimited collection runs on every tier | | Scheduled test runs | Yes — Included from Starter — independent of monitoring limits | Partial — Inso CLI runs suites in your own CI; no scheduled runs inside the product | | API monitoring | Yes — Uptime and contract checks generated from the spec, with alert policies, incidents and maintenance windows, from Pro | No — No uptime or endpoint monitoring listed | | API security scanning | Yes — Active OWASP API Top 10 scanning against a running environment — 8 scanners, auth personas for access-control tests, findings with severity, remediation guidance and a security score | No — No API security or vulnerability scanning listed | | MCP server for AI agents | Yes — Built-in MCP server covering the full feature set, plus 13 prompts and 12 resources; zero-install OAuth connector, RBAC-scoped on every plan | Yes — Koh CLI lets agents work with collections, requests and specs | | Data residency choice | Yes — EU or US region chosen at signup, on every plan — German vendor, Azure-hosted | Partial — Enterprise can mandate where projects are stored (local, git or cloud); no EU/US region choice documented | | External secret vault integrations | No — Secrets live in Routebase environments; no external vault integration | Yes — Native AWS, GCP, HashiCorp and Azure vault integrations on Enterprise | | Pricing model | Yes — Per user: free plan, then $9–$39/user/mo (annual) — every feature of a tier included | Yes — Free, $12 Pro, $45 Enterprise per user/month (annual); SSO and SCIM on the $45 tier | *Comparison as of August 2026, based on the vendor's public pricing page and product documentation; prices are the per-user annual rates unless noted. All third-party names and marks belong to their respective owners; Routebase is not affiliated with or endorsed by them. Spotted something outdated? Email us and we'll correct it.* ## Frequently asked questions ### What does Routebase cover that Insomnia does not? Four things a client does not do, and Kong's own product documentation lists none of them. They are a hosted documentation portal on your own domain, and uptime and contract monitoring. They are also a review step on the specification with branches and merge requests, and a choice of EU or US data residency on every plan. Those are the rows in the table where the two products are furthest apart, and they are the reason most teams end up running a second tool alongside a client. ### Can I import my Insomnia collections? Yes, directly. Insomnia Export v4 is one of three supported import formats, next to OpenAPI 3.0 to 3.2 and Postman Collection v2.1. A dry run lists every endpoint, folder and schema that would be created before anything is written. The same operation exists as an MCP tool, so an agent can run the import and then generate the test suites your collection never carried. [The migration page, Insomnia included](https://routebase.dev/migrate-from-postman/) ### Does Insomnia have an MCP server? Kong documents the Koh CLI for agent access, so the question is what an agent reaches through it. Routebase exposes its full feature set, spanning design, mocking, testing, documentation and monitoring, which is enough for an agent to build and publish a specification and its test suites, not just read collections. Every call is scoped by your role-based permissions. ### We use Insomnia's vault integrations. Do you have those? Not as external integrations, and the table says so plainly. Routebase keeps secrets in encrypted environment variables, scoped per environment and per project, with an audit log over who read which secret and when. For most teams that is the whole requirement. If your security policy mandates that credentials never leave an existing AWS, GCP, HashiCorp or Azure vault, that policy is worth checking before you plan a migration. ### How does data residency compare? They solve different problems. Insomnia's Enterprise tier lets you mandate the storage type, whether local, git or cloud, which is about where a project lives rather than in which jurisdiction. Routebase asks you to choose EU or US at signup and keeps the workspace in that region on every plan, including the free one. Routebase is a German company, so a DPA and GDPR compliance do not require an enterprise negotiation. ### Am I locked in? No. Specs export as standard OpenAPI 3.0, 3.1 or 3.2 in YAML or JSON at any time, and there is an Insomnia v4 exporter as well, in the same format you would have imported from. Whatever you bring in, you can take back out. --- # The Apidog alternative with residency on every plan — Routebase > Apidog is the closest thing to a like-for-like competitor we have, with one workspace for design, mocking, testing and documentation. The comparison below is therefore not about who has more boxes ticked. It is about three specific rows. Where your workspace is hosted, whether anything monitors the API once it is live, and how much an agent can actually do. Canonical page: https://routebase.dev/apidog-alternative/ Routebase vs Apidog ## Where the two products genuinely differ Apidog covers a similar surface, so this page goes straight to the three rows that decide most evaluations, which are the ones where the products do not overlap at all. Where the workspace is hosted, whether anything watches the API once it is live, and what an agent is actually able to do. Each of them is a requirement a team either has or does not, and where they apply, there is no version of Apidog that answers them. - Data residency: EU or US on every Routebase plan, chosen at signup - Monitoring: uptime and contract checks are part of the platform, not absent from it - Agents: MCP tools that design, test and publish, not a read channel into an IDE - Governance: built-in style guide rules from Pro, and 21 breaking-change rules on every version comparison ## Where the workspace lives, on every plan In Apidog's matrix, Global SaaS is available everywhere and the "Europe Hosting Option" appears in exactly one column, which is Enterprise, marked optional. For a European team with a procurement questionnaire, that turns a $9 decision into a $27 one, and an on-premises conversation if the answer has to be stronger. In Routebase you pick EU or US at signup and the workspace stays there, on the free plan as much as on Enterprise. Routebase is a German company, so the DPA and the GDPR paperwork are not a tier. - EU or US chosen at signup, on every plan including Free - Both regions on Microsoft Azure, with the data staying in the chosen one - German vendor — DPA and GDPR compliance without an enterprise negotiation - Region visible in the app and in the API, so an audit can verify it ## Something watching after the spec ships Apidog's feature matrix is long and detailed, which makes an absence in it meaningful, because there is no uptime or endpoint monitoring anywhere in it. Testing tells you the API was correct when you ran the suite, while monitoring tells you it still is at four on a Sunday morning. Routebase generates monitors from the endpoints you already designed, so the check knows the contract, meaning status, schema, and latency, rather than pinging a URL and calling it green. - Monitors generated from the spec, checking schema and status rather than reachability - Alert policies assigned across environments, specs or individual monitors - Incidents with timelines, plus maintenance windows so a deploy is not a page - Scheduled test suites from Starter, in the platform — no self-hosted runner to operate ## Scheduled runs without a runner to babysit Apidog's scheduled tasks are a capability of its self-hosted runner, so you deploy it and you keep it alive. The runs are metered in run steps, with 10k a month on Free and a run every six hours at most until you reach Basic. That is a piece of infrastructure to deploy, patch and keep alive before a single suite runs on a schedule. Routebase runs schedules as part of the platform from the Starter tier, with no monthly cap on Pro. The CLI covers the CI case where you do want the run to happen on your own machines. - Scheduled suites included from Starter, independent of monitoring limits - No runner to deploy, patch or keep alive - CLI runs in your own CI when you want the execution to stay in-house - Results, diffs and history in the same place as the spec they test ## What an agent is allowed to do Both products have MCP, and the table says so, so this is about direction. Apidog's MCP server is documented as reading and caching your API specifications so an AI IDE can generate code that matches them. The data sources it names are an Apidog project, a published doc site, or OpenAPI files. That is a supply line into the editor. Routebase exposes the platform itself, with its full feature set as tools, so an agent designs endpoints, writes schemas, builds and runs test suites, configures mocks and publishes a version. It does so under the same role-based permissions as the human next to it. - The full feature set as tools, plus 13 prompts and 12 resources - An agent can take a spec from empty to published, tests included - Every call scoped by your roles; RBAC on every plan, not from a tier - Zero-install remote connector over OAuth, or stdio for local agents ## Governance that runs on every change A design tool keeps a spec valid. Governance keeps a spec consistent across twelve of them and four teams, covering naming, required descriptions, error shapes, and versioning discipline. Routebase ships a style guide with a severity per rule from the Pro plan, and 21 breaking-change rules on every version comparison. The same rules meet an agent working over MCP, and with enforcement switched on nothing gets published past them by a prompt either. - Built-in style guide rules with a severity per rule, set org-wide and overridden per project - 21 breaking-change rules checked between versions before publish - Custom rules alongside the built-ins, checked in the editor and again at publish - A governance score per project, so drift is visible before it is a migration ## Export OpenAPI, import it, keep the branches Apidog exports OpenAPI 3.1, 3.0 and Swagger 2.0 in YAML or JSON, with the export range scoped to everything, selected endpoints, tags or folders. That file is exactly what Routebase runs on, so the portal, the mocks and the linting exist as soon as the import finishes. What does not travel is what never lived in the spec, which is the test scenarios. That work is mechanical, which is what the MCP server is for. - OpenAPI 3.0, 3.1 or 3.2 import, YAML or JSON, from Apidog's own export - Dry run first — every warning and every object listed before anything is written - Portal, try-it console and search generated from the spec on import - Style guide findings from the first import on the Pro plan, with one-click fixes on some of them - An agent generates the test suites from your endpoints and runs them - Full OpenAPI export any time — the same door you came through ## The full comparison, row by row | Capability | Routebase | Apidog | |------------|-----------|---------------| | Spec-first API design | Yes — Visual OpenAPI editor with spec branches and merge requests, built-in style guide rules and 21 breaking-change checks before publish | Yes — Visual OpenAPI/JSON Schema designer, schema reuse, unlimited sprint branches on every tier | | Docs portal with custom domain | Yes — Branded portal generated from the spec: WYSIWYG editor, reusable snippets, page revisions, versioned pages, try-it and search; custom domain on Pro | Yes — Interactive docs with try-it console, search, theming, llms.txt and unlimited custom domains on every tier | | Hosted mock servers | Yes — 1,000 free / 10,000 Starter / 100,000 Pro cloud requests per month, unlimited on Enterprise | Yes — Smart mock with expectations and scripts; 10,000 free / 50,000 Basic / 100,000 Pro / 1M Enterprise cloud calls per month, local mock unlimited | | API test execution | Yes — Declarative test engine — 6 assertion types, 10 operators, 10 auth schemes, multi-step scenarios with chaining, fixtures and snapshots; no scripting required | Yes — Test scenario orchestration with flow control, unlimited runs, CLI; test report storage capped 100 MB–2 GB by tier | | Scheduled test runs | Yes — Included from Starter — independent of monitoring limits | Partial — Scheduled tasks run through a self-hosted runner; every 6 hours on Free, every minute from Basic, metered in run steps | | API monitoring | Yes — Uptime and contract checks generated from the spec, with alert policies, incidents and maintenance windows, from Pro | No — No uptime or endpoint monitoring in the feature matrix | | API security scanning | Yes — Active OWASP API Top 10 scanning against a running environment — 8 scanners, auth personas for access-control tests, findings with severity, remediation guidance and a security score | Partial — Secret Scanner and Vault Secrets on Enterprise; no OWASP API vulnerability scanning in the matrix | | MCP server for AI agents | Yes — Built-in MCP server covering the full feature set, plus 13 prompts and 12 resources; zero-install OAuth connector, RBAC-scoped on every plan | Partial — MCP server documented as supplying specs to AI IDEs for code generation; MCP client in the app | | Data residency choice | Yes — EU or US region chosen at signup, on every plan — German vendor, Azure-hosted | Partial — Global SaaS on all tiers; "Europe Hosting Option" listed as optional on Enterprise only | | Self-hosted / on-premises | No — SaaS only — EU or US region, no self-hosted deployment | Yes — Enterprise On-premises: self-hosted Docker/K8s, air-gapped option, private API hub and mock service | | Custom domain on the free tier | No — Custom domain with automatic SSL from Pro ($19/user/mo) | Yes — Unlimited custom domains on every tier, including Free | | Pricing model | Yes — Per user: free plan, then $9–$39/user/mo (annual) — every feature of a tier included | Yes — Free for up to 4 users, then $9 Basic, $18 Professional, $27 Enterprise per user/month (annual) | *Comparison as of August 2026, based on the vendor's public pricing page and product documentation; prices are the per-user annual rates unless noted. All third-party names and marks belong to their respective owners; Routebase is not affiliated with or endorsed by them. Spotted something outdated? Email us and we'll correct it.* ## Frequently asked questions ### Apidog does most of this too. What is actually different? Three rows, and each of them is the kind that decides a procurement. The first is where the data sits. Apidog's matrix lists a Europe hosting option on the Enterprise tier only, so an EU requirement costs $27 per user there. Here it costs nothing, because it is part of every Routebase plan, including the free one. The second is whether anything watches the API after release. There is no uptime or endpoint monitoring anywhere in Apidog's matrix, while Routebase generates monitors from the endpoints you designed. The third is what an agent may do. Apidog's MCP server is documented as supplying specs to an IDE, while Routebase exposes its full feature set so an agent designs, tests and publishes the spec itself. ### How does the MCP server differ? By direction. Apidog documents its MCP server as reading and caching your API specifications so an AI IDE can generate code that matches them, which is a supply line into the editor. Routebase exposes the platform, with its full feature set as tools, which is enough for an agent to design endpoints, write schemas, generate and run test suites, configure mocks and publish a version. Every call is scoped by the same role-based permissions as the person who asked for it. In practice that is the difference between an agent that writes client code against your API and one that builds the API. ### Can I import an Apidog project? Yes, through OpenAPI. Apidog exports OpenAPI 3.1, 3.0 or Swagger 2.0 as YAML or JSON, and Routebase imports 3.0, 3.1 and 3.2 directly. A dry run shows every endpoint, schema and component that would be created before anything is written. The test scenarios do not come across, because they are not part of an OpenAPI document in either product, so an agent regenerates them from the endpoints over MCP. ### Do you offer an on-premises version? No. Routebase is SaaS, in the EU or US region you choose at signup, and there is no self-hosted or air-gapped edition. It is worth separating the two requirements though. If the actual need is that the data stays in the EU, that is part of every Routebase plan including the free one, while Apidog places its Europe hosting option on the Enterprise tier. Only a genuine air-gap requirement rules us out. ### How does pricing compare? The list prices are close. Apidog is free for up to four users, then $9, $18 and $27 per user/month billed annually, and Routebase is free, then $9, $19 and $39. The comparison turns on what a tier has to include. A European team needing EU hosting reaches Apidog's $27 tier for that reason alone, while the same requirement is part of the free plan here. Monitoring, which has no Apidog tier at all, is included from $19. ### Am I locked in? No. Specs export as standard OpenAPI 3.0, 3.1 or 3.2 in YAML or JSON at any time, in the same format you would have imported from Apidog. That property is worth checking in both directions before any migration, including this one. --- # Bruno keeps your collections local. Routebase runs what has to be shared — Routebase > Bruno stores collections as plain-text files on one machine. The friction starts the moment something has to be reachable by somebody else. That is a mock server the frontend can call, a docs portal consumers read, or a monitor that runs while your laptop is closed. Routebase hosts all of them, from the same OpenAPI spec. Canonical page: https://routebase.dev/bruno-alternative/ Routebase vs Bruno ## Where a local client runs out of room Bruno's own documentation marks the line clearly. Its mock server "runs on your machine" and closes when Bruno does. Its documentation feature generates "a standalone HTML documentation file" that somebody then has to host, keep current and give a domain. Monitoring, scheduled runs and MCP have no documentation section at all. None of that is a flaw in a local client, because it is what local means. It is also the moment a team needs something else, such as an address a frontend can call on Tuesday, a portal consumers read, or a check that runs while every laptop is shut. - Hosted mock servers with a stable URL, running whether or not anyone's laptop is open - A published docs portal on your own domain, not an HTML file you deploy yourself - Monitors and scheduled suites that run on their own schedule - Keep Bruno for the client work — the OpenAPI file travels between both ## A mock the frontend can actually call Bruno's mock server is documented as running on your machine, backed by saved examples or an OpenAPI spec, and it shuts down when Bruno does. It is also still marked beta. For debugging your own request that is fine. For a frontend team starting work on Monday against an endpoint the backend has not built yet, it is not. They need a URL that answers on Tuesday too, and one that behaves like the real thing on a bad day. - Hosted mock servers with a stable URL, no laptop in the loop - Realistic generated data — names, emails, addresses, not a repeated placeholder - Stateful flows that keep state until you reset it, plus request variables like {{request.body.name}} - Latency, 5xx responses, timeouts and rate limiting, so the client handles the bad day ## Docs that publish themselves Bruno can generate a standalone HTML documentation file for a collection, which is a real feature, and enough if the audience is your own team. Where it stops is hosting, because the file has to be deployed, kept current, and given a domain, search and access control by somebody. Routebase publishes the portal from the spec, so the descriptions and error responses in it are the ones the contract carries, and republishing is part of releasing a version rather than a separate errand. - Branded portal with try-it console, full-text search and code examples - Your own domain with automatic SSL on Pro - Versioned pages — a consumer on v1 keeps reading v1 - llms.txt output, so agents read your docs as cheaply as humans do ## The hours nobody is at the keyboard Neither scheduled runs nor monitoring appear anywhere in Bruno's documentation, which follows from what it is, a client you open. But a contract does not only break while someone is looking at it. Routebase runs suites on a schedule from the Starter tier and generates monitors from the endpoints you designed, so the check knows the schema rather than pinging a URL. - Scheduled test suites from Starter, independent of monitoring limits - Monitors generated from the spec: status, schema and latency - Alert policies across environments, specs or individual monitors - Incidents and maintenance windows, so a planned deploy is not a page ## The contract as a shared object Files in Git give you diffs and history. What a diff cannot tell you is whether a change breaks somebody, because removing a required field and renaming an enum look the same in a text diff. Routebase treats the specification as a reviewable object with rules attached, meaning branches, merge requests, and a check that names the breaking change before it ships. - Spec branches with merge requests and required reviewers - 21 breaking-change rules checked between versions before publish - Built-in style guide rules from the Pro plan, with one-click fixes on some of them - Live presence — see who is editing which endpoint, down to the field ## An agent that can build the whole thing Bruno lists an AI Assistant from its Pro edition, and there is no MCP server in its documentation. Routebase ships one as part of the product, and it covers the full feature set. That is enough for an agent to design endpoints, write schemas, generate and run test suites, configure mocks and publish a version, under the same permissions as the person who asked for it. - The full feature set as tools, plus 13 prompts and 12 resources - Zero-install remote connector over OAuth, or stdio for a local agent - Every action scoped by your roles and reviewable as a diff - RBAC on every plan, not from a specific tier ## Bruno exports OpenAPI, and that is the whole migration There is no native .bru import in Routebase, and it would be the wrong thing to build, because Bruno exports collections as OpenAPI V3, and OpenAPI is what Routebase runs on. Export, import, and the portal, mocks and linting exist immediately. The free Bruno edition allows five OAS imports a month, which is worth knowing if you plan to move several collections in an afternoon. The export direction is not limited that way. - Bruno exports OpenAPI V3; Routebase imports 3.0, 3.1 and 3.2, YAML or JSON - No .bru import — the OpenAPI file is the supported path, and the honest one - Dry run first: every endpoint, schema and component listed before it is written - Keep Bruno as your client afterwards — export from Routebase whenever you want it back - An agent generates the test suites the export does not carry - Your collections stay where they are; nothing is deleted by importing a copy ## The full comparison, row by row | Capability | Routebase | Bruno | |------------|-----------|---------------| | Spec-first API design | Yes — Visual OpenAPI editor with spec branches and merge requests, built-in style guide rules and 21 breaking-change checks before publish | Partial — OpenAPI import, export and sync; the free edition allows 5 OAS imports per month, unlimited syncs from Pro | | Docs portal with custom domain | Yes — Branded portal generated from the spec: WYSIWYG editor, reusable snippets, page revisions, versioned pages, try-it and search; custom domain on Pro | Partial — In-app docs at workspace, collection, folder and request level; generates a standalone HTML file you host yourself | | Hosted mock servers | Yes — Spec-driven mock servers with realistic generated data, stateful flows, latency and failure simulation, and proxy mode | Partial — Local mock server on your own machine, generated from examples or an OpenAPI spec; currently a beta feature and stops when Bruno closes | | API test execution | Yes — Declarative test engine — 6 assertion types, 10 operators, 10 auth schemes, multi-step scenarios with chaining, fixtures and snapshots; no scripting required | Yes — Collection runner with tests and scripting, plus a CLI for CI | | Scheduled test runs | Yes — Included from Starter — independent of monitoring limits | No — No scheduled runs documented | | API monitoring | Yes — Uptime and contract checks generated from the spec, with alert policies, incidents and maintenance windows, from Pro | No — No uptime or endpoint monitoring documented | | API security scanning | Yes — Active OWASP API Top 10 scanning against a running environment — 8 scanners, auth personas for access-control tests, findings with severity, remediation guidance and a security score | No — No security scanning documented | | MCP server for AI agents | Yes — Built-in MCP server covering the full feature set, plus 13 prompts and 12 resources; zero-install OAuth connector, RBAC-scoped on every plan | No — No MCP server documented; an AI Assistant is listed from the Pro edition | | Local-first, offline storage | Partial — Desktop apps for macOS and Windows with offline editing and sync; the workspace itself is hosted | Yes — Collections are plain-text files on disk, offline-first, no account required | | Data residency choice | Yes — EU or US region chosen at signup, on every plan — German vendor, Azure-hosted | Yes — Nothing is hosted — collections stay on your machine and in your own Git remote | | Pricing model | Yes — Per user: free plan, then $9–$39/user/mo (annual) — every feature of a tier included | Yes — Open source free, $6 Pro, $11 Ultimate per user/month (annual); SSO, SCIM and audit logs on Ultimate | *Comparison as of August 2026, based on the vendor's public pricing page and product documentation; prices are the per-user annual rates unless noted. All third-party names and marks belong to their respective owners; Routebase is not affiliated with or endorsed by them. Spotted something outdated? Email us and we'll correct it.* ## Frequently asked questions ### What does Routebase add to a Bruno setup? Everything that needs an address. A hosted mock server a frontend can call on its own schedule, with realistic data, stateful flows and failure modes, rather than a process that ends when someone closes their laptop. A published documentation portal on your own domain, instead of an HTML file to deploy. Scheduled test suites and monitors that check the contract at four in the morning. And a specification that is branched, reviewed and versioned as a shared object, with 21 breaking-change rules running before a version ships. ### Is Routebase open source? No. Routebase is a commercial hosted platform, and the hosting is the point, with mock servers with a stable address, a published portal, and monitors that run unattended. What open source usually buys you is control over your own work, and that part holds here too. Specifications export as standard OpenAPI 3.0, 3.1 or 3.2 in YAML or JSON at any time, so the artifact stays yours in a format any tool reads. ### Can I import my Bruno collections? Not the .bru files directly, because Routebase imports OpenAPI 3.0 to 3.2, Postman Collection v2.1 and Insomnia Export v4. Bruno exports collections to OpenAPI V3, and that file imports cleanly. Note that Bruno's free edition caps OAS imports at five per month. That limit is on its import side, not its export, so moving out is not affected. ### Bruno costs less per seat. What does the difference buy? The infrastructure you would otherwise run yourself. Bruno is $6 and $11 per user against our $9 and $19, and at that price the mock server, the documentation hosting, the scheduled runs and the monitoring are your problem. Someone deploys the HTML docs file, someone keeps a mock reachable, and nothing watches the API at all. Routebase Pro includes hosted mocks, the branded portal with your own domain, uncapped scheduled suites, monitoring and the MCP server in the $19. ### Do you work offline? Partly, and less completely than Bruno. There are desktop apps for macOS and Windows with offline editing and a sync queue, but the workspace itself is hosted, so it lives in the EU or US region you choose at signup. Bruno's model is stronger here by design, because its collections are files that never need a server. Routebase trades that for a workspace the whole team and every agent can reach. ### Can we use both? Yes. Keep Bruno as the client people drive day to day, and let Routebase own the shared artifacts, meaning the specification, the hosted mocks, the published portal, and the monitors. The OpenAPI file moves in both directions, so neither side becomes a place your work is trapped. --- # The Mintlify alternative where the docs come from the contract — Routebase > Mintlify builds documentation, and only documentation. The question this page answers is whether your documentation should be a product you buy separately from the spec that produces it, the mocks that stand in for it, and the monitors that watch it. Canonical page: https://routebase.dev/mintlify-alternative/ Routebase vs Mintlify ## A docs portal is one output, not the whole product Mintlify's feature matrix is a documentation platform end to end, with a web editor, API playground, custom domain, MCP server, an assistant and a writing agent. What it does not contain is an OpenAPI design surface, mock servers, test execution or monitoring. An API team needs those regardless, and each one becomes another subscription and another place for the specification to drift. Routebase publishes the same kind of portal, and generates it from the spec it also designs, mocks, tests and watches. - The portal is generated from a spec you also design, version and review here - Mocks, test suites and monitors run from that same spec - EU or US data residency on every plan, chosen at signup - Per-user pricing — cheaper for small teams, and honestly not for large ones ## Docs generated from the contract you designed here Both products render an OpenAPI file well, and both give you a try-it console next to it. The difference is upstream. In Mintlify the specification arrives from somewhere else, whether a repo, another tool, or someone's export, and the docs are as current as that hand-off. In Routebase the spec is designed, branched, reviewed and versioned in the same place that publishes it. A field description is written once, and a breaking change is caught before the version goes out, not after a reader files an issue. - Field descriptions, error responses and examples come from the spec itself - Publishing a spec version and publishing the portal are one release, not two - 21 breaking-change rules run before a version can be published - Versioned pages — a consumer on v1 keeps reading v1 ## Everything that is not documentation This is the honest shape of the comparison. Several rows in the table are simply absent on one side, because Mintlify is a documentation platform and does not claim otherwise. Your API probably also needs a mock a frontend can develop against, suites that prove the implementation still matches, and monitors that check the contract at four in the morning. With Mintlify those are more tools, more bills, and more places for the spec to drift. - Spec-driven mocks with realistic data, stateful flows and failure modes - Declarative test suites — 6 assertion types, 10 operators, 10 auth schemes - Active OWASP API Top 10 scanning against a running environment, with remediation guidance - Monitors generated from the endpoints, with alert policies and incidents ## What the price actually covers Mintlify Pro is a flat $450 a month for documentation. Routebase Pro is $19 per user for documentation plus the specification editor, the hosted mocks, the test engine, security scanning, monitoring and the MCP server. For a team of five that is $95 against $450, with capabilities included that the flat rate does not contain at any price. The per-seat model only overtakes the flat rate somewhere past twenty editors. By then the comparison is no longer like for like, because matching the Routebase feature set means buying several more products alongside it. - 5 editors: $95/mo here, $450 there — and mocks, tests and monitoring included - No AI credit meter — agent access over MCP is part of the plan - Free plan with EU or US residency and the full specification editor - Enterprise is self-service from 25 seats, with SAML SSO, SCIM and audit export ## Where the workspace lives Mintlify's matrix lists EU hosting as available on Enterprise, which is the tier you reach by talking to sales. For a European team whose only blocker is where the data sits, that turns a pricing decision into a procurement one. Routebase asks the question at signup, on every plan including the free one, and keeps the workspace in the region you picked. - EU or US chosen at signup, on every plan - German vendor — DPA and GDPR compliance without an enterprise negotiation - Both regions on Microsoft Azure; the region is visible in the app and the API - SAML SSO, SCIM and audit log export self-service from 25 seats ## Agents that reach the API, not only the docs Mintlify ships an MCP server on every tier, and what it does is make the documentation readable by an agent. Routebase's MCP server exposes the platform, with its full feature set as tools, so an agent designs endpoints, writes schemas, builds and runs test suites, configures mocks and publishes the version that produces the docs. Both are MCP, but they open onto different things. - The full feature set as tools, plus 13 prompts and 12 resources - An agent can take a spec from empty to published portal - Every call scoped by your roles; RBAC on every plan - llms.txt published for your portal, so your consumers' agents read it cheaply too ## Bring the spec, because the prose is the work The OpenAPI file moves cleanly, so you import it and the portal, the try-it console and the search exist immediately, with the mocks and the linting alongside. What does not move automatically is the hand-written material, because Mintlify's MDX pages are its own format, and guides, tutorials and conceptual pages have to be carried across as content. Pages can be created over MCP, so an agent can do the mechanical part of that, but it is worth planning for rather than discovering. - OpenAPI 3.0, 3.1 or 3.2 import, YAML or JSON — the reference section rebuilds itself - Dry run first: every endpoint and schema listed before anything is written - Hand-written MDX pages are content, not an import — plan the guides - Doc pages, folders and versions are all MCP tools, so an agent can bulk-create them - Your own domain with automatic SSL on Pro, with redirects from the old paths - Full OpenAPI export any time — the spec is yours either way ## The full comparison, row by row | Capability | Routebase | Mintlify | |------------|-----------|---------------| | Docs portal with custom domain | Yes — WYSIWYG editor with slash commands and live collaboration, reusable snippets, page revisions, versioned docs, try-it console and search; custom domain on Pro | Yes — Web editor with live collaboration, comments and suggestions, API playground, 27 MDX components plus React, custom domain and search on every tier; assistant and writing agent from Pro | | Spec-first API design | Yes — Visual OpenAPI editor with spec branches and merge requests, built-in style guide rules and 21 breaking-change checks before publish | No — No OpenAPI design surface — specs are authored elsewhere and rendered here | | Hosted mock servers | Yes — Spec-driven mock servers with realistic generated data, stateful flows, latency and failure simulation, and proxy mode | No — No mock servers | | API test execution | Yes — Declarative test engine — 6 assertion types, 10 operators, 10 auth schemes, multi-step scenarios with chaining, fixtures and snapshots; no scripting required | No — No test execution | | API monitoring | Yes — Uptime and contract checks generated from the spec, with alert policies, incidents and maintenance windows, from Pro | No — No API monitoring | | API security scanning | Yes — Active OWASP API Top 10 scanning against a running environment — 8 scanners, auth personas for access-control tests, findings with severity, remediation guidance and a security score | No — Not a documentation platform capability | | MCP server for AI agents | Yes — Built-in MCP server covering the full feature set, plus 13 prompts and 12 resources; zero-install OAuth connector, RBAC-scoped on every plan | Yes — MCP server on every tier, aimed at making the documentation readable by agents | | Data residency choice | Yes — EU or US region chosen at signup, on every plan — German vendor, Azure-hosted | Partial — EU hosting listed as available on Enterprise only | | Custom domain on the free tier | No — Custom domain with automatic SSL from Pro ($19/user/mo) | Yes — Custom domain included on the free Starter tier | | Seat model | Partial — Per user — better below roughly 24 editors, worse above it | Yes — Flat $450/mo with unlimited editor seats on Pro; 5 seats on the free Starter tier | | Pricing model | Yes — Per user: free plan, then $9–$39/user/mo (annual) — every feature of a tier included | Yes — Starter free (5 seats), Pro $450/mo flat (annual), Enterprise on request; AI credits 10,000/mo on Pro, $0.01 per credit over | *Comparison as of August 2026, based on the vendor's public pricing page and product documentation; prices are the per-user annual rates unless noted. All third-party names and marks belong to their respective owners; Routebase is not affiliated with or endorsed by them. Spotted something outdated? Email us and we'll correct it.* ## Frequently asked questions ### Can Routebase publish the docs we run on Mintlify today? Yes, with a branded portal on your own domain with a try-it console on every endpoint, full-text search, code examples in nine languages, versioned pages and llms.txt output for agents. Two differences are worth knowing. The reference documentation is generated by the specification you design, branch and review in the same product, so a field description is written once and a breaking change is caught before the version publishes. And publishing does not go through a repository. Mintlify's editor commits to your Git repo and opens a pull request, which suits a docs-as-code team and requires one. In Routebase the version is published from the app, and the CLI is there for teams that do want the Git workflow. ### How does the pricing compare? Routebase Pro is $19 per user per month billed annually and covers the whole lifecycle, while Mintlify Pro is a flat $450 a month and covers documentation. A five-person team pays $95 here against $450 there, and gets the spec editor, mocks, test suites, security scanning and monitoring in the same subscription. A flat rate wins on paper once you pass roughly twenty editors, but only against the documentation half of the product, since the other capabilities are not part of it. ### Can I migrate my Mintlify docs? The API reference comes across with the OpenAPI file, so you import it and the endpoint pages, schemas and try-it console are generated. The hand-written MDX pages are the real work, because they are Mintlify's own format, so guides and conceptual pages have to be moved as content rather than imported. Doc pages, folders and versions are all available as MCP tools, so an agent can do the repetitive part under your review. ### How do agents and AI readers work with the portal? Every published portal serves an llms.txt, so a reader's own assistant, whether Claude, ChatGPT, or an IDE agent, consumes your documentation cheaply and accurately instead of scraping rendered HTML. On the building side, the MCP server gives your team's agents tools over the spec, the tests and the docs themselves, with no credit meter on top of the plan. Routebase does not host a chat widget on your docs, because the direction here is agents that work on the API, and readers who bring their own. ### Where is my data hosted? You choose EU or US at signup and the workspace stays in that region, on every plan including the free one. Mintlify lists EU hosting as available on its Enterprise tier. Both run on major cloud infrastructure, and Routebase is a German company, so a DPA and GDPR compliance do not require an enterprise contract. ### Am I locked in? No. Specs export as standard OpenAPI 3.0, 3.1 or 3.2 in YAML or JSON at any time, and doc pages are readable through the API and over MCP. The reference documentation is reproducible anywhere from the exported spec, which is the same reason migrating into Routebase is straightforward for that part. --- # Pricing — Routebase > Every account starts with a 14-day Pro trial — no credit card required. Canonical page: https://routebase.dev/pricing/ ## Pricing that scales with your team Per user, per month. Prices exclude VAT. Billed annually or monthly. European customers pay the same amounts in EUR, everyone else in USD. | Plan | Annual (per user/month) | Monthly (per user/month) | For | |------|------------------------|--------------------------|-----| | Free | $0 | $0 | For trying Routebase and small personal projects. | | Starter | $9 | $11 | For small teams getting their API workflow in order. | | Pro | $19 | $23 | For teams running their whole API lifecycle in one place. | | Enterprise | $39 | $45 | For organizations with compliance and identity requirements. | ## Free For trying Routebase and small personal projects. - 1 user, 2 projects - 1,000 mock requests/mo - Auto-generated docs portal - OpenAPI import & export ## Starter For small teams getting their API workflow in order. - Unlimited users, 10 projects - 10,000 mock requests/mo - Scheduled test runs - Email support ## Pro For teams running their whole API lifecycle in one place. - Unlimited projects & specs - 100,000 mock requests/mo - Spec branches & merge requests - Governance & security scanning - Monitoring & alerts - Custom domain for your docs portal ## Enterprise For organizations with compliance and identity requirements. 25 seats minimum — self-service, no sales call. - SAML SSO & SCIM provisioning - Unlimited mock requests & monitors - Audit log export - Dedicated support & SLA ## Compare plans ### Usage | | Free | Starter | Pro | Enterprise | |---|---|---|---|---| | Users | 1 | Unlimited | Unlimited | 25 minimum | | Projects | 2 | 10 | Unlimited | Unlimited | | Specs per project | 3 | 10 | Unlimited | Unlimited | | Endpoints per spec | 20 | Unlimited | Unlimited | Unlimited | | Test suites | 2 | Unlimited | Unlimited | Unlimited | | Test runs per month | 100 | 2,000 | Unlimited | Unlimited | | Mock requests per month | 1,000 | 10,000 | 100,000 | Unlimited | | Monitors | No | No | 100 | Unlimited | | Webhooks | No | 3 | Unlimited | Unlimited | | Custom pages per docs version | 3 | Unlimited | Unlimited | Unlimited | ### Design, docs and mocks | | Free | Starter | Pro | Enterprise | |---|---|---|---|---| | Visual OpenAPI editor, import and export | Yes | Yes | Yes | Yes | | Docs portal generated from the spec | Yes | Yes | Yes | Yes | | Mock server generated from the spec | Yes | Yes | Yes | Yes | | Built-in MCP server | Read-only | Yes | Yes | Yes | | Mock proxy mode for unmatched requests | No | Yes | Yes | Yes | | Spec branches and merge requests | No | No | Yes | Yes | | Custom domain for the docs portal | No | No | Yes | Yes | | Remove Powered by Routebase | No | No | Yes | Yes | ### Testing and quality | | Free | Starter | Pro | Enterprise | |---|---|---|---|---| | Postman and Insomnia collection import | No | Yes | Yes | Yes | | Scheduled test runs | No | Yes | Yes | Yes | | Custom style guides and governance score | No | No | Yes | Yes | | OWASP API security scanning | No | No | Yes | Yes | | Monitoring with contract drift alerts | No | No | Yes | Yes | ### Organization and security | | Free | Starter | Pro | Enterprise | |---|---|---|---|---| | Hosting in the EU or the US | Yes | Yes | Yes | Yes | | Custom roles | No | No | Yes | Yes | | Security audit log | No | No | 30 days | 365 days, with export | | SAML SSO and SCIM provisioning | No | No | No | Yes | ## Pricing questions ### What does the Free plan include? The Free plan is for one user and covers two projects with three specs each, up to 20 endpoints per spec, 1,000 mock requests and 100 test runs a month. The docs portal, the mock server and read access over the MCP server are included, so you can design, document, mock and test one API before you pay. ### Which plan do I need for API monitoring? Monitoring starts on Pro, which includes 100 monitors, and Enterprise has no monitor limit. Every check validates the response against the contract as well as the status code, so drift raises an alert on both plans. ### Which plan includes security scanning and governance? OWASP API security scanning, custom style guides and the governance score are part of Pro and Enterprise. Pro also adds monitoring, spec branches with merge requests and custom roles. ### How is Routebase billed? Starter, Pro and Enterprise are priced per user per month, and billing annually costs less than billing monthly. Enterprise starts at 25 seats and is bought self-service like the other plans, without a sales call. ### What happens when I reach the mock request limit? The usage view warns you from 80 percent of the monthly limit onward. At 100 percent, new mock requests are blocked until the monthly counter resets or you upgrade. ## Microsoft Marketplace Prefer to buy through Microsoft? Starter, Pro, and Enterprise are listed on Microsoft Marketplace at the same USD list prices — billed by Microsoft on your existing account, with the 14-day trial on Starter and Pro. [How buying through Microsoft works](https://routebase.dev/microsoft-marketplace/) --- # Buy Routebase through your Microsoft account — Routebase > Routebase is a transactable SaaS offer on Microsoft Marketplace. Pick a plan there and Microsoft bills it with the rest of your Microsoft spend — no new vendor onboarding, no separate invoice. Canonical page: https://routebase.dev/microsoft-marketplace/ Listing: https://marketplace.microsoft.com/en-us/product/routebase.routebase-api-lifecycle ## What changes when you buy through Microsoft ### One invoice, one vendor Microsoft bills your existing account. Procurement already knows the vendor, so there is nothing new to onboard. ### Sign in with Microsoft Microsoft Entra ID sign-in on every plan. Enterprise adds SAML SSO and SCIM provisioning for your directory. ### EU or US, on Azure Choose the region when the workspace is created. Both run on Microsoft Azure, and your data stays where you put it. ## Plans on Microsoft Marketplace The same USD list prices as on routebase.dev — Microsoft shows them in your local currency on the listing. | Plan | Per user / month (USD) | On Microsoft Marketplace | |------|------------------------|--------------------------| | Starter | $11 monthly · $9 annually | Available · 14-day free trial | | Pro | $23 monthly · $19 annually | Available · 14-day free trial | | Enterprise | $45 monthly · $39 annually | Available · 25 seats minimum | | Free | $0 | Direct only — sign up on routebase.dev | ## Built for Microsoft environments Routebase runs on Microsoft Azure in the EU and US. Developers reach the workspace from Visual Studio Code, and the test runner ships as a .NET tool and a GitHub Action, so contract tests run in the pipelines you already have. - Microsoft Entra ID - SAML SSO & SCIM - Visual Studio Code - .NET tool - GitHub Action - Azure EU · US ## Frequently asked questions ### Is the price the same as buying direct? Yes, in USD: the listing carries the same per-user list prices as routebase.dev, monthly or annual. Microsoft converts them into your local currency and bills them on your existing Microsoft account. ### Which plans can we buy there? Starter, Pro, and Enterprise. Starter and Pro include the 14-day free trial; Enterprise starts at 25 seats. The Free plan is available directly on routebase.dev. [Compare all plans](https://routebase.dev/pricing/) ### Where does our data live? You choose EU or US when the workspace is created, and it stays in that region. Both regions run on Microsoft Azure. --- # API Guides — Routebase > Long-form guides on API testing, API authentication, API versioning, API documentation, OpenAPI, API monitoring, API design, API mocking, API governance and API security, covering the methods, the trade-offs between them, and how to put them into practice. Canonical page: https://routebase.dev/guides/ 10 guides, 107 chapters Each guide starts with the methods, explains where each one earns its place, and ends with how you put it into practice. The ten build on each other in the order they are numbered. Every chapter still stands on its own, so you can read the one you need and follow the links from there. ## [API Design](https://routebase.dev/guides/api-design/) The decisions you make before you write a line of OpenAPI, from resource shape and method semantics through errors, pagination, idempotency and rate limits, each one with what it costs. Eleven chapters. 1. [Resources and URLs](https://routebase.dev/guides/api-design/resources-and-urls/index.md): How to pick the things your API exposes, why nesting stops paying after one level, what a path convention is worth, and which identifiers belong in a URL. 2. [Methods and Status Codes](https://routebase.dev/guides/api-design/http-methods-and-status-codes/index.md): What each HTTP method promises a caller, why PUT and PATCH are not interchangeable, and which status code sets which expectation, with the RFC behind each one. 3. [Designing API Errors](https://routebase.dev/guides/api-design/designing-api-errors/index.md): One shape for every failure, why an error code is a contract and a message is not, what belongs in a problem document, and what has to stay out of it. 4. [Actions That Are Not CRUD](https://routebase.dev/guides/api-design/actions-that-are-not-crud/index.md): Cancel, publish, retry, search and bulk edit, modelled three different ways, with what each modelling costs and the questions that decide between them. 5. [Pagination, Filtering and Sorting](https://routebase.dev/guides/api-design/api-pagination-filtering-and-sorting/index.md): Offset against cursor and what each costs when data changes underneath, why limits are not optional, and how little filter and sort syntax is standard. 6. [Idempotency and Retries](https://routebase.dev/guides/api-design/idempotency-and-retries/index.md): Why a timeout is ambiguous, what an idempotency key actually promises, how long a stored result has to live, and which parts of the pattern are standardised. 7. [Rate Limits as a Design Decision](https://routebase.dev/guides/api-design/api-rate-limiting/index.md): What a published limit promises a caller, why 429 needs Retry-After, how little of the header convention is standardised, and what a limit counts against. 8. [Consistency Across an API](https://routebase.dev/guides/api-design/consistency-across-an-api/index.md): Why the same decision has to appear at every endpoint, why intention is not a mechanism, and the three things that hold a convention in place over time. 9. [Designing APIs for AI Agent Clients](https://routebase.dev/guides/api-design/designing-for-agent-clients/index.md): Hypermedia promised runtime discovery to clients generated ahead of time. A caller that reads your description at runtime now exists, and it reads the prose. 10. [What to Look for in an API Design Tool](https://routebase.dev/guides/api-design/api-design-tools/index.md): Eight questions about what a design tool stores, checks and lets you take with you, tested on your largest real description instead of a sample. ## [OpenAPI](https://routebase.dev/guides/openapi/) What an OpenAPI document is, how one is put together, how to write schemas that hold up, how to validate and lint it, and everything you can derive from the file once it exists. Eleven chapters. 1. [OpenAPI vs Swagger](https://routebase.dev/guides/openapi/openapi-vs-swagger/index.md): Where the two names come from, what changed when Swagger 2.0 became OpenAPI 3.0, which tools still say Swagger, and which file your tooling expects. 2. [Anatomy of an OpenAPI Document](https://routebase.dev/guides/openapi/anatomy-of-an-openapi-document/index.md): Every top-level field of an OpenAPI document explained in the order you meet it, with one complete working example and the difference between YAML and JSON. 3. [OpenAPI 3.0, 3.1 and 3.2](https://routebase.dev/guides/openapi/openapi-3-0-3-1-3-2/index.md): What changed when 3.1 adopted JSON Schema 2020-12, what 3.2 added on top, and what a document and its tooling actually have to touch on the way up. 4. [OpenAPI Schemas](https://routebase.dev/guides/openapi/openapi-schemas/index.md): Objects, arrays and primitives, allOf against oneOf and anyOf, enums with meaning, formats, nullability in both dialects, and examples that stay true. 5. [Parameters, Request Bodies and Responses](https://routebase.dev/guides/openapi/openapi-parameters-request-bodies-and-responses/index.md): The four parameter locations, how a request body is described, responses per status code with headers and examples, and the errors documents omit. 6. [Components and Reuse](https://routebase.dev/guides/openapi/openapi-components-and-reuse/index.md): What lives under components, how a reference works, when extracting something pays off and when it is premature, and what changes once it is shared. 7. [Validating and Linting OpenAPI](https://routebase.dev/guides/openapi/validating-and-linting-openapi/index.md): Validation asks whether a document is legal OpenAPI, linting whether it is good. What each catches, which rules find real defects, what blocks a release. 8. [Importing Postman and Insomnia Collections](https://routebase.dev/guides/openapi/importing-postman-and-insomnia-collections/index.md): Why a Postman or Insomnia collection is not an API contract, what an importer can infer from example data, and the work left after the import. 9. [What You Derive From OpenAPI](https://routebase.dev/guides/openapi/what-you-derive-from-openapi/index.md): Reference docs, mocks, contract tests, monitors and code samples all come from one document. What each needs from it, and where generation stops helping. 10. [OpenAPI Descriptions for AI Agents](https://routebase.dev/guides/openapi/openapi-descriptions-for-agents/index.md): What a coding agent reads from an OpenAPI document, the four questions a description must answer, and why fields treated as decoration decide the call. ## [API Mocking](https://routebase.dev/guides/api-mocking/) What a mock server answers and what it never proves, how one is generated from a contract, how to make it behave like the network it replaces, and how to stop it drifting. Eleven chapters. 1. [Mocking an API from an OpenAPI Contract](https://routebase.dev/guides/api-mocking/mock-api-from-openapi/index.md): Why mocks are derived rather than written, what a generator reads from paths, status codes and schemas, what it cannot know, and why coverage matters. 2. [Which Rule Answers a Mock Request](https://routebase.dev/guides/api-mocking/mock-request-matching/index.md): A mock server is a router first. What can be matched, why rules overlap, how priority breaks the tie, and what should happen when nothing matches. 3. [Mock Data Worth Testing Against](https://routebase.dev/guides/api-mocking/mock-data-generation/index.md): Static, generated and fixture data as three sources with three failure modes, why a field reading string ruins a layout, and how locale breaks a client. 4. [Conditional Mock Responses](https://routebase.dev/guides/api-mocking/conditional-mock-responses/index.md): How to get a valid case, a not-found and a validation failure out of one route without a rule per outcome, what to branch on, and what the fallback is. 5. [Simulating API Errors, Latency and Rate Limits](https://routebase.dev/guides/api-mocking/simulating-errors-latency-and-rate-limits/index.md): Latency with a range, failures at a probability, a dead socket instead of a clean 500, and the 429 nobody handles until it happens in production. 6. [Stateful Mocks: When the Attempt Needs Memory](https://routebase.dev/guides/api-mocking/stateful-mocks/index.md): Why a create followed by a list breaks every stateless mock, what state buys you in a cart or a wizard, and where memory turns a mock into a backend. 7. [Keeping Mocks in Sync With the Spec](https://routebase.dev/guides/api-mocking/keeping-mocks-in-sync/index.md): A mock behind the contract is worse than no mock. The three states of a generated rule, why a published version should freeze, and what regeneration replaces. 8. [Mocks in the Frontend Workflow](https://routebase.dev/guides/api-mocking/mocking-for-frontend-development/index.md): Starting on day one, the base URL as configuration instead of a code branch, CORS and tokens in a browser, and what changes at the real backend. 9. [When Not to Mock an API](https://routebase.dev/guides/api-mocking/when-not-to-mock/index.md): A passing run against a mock is a statement about the mock. Four questions mocking cannot answer, what takes over for each, and proxy mode in between. 10. [What to Look For in an API Mocking Tool](https://routebase.dev/guides/api-mocking/api-mocking-tools/index.md): Eight questions about where a mock's responses come from, what happens when the contract changes and who can reach it, with two exercises. ## [API Documentation](https://routebase.dev/guides/api-documentation/) What belongs in API documentation, how to write it, how to keep it true while the API changes, and how to publish and measure it. Ten chapters from the page inventory through hosting. 1. [What Belongs in API Documentation](https://routebase.dev/guides/api-documentation/what-belongs-in-api-documentation/index.md): The pages nearly every API needs beyond the endpoint reference, what each must deliver, and how to tell a working page from one that only looks complete. 2. [How to Write API Reference Documentation](https://routebase.dev/guides/api-documentation/how-to-write-api-documentation/index.md): Summaries against descriptions, the questions a description has to answer, examples per response, enum values with meaning, and errors a reader can act on. 3. [Keeping API Documentation Up to Date](https://routebase.dev/guides/api-documentation/keeping-api-documentation-up-to-date/index.md): Why documentation drifts from the API, what to generate and what to write, how pinned snapshots and doc versions work, and where a changelog comes from. 4. [Interactive API Documentation](https://routebase.dev/guides/api-documentation/interactive-api-documentation/index.md): What a try-it playground needs to be useful, which servers and credentials it may carry, how code samples earn their place, and what must never appear. 5. [API Documentation for AI Agents](https://routebase.dev/guides/api-documentation/api-documentation-for-ai-agents/index.md): What an agent can read from a documentation site, the llms.txt proposal, Markdown versions and content negotiation, and how to check what an agent receives. 6. [Publishing and Hosting API Documentation](https://routebase.dev/guides/api-documentation/publishing-and-hosting-api-documentation/index.md): Where documentation lives, subdomain against your own domain, who may read it, how to take a version back, and the settings that decide how it is found. 7. [API Docs as Code](https://routebase.dev/guides/api-documentation/api-docs-as-code/index.md): Markdown in the repository against an editor in the portal, what each arrangement buys, what keeping both in step costs, and where the contract lives. 8. [Measuring API Documentation](https://routebase.dev/guides/api-documentation/measuring-api-documentation/index.md): The signals that show whether documentation works, why failed searches are your best backlog, how to read reader feedback, and which numbers to ignore. 9. [API Documentation Structure and Navigation](https://routebase.dev/guides/api-documentation/api-documentation-structure-and-navigation/index.md): Trees against flat lists, how readers actually find a page, what a version switcher has to do, and branding that supports the content instead of competing. 10. [What to Look For in API Documentation Tools](https://routebase.dev/guides/api-documentation/api-documentation-tools/index.md): Nine questions about where a documentation tool gets its reference, how its versions follow the API, and what readers and their agents can find. ## [API Testing](https://routebase.dev/guides/api-testing/) The methods, the strategy that ties them together, and how to run each one in practice. Twelve chapters covering functional, contract, workflow, data-driven, performance, security and production testing. 1. [Types of API Testing, and Where Each One Fits](https://routebase.dev/guides/api-testing/types-of-api-testing/index.md): Functional, contract, workflow, data-driven, performance, security and production tests, with what each one finds, what it misses, and where it belongs. 2. [Contract Testing vs. Integration Testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/index.md): What a contract test proves, what an integration test proves, why neither replaces the other, and how drift opens up between a spec and the running service. 3. [Functional API Tests: What to Assert](https://routebase.dev/guides/api-testing/functional-api-tests/index.md): How to choose assertions that catch real breakage without turning every unrelated change into a red run, plus negative cases, extraction and chaining. 4. [API Integration Testing With Scenarios](https://routebase.dev/guides/api-testing/api-integration-testing/index.md): Testing multi-step flows where each call depends on the last, covering state between steps, asynchronous work, conditional branches and idempotency. 5. [API Test Data and Data-Driven Runs](https://routebase.dev/guides/api-testing/api-test-data/index.md): How to make API tests deterministic, which means owning the data each run needs, cleaning up after it, and repeating one suite across many input rows. 6. [API Testing Environments, Auth and Secrets](https://routebase.dev/guides/api-testing/api-testing-environments/index.md): Run one suite against development, staging and production without editing it, guard the environments nobody may write to, and keep credentials out of tests. 7. [API Performance Testing: Load, Stress and Soak](https://routebase.dev/guides/api-testing/api-performance-testing/index.md): Load, stress and soak profiles, why the p95 beats the average, how to turn a latency budget into a pass or fail, and where a load test must never point. 8. [API Security Testing](https://routebase.dev/guides/api-testing/api-security-testing/index.md): How security tests fit into an API test suite, from authorization tests with two identities and fuzzing to the cadence of scans and where automation stops. 9. [Automated API Testing in CI/CD](https://routebase.dev/guides/api-testing/automated-api-testing-in-ci-cd/index.md): Where the gate belongs, why exit codes are a contract, how to make a failure readable in the pipeline, and how to fix flakiness before people learn to rerun. 10. [Testing APIs in Production](https://routebase.dev/guides/api-testing/api-monitoring-and-contract-drift/index.md): Why testing does not stop at the release, what scheduled checks and live contract validation add to a suite, and where the monitoring guide takes over. 11. [Testing an API With an AI Agent Over MCP](https://routebase.dev/guides/api-testing/testing-with-an-agent-over-mcp/index.md): What an agent can reliably derive from a specification, what it must not decide on its own, and why the permission model matters more than the model does. 12. [What to Look For in API Testing Tools](https://routebase.dev/guides/api-testing/api-testing-tools/index.md): Nine questions that separate a testing tool your pipeline can rely on from one that only demos well, from spec validation to CI exit codes. ## [API Authentication](https://routebase.dev/guides/api-authentication/) Every method worth knowing, from API keys and JWT through the OAuth 2.0 grants to mutual TLS, with the trade-offs of each and how to set them up. Eleven chapters, every security claim sourced to its RFC. 1. [API Keys: What They Are and What They Are Not](https://routebase.dev/guides/api-authentication/api-keys/index.md): How an API key differs from a user credential, why the query string is the wrong place for one, and what scoping, rotation and per-key rate limits buy you. 2. [HTTP Basic Authentication and Digest, Explained](https://routebase.dev/guides/api-authentication/http-basic-authentication/index.md): Why Base64 is not encryption, what Digest was designed to solve, where both still make sense, and the challenge-response mechanics behind them. 3. [Bearer Tokens and JWT](https://routebase.dev/guides/api-authentication/bearer-tokens-and-jwt/index.md): Opaque tokens against self-contained ones, what a JWT actually guarantees, the validation mistakes that keep recurring, and what RFC 8725 says about them. 4. [OAuth 2.0: The Grant Types, Explained](https://routebase.dev/guides/api-authentication/oauth-2-grant-types/index.md): The four roles, the grants that matter today, why PKCE is now required for every authorization code flow, and what RFC 9700 has retired. 5. [OpenID Connect](https://routebase.dev/guides/api-authentication/openid-connect/index.md): The identity layer on top of OAuth 2.0, why an ID token is not an access token, what discovery buys you, and when plain OAuth is the right answer instead. 6. [Request Signing: OAuth 1.0, AWS SigV4 and Hawk](https://routebase.dev/guides/api-authentication/request-signing/index.md): What request signing buys you over a bearer token, how nonces and timestamps stop replay, and where each of these four schemes still turns up. 7. [Mutual TLS, Cookies and Custom HMAC Schemes](https://routebase.dev/guides/api-authentication/mutual-tls-cookies-and-custom-hmac/index.md): Certificates as identity at the transport layer, cookies and CSRF, and why a home-grown signing scheme is usually a worse version of one that already exists. 8. [OpenAPI Security Schemes and Per-Endpoint Auth](https://routebase.dev/guides/api-authentication/openapi-security-schemes/index.md): Security schemes, per-operation requirements, scopes, and what consumers and agents can only learn from a specification that documents its authentication. 9. [Setting Up API Authentication in Routebase, End to End](https://routebase.dev/guides/api-authentication/setting-up-authentication-in-routebase/index.md): Configure credentials once per environment, inherit them everywhere, keep secrets in variables, and cover the pipeline, scans and agents from one setup. 10. [API Authentication Testing: The Negative Cases](https://routebase.dev/guides/api-authentication/api-authentication-testing/index.md): The negative cases worth writing, why 401 and 403 mean different things, and how two identities prove what a single-user suite structurally cannot. 11. [Choosing an API Authentication Method](https://routebase.dev/guides/api-authentication/choosing-an-api-authentication-method/index.md): A decision table across complexity, revocation, rotation, delegation, browser exposure and maturity, plus the four questions that usually settle it first. ## [API Security](https://routebase.dev/guides/api-security/) The OWASP API Security Top 10 from 2023 as a working map, what each category looks like from the outside, how to scan a running API for them, and what no scanner will ever find. Thirteen chapters. 1. [Broken Object Level Authorization](https://routebase.dev/guides/api-security/broken-object-level-authorization/index.md): API1:2023 is the flaw a single-user suite cannot see, why proving it takes two identities from two tenants, and why 404 beats 403 on a foreign object. 2. [Function and Property Level Authorization](https://routebase.dev/guides/api-security/function-and-property-level-authorization/index.md): API5:2023 and API3:2023, meaning the admin endpoint that forgot its role check and the body that carries fields this caller has no business with. 3. [Broken Authentication in APIs](https://routebase.dev/guides/api-security/api-authentication-failures/index.md): API2:2023 covers what breaks after the method is chosen, from tokens accepted without a valid signature to a login that answers a thousand guesses. 4. [Unrestricted Resource Consumption](https://routebase.dev/guides/api-security/unrestricted-resource-consumption/index.md): API4:2023 is a design failure, not an operations problem, covering unbounded pages, oversized bodies, missing limits and calls that cost money. 5. [Server Side Request Forgery](https://routebase.dev/guides/api-security/server-side-request-forgery/index.md): API7:2023 turns any URL field in a request body into an instruction your server carries out, which is why the defence is an allow list rather than a filter. 6. [Misconfiguration, TLS and Headers](https://routebase.dev/guides/api-security/api-security-misconfiguration/index.md): API8:2023 covers settings that give ground away before any attack, from cleartext transport and old TLS to wildcard CORS and a live debug endpoint. 7. [Shadow and Zombie APIs](https://routebase.dev/guides/api-security/shadow-and-zombie-apis/index.md): API9:2023 is about what is still answering that nobody remembers deploying, from an old version left running to a staging host with production data behind it. 8. [Running a Scan Against a Live API](https://routebase.dev/guides/api-security/running-an-api-security-scan/index.md): What a scan needs before it starts, what it does to its target, and why concurrency, delay and a time budget are courtesy settings, not performance ones. 9. [Triaging API Security Findings](https://routebase.dev/guides/api-security/triaging-security-findings/index.md): Severity against confidence, reproducing before reporting, a false positive versus an accepted risk, and what a security score is actually good for. 10. [API Security in CI/CD](https://routebase.dev/guides/api-security/api-security-in-ci-cd/index.md): Where a scan belongs in a pipeline, how to set a gate that stays switched on in month three, and why findings belong in the code host. 11. [What a Scanner Cannot Find](https://routebase.dev/guides/api-security/what-a-scanner-cannot-find/index.md): Business logic abuse, multi-step sequences and the APIs you consume are beyond a scanner, and knowing that line is what gives a green report meaning. 12. [What to Look for in an API Security Testing Tool](https://routebase.dev/guides/api-security/api-security-testing-tools/index.md): Eight criteria that decide whether a scanner is still being read in month three, written as questions to put to any tool including the one you already run. ## [API Versioning](https://routebase.dev/guides/api-versioning/) Every versioning method, what each one costs, when a new version is unavoidable, and when the right answer is not to version at all. Thirteen chapters from breaking changes through deprecation and sunset. 1. [What Counts as a Breaking Change in an API](https://routebase.dev/guides/api-versioning/api-breaking-changes/index.md): The changes that break a live consumer, the ones that only feel dangerous, the asymmetry between request and response, and how to classify them automatically. 2. [How Often Do APIs Break?](https://routebase.dev/guides/api-versioning/how-often-do-apis-break/index.md): Half of the public API contracts we compared changed within three years, two thirds of those changes break a client, and nine in ten breaking changes kept the major version. 3. [API Versioning Strategies Compared](https://routebase.dev/guides/api-versioning/api-versioning-strategies/index.md): URL path, header, query parameter, media type and date-based versioning, with the routing, caching, tooling and visibility trade-offs of each. 4. [Semantic Versioning for APIs](https://routebase.dev/guides/api-versioning/semantic-versioning-for-apis/index.md): How SemVer maps onto an HTTP API, why consumers only ever feel the major, what an alias like v1 really is, and where date-based numbering fits instead. 5. [When You Must Version an API](https://routebase.dev/guides/api-versioning/when-to-version-an-api/index.md): The changes that have no additive path, the consumer situations that leave you no choice, and the semantic breaks that never show up in a diff. 6. [When API Versioning Does Not Matter](https://routebase.dev/guides/api-versioning/when-not-to-version-an-api/index.md): The situations where a version number buys nothing, what running parallel versions really costs, and the alternatives that solve the same problem for less. 7. [Backward Compatible API Changes](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/index.md): Additive evolution, the tolerant reader pattern, expand and contract, and how to prove an API stayed compatible instead of assuming it did. 8. [Running Multiple API Versions at Once](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/index.md): What it means for a version to be live in an environment, how routing decides who gets which one, and how docs, mocks and tests stay bound to it. 9. [API Deprecation and the Sunset Header](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/index.md): How to retire an endpoint or a version without ambushing anyone, using the Deprecation and Sunset headers, dated phases and a usable migration guide. 10. [API Changelogs and Migration Guides](https://routebase.dev/guides/api-versioning/api-changelogs-and-migration-guides/index.md): What belongs in a changelog entry, how release notes differ from it, and how to write a migration guide that reaches the consumer at the moment they need it. 11. [OpenAPI Versioning](https://routebase.dev/guides/api-versioning/openapi-versioning/index.md): The three different versions an OpenAPI document carries, how spec versions relate to the API consumers call, and where documentation versions fit. 12. [Versioning Beyond REST: GraphQL, gRPC and Events](https://routebase.dev/guides/api-versioning/versioning-graphql-grpc-and-events/index.md): Why GraphQL evolves instead of versioning, how Protobuf field numbers make compatibility mechanical, and what a schema registry does for event streams. 13. [Choosing an API Versioning Strategy](https://routebase.dev/guides/api-versioning/choosing-an-api-versioning-strategy/index.md): One decision path from the change in front of you to the method, with the criteria that actually separate the options and the policy each one needs. ## [API Monitoring](https://routebase.dev/guides/api-monitoring/) What to watch on a live API, which kinds of check answer which question, how to set thresholds and alerts people still read, and how to catch a response that is wrong while the status code stays green. Ten chapters. 1. [Types of API Monitoring Checks](https://routebase.dev/guides/api-monitoring/types-of-api-monitoring-checks/index.md): What a health check proves, what a synthetic call adds, what contract validation catches that neither does, and how to set intervals and timeouts. 2. [API Uptime, Latency and SLAs](https://routebase.dev/guides/api-monitoring/api-uptime-latency-and-slas/index.md): Why the average response time hides the problem, what each additional nine actually costs in minutes, and how to keep an uptime figure honest enough to publish. 3. [API Alerting Without the Noise](https://routebase.dev/guides/api-monitoring/api-alerting-and-alert-fatigue/index.md): How to turn check results into alerts people still read, using sustained conditions, windows, cooldowns and a routing rule that keeps the paging set small. 4. [API Incidents and Maintenance Windows](https://routebase.dev/guides/api-monitoring/incidents-and-maintenance-windows/index.md): When failed checks should become an incident, what acknowledging means, and how to schedule planned work without teaching anyone to mute the channel. 5. [API Contract Drift Monitoring](https://routebase.dev/guides/api-monitoring/api-contract-drift/index.md): Why a 200 proves nothing about the body behind it, which contract a live response should be validated against, and how a silent deviation gets an owner. 6. [Design-First API Monitoring: Monitors That Wait](https://routebase.dev/guides/api-monitoring/design-first-api-monitoring/index.md): What changes when the contract exists before the service, why an unshipped endpoint must not report zero uptime, and what coverage tells you. 7. [Authentication and Secrets for API Monitors](https://routebase.dev/guides/api-monitoring/authentication-for-api-monitors/index.md): Why an unauthenticated check watches the wrong surface, how to give a monitor an identity that expires gracefully, and why expiry is not an outage. 8. [API Data Freshness Monitoring](https://routebase.dev/guides/api-monitoring/api-data-freshness-monitoring/index.md): A field that keeps its shape but stops changing its value passes every validation, which is why staleness needs its own check and its own judgement. 9. [What to Look For in an API Monitoring Tool](https://routebase.dev/guides/api-monitoring/api-monitoring-tools/index.md): Nine questions about what a monitoring tool judges a response against, how it authenticates, when it alerts and what it leaves out of its numbers. ## [API Governance](https://routebase.dev/guides/api-governance/) How a design decision keeps applying to every API your organisation ships, including the ones built next quarter by people who were not in the room. Eleven chapters. 1. [What Belongs in an API Style Guide](https://routebase.dev/guides/api-governance/api-style-guide/index.md): The subjects a style guide has to cover, the difference between a decision and a preference, and how to write rules that apply to an API you already shipped. 2. [Machine-Checkable API Rules](https://routebase.dev/guides/api-governance/machine-checkable-api-rules/index.md): What an automated check can see in an API description, what it will never see, and what a design review is for once the machine has taken the mechanical half. 3. [API Rule Severity and Enforcement](https://routebase.dev/guides/api-governance/api-rule-severity-and-enforcement/index.md): Error, warning and info as three different promises to the people who hit them, where a block is fair, and why an escape hatch keeps a guide switched on. 4. [Custom API Linting Rules](https://routebase.dev/guides/api-governance/custom-api-rules/index.md): When a house convention earns an automated check, what a condition-based rule can express, and how to write one that does not fire on half your endpoints. 5. [Reuse Over Inspection in API Governance](https://routebase.dev/guides/api-governance/reuse-beats-inspection/index.md): Why a shared definition removes a class of violation instead of reporting it, what belongs in an organisation-wide library, and how to roll out a change. 6. [Consistent Headers Across Every API](https://routebase.dev/guides/api-governance/consistent-api-headers/index.md): Headers are where consistency decays first. The four families worth standardising, why a policy beats a rule here, and what a policy cannot do. 7. [Measuring API Quality](https://routebase.dev/guides/api-governance/measuring-api-quality/index.md): What a weighted quality score is made of, why coverage is not quality, what the number cannot see, and what happens to it the moment a team is measured by it. 8. [Rolling Governance Out Without Stopping the Team](https://routebase.dev/guides/api-governance/rolling-out-api-governance/index.md): Measure, then warn, then block. Why the reverse order gets governance switched off, how existing APIs differ from new ones, and who grants exceptions. 9. [Governing API Changes Between Versions](https://routebase.dev/guides/api-governance/governing-api-change/index.md): Governance does not end at the first release. Which rules can check a change, what only a comparison between versions can tell you, and the alerts worth having. 10. [What to Look for in an API Governance Tool](https://routebase.dev/guides/api-governance/api-governance-tools/index.md): Eight questions about where governance checks run, how exceptions are recorded and whether a standard cascades, tested on your least consistent API. --- # API Design: A Complete Guide — Routebase > The decisions behind an HTTP API, in the order they arrive. Resources, methods, status codes, errors, pagination, idempotency and rate limits. Canonical page: https://routebase.dev/guides/api-design/ Guide overview · 10 chapters · Last reviewed 2026-09-13 by The Routebase Team. You have already made these decisions. Every API has a resource model, a status code for a rejected write and a shape for its error bodies, whether or not anyone chose them on purpose. The question is whether they were decided once and written down, or a hundred times by different people under deadline pressure. This guide covers the decisions themselves, in the order they arrive, and what each one costs when you get it wrong. ## The decisions arrive in an order Design decisions are not a checklist you can work through in any sequence, because the early ones constrain the later ones. _Figure: The resource model comes first because it decides what a URL can express, and everything downstream inherits it. Methods and status codes follow from the resources, error design has to cover every one of those operations, and the recurring patterns sit on top. Writing the OpenAPI document is the last step rather than the first, because the file records decisions instead of making them._ That order is also why so much design debt is expensive. Changing a pagination style touches every list endpoint, and changing a resource model touches every URL you have published. ## Why the specification is not the design An OpenAPI document describes an interface precisely, and it is completely indifferent to whether the interface is any good. You can write a valid document for an API with three different pagination styles, five error shapes and a `POST /doThing` in the middle of it. The file will validate, the reference documentation will render and the mock server will answer. None of those tools has an opinion about the decisions underneath. So the specification is where a decision gets recorded and checked, and it is not where the decision gets made. The [OpenAPI guide](https://routebase.dev/guides/openapi/) covers the format itself, and this guide covers what you put in it. ## The cost of deciding twice Almost every decision here has more than one defensible answer, and the difference between the answers is usually smaller than the difference between deciding once and deciding repeatedly. Cursor pagination and offset pagination both work. What does not work is one collection paged by cursor, a second by page number and a third returning everything. A consumer writes the pagination loop three times, and the third one is where the bug lives. This is the argument that runs through the whole guide. Where two options are genuinely close, the text says so and moves on to the thing that matters, which is applying whichever you picked everywhere. ## The short answer If you take one rule from this guide, take this one. Decide each of these once, write the decision into the contract rather than into a wiki page, and put a check in the way of the next person who decides differently. The rest of the guide is that rule taken apart. | Chapter | Answers | |---|---| | [Resources and URLs](https://routebase.dev/guides/api-design/resources-and-urls/) | Nouns over verbs, when nesting helps and when it traps you | | [Methods and status codes](https://routebase.dev/guides/api-design/http-methods-and-status-codes/) | What each method promises, and which code sets which expectation | | [Designing API errors](https://routebase.dev/guides/api-design/designing-api-errors/) | One shape for every failure, and a way out of each one | | [Actions that are not CRUD](https://routebase.dev/guides/api-design/actions-that-are-not-crud/) | Cancel, publish, retry, search, and the cost of each modelling | | [Pagination, filtering and sorting](https://routebase.dev/guides/api-design/api-pagination-filtering-and-sorting/) | Offset against cursor, and what each costs under concurrent writes | | [Idempotency and retries](https://routebase.dev/guides/api-design/idempotency-and-retries/) | Why callers retry, and what an idempotency key actually promises | | [Rate limits](https://routebase.dev/guides/api-design/api-rate-limiting/) | What a limit tells a caller, and the headers that carry it | | [Consistency across an API](https://routebase.dev/guides/api-design/consistency-across-an-api/) | Why consistency has to be a mechanism rather than an intention | | [Design for the client you now have](https://routebase.dev/guides/api-design/designing-for-agent-clients/) | What changes when the caller reads your description at runtime | | [Choosing a design tool](https://routebase.dev/guides/api-design/api-design-tools/) | The criteria that separate an editor from a design workflow | Three neighbouring subjects live in other guides. The document format is covered in the [OpenAPI guide](https://routebase.dev/guides/openapi/), and what to do when a decision has to change is covered in [API versioning](https://routebase.dev/guides/api-versioning/). How a decision becomes an enforced rule runs through [consistency](https://routebase.dev/guides/api-design/consistency-across-an-api/) into the tooling. For a one-page summary of the same ground, the [API design principles](https://routebase.dev/blog/api-design-principles/) post is the short version this guide expands. ## In Routebase Routebase is a structured API designer, so a decision lands in a form rather than in YAML, and the OpenAPI document is what it is stored as. _Screenshot: The endpoint tree, the operation being edited and a real request against a selected environment sit in one window, so a design decision and the check that it holds are never two tools apart._ The decisions in this guide surface in three places in the product. Folders and tags carry the resource model, components and the organisation-level shared library carry the shapes you reuse, and the style guide turns a convention into a check that runs while you type. Start with the [Endpoints guide](https://docs.routebase.dev/endpoints/) in the product documentation, or read on. The [API design feature page](https://routebase.dev/api-design/) has the short version of how the designer fits into the rest of the lifecycle. ## Frequently asked questions ### What is API design? API design is the set of decisions that fix what an HTTP interface promises before any of it is built. Those decisions cover which resources exist and what they are called, which method does what, and which status code comes back. They also cover what an error looks like, how a long list is paged and what happens when a caller retries. Writing the specification records those decisions, and it does not make them for you. ### What are the most important API design decisions? Four of them shape everything that follows. The resource model decides what your URLs can express, and the method and status code semantics decide what a caller may assume. The error format decides how a client recovers, and the pagination style decides whether a list endpoint survives its own growth. Each of those is expensive to change later, because each one is visible to every consumer. ### Should you design an API before writing code? Designing first is worth it when more than one team depends on the result, because the contract becomes something they can build against in parallel. It is worth less on an interface with a single consumer that ships in the same commit. The real question is not the order of the work but whether the contract ends up written down somewhere a machine can check. ### What makes an API easy to use? Predictability, more than any single convention. A caller who has used three of your endpoints should be able to guess the fourth, get the error they expect in the shape they expect, and page through a list the same way everywhere. Consistency is worth more than the individual choices it applies, which is why picking a convention and holding to it beats picking the best one. ## Chapters in this guide 1. [Resources and URLs](https://routebase.dev/guides/api-design/resources-and-urls/index.md): How to pick the things your API exposes, why nesting stops paying after one level, what a path convention is worth, and which identifiers belong in a URL. 2. [Methods and Status Codes](https://routebase.dev/guides/api-design/http-methods-and-status-codes/index.md): What each HTTP method promises a caller, why PUT and PATCH are not interchangeable, and which status code sets which expectation, with the RFC behind each one. 3. [Designing API Errors](https://routebase.dev/guides/api-design/designing-api-errors/index.md): One shape for every failure, why an error code is a contract and a message is not, what belongs in a problem document, and what has to stay out of it. 4. [Actions That Are Not CRUD](https://routebase.dev/guides/api-design/actions-that-are-not-crud/index.md): Cancel, publish, retry, search and bulk edit, modelled three different ways, with what each modelling costs and the questions that decide between them. 5. [Pagination, Filtering and Sorting](https://routebase.dev/guides/api-design/api-pagination-filtering-and-sorting/index.md): Offset against cursor and what each costs when data changes underneath, why limits are not optional, and how little filter and sort syntax is standard. 6. [Idempotency and Retries](https://routebase.dev/guides/api-design/idempotency-and-retries/index.md): Why a timeout is ambiguous, what an idempotency key actually promises, how long a stored result has to live, and which parts of the pattern are standardised. 7. [Rate Limits as a Design Decision](https://routebase.dev/guides/api-design/api-rate-limiting/index.md): What a published limit promises a caller, why 429 needs Retry-After, how little of the header convention is standardised, and what a limit counts against. 8. [Consistency Across an API](https://routebase.dev/guides/api-design/consistency-across-an-api/index.md): Why the same decision has to appear at every endpoint, why intention is not a mechanism, and the three things that hold a convention in place over time. 9. [Designing APIs for AI Agent Clients](https://routebase.dev/guides/api-design/designing-for-agent-clients/index.md): Hypermedia promised runtime discovery to clients generated ahead of time. A caller that reads your description at runtime now exists, and it reads the prose. 10. [What to Look for in an API Design Tool](https://routebase.dev/guides/api-design/api-design-tools/index.md): Eight questions about what a design tool stores, checks and lets you take with you, tested on your largest real description instead of a sample. --- # Resources and URLs — Routebase > How to pick the things your API exposes, why nesting stops paying after one level, what a path convention is worth, and which identifiers belong in a URL. Canonical page: https://routebase.dev/guides/api-design/resources-and-urls/ Chapter 1 of 10 · API Design · Last reviewed 2026-09-13 by The Routebase Team. The resource model is the first decision and the most expensive one to revisit, because every URL you publish inherits it. Everything else in this guide sits on top of the nouns you pick here. ## Model the domain, not the procedure The common failure is exposing an implementation as an endpoint. Something like `POST /runSyncJob?mode=full` describes how your system works internally, and it breaks the moment the internals change. The alternative is to name the thing rather than the action, and let the method carry the verb. A sync becomes a resource that can be created, read and cancelled, which means a caller who knows how to create one already knows how to read it. The [API design principles](https://routebase.dev/blog/api-design-principles/) post covers that reframing with worked examples. What the short version leaves out is where the rule stops. Some operations genuinely have no noun, and forcing one produces worse names than the verb you were avoiding. Those cases get their own chapter on [actions that are not CRUD](https://routebase.dev/guides/api-design/actions-that-are-not-crud/), because the answer there is a trade-off rather than a principle. ## Collections and items Almost every resource shows up twice, once as a collection and once as an item inside it, and the two behave differently enough to be worth separating. A collection accepts a create and answers a list, so it needs pagination, filtering and a sort order from the start. An item accepts a read, a replace, a partial update and a delete, and it needs an identifier that stays valid. Callers assume that the item under a collection has the same shape as the entries the collection returns, and breaking that assumption is a surprise you will explain repeatedly. The one place teams disagree is whether the collection response wraps its items in an envelope. An envelope costs one level of indirection and buys somewhere to put paging information, which is why most APIs that page at all end up with one. ## Nesting expresses ownership, once Nesting reads well at one level, because the path then states a fact about ownership that a caller can rely on. _Figure: One level of nesting states that the child belongs to the parent, and the caller needs one identifier it already has. At three levels the path has become a traversal, so the caller has to carry two identifiers it never asked for, and every one of them is now part of your contract. When the leaf has an identity of its own, the flat address needs a single identifier and survives a reparenting that would break the nested form._ The failure is gradual rather than sudden. Each additional level looks reasonable on its own. The cost only shows up when a caller holds a leaf identifier and has to reconstruct the ancestors to build a URL. At that point clients start caching identifiers they should never have known, and moving a record to a different parent becomes a breaking change. A useful test is whether the leaf can be found without its ancestors. If a payment can be looked up by its own identifier alone, it deserves a top-level collection and a reference to the invoice it belongs to. If it genuinely cannot exist outside its parent, one level of nesting is telling the truth. ## Naming the segments Three naming decisions repeat in every API. All three are conventions rather than requirements. The first is plural against singular for collections, where plural is the more common choice. The second is the case of multi-word segments, where kebab-case is common and lowercase avoids case-sensitivity bugs between servers. The third is whether the same concept keeps the same word everywhere, which is the only one of the three with an obviously wrong answer. Because none of these is a standard, an existing API has no correctness argument for migrating. It has a consistency argument. That argument is usually weaker than the cost of breaking every published URL. The realistic move on an existing API is to fix the convention going forward and enforce it on new paths. ## Identifiers are part of the contract The moment an identifier appears in a URL, it stops being an implementation detail. A caller will store it, log it, and put it in a support ticket eighteen months from now. That has two consequences worth deciding up front. A sequential key exposes your record count and makes neighbouring records guessable, so most APIs expose an opaque identifier instead. And whichever you expose, you can no longer change the underlying key without breaking clients, which is a constraint on the database rather than on the API. Some resources also have a natural key, such as an order number that already exists in the business. Accepting both that key and an internal identifier at the same path is convenient and ambiguous, so it is worth choosing one and offering the other as a filter on the collection. ## In Routebase Endpoints live in a folder tree rather than a flat list of tag groups, and that tree is the same structure readers see in the published reference documentation. Folders and tags do different jobs on purpose. Folders define the visible hierarchy, while tags are flat labels that cut across it, and a tag carries a description that is exported as the OpenAPI tag description. Because the two can drift apart, renaming a folder asks what should happen to the tags, and it tells you which choice changes the exported contract and which does not. Path variables are read out of the path itself. Creating `GET /users/{id}` also creates the path parameter, and removing it from the path removes the parameter, with a dialog first when the parameter carries a description or an example you would lose. The path convention is a style guide rule rather than a fixed opinion. The rule for URL paths defaults to kebab-case and also accepts camelCase, PascalCase and lowercase, chosen from a dropdown in the rule table. So a team that has always written `/userProfiles` can keep the check without changing its URL scheme. Uniqueness is checked at a level that matches how OpenAPI reads paths, since `/items/{id}` and `/items/{itemId}` address the same route and are reported as a collision. The [Endpoints guide](https://docs.routebase.dev/endpoints/) covers the tree and the tag behaviour, and the [Style Guide](https://docs.routebase.dev/style-guide/) covers the naming rules and their severities. ## Frequently asked questions ### Should REST resources be plural or singular? Plural for collections is the common convention, so a list is at the collection path and one item sits under it with an identifier. Neither form is required by any specification, and both are readable. What matters is that you use the same form for every collection in the API, because a caller who has learned one path is trying to guess the next one. ### How deep should a REST URL be nested? One level of nesting expresses ownership and stays readable. Beyond that the path starts encoding a traversal rather than an address, and callers end up holding identifiers they should never have needed. When a nested resource has an identity of its own, give it a top-level collection and let it reference its parent by identifier instead. ### Should API URLs use kebab-case or camelCase? Kebab-case is the more common choice for path segments, and lowercase paths avoid an entire class of case-sensitivity bugs. Neither is a standard, so an existing API with camelCase paths has no correctness reason to migrate. The decision worth enforcing is that one convention applies to every path in the API. ### Should database IDs be exposed in API URLs? A sequential database key in a URL tells a caller how many records you have and makes neighbouring records guessable, so most teams expose an opaque identifier instead. The identifier also becomes part of the contract the moment it appears in a URL, which means the internal key can no longer be changed freely. Both of those are reasons to decide the identifier deliberately rather than inheriting it. --- # Methods and Status Codes — Routebase > What each HTTP method promises a caller, why PUT and PATCH are not interchangeable, and which status code sets which expectation, with the RFC behind each one. Canonical page: https://routebase.dev/guides/api-design/http-methods-and-status-codes/ Chapter 2 of 10 · API Design · Last reviewed 2026-09-13 by The Routebase Team. A method and a status code are the two smallest pieces of an API, and they carry more promises than anything else in the contract. Callers, caches, proxies and retry libraries all act on them without asking you. ## What a method promises HTTP semantics are defined in [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110), and two properties of a method matter for design. A method is **safe** when it is essentially read-only, and a client, a crawler or a prefetching browser may therefore call it without being asked twice. A method is **idempotent** when making the same request more than once has the same effect as making it once, which is what allows a client library to retry automatically after a timeout. | Method | Safe | Idempotent | Typically used for | |---|---|---|---| | `GET` | yes | yes | Reading a resource or a collection | | `HEAD` | yes | yes | The headers of a `GET` without the body | | `OPTIONS` | yes | yes | Communicating supported behaviour | | `PUT` | no | yes | Replacing a representation in full | | `DELETE` | no | yes | Removing a resource | | `POST` | no | no | Creating, submitting and everything else | | `PATCH` | no | no | Applying a partial modification | The two properties are the reason retry behaviour is not your decision. A client library that retries a failed `PUT` is following the specification, so an implementation where a repeated `PUT` creates a second record is a bug rather than a surprise. ## PUT is not a lenient PATCH The most common semantic mistake in an otherwise careful API is treating `PUT` as an update that only touches the fields you sent. `PUT` replaces the representation, so a field absent from the body is a field the caller is asking you to unset. `PATCH`, defined separately in [RFC 5789](https://www.rfc-editor.org/rfc/rfc5789), carries a description of changes rather than a new state. Implementing `PUT` with `PATCH` semantics works until a caller relies on the specified behaviour to clear an optional field, and then it silently does nothing. `PATCH` costs a second decision that teams often skip, which is what the patch document actually looks like. A partial object of the same shape is the common convention and it cannot express removing a field or editing one entry of an array. The formats that can, such as JSON Patch and JSON Merge Patch, are more precise and less pleasant to write by hand. Whichever you pick, the media type has to say which one it is. ## Status codes set expectations A status code is the part of your response that gets read by software you have never seen. Picking a plausible-looking code has consequences beyond documentation. **`201 Created`** says one or more resources came into existence, and it should carry a `Location` header pointing at the primary one. Clients that follow it avoid parsing your body for an identifier, which is one fewer thing to break. **`202 Accepted`** says the work has not happened yet. It is the correct answer for anything queued, and it obliges you to hand back somewhere to look, usually a status resource the caller can poll. A `202` with nothing to follow leaves the caller with no way to learn the outcome. **`204 No Content`** says the request succeeded and there is deliberately nothing to send. RFC 9110 forbids a body on a `204`, and the same applies to `304 Not Modified`, so declaring one in your contract makes generated clients emit deserialisation code that will never run. **`4xx` against `5xx`** is a statement about blame. A `4xx` says the caller can fix this by changing the request, and a `5xx` says they cannot. Getting that boundary wrong sends people to the wrong place, because a retry on a genuine `4xx` will fail exactly the same way forever. ## The codes that need a house rule A handful of codes are used differently by different APIs, and those are the ones worth deciding once and writing down. `400` against `422` is the usual argument, where `400` covers a request that is malformed and `422` covers one that parses but fails validation. Both are defined in RFC 9110 and both are defensible, so the value is in picking one and using it everywhere rather than in the choice. `404` against `403` is a security decision more than a semantic one. Answering `403` on a resource that exists but is not yours confirms that it exists, and answering `404` does not. That is a deliberate trade of clarity against disclosure, and it should be the same trade on every endpoint. `409 Conflict` is worth reserving for the case where the request contradicts the current state, such as a concurrent update or a duplicate that violates a real constraint. Once it starts absorbing general validation failures it stops telling the caller anything. ## In Routebase Methods and responses are edited on the endpoint rather than in a document, and the editor keeps the two consistent with the rest of the specification. _Screenshot: One operation with its method, its parameters and every status code it can answer with, in the same view where the decision is made rather than in a separate document._ Changing the method on an endpoint only offers methods that are not already taken by another endpoint on the same path, so a collision is prevented rather than reported later. Responses are added one at a time or scaffolded as a set that matches the method, which gives a `GET` the read codes and a `POST` the create codes including `409`. Common codes arrive with a sensible description already filled in. Two style guide rules cover the semantics in this chapter. One requires every operation to define at least one success response, and one flags a body declared on a `204` or a `304`, citing RFC 9110 and the dead deserialisation code that follows from it. Both ship at Warning, and severities are set per organisation and per project, so a team that wants either as a hard error can raise it. The [Responses guide](https://docs.routebase.dev/responses/) covers the editor, and the [Style Guide](https://docs.routebase.dev/style-guide/) covers the rules and their severities. ## Frequently asked questions ### What is the difference between PUT and PATCH? PUT replaces the whole representation of a resource, so anything you leave out of the body is meant to be removed. PATCH applies a partial modification described by the request body, which is defined in RFC 5789 rather than in the core HTTP semantics. The practical consequence is that PUT is idempotent and a PATCH generally is not, because a patch that increments a value produces a different result each time it is applied. ### Which HTTP methods are idempotent? RFC 9110 defines PUT and DELETE as idempotent, along with the safe methods GET, HEAD, OPTIONS and TRACE. POST and PATCH are not idempotent by definition, which is why a create that must not run twice needs an idempotency key rather than a well chosen verb. Idempotent means that repeating the request has the same effect as making it once, and it does not mean the response has to be identical. ### When should an API return 201 versus 200? Return 201 Created when the request resulted in one or more new resources, and include a Location header pointing at the primary one. Return 200 when the request succeeded without creating anything, such as a read or an update in place. The distinction matters to callers that follow the Location header rather than parsing the body for an identifier. ### What does HTTP 202 Accepted mean? 202 says the request was accepted for processing and that the processing has not finished, so the response body cannot contain the result. It is the honest code for work that runs asynchronously, and it obliges you to give the caller somewhere to look for the outcome. In practice that means returning a reference to a status resource the caller can poll, because a 202 with no follow-up leaves the caller guessing. --- # Designing API Errors — Routebase > One shape for every failure, why an error code is a contract and a message is not, what belongs in a problem document, and what has to stay out of it. Canonical page: https://routebase.dev/guides/api-design/designing-api-errors/ Chapter 3 of 10 · API Design · Last reviewed 2026-09-13 by The Routebase Team. Error responses are designed last and met first. A caller integrating with your API spends their first afternoon on the failures, because the success path worked on the second attempt. ## One shape, every failure The decision that pays for itself is that every failure in the API has the same body shape. Everything else in this chapter is detail on top of it. The reason is that a caller writes error handling once. When the shape is uniform, adding an endpoint costs them nothing, because their existing handler already parses the response and finds the fields it expects. When the shape varies, every new endpoint is a new special case, and the special cases accumulate in a client codebase you will never see. [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457) is the standard worth adopting for that shape, and it defines five members. A `type` identifies the kind of problem, a `title` names it briefly, `status` repeats the HTTP status code, `detail` explains this specific occurrence and `instance` points at the occurrence itself. The media type is `application/problem+json`, and the specification explicitly allows extension members alongside the five. RFC 9457 obsoletes RFC 7807, which described the same format under the same media type. An API that already emits problem documents is therefore already compliant, and the newer document mainly clarifies and adds guidance. ## The code is the contract, the message is not The most useful field in an error body is the one that never changes. Callers have to branch on something, and if you do not give them a stable identifier they will branch on your prose. That is a real failure mode rather than a hypothetical one. A team rewrites `Invalid email` to `The email address is not valid` for clarity, and somewhere a client that matched on the old string stops recognising the error. The wording change was correct and it was still breaking. The string had quietly become an interface. So the `type` member should be a stable identifier, and it should mean the same thing forever. Whether you use a URI, as the RFC suggests, or a short code in an extension member, the property that matters is stability rather than format. The full treatment, covering extension members, type registries and how to evolve a catalogue, is in [Consistent error handling with RFC 9457](https://routebase.dev/blog/consistent-error-handling-rfc-9457/). ## A way out of every error An error that a caller cannot act on is a support ticket with extra steps. The design goal is that each failure tells the caller either what to change or what to wait for. Validation failures need field-level detail, because a caller with three bad fields wants three messages rather than one. That is what extension members are for. A list of field and message pairs alongside the five standard fields is the common shape. Conflicts and state errors need to say what the current state is, since the caller has to decide whether to refetch or give up. Rate limiting needs to say when to come back, which is a header rather than a body field and is covered in [rate limits](https://routebase.dev/guides/api-design/api-rate-limiting/). Server errors need a correlation identifier the caller can quote. That is the only thing they can usefully do with a `500`. ## What has to stay out An error body is readable by everyone who can reach the endpoint, including people you did not intend to serve. Stack traces, database messages and query fragments describe your internals to an attacker at no cost to them. Internal hostnames and file paths do the same. Personal data echoed back from a failing request lands in the caller's logs, which is a place you have no control over and no visibility into. The workable test is whether a field helps the caller fix their request. A correlation identifier passes, because it lets them quote something to your support. A serialised exception fails, because the caller cannot act on it and somebody else can. ## The catalogue is part of the contract Once error codes are stable identifiers, the set of them is an interface, and it needs the same care as the endpoints. Adding a code is safe, since a caller that does not recognise it falls back to the status code. Removing one or changing what it means is a breaking change, even though nothing about the request or response schema moved. That is worth writing down where breaking changes are defined, which for most teams is next to the [versioning policy](https://routebase.dev/guides/api-versioning/api-breaking-changes/). The other half of the catalogue is coverage. Every operation should declare the errors it can actually return, because an undeclared `409` is a surprise no generated client handles. ## In Routebase An error response is defined once as a reusable component and referenced from every operation that returns it, which is what stops forty copies of the same body from drifting apart. _Screenshot: One NotFound and one Unauthorized for the whole specification, each carrying its media type, and each showing how many operations reference it before you change one._ An inline response that already exists can be extracted into a component in one action, and the endpoint is relinked automatically rather than left pointing at a copy. Above the specification there is an organisation-level shared library, which is where a single `ErrorResponse` shape belongs when several projects should answer the same way. A specification keeps the library version it linked, so an edit in the library never changes a consuming specification silently, and an update shows as an indicator you accept when you are ready. Three style guide rules cover this ground. One asks that `4xx` and `5xx` responses use `application/problem+json`. Two separate rules then ask that endpoints declare their error responses at all, where one accepts any `4xx`, `5xx` or default response and the other asks specifically for a `4xx`. All three ship below error severity, so they inform rather than block until you decide otherwise, and severity is set per organisation and per project. The [Components](https://docs.routebase.dev/components/) and [Shared Library](https://docs.routebase.dev/shared-library/) guides cover the two levels of reuse, and the [Style Guide](https://docs.routebase.dev/style-guide/) covers the rules. ## Frequently asked questions ### What is RFC 9457 Problem Details? RFC 9457 defines a standard JSON body for HTTP error responses, carried under the media type application/problem+json. It specifies five members, namely a type identifier, a short title, the status code, a human readable detail and an instance reference, and it allows you to add your own members alongside them. It obsoletes RFC 7807, which described the same format under the same media type. ### Should every API endpoint use the same error format? Yes, and this is the single highest value decision in error design. A caller writes error handling once against one shape rather than once per endpoint, which means new endpoints inherit working error handling instead of needing new code. Mixed shapes also defeat generated clients, because the generator has no single type to deserialise a failure into. ### Should API errors include a machine readable error code? They should, because a caller has to branch on something and a human readable message is the worst available candidate. Messages get rewritten for clarity, translated and shortened, and every one of those changes silently breaks a client that matched on the string. A stable identifier lets you improve the wording freely. ### What should not be in an API error response? Anything that helps an attacker more than it helps a caller. That means no stack traces, no database errors or query fragments, no internal hostnames or file paths, and no personal data echoed back from the request. The test is whether the field helps the caller fix their request, because an error body is read by everyone who can reach the endpoint. --- # Actions That Are Not CRUD — Routebase > Cancel, publish, retry, search and bulk edit, modelled three different ways, with what each modelling costs and the questions that decide between them. Canonical page: https://routebase.dev/guides/api-design/actions-that-are-not-crud/ Chapter 4 of 10 · API Design · Last reviewed 2026-09-13 by The Routebase Team. Most of an API maps onto create, read, update and delete without complaint. Then somebody has to cancel an order, publish a document, retry a failed job or run a search with forty filters, and the mapping stops being obvious. Forcing a noun onto every one of those produces worse names than the verb you were avoiding. This chapter is about picking deliberately between the options rather than defaulting into one. ## Three ways to model a state change Take cancelling an order. All three of the following are used by well designed APIs, and they are not equivalent. **An action sub-resource** puts the verb in the path, so a `POST` to the cancel path under the order performs it. This is the easiest to document, the easiest to authorise separately from a general update, and the easiest to give its own request body when a cancellation needs a reason. It is not idempotent, so a retry after a timeout hits the server twice. **A state field** exposes the status as part of the representation and lets a partial update change it. This keeps the API uniform, since there is no new endpoint to learn, and it moves the rules into the server. It also invites a caller to attempt a transition that makes no sense, and rejecting one now needs a good error rather than a missing route. **The action as its own resource** creates a cancellation that references the order. This is the most work and it gives you two things the others do not, which are a record of who cancelled and when, and a natural place for an asynchronous outcome. It suits actions that take time or need an audit trail. ## The questions that decide it Four questions separate the three options faster than any principle does. Does the action need input beyond the identifier? A cancellation reason, a publish target or a retry policy pushes towards an action endpoint or an action resource, because a state field has nowhere to put it. Does the caller need the history? If somebody will ask which refunds were issued last month, the action wants to be a resource, since a state field remembers only the final state. Is it slow? Anything that takes longer than a request should answer `202` and hand back a status resource, which is described in [methods and status codes](https://routebase.dev/guides/api-design/http-methods-and-status-codes/). That is an action resource in all but name, so you may as well make it one. Can it be retried? None of the three is idempotent by construction, so a caller that times out has no safe move unless you provide one. That is the subject of [idempotency and retries](https://routebase.dev/guides/api-design/idempotency-and-retries/). ## Search when the query outgrows the URL Search starts as a `GET` with query parameters, which is the right default. The request is safe, it is cacheable, and a caller can paste the URL into a ticket. It stops being enough when the query gets large or sensitive. There is no fixed URL length in the HTTP specifications. [RFC 9112](https://www.rfc-editor.org/rfc/rfc9112) recommends only that a server be able to handle a request line of at least 8000 octets, and intermediaries are free to impose their own limits. A structured filter tree hits that ceiling sooner than it looks, and query strings end up in access logs whether or not the values belong there. The usual escape is a `POST` that carries the query in the body, and it costs real things. You lose caching, you lose the shareable URL, and you have made a safe operation look unsafe to every intermediary. Sending a body on a `GET` is not the way around that, because RFC 9110 gives content on a `GET` no defined semantics and notes that a server may reject it. The compromise that works is offering both, with the `GET` covering the queries that fit and the `POST` covering the rest. Two endpoints for one concept is a cost, and it is smaller than either of the alternatives. ## Bulk operations A bulk endpoint exists because a caller has a thousand items and your rate limit has other ideas. The design decision is not the payload format, it is atomicity. An atomic bulk operation either applies everything or nothing, which is simple to reason about and expensive to implement. A non-atomic one applies what it can, which means the response has to report per-item outcomes, since the caller needs to know exactly which entries to retry. The failure to avoid is a `200` on a batch where half the items were rejected, with the failures buried in a body nobody parses. That reads as success to every generated client and to most retry logic, and the missing records surface much later. If the operation is not atomic, say so in the status code as well as the body, and give each item its own result. ## In Routebase Actions are endpoints like any other, so the product surface for them is the naming and grouping that keeps them findable. Every operation carries an operation identifier, generated from the method and path and overridable, and that identifier is what code generators turn into a method name in somebody's client library. Because an action endpoint is exactly where a generated name gets ugly, it is the place worth overriding. Uniqueness is enforced as an error rather than a warning, and a second rule keeps the identifier safe to use in a URL. Grouping is the other half. Folders give the visible hierarchy that readers see in the published reference, while tags cut across it as flat labels. So a set of cancellation and refund endpoints can sit with their parent resources and still be collected under one tag. A tag description is exported as the OpenAPI tag description, which means the explanation of why these endpoints exist travels with the contract. The [Endpoints guide](https://docs.routebase.dev/endpoints/) covers folders, tags and operation identifiers. ## Frequently asked questions ### How do you model actions in a REST API? There are three workable options. You can add an action sub-resource under the item, or you can expose the state as a field and let a partial update change it. The third option is to make the action itself a resource that gets created. Each is defensible, and they differ in whether the action can carry input, whether it can be retried safely and whether the history of it is queryable afterwards. ### Is POST /orders/123/cancel RESTful? It is a widely used pattern and no specification forbids it, so the useful question is what it costs rather than whether it qualifies. An action sub-resource is easy to document and easy to authorise separately, and it is not idempotent by default, which means a retried cancel needs either a guard on the server or an idempotency key. ### Should search use GET or POST? GET is the better default because the request is safe, cacheable and shareable as a URL. POST becomes necessary when the query no longer fits reliably in a URL, or when it carries values you should not put in a log. RFC 9112 only recommends that servers accept a request line of at least 8000 octets. The cost of moving to POST is that you lose caching and the ability to link to a result. ### How should a bulk API endpoint report partial failure? Decide first whether the operation is atomic, because that decision drives everything else. An atomic bulk operation fails as a unit and can answer with a single error, while a non-atomic one has to return a per-item result so the caller knows which entries to retry. Answering 200 for a batch where half the items failed is the version that causes silent data loss downstream. --- # Pagination, Filtering and Sorting — Routebase > Offset against cursor and what each costs when data changes underneath, why limits are not optional, and how little filter and sort syntax is standard. Canonical page: https://routebase.dev/guides/api-design/api-pagination-filtering-and-sorting/ Chapter 5 of 10 · API Design · Last reviewed 2026-11-11 by The Routebase Team. Every collection endpoint eventually returns more than anyone wants in one response. Adding pagination afterwards is a breaking change, and shipping it on the first day costs a query parameter. ## Offset and cursor answer different questions Offset pagination names a position, so the caller asks to skip a number of rows and take the next few. Cursor pagination names an item, so the caller asks for everything after the token the previous page handed back. The distinction is invisible on static data and decisive on data that moves. _Figure: Between the two requests a new row is inserted at the top of the ordering. The offset request skips the same number of rows as before, so the row that was last on page one is now first on page two and the caller sees it twice. The cursor points at an item rather than a count, so the second page starts exactly where the first one ended, and a deletion instead of an insertion is the same story with a row silently skipped._ That duplication and skipping is not a rare edge case on a busy collection. It is the normal behaviour of offset pagination whenever writes and reads overlap, and it produces bugs that reproduce only under load. ## What each one gives up Cursor pagination is the safer default, and it is not free. A cursor cannot jump. There is no page seven, because the token encodes a position in one specific traversal, so a caller who wants deep navigation has to walk. A cursor also usually arrives without a total count, since counting the whole set defeats the reason the query was fast. Both of those are user-visible in any interface with numbered pages. Offset gives you exactly those two things and pays for them with correctness under concurrency and with performance at depth, because a large offset still makes the database walk the rows it is skipping. Cursors also cost more to build than offsets, and that cost is easy to miss. Every sort order you allow needs an index that matches it, because otherwise the database falls back to scanning and the speed advantage is gone. A cursor is only valid for the sort and the filters that produced it. So the server has to recognise a token that comes back with different parameters and reject it, instead of returning a page from somewhere else. Paging backwards needs a second query that reads the index in the other direction, and an expired or tampered token needs a defined error. None of that is hard, but on a small table with one fixed sort it is work that buys nothing. So the decision is about the collection rather than about the technique. A slow-changing reference list that users page through visually is a reasonable place for offset. An event feed, an audit log, an export that walks the whole collection once or anything else a machine iterates is a place for cursors. Whichever you choose, the cursor format is your business. There is no standard for it, and treating it as opaque in the documentation keeps it changeable, because a caller who decodes your token has turned an implementation detail into a contract. ## Limits are part of the design Two numbers need to exist before the first caller arrives, namely a default page size and a maximum. The default matters because a caller who omits the parameter has to get something sensible rather than the whole table. The maximum matters because otherwise the parameter is a request for as much work as the caller feels like asking for, which is a denial of service you built yourself. When a caller asks for more than the maximum, clamping is friendlier than rejecting, provided the response states the size that was actually applied. Silently returning fewer items than requested without saying so is the version that produces a client which thinks it has reached the end. ## Filtering and sorting are conventions There is no specification for filter syntax. Every style you have seen, whether that is a parameter per field, a bracketed operator or a small query language, is a house convention, and none of them is more correct than the others. That means the value is entirely in consistency, which is covered in its own [chapter](https://routebase.dev/guides/api-design/consistency-across-an-api/). Two decisions are worth making explicitly. Decide whether an unknown filter parameter is ignored or rejected, because ignoring it turns a typo into a silently wrong result set. And decide whether multiple filters combine with and or with or, since callers will assume one of them. Sorting needs the same treatment plus one extra rule. A sort that is not total is not stable, so two rows with the same value can swap places between requests and break pagination in both styles. Appending a unique tiebreaker to every sort is the fix, and it is invisible to the caller. The one standardised piece in this area is where the links live. [RFC 8288](https://www.rfc-editor.org/rfc/rfc8288) defines the `Link` header field, and the `next` and `prev` relation types are registered, so pagination links have a defined home outside your body envelope. ## In Routebase Pagination parameters are the clearest case for defining a parameter once and referencing it everywhere, because they repeat on every list endpoint in the API. A parameter component fixes the name, location, type, format, default and whether it is required. Each component also lists the endpoints that use it, so changing the maximum page size shows you the blast radius first. Specifications imported from OpenAPI keep their referenced parameters as components rather than flattening them into copies. Two style guide rules touch this chapter. One flags a `GET` that returns a collection without pagination parameters. The other flags a success response that returns a bare array instead of an object, which is what pushes list responses towards an envelope with somewhere to put paging information. Both ship below error severity and are configurable per organisation and per project. Routebase does not ship a pagination envelope of its own, so the shape is yours to define, and the shared library is where it belongs once a second project needs the same one. The [Parameters](https://docs.routebase.dev/parameters/) and [Components](https://docs.routebase.dev/components/) guides cover reuse, and the [Style Guide](https://docs.routebase.dev/style-guide/) covers the rules. ## Frequently asked questions ### What is the difference between offset and cursor pagination? Offset pagination asks for a position in the result set, so page three means skip the first two pages worth of rows. Cursor pagination asks for everything after a specific item, using a token the server issued with the previous page. The difference shows up when rows are inserted or deleted between two requests, because an offset then points somewhere else than it did and a cursor still points at the same item. ### Is cursor pagination always better than offset? It is the safer default on data that changes, and it gives up two things people want. A cursor cannot jump to page seven, and it usually comes without a total count, because computing one defeats the reason cursors are fast. On a small, slow-changing collection where users expect numbered pages, offset is the better answer. ### Should an API have a maximum page size? Yes, and it should apply whether or not the caller asks for one. Without a default the first caller who omits the parameter gets the whole table, and without a maximum a caller who wants everything asks for it in one request. Clamping an oversized request to the maximum is friendlier than rejecting it, as long as the response says what was applied. ### Is there a standard for API filtering and sorting? Not for the syntax. There is no specification that says filters look like one thing or that sort parameters take a leading minus for descending, so every convention you see is a house style. The one standardised piece nearby is the Link header from RFC 8288, whose next and prev relation types give pagination links a defined home. --- # Idempotency and Retries — Routebase > Why a timeout is ambiguous, what an idempotency key actually promises, how long a stored result has to live, and which parts of the pattern are standardised. Canonical page: https://routebase.dev/guides/api-design/idempotency-and-retries/ Chapter 6 of 10 · API Design · Last reviewed 2026-09-28 by The Routebase Team. A client sends a create request and the connection drops before the response arrives. The client now knows nothing useful, because a timeout looks identical whether the server did the work or never received the request. Its options are to retry and risk a duplicate, or to give up and risk losing a real order. Neither is acceptable, which is why the caller's retry behaviour is your design problem rather than theirs. ## The methods that already answer this [RFC 9110](https://www.rfc-editor.org/rfc/rfc9110) defines `PUT` and `DELETE` as idempotent, alongside the safe methods, and that guarantee is what allows a client library to retry automatically. Repeating the request must have the same effect as making it once. Two things are worth being precise about. The guarantee is about the effect on the server rather than about the response, so a second `DELETE` answering `404` is still idempotent. And the guarantee is a promise you make, not a property you inherit, since nothing stops an implementation of `PUT` from appending a record. What the method semantics do not cover is `POST`, and creating a resource is exactly where a duplicate is expensive. That gap is what idempotency keys exist to close. ## What a key promises The client generates a unique value, sends it with the request, and reuses the same value for every retry of that same intent. The server stores the key together with the outcome of the first attempt, and any later request carrying that key gets the stored response instead of new work. The client has to be the one generating it, because only the client knows which attempts represent one intent. A server-generated value would arrive in the response the client never received. _Figure: The first attempt reaches the server and the response is lost, so the client retries with the same key and gets the stored result rather than a second order. The key is kept for a published retention window, and a retry after that window has expired is indistinguishable from a new request, which is why the window is part of the contract rather than an implementation detail._ The header name is a convention rather than a standard. The IETF HTTPAPI working group carried a draft called The Idempotency-Key HTTP Header Field. After its seventh revision in October 2025 that draft expired without being published as an RFC, which the IETF datatracker still records. So the name is common enough to be recognisable and you still have to document the semantics yourself. ## The decisions inside the pattern Adopting the pattern means answering four questions that callers will otherwise discover by experiment. **How long is a key kept?** The window has to cover realistic retry behaviour and stay bounded, which lands most APIs somewhere around a day. Publish the number, because a caller needs to know when a retry stops being a replay. **What happens to a key sent with a different body?** Reusing a key for a genuinely different request is a client bug. The useful answer is a `409` that says so, rather than silently replaying the old result or silently doing the new work. **What is the key scoped to?** A key is normally unique per caller rather than globally, since two customers picking the same random value should not collide. Scoping it to the account and the endpoint is the common choice. **What happens if the first attempt is still running?** A retry that arrives before the original finished cannot be answered from a store that has nothing in it yet. Answering `409` and asking the caller to retry shortly is honest, and returning a duplicate is not. ## Making retries safe on the caller's side Even with keys in place, the retry loop belongs to the caller, and your response is what steers it. A `5xx` or a timeout invites a retry, and a `4xx` other than `429` does not, since nothing about repeating the same rejected request will change the outcome. Saying that clearly in the [error body](https://routebase.dev/guides/api-design/designing-api-errors/) is worth more than any amount of documentation, because retry logic reads the status code. Where you want the caller to come back, say when. `Retry-After` is defined in RFC 9110 and works on `429` and on `503`, and it turns a guess into an instruction. That is covered further in [rate limits](https://routebase.dev/guides/api-design/api-rate-limiting/). ## In Routebase Routebase does not implement idempotency, because it does not sit in front of your API. What it does is let you declare the key as part of the contract, in the two places a caller and a generated client will look. The header itself is a parameter with a header location, and defining it once as a parameter component fixes the name, the type and whether it is required across every operation that accepts it. Each component lists the endpoints using it, so adding the key to a new create endpoint is a link rather than a copy. The second place is the operation description, which is where the precondition that no schema can express actually belongs. _Screenshot: The rule a caller has to follow, written on the operation it applies to, where a human reader and a generated client both meet it rather than in a wiki page neither of them opens._ That description travels with the exported document, so it reaches the reference documentation and anything else generated from the contract. A style guide rule watches the gap. A `POST` that declares a `201` response and accepts no idempotency key header is flagged while you edit, at informational severity and configurable per organisation and per project. The rule is anchored on the declared `201` rather than on the method, so a search or a login endpoint is not reported. The [Parameters](https://docs.routebase.dev/parameters/) guide covers header parameters and their components, [Endpoints](https://docs.routebase.dev/endpoints/) covers the description editor, and the [Style Guide](https://docs.routebase.dev/style-guide/) covers the rule and its severity. ## Frequently asked questions ### What is an idempotency key? It is a value the client generates and sends with a request so the server can recognise a retry of that exact request. The server stores the key with the result of the first attempt, and it replays that result for any later request carrying the same key. That turns an unsafe operation into one a client can repeat without creating a duplicate. The client picks the value, because only the client knows which attempts are the same intent. ### Is the Idempotency-Key header a standard? No. The IETF HTTPAPI working group had a draft named The Idempotency-Key HTTP Header Field, and that draft expired without being published as an RFC. The header name is therefore a widely used convention, so an API that accepts it has to document the semantics itself rather than pointing at a specification. ### Why do idempotent HTTP methods not solve this? They solve it for the methods they cover. RFC 9110 makes PUT and DELETE idempotent, so a client library can retry those safely, and it leaves POST and PATCH outside that guarantee. Since creating a resource is the operation where a duplicate costs the most, the case that matters most is exactly the case the method semantics do not cover. ### How long should an idempotency key be stored? Long enough to cover realistic retry behaviour and short enough that the store stays bounded, which for most APIs lands in the range of a day. The number itself matters less than publishing it, because a caller needs to know when a retry stops being a replay and starts being a second request. Whatever window you choose becomes part of the contract. --- # Rate Limits as a Design Decision — Routebase > What a published limit promises a caller, why 429 needs Retry-After, how little of the header convention is standardised, and what a limit counts against. Canonical page: https://routebase.dev/guides/api-design/api-rate-limiting/ Chapter 7 of 10 · API Design · Last reviewed 2026-09-13 by The Routebase Team. A rate limit is usually introduced as an operational control, and it lands on the caller as part of the interface. The moment a client has to handle a `429`, the limit is in your contract whether or not you wrote it down. ## What a limit tells a caller A published limit is more useful to a well behaved caller than an unpublished one is to you. It tells them how to size a batch job, when to add a queue and whether your API can support the integration they are planning. An unpublished limit produces the opposite behaviour. A caller who does not know the ceiling finds it by hitting it, usually in production, and the way they discover it is a failure they did not expect. They then guess a safe rate, which is either too slow for them or still too fast for you. So the design question is not whether to have a limit. It is what the limit is counted against, and how the caller learns they are approaching it. ## The response when a caller exceeds it The status code is `429 Too Many Requests`, defined in [RFC 6585](https://www.rfc-editor.org/rfc/rfc6585) rather than in the core HTTP semantics. Using `503` instead sends the caller to your status page when the problem is their request rate. The important half is what the response says next. `Retry-After` is defined in RFC 9110, accepts either a number of seconds or a date, and turns the caller's guess into an instruction. Without it a client backs off by whatever its library decided, which is either too eager or needlessly slow. The body should follow the same [error format](https://routebase.dev/guides/api-design/designing-api-errors/) as everything else, with a stable code the caller can branch on. A `429` is one of the few errors where the correct client behaviour is to wait and repeat, so it is worth being unambiguous that this one is retryable. ## The headers are mostly convention Callers would rather not hit the limit at all, which is what the quota headers are for. They report the ceiling, what is left and when the window resets, so a client can slow down before it is refused. Almost none of that is standardised. The names beginning with `X-RateLimit` spread by imitation rather than by specification, and no published RFC defines them. The IETF HTTPAPI working group has an active draft for `RateLimit` header fields without the prefix, and its eleventh revision from May 2026 had still not been published as an RFC. The practical consequence is that the header names are your decision and your documentation problem. Pick one set, use it on every endpoint that is limited, and declare it in the contract, because a caller cannot discover a response header from a specification that does not mention it. ## What the limit counts Three decisions sit under the number, and each one changes what the limit protects. **The partition** decides who shares a quota. Per credential is the usual answer, since that is the unit a caller can reason about. Partitioning by IP address looks similar and behaves differently, because an entire office behind one address counts as one caller, and a single script there can exhaust the quota for everybody. **The unit** decides what a request costs. Counting requests is simple and treats a cheap read the same as an expensive aggregation, so APIs with a wide cost range often weight requests instead. Weighting is fairer and harder to explain, which is why it needs the cost to be visible in the response. **The shape** decides whether bursts are allowed. A fixed window is easy to describe and lets a caller spend the whole quota in the first second. A token bucket smooths that out and is harder to state as a single number. Whichever you pick, the caller needs to know, because it determines whether their retry after a `429` will succeed. ## In Routebase Rate limiting is enforced by your infrastructure, and what belongs in the contract is the response a limited caller gets. Routebase is where that half is declared and kept consistent. Header policies apply a set of header components to every response whose status code matches the policy scope. A scope can be a whole class such as `4xx`, or an exact code such as `429`. So a single policy puts `Retry-After` and your quota headers on every rate limited response in a specification without anyone adding them endpoint by endpoint. The prebuilt header components cover the common cases including `Retry-After`, and policies cascade from organisation to project to specification with the most specific level winning. Before a policy goes live, an impact analysis card names how many endpoints and responses it would touch and warns where it overlaps another policy. Individual responses can opt out through an exclusion with a reason rather than by narrowing the policy, and an excluded header can be restored later. One style guide rule covers the contract side, flagging success responses that carry no rate limit headers, and it ships at informational severity so it prompts rather than blocks. Severities are configurable per organisation and per project. The [Header Policies](https://docs.routebase.dev/header-policies/) guide covers policies, scopes and exclusions, and the [Style Guide](https://docs.routebase.dev/style-guide/) covers the rule. ## Frequently asked questions ### What HTTP status code should a rate limited request return? 429 Too Many Requests, which is defined in RFC 6585 rather than in the core HTTP semantics. The response should say when the caller may try again, and RFC 9110 defines Retry-After for exactly that. Returning 503 instead tells the caller your service is unavailable, which sends them to your status page rather than to their own request rate. ### Are X-RateLimit headers a standard? No. The names beginning with X-RateLimit are a convention that spread by imitation, and no published RFC defines them. The IETF HTTPAPI working group has an active draft for RateLimit header fields without the prefix, and as of its eleventh revision in May 2026 it had not been published as an RFC. ### Should rate limits be per user or per API key? Per credential is the usual answer, because that is the unit a caller can reason about and the unit you can enforce. Partitioning by IP address looks equivalent and is not, since an entire office behind one address counts as a single caller and one script can exhaust the quota for everybody. Whatever the partition is, the caller has to be told what it is. ### How should rate limits be documented? In the contract rather than in a page beside it, because a limit is something client code has to handle. That means declaring the 429 response on the operations that can return it, declaring the headers that carry the quota, and stating what the limit is counted against. A limit a caller discovers in production is a limit you did not design. --- # Consistency Across an API — Routebase > Why the same decision has to appear at every endpoint, why intention is not a mechanism, and the three things that hold a convention in place over time. Canonical page: https://routebase.dev/guides/api-design/consistency-across-an-api/ Chapter 8 of 10 · API Design · Last reviewed 2026-09-27 by The Routebase Team. Every chapter before this one ends in a decision. This chapter is about the fact that a decision made once and applied unevenly is worth less than a worse decision applied everywhere. ## Consistency is the thing callers actually experience Nobody integrating with your API evaluates your pagination style in isolation. They notice how many times they had to learn something new. An API where every list pages the same way, every error has the same shape and every timestamp has the same name can be learned once. The fourth endpoint costs almost nothing, because the caller is guessing correctly. An API assembled from individually reasonable decisions costs them a fresh reading every time, and the cost is invisible to you because it lands entirely on the other side. This is why the guide keeps saying that two close options are less important than picking one. The gap between cursor and offset is real and small, while the gap between one pagination style and three is neither. Three list endpoints from a fictional shop show the difference, first as they grew one decision at a time and then after the team picked a single style. ```txt # Before: three lists, three loops for every caller to write GET /orders -> { "orders": [...], "next_page": 2 } GET /customers -> { "data": [...], "cursor": "Y3VzXzQw" } GET /invoices -> { "results": [...], "offset": 50, "total": 812 } # After: one envelope, so the loop is written once GET /orders -> { "items": [...], "nextCursor": "b3JkXzUw" } GET /customers -> { "items": [...], "nextCursor": "Y3VzXzQw" } GET /invoices -> { "items": [...], "nextCursor": "aW52XzUw" } ``` ## Intention is not a mechanism Teams do not become inconsistent through disagreement. They become inconsistent through turnover, deadlines and the ordinary fact that the person writing the fifteenth endpoint was not in the room for the first. A written convention alone therefore decays predictably. It is read once during onboarding, it is not in front of anyone at the moment a decision is made, and nothing happens when it is ignored. Six months later the document describes an API that no longer exists, which makes it worse than nothing, because now people distrust it. Holding a convention in place needs three things working together. **Something written down** gives the team an artefact to argue with and change deliberately. It is the cheapest of the three and the least effective on its own. **A reusable building block** makes the agreed shape the path of least resistance. When the error response is a component you reference, writing a different one is more work than complying, which is the only reliable form of encouragement. **An automated check** catches what the other two missed and does it where the decision is being made. A check that runs in a nightly report is a list nobody reads, while a check that runs while somebody types is a correction. ## What to make reusable, and when The instinct after reading the above is to extract everything, which produces an API description that is technically tidy and genuinely hard to read. The signal to extract is the second occurrence rather than a feeling that a shape looks reusable. Three cases are worth extracting on sight because the second occurrence is certain, and those are the error body, the pagination envelope and the authentication scheme. Everything else can wait until it repeats. The [components chapter](https://routebase.dev/guides/openapi/openapi-components-and-reuse/) of the OpenAPI guide covers where that line sits in the document itself. Reuse across APIs is a different decision with a different failure mode. One definition shared by twelve services means a change reaches all twelve at once. That is right when the definition is a genuine standard and wrong when it is not, since nobody chose to receive it. A library that copies the definition and records where it came from lets each consumer move on its own schedule, and the price is that versions coexist for a while. ## Promote rules slowly A style guide switched on over an existing API produces a large number of violations on the first run, and how you handle that first number decides whether the guide survives. Turning everything into a blocker stops work and teaches people to route around the check. Leaving everything advisory means the number only grows, because nothing ever has to be fixed. The path that works is to start advisory, work the backlog down, and then promote the handful of rules you are genuinely unwilling to ship without. That handful is usually smaller than expected. Unique operation identifiers and declared error responses earn their place quickly, while a naming convention on descriptions rarely does. ## In Routebase The three mechanisms map onto three surfaces, and they are meant to be used together. _Screenshot: Each rule carries a severity you set for the organisation and can override per project, so promoting one from advisory to blocking is a dropdown rather than a migration._ The style guide ships with rules across naming, completeness, best practices, security and structure, and each one is set to error, warning, informational or off. Severity is decided at organisation level and can be overridden per project, where a source column shows whether the current value is custom, inherited or the default. Blocking is opt-in, because enforcement on publish is off until you turn it on, and warnings never block. Configuring the guide needs the governance permission and it is a Pro plan feature. Rules whose name says must are not automatically errors, since the name and the severity are set independently. That is worth knowing before you read the table as a list of things that will stop a release. Violations surface where the work happens rather than in a report. An issues panel at the bottom of the designer groups them by rule, with severity counts that double as filters. Many issues carry a one-click fix, and a button applies all the available fixes at once. A summary badge sits in the header, the endpoint and schema tree carries badges with the violations in their tooltips, and the publish dialog lists what is left before a version is frozen. Where a house rule has no built-in equivalent, custom rules cover a defined slice. A custom rule targets an endpoint, a schema or the specification, picks one field on that target, and matches with a regex, contains, equals or exists condition. That is enough for conventions about paths, summaries, operation identifiers and specification metadata, and it does not reach parameters, responses or status codes. Reuse is the second mechanism. Components hold the shapes reused inside one specification, and an organisation-level shared library holds the ones reused across projects. Each specification keeps the library version it linked, so an update is something you accept rather than something that happens to you. Duplicate detection groups schemas by structure rather than by name, which is what finds the three teams that each wrote their own address type. Header policies do the same job for response headers. The [Style Guide](https://docs.routebase.dev/style-guide/), [Shared Library](https://docs.routebase.dev/shared-library/) and [Header Policies](https://docs.routebase.dev/header-policies/) guides cover the three surfaces, and the [linting chapter](https://routebase.dev/guides/openapi/validating-and-linting-openapi/) of the OpenAPI guide covers the difference between a document being valid and being good. Applying the three across several teams rather than one API is the subject of the [API governance guide](https://routebase.dev/guides/api-governance/). ## Frequently asked questions ### Why is consistency important in API design? Because a consistent API can be learned once and then guessed. A caller who has integrated three endpoints already knows how the fourth pages its results, shapes its errors and names its fields, so each new endpoint costs them almost nothing. An inconsistent API has to be learned endpoint by endpoint, and the cost lands on every consumer rather than on the team that saved an afternoon. ### How do you enforce API design standards across teams? With three things rather than one. A written convention gives people something to agree on, reusable building blocks make the agreed shape the easiest one to use, and an automated check catches the cases where neither of those held. A style guide with no check is a document, and a check with no shared components makes people reimplement the same shape correctly over and over. ### Why does consistency matter more than individual API design choices? Callers do not judge your pagination style in isolation. They notice how many times they had to learn something new. An API where every list pages the same way and every error has the same shape can be learned once. An API assembled from individually reasonable decisions costs a fresh reading at every endpoint, and that cost lands entirely on the people calling it. ### Should API design rules block a release? Some of them, eventually. Turning every rule into a blocker on day one stops work and trains people to bypass the check, while leaving everything advisory means the count of violations only grows. The workable path is to start advisory, fix the backlog, and then promote the small number of rules you are genuinely unwilling to ship without. --- # Designing APIs for AI Agent Clients — Routebase > Hypermedia promised runtime discovery to clients generated ahead of time. A caller that reads your description at runtime now exists, and it reads the prose. Canonical page: https://routebase.dev/guides/api-design/designing-for-agent-clients/ Chapter 9 of 10 · API Design · Last reviewed 2026-09-27 by The Routebase Team. Hypermedia was the part of REST that never landed. The idea was that a response would carry the operations available next, so a client could navigate an API the way a browser navigates a site rather than by hard coding URLs. It was coherent and it went almost entirely unused. This chapter is about why, and about what changed. ## The audience did not exist The reason hypermedia controls stayed unused is not that the argument was wrong. Roy Fielding's often quoted post insisting that a REST API must be hypertext driven made the case clearly enough, and Leonard Richardson's maturity model put hypermedia controls at the top for the same reason. The problem was the client. Almost every consumer of an HTTP API was written against a description at build time, whether by a person reading documentation or by a generator producing a typed client. Such a client already knows every URL it will ever call, so a link object in a response tells it something it has been compiled with. Following the links would have been strictly more work for the same result. So the capability shipped in a handful of APIs and the callers ignored it, which is the ordinary fate of a feature nobody is on the other side of. ## The runtime reader arrives An agent driven client is genuinely different, because it decides which call to make while it is running. That is the consumer hypermedia was designed for, and it does not use hypermedia. What it reads is your description. It is given a set of operations with their names, summaries, parameters and schemas, and it picks one by reasoning over that text. The link objects in a response body are not where it looks, because it needed to know what was possible before it made the first call. The idea therefore came back and the mechanism did not. Runtime discovery is now real, and the surface it happens on is the API description rather than the payload. ## What the reader actually uses Designing for that reader is mostly a matter of writing down what you were leaving to convention. **The operation name carries the first guess.** An identifier like `cancelOrder` says what happens, and one like `postOrdersIdCancel2` says only where it sits. That name is also what a code generator turns into a method, so the work pays twice. **The description answers what a schema cannot.** Which of two similar operations to use, what the operation is for, what it costs, and when not to call it. A field typed as a string with no description is a field the caller will fill in with something plausible. **Preconditions have to be stated.** A create that needs an idempotency key, a filter that is required in practice, an ordering constraint between two calls. None of that is expressible in a schema, and all of it is expressible in a sentence. **Enums need meaning, not just membership.** A status of `pending` against `processing` is a distinction a schema records and does not explain, so the difference belongs in the description. **Errors should say what to change.** A caller that can read prose can act on an instruction. That makes the error text from the [error design chapter](https://routebase.dev/guides/api-design/designing-api-errors/) worth more here than anywhere else, because a good message turns a failure into a corrected retry rather than a stop. One operation from a fictional orders API shows the difference, first as a generator named it and then written for a reader that decides at runtime. ```yaml # Before: the name says where the operation sits, and the rest is convention /orders/{orderId}/cancel: post: operationId: postOrdersIdCancel2 responses: "200": description: OK # After: the name says what happens, and the prose says when it works /orders/{orderId}/cancel: post: operationId: cancelOrder summary: Cancel an order that has not shipped description: > Cancels the order and releases its reserved stock. This only works while the status is pending or paid. For an order that has shipped, create a return with createReturn instead. responses: "200": description: The order is cancelled and its status is now cancelled. "409": description: The order has already shipped. Create a return instead. ``` The [descriptions chapter](https://routebase.dev/guides/openapi/openapi-descriptions-for-agents/) of the OpenAPI guide goes through the questions a description has to answer in more detail. ## The hypermedia that did survive Two narrow uses of links outlived the general idea, and both are worth keeping. The `Location` header on a `201` points at the resource that was created, which saves every client from digging an identifier out of a body. And a `202` needs somewhere to look for the outcome, so handing back a reference to a status resource is a link in everything but name. Both are covered in [methods and status codes](https://routebase.dev/guides/api-design/http-methods-and-status-codes/). What did not survive is the general link collection on every representation. If your API does not have it, adding it now for a runtime reader is aiming at the wrong surface. ## In Routebase The description is a first class field on the operation rather than an afterthought, and it is edited where the operation is defined. Operation identifiers are generated from the method and path and can be overridden, which is the moment to give an action endpoint a name that reads like a method. Uniqueness is checked as an error, and a second rule keeps the identifier safe to use in a URL. Because descriptions are part of the specification rather than a layer beside it, they travel with every export and reach the published reference documentation without a second edit. Style guide rules cover the completeness side, flagging operations and responses that carry no description, at severities you set per organisation and per project. The [Endpoints guide](https://docs.routebase.dev/endpoints/) covers the description editor and operation identifiers. ## Frequently asked questions ### Does HATEOAS matter now that clients can be LLM driven? Not in its original form. Hypermedia proposed that a client discover what it can do next from link objects in the response. An agent driven client does discover at runtime, and it discovers from the API description rather than from links in a payload. So the underlying idea is more relevant than it was, while the specific mechanism is still largely unused. ### What does an AI agent need from an API description? The same things a new engineer needs, stated explicitly rather than implied. It needs an operation name that reads like what it does, and a description saying what the operation is for and when not to use it. It also needs preconditions that no schema can express, and error responses whose text says what to change. Anything left to convention is a thing the agent has to guess. ### Is HATEOAS dead? It was never widely adopted, which is a different thing. Most APIs called REST stop short of hypermedia controls, and the reason is that hardly any client was written to follow them, since clients were generated from a description ahead of time. The parts that did survive are the narrow ones, such as the Location header on a created resource and links to a status resource for asynchronous work. ### How should error messages be written for agent callers? So that the next action is in the message. A caller that can read prose can act on an instruction, so an error saying which field was wrong and what a valid value looks like turns a failure into a corrected retry. An error that says the request was invalid gives a human and an agent exactly the same amount to work with, which is none. --- # What to Look for in an API Design Tool — Routebase > Eight questions about what a design tool stores, checks and lets you take with you, tested on your largest real description instead of a sample. Canonical page: https://routebase.dev/guides/api-design/api-design-tools/ Chapter 10 of 10 · API Design · Last reviewed 2026-09-27 by The Routebase Team. A design tool is easy to like on a sample specification, because sample specifications are small and consistent. The difference shows once your own description is inside, with its reuse across projects, its house conventions and the changes waiting to ship. The questions below look at that part. ## Eight questions for a design tool ### 1. What is the stored artefact Ask whether the tool stores the contract itself or stores something else and can produce a contract on request. The difference decides what happens to everything downstream. When the description is the artefact, the reference documentation, the mock and the tests are projections of one thing. When the description is an export, every consumer of it is working from a copy, and a copy has a date on it. ### 2. Can reuse cross a project boundary Reuse inside one description is the easy half, and most tools handle it because the format does. The harder question is what happens when twelve services should answer with the same error body. Ask whether a definition can live above the individual API, whether a consumer records which version of it they took, and whether an update reaches them automatically or on their own schedule. Both answers are defensible, and a tool that has not thought about it leaves you copying. ### 3. Where does a rule check appear A convention that is checked in a nightly report is a list, and a convention checked while somebody types is a correction. Ask where violations surface, whether they can be fixed from where they appear, and whether severity is something you set rather than something the vendor decided. Then ask the one that matters most, which is whether a rule can block a release and whether that blocking is optional. A tool with only advisory checks never changes behaviour, and one with only blocking checks gets switched off. ### 4. Can you express your own conventions Every organisation has rules the built-in set does not cover. Ask what a custom rule can target and what it can match, because that boundary is where you will find out whether your house style is expressible. A tool that only offers regular expressions over a name will not carry a rule about response coverage, and knowing that before you buy is better than discovering it during rollout. ### 5. What does it tell you before a change ships The design question that recurs is not what the API looks like, it is what this edit does to the people already using it. Ask whether the tool can diff two versions, whether it classifies a change as breaking, and whether that classification appears before publication rather than after. The [versioning guide](https://routebase.dev/guides/api-versioning/api-breaking-changes/) covers what should count as breaking, and a tool that has no opinion leaves that judgement to whoever is reviewing at the time. ### 6. Can more than one person work at once A single-file description in a repository handles concurrent work through the mechanism the repository already has, which is branching and merging. A tool that owns the description has to provide an equivalent. So ask what happens when two people edit the same specification, and what happens when one of them needs a fortnight on a change that should not reach the published version yet. Ask what conflict resolution looks like, because the honest answers vary widely. ### 7. What can you take with you Ask what a full export contains and try it on the largest description you have. A round trip is the test. Import, export, and diff the result against the original, since what disappears is what the tool does not really model. Comments, examples, extensions and vendor specific fields are the usual casualties, and each one is a thing you would have to rebuild elsewhere. ### 8. Does it cover the decisions or only the syntax An editor that validates a document tells you the file is legal. Every chapter in this guide is about a decision the file cannot be wrong about. So ask what the tool does about the choices rather than the syntax. Whether it can hold a house convention, whether it can make the agreed error shape the easiest one to use, and whether it notices when a list endpoint ships without pagination. That is the difference between a tool that stores your design and one that participates in it. ## A scorecard for design tools | Criterion | The question | Poor answer | |---|---|---| | Stored artefact | Is the contract the thing, or an export | A contract generated on demand from something else | | Reuse across projects | Can one definition serve several APIs | Copy and paste, with no record of the source | | Where checks appear | Do violations show while editing | A report you have to go and read | | Custom conventions | What can a rule target and match | A fixed rule set with no extension | | Change impact | Is a breaking change named before release | A diff of raw text | | Concurrent work | What happens when two people edit | Last write wins | | Export | What survives a round trip | An export missing examples and extensions | | Decisions | Does it hold conventions, not just syntax | Validation only | ## Import your largest description, then break a convention Do not evaluate on a sample specification, because sample specifications are consistent and yours is not. Import your largest real description and look at what arrived. Then break one of your own conventions deliberately, such as adding a list endpoint with no paging parameters or an operation with no error response, and see whether anything says so and where. Finally export and diff against what you imported. Three afternoons of that will tell you more than a feature matrix, and it surfaces the round trip problems that are expensive to discover later. ## In Routebase Put to Routebase, the eight questions have short answers, and the earlier chapters of this guide describe each one in full. The stored artefact is the specification, and the reference documentation, the mock server, the contract tests and the monitors are derived from it rather than maintained beside it. Reuse works at two levels, with components inside a specification and an organisation-level shared library above it, where a linked definition records the version it took and an update is accepted rather than imposed. Conventions are style guide rules with severities set per organisation and overridable per project. They surface in an issues panel with one-click fixes while you edit and again in the publish dialog, and blocking on publish is a switch you turn on when you are ready. Custom rules extend that to endpoints, schemas and specification metadata. Versions can be compared, breaking changes are named before a release, branches exist for work that should not reach the published version yet, and every frozen version exports as YAML, JSON, Postman or Insomnia. The [Style Guide](https://docs.routebase.dev/style-guide/), [Shared Library](https://docs.routebase.dev/shared-library/), [Branching](https://docs.routebase.dev/branching/) and [Import and Export](https://docs.routebase.dev/import-export/) guides cover the four in the product documentation, and the [API design feature page](https://routebase.dev/api-design/) has the short version. ## Frequently asked questions ### What should you look for in an API design tool? Ask what the tool stores, whether it can express reuse across more than one API, where its rule checks appear, and what you can take with you if you leave. Those four separate an editor from a design workflow. The features that demo well, such as a pretty rendering of the document, tend to matter only on the first afternoon. ### Do you need a design tool if you can write OpenAPI by hand? Not for one small API maintained by one person, where a text editor and a linter cover it. The case for a tool starts when several people edit the same description, when shapes have to be reused across projects, or when conventions have to hold without a reviewer noticing every deviation. Those are coordination problems rather than editing problems. ### Is a design tool the same as an API client? They overlap on sending a request and diverge everywhere else. A client is organised around a collection of saved requests, while a design tool is organised around a contract that other artefacts are derived from. The distinction shows up when you ask what happens to the mocks, the tests and the documentation when the contract changes. ### How do you evaluate an API design tool properly? Import your largest real specification rather than a sample, then make a change that should be caught by one of your own conventions and see whether anything says so. Then export the result and diff it against what you imported. What survives the round trip, and what the tool noticed, tell you more than any feature list. --- # OpenAPI: A Complete Guide to the Specification — Routebase > What the OpenAPI Specification is, how a document is built, why a contract is not documentation, and what you get out of the file once it exists. Canonical page: https://routebase.dev/guides/openapi/ Guide overview · 10 chapters · Last reviewed 2026-09-13 by The Routebase Team. Your API already has a contract. The question is whether it is written down anywhere a machine can read it, or whether it lives in the implementation, in a wiki page from last year and in the heads of two people. An OpenAPI document is that contract written down. This guide covers what belongs in the file and how to write the parts that are easy to get wrong. It then covers how to check that the result is both valid and good, and what you can build from it afterwards. ## A contract is not documentation The distinction sounds academic until you watch a team maintain both of them. Documentation describes what an API does, while a contract states what it promises, and only the second of those can be checked by a machine. That difference is what makes the file worth the effort. A description nobody can verify ages quietly, because there is no moment at which being wrong costs anything. A contract can be validated against the running service, so being wrong surfaces on the next test run rather than in a support ticket six weeks later. Everything else in this guide follows from that. The file is written for tools first and for people second, which is exactly why people end up trusting it. ## What you get from one file The reason to keep a contract in one place is that so many other things are derived from it rather than written again. _Figure: The contract is written once, and the reference documentation, the mock server, the contract tests, the monitors and the code samples are all projections of it rather than separate copies that somebody keeps in step by hand._ Each of those arrows is a copy you do not maintain. That is also the honest limit of the idea, because anything the document does not say cannot be derived. A document full of untyped objects and missing descriptions generates exactly as little as it contains. ## The shape of a document An OpenAPI document is one object with a small number of top-level fields, and almost everything you write sits under two of them. The `info` block names and versions the document, and the `servers` block lists the base URLs it is reachable at. The `paths` block holds one entry per route, and each of those holds one entry per HTTP method, which the specification calls an operation. The `components` block holds the definitions you reference from more than one place. The [anatomy chapter](https://routebase.dev/guides/openapi/anatomy-of-an-openapi-document/) walks through all of it with a complete example. Two of those fields are worth separating right now, because mixing them up causes real confusion. The `openapi` field at the root names the version of the specification your file is written against, while `info.version` describes your document. OpenAPI 3.1.1 defines `info.version` as the version of the OpenAPI document and states that this is distinct from the specification version and from the version of the API being described. ## Which version of the specification Three lines of the specification are in use, and the difference between them is mostly about JSON Schema. OpenAPI 3.0 uses a modified subset of an old JSON Schema draft, which is where `nullable` comes from. OpenAPI 3.1 replaced that with JSON Schema 2020-12 and dropped the workarounds. OpenAPI 3.2.0 arrived on 19 September 2025 and added new capabilities on top of 3.1 rather than changing the schema model again. The [version chapter](https://routebase.dev/guides/openapi/openapi-3-0-3-1-3-2/) covers what actually changed and what a tool has to touch when you upgrade. ## The short answer If you take one rule from this guide, take this one. Write the contract first, keep exactly one copy of it, and derive everything else from that copy rather than maintaining a second description by hand. The rest of the guide is that rule taken apart. | Chapter | Answers | |---|---| | [OpenAPI vs Swagger](https://routebase.dev/guides/openapi/openapi-vs-swagger/) | Where the two names came from and which one applies to what | | [Anatomy of a document](https://routebase.dev/guides/openapi/anatomy-of-an-openapi-document/) | Every top-level field, with a complete working example | | [3.0, 3.1 and 3.2](https://routebase.dev/guides/openapi/openapi-3-0-3-1-3-2/) | What each version changed, and what an upgrade costs | | [Schemas](https://routebase.dev/guides/openapi/openapi-schemas/) | Objects, composition, enums, formats and nullability | | [Parameters, bodies, responses](https://routebase.dev/guides/openapi/openapi-parameters-request-bodies-and-responses/) | The three halves of an operation and the mistakes in each | | [Components and reuse](https://routebase.dev/guides/openapi/openapi-components-and-reuse/) | What `$ref` buys you and when extracting one is premature | | [Validating and linting](https://routebase.dev/guides/openapi/validating-and-linting-openapi/) | Is it valid OpenAPI, and separately, is it any good | | [From collections to contracts](https://routebase.dev/guides/openapi/importing-postman-and-insomnia-collections/) | What an importer can infer from examples and what it cannot | | [What you derive](https://routebase.dev/guides/openapi/what-you-derive-from-openapi/) | Docs, mocks, tests, monitors, samples, and where generation stops | | [Descriptions an agent can use](https://routebase.dev/guides/openapi/openapi-descriptions-for-agents/) | The four questions a description has to answer | Three neighbouring subjects live in other guides. Security schemes are covered in [OpenAPI security schemes](https://routebase.dev/guides/api-authentication/openapi-security-schemes/), and the several things called a version are untangled in [OpenAPI versioning](https://routebase.dev/guides/api-versioning/openapi-versioning/). This guide covers how a contract is written down, while [API design](https://routebase.dev/guides/api-design/) covers how it is decided in the first place. ## In Routebase Routebase is an OpenAPI editor with the rest of the lifecycle attached. You work on endpoints, schemas and components in a structured designer rather than in raw YAML, and the document is the storage format rather than an export step. _Screenshot: The endpoint tree, the operation being edited and a real request against a selected environment sit in one window, so the contract and the check that it holds are never two tools apart._ Specifications are authored as OpenAPI 3.0, 3.1 or 3.2, new ones default to 3.2, and every frozen version exports as YAML, JSON, Postman or Insomnia. Existing files come in the same way, so nothing about this is a one-way door. Start with the [Endpoints guide](https://docs.routebase.dev/endpoints/) in the product documentation, or read on. The [API design feature page](https://routebase.dev/api-design/) has the short version of how the designer fits into the rest of the lifecycle. ## Frequently asked questions ### What is OpenAPI? OpenAPI is a specification for describing an HTTP API in a single machine-readable document. The document lists the paths, the operations on each path, the inputs each operation takes, the responses it returns and the schemas behind those responses. Because the format is standardised, other tools can read your description and produce documentation, mock servers, tests and client code from it. ### Is OpenAPI the same as Swagger? They share a lineage rather than a meaning. Swagger was the original name of the specification, and version 2.0 was donated to the OpenAPI Initiative at the end of 2015, after which the specification was renamed and continued as OpenAPI 3.0. Today Swagger is a family of tools from SmartBear, so a file is OpenAPI while an editor or a renderer might be Swagger. ### What is an OpenAPI document used for? It is the one description that several tools read instead of each holding its own copy. A reference page can be generated from it, and a mock server can answer from its response schemas. A test runner can assert that the live API still matches it, and a monitor can validate production responses against it. The value comes from having one source rather than five that drift apart. ### Should you write OpenAPI in YAML or JSON? Both are valid and describe the same document, so the choice is about who reads the file. YAML carries comments and produces readable diffs in review, which is why most teams write it that way. JSON is what most tooling emits and consumes, and converting between the two loses nothing except the comments. ## Chapters in this guide 1. [OpenAPI vs Swagger](https://routebase.dev/guides/openapi/openapi-vs-swagger/index.md): Where the two names come from, what changed when Swagger 2.0 became OpenAPI 3.0, which tools still say Swagger, and which file your tooling expects. 2. [Anatomy of an OpenAPI Document](https://routebase.dev/guides/openapi/anatomy-of-an-openapi-document/index.md): Every top-level field of an OpenAPI document explained in the order you meet it, with one complete working example and the difference between YAML and JSON. 3. [OpenAPI 3.0, 3.1 and 3.2](https://routebase.dev/guides/openapi/openapi-3-0-3-1-3-2/index.md): What changed when 3.1 adopted JSON Schema 2020-12, what 3.2 added on top, and what a document and its tooling actually have to touch on the way up. 4. [OpenAPI Schemas](https://routebase.dev/guides/openapi/openapi-schemas/index.md): Objects, arrays and primitives, allOf against oneOf and anyOf, enums with meaning, formats, nullability in both dialects, and examples that stay true. 5. [Parameters, Request Bodies and Responses](https://routebase.dev/guides/openapi/openapi-parameters-request-bodies-and-responses/index.md): The four parameter locations, how a request body is described, responses per status code with headers and examples, and the errors documents omit. 6. [Components and Reuse](https://routebase.dev/guides/openapi/openapi-components-and-reuse/index.md): What lives under components, how a reference works, when extracting something pays off and when it is premature, and what changes once it is shared. 7. [Validating and Linting OpenAPI](https://routebase.dev/guides/openapi/validating-and-linting-openapi/index.md): Validation asks whether a document is legal OpenAPI, linting whether it is good. What each catches, which rules find real defects, what blocks a release. 8. [Importing Postman and Insomnia Collections](https://routebase.dev/guides/openapi/importing-postman-and-insomnia-collections/index.md): Why a Postman or Insomnia collection is not an API contract, what an importer can infer from example data, and the work left after the import. 9. [What You Derive From OpenAPI](https://routebase.dev/guides/openapi/what-you-derive-from-openapi/index.md): Reference docs, mocks, contract tests, monitors and code samples all come from one document. What each needs from it, and where generation stops helping. 10. [OpenAPI Descriptions for AI Agents](https://routebase.dev/guides/openapi/openapi-descriptions-for-agents/index.md): What a coding agent reads from an OpenAPI document, the four questions a description must answer, and why fields treated as decoration decide the call. --- # OpenAPI vs Swagger — Routebase > Where the two names come from, what changed when Swagger 2.0 became OpenAPI 3.0, which tools still say Swagger, and which file your tooling expects. Canonical page: https://routebase.dev/guides/openapi/openapi-vs-swagger/ Chapter 1 of 10 · OpenAPI · Last reviewed 2026-09-13 by The Routebase Team. Two names sit on the same subject, and people use both for both things. The confusion is historical rather than technical, so a short history settles it. ## One specification, two names The format started as Swagger, a project first released in August 2011. Version 2.0 followed in September 2014 and became the format most tooling supported. At the end of 2015 the specification was donated to the OpenAPI Initiative, which the revision history in the specification itself records as the entry for 31 December 2015. The next major release came out on 26 July 2017 under the new name, as OpenAPI 3.0.0, and every version since has carried it. So the specification is called OpenAPI, and it has been for about a decade. The name Swagger stayed with the tools. ## What Swagger means today SmartBear owns the Swagger trademark and ships a family of tools under it. Swagger UI renders an OpenAPI document as browsable reference pages, Swagger Editor edits one, Swagger Codegen generates client and server code from one, and SwaggerHub is the hosted product around all of that. None of those names describe a file format. When somebody sends you a Swagger file, they mean an OpenAPI document, and the only thing worth asking is which version. ## Telling the versions apart The root of the document says which format you are holding, and it takes one line to check. ```yaml swagger: "2.0" # the format formerly known as Swagger 2.0 ``` ```yaml openapi: 3.1.0 # OpenAPI 3, the current line ``` The difference matters because the two are not shaped alike. Version 2.0 has `definitions`, `parameters` with a body location and a single `produces` list for the whole document. Version 3 replaced all of that with `components`, a separate `requestBody` object and a content map keyed by media type. A parser built for one will not read the other. ## What changed between 2.0 and 3.0 Four changes account for most of the difference, and each of them removes a workaround the older format needed. **Request bodies became their own thing.** In 2.0 a body was a parameter whose location was `body`, which meant a body could not have several media types and could not be reused cleanly. Version 3 gives it a `requestBody` field with a content map. **Content types moved next to the content.** The global `consumes` and `produces` lists disappeared, so each request body and each response declares its own media types and a schema for each one. **Reusable pieces got one home.** Instead of `definitions`, `parameters` and `responses` as separate top-level maps, everything reusable moved under `components`. **Servers replaced the host triple.** The single `host`, `basePath` and `schemes` fields became a `servers` array with full URLs and variables, which is what lets one document describe several environments. ## Which files your tooling expects Most current tooling reads OpenAPI 3.0 and 3.1, a good deal of it still reads 2.0, and a converter sits in front of anything that does not. The practical rule is that the file you keep should be the newest version your generators handle, because everything downstream inherits its limitations. Converting upward is mechanical and well supported. What conversion cannot do is add the descriptions, examples and error responses the old document never carried, and those are the parts that decide whether the generated output is useful. The [version chapter](https://routebase.dev/guides/openapi/openapi-3-0-3-1-3-2/) covers the upgrade from 3.0 onward in detail. ## In Routebase Routebase authors specifications as OpenAPI 3.0, 3.1 or 3.2, and new specifications default to 3.2. An existing file goes in through the import wizard, which detects the version, validates the document and shows you what it found before anything is created. _Screenshot: The importer names the version it detected and offers the upgrade to 3.1 as a switch rather than as a separate migration step._ Whatever wrote the file originally, the workspace holds it as a structured specification from that point on, and every frozen version leaves again as standard YAML or JSON. The [Import and Export guide](https://docs.routebase.dev/import-export/) covers both directions, and the [Swagger comparison](https://routebase.dev/swagger-alternative/) covers the tooling question rather than the format one. ## Frequently asked questions ### What is the difference between OpenAPI and Swagger? OpenAPI is the specification and Swagger is a set of tools named after it. The specification was called Swagger up to version 2.0, which was donated to the OpenAPI Initiative on 31 December 2015 and continued under the new name as OpenAPI 3.0.0 in July 2017. So a file written today is an OpenAPI document, while Swagger UI and Swagger Editor are tools that read one. ### Is Swagger 2.0 the same as OpenAPI 2.0? Yes, those are two names for the same document format. People write OpenAPI 2.0 to make the lineage clear. The OpenAPI Initiative's own revision history lists version 2.0 twice, once as the Swagger release in 2014 and once as the donation at the end of 2015. Tooling usually recognises it by the root field, which reads swagger rather than openapi. ### Should I upgrade a Swagger 2.0 file to OpenAPI 3? Usually yes, because the newer specification separates request bodies from parameters, supports several content types per response and has a components section that actually holds everything reusable. Converters handle most of the work. What they cannot do is invent the descriptions and examples the older file never had, so budget for reading the result rather than for running a command. ### What is the swagger field at the top of a file? It is the marker of a version 2.0 document. A 2.0 file starts with swagger followed by the version string, while a version 3 file starts with openapi followed by something like 3.1.0. Checking that one line is the fastest way to tell which format you have been handed before you feed it to anything. --- # Anatomy of an OpenAPI Document — Routebase > Every top-level field of an OpenAPI document explained in the order you meet it, with one complete working example and the difference between YAML and JSON. Canonical page: https://routebase.dev/guides/openapi/anatomy-of-an-openapi-document/ Chapter 2 of 10 · OpenAPI · Last reviewed 2026-09-13 by The Routebase Team. An OpenAPI document is one object with fewer top-level fields than people expect. Once you can name all of them, reading somebody else's specification stops being an exercise in scrolling. ## The top-level fields | Field | What it holds | |---|---| | `openapi` | The version of the specification this document is written against | | `info` | Title, version, description, contact, license | | `servers` | The base URLs the API is reachable at, with optional variables | | `paths` | One entry per route, each holding its operations | | `webhooks` | Incoming webhooks the API may send, added in 3.1 | | `components` | Reusable schemas, responses, parameters, headers and security schemes | | `security` | The authentication that applies unless an operation overrides it | | `tags` | Named groups with descriptions, used to organise the reference | | `externalDocs` | A link to documentation that lives elsewhere | Two of these are worth stating plainly. The `openapi` field describes the file format and has nothing to do with your API, while `info.version` describes the document. The specification is explicit that `info.version` is distinct from the specification version and from the version of the API being described, so a document can say 2.3.0 while your consumers call `/v2`. ## A complete example The following document is small enough to read and complete enough to run through a validator, a documentation generator and a mock server without additions. ```yaml openapi: 3.1.0 info: title: Acme Orders API version: 2.3.0 summary: Place and retrieve customer orders. description: | Orders are priced by the server at the time they are placed, so the totals in the response are authoritative. license: name: Apache-2.0 identifier: Apache-2.0 servers: - url: https://api.acme.example/v2 description: Production - url: https://sandbox.api.acme.example/v2 description: Sandbox tags: - name: Orders description: Creating, reading and cancelling customer orders. security: - bearerAuth: [] paths: /orders/{orderId}: get: operationId: getOrder summary: Get an order description: Returns one order including its line items and totals. tags: [Orders] parameters: - name: orderId in: path required: true description: Public identifier of the order. schema: type: string format: uuid responses: "200": description: The order was found. content: application/json: schema: $ref: "#/components/schemas/Order" "404": $ref: "#/components/responses/NotFound" components: securitySchemes: bearerAuth: type: http scheme: bearer bearerFormat: JWT responses: NotFound: description: No order exists with that identifier. content: application/problem+json: schema: $ref: "#/components/schemas/Problem" schemas: Order: type: object description: A customer order with line items and server-calculated totals. required: [id, status, total, currency, createdAt] properties: id: type: string format: uuid status: type: string enum: [PENDING, PAID, SHIPPED, CANCELLED] description: Where the order currently is in fulfilment. total: type: number format: double description: Grand total including shipping. currency: type: string description: ISO 4217 code the totals are expressed in. createdAt: type: string format: date-time Problem: type: object description: RFC 9457 problem details. required: [type, title, status] properties: type: type: string format: uri title: type: string status: type: integer detail: type: string ``` ## Reading it from the top **The version marker** tells a parser how to read everything below it, so it is the first thing any tool looks at. **The info block** is what shows up as the title of your reference documentation. The `summary` field and the SPDX `identifier` under `license` were both added in 3.1, so a 3.0 document uses `description` and a license `url` instead. **Servers** are a list rather than a single value, which is how one document covers production and a sandbox. Variables in a server URL let you leave a region or a tenant open for the reader to fill in. **Paths** hold the actual API. Each key is a URL template, each entry under it is an HTTP method, and the object under that method is what the specification calls an operation. The template variables in braces have to match declared path parameters, and a validator will tell you when they do not. **Components** hold everything you reference more than once, addressed through `$ref` with a pointer such as `#/components/schemas/Order`. The [reuse chapter](https://routebase.dev/guides/openapi/openapi-components-and-reuse/) covers when extracting something is worth it. **Security** at the top level applies to every operation, and an operation can override it with its own list. An empty list on an operation makes it public, which is the only way to say that explicitly. [OpenAPI security schemes](https://routebase.dev/guides/api-authentication/openapi-security-schemes/) covers the types and their fields. ## Tags do more than group things Tags look like filter chips and behave like structure. Most reference renderers group operations by their first tag and use the matching entry in the top-level `tags` list for the section introduction. That makes a tag description part of your published documentation rather than an internal label. A document with eight tags and no descriptions produces eight unexplained headings, and nobody notices until it is live. ## YAML or JSON Both are valid and interchangeable, since YAML is a superset of JSON for these purposes and every parser accepts either. YAML wins on review, because it carries comments and produces diffs a human can read. JSON wins on tooling, because it is what most generators emit and what every language parses without a dependency. Teams that write by hand tend to keep YAML in the repository and let anything downstream take whichever form it asks for. The one thing to watch in YAML is that status codes and version strings are quoted. Written bare, `200` is a number and `3.10` would be read as a float, which is why the example above quotes both. ## In Routebase Routebase edits the same structure through a designer rather than through the file. An operation opens with its method and path at the top, and the parameter block and the response block below it are the same two halves of the contract that the YAML has. _Screenshot: One operation with its parameters and its responses in a single view, which is the same thing the paths block of the document holds._ The raw document stays one click away in the preview panel, and every frozen version downloads as YAML or JSON with tag descriptions, enum labels and deprecation metadata included. The [Endpoints guide](https://docs.routebase.dev/endpoints/) covers the editor, and [Import and Export](https://docs.routebase.dev/import-export/) covers what travels with the file. ## Frequently asked questions ### What are the parts of an OpenAPI document? A document has a version marker at the root and an info block that names and versions it. Below those sit a servers list of base URLs, a paths object holding one entry per route, and a components object holding the definitions you reference more than once. Tags, security and external documentation are optional additions that most real documents end up using. ### What is the difference between a path, an operation and an endpoint? A path is a URL template such as /orders/{orderId}. An operation is one HTTP method on that path, so GET and DELETE on the same path are two operations. The word endpoint is not a field in the specification at all, and people use it to mean either of the two, which is why it is worth saying method and path when precision matters. ### Is the paths field required in OpenAPI? Not since version 3.1. A 3.1 document must contain at least one of paths, components or webhooks, which is what allows a document that only describes incoming webhooks or only publishes reusable schemas. In OpenAPI 3.0 the paths field is required, although it may be empty. ### Can I split an OpenAPI document across several files? Yes, because a reference can point at another document rather than at a location inside the current one. Splitting helps when several teams own different parts, and it costs you the ability to hand somebody one file. Most tooling resolves external references, so check the tools you actually use before committing to the layout. --- # OpenAPI 3.0, 3.1 and 3.2 — Routebase > What changed when 3.1 adopted JSON Schema 2020-12, what 3.2 added on top, and what a document and its tooling actually have to touch on the way up. Canonical page: https://routebase.dev/guides/openapi/openapi-3-0-3-1-3-2/ Chapter 3 of 10 · OpenAPI · Last reviewed 2026-09-28 by The Routebase Team. Three lines of the specification are in active use, and the jump between the first two is bigger than the version numbers suggest. This chapter covers what actually changed and what an upgrade costs. ## The dates | Version | Released | What it is | |---|---|---| | 3.0.0 | 26 July 2017 | The first release under the OpenAPI name | | 3.0.4 | 24 October 2024 | The current 3.0 patch, clarifications only | | 3.1.0 | 15 February 2021 | JSON Schema 2020-12 alignment | | 3.1.1 | 24 October 2024 | Patch release | | 3.1.2 | 19 September 2025 | The current 3.1 patch, editorial fixes and clarifications only | | 3.2.0 | 19 September 2025 | New capabilities on top of the 3.1 model | | 3.2.1 | 10 September 2026 | The current release | Patch releases clarify wording rather than change the format, so a 3.0.0 document is still a valid 3.0.4 document and tooling that supports a line supports all of its patches. ## What 3.1 changed Almost everything worth knowing follows from one decision, which is that the Schema Object became a superset of JSON Schema 2020-12 instead of a modified subset of an old draft. **Null became a type.** OpenAPI 3.0 defines a `nullable` boolean that only takes effect when `type` is also set, because its schema dialect had no way to say null. In 3.1 you write the type as a list instead. ```yaml # OpenAPI 3.0 cancelledAt: type: string format: date-time nullable: true ``` ```yaml # OpenAPI 3.1 cancelledAt: type: [string, "null"] format: date-time ``` **Exclusive bounds became numbers.** The old draft treats `exclusiveMinimum` as a boolean that modifies `minimum`. JSON Schema 2020-12 makes it the bound itself, so `minimum` with a flag becomes one field with a value. **Every JSON Schema keyword is available.** Keywords such as `const`, `prefixItems`, `patternProperties`, `if` and `unevaluatedProperties` are simply valid, where 3.0 called anything outside its list strictly unsupported. Schemas generated from code no longer have to be trimmed to fit. **Dialects became explicit.** A document can set `jsonSchemaDialect` to change the default, and an individual schema resource can carry `$schema`, which is what lets a document mix schemas written against another draft. **Webhooks got a home.** The new `webhooks` field describes incoming calls your consumers may receive, so an API that sends events no longer has to invent a path for them. **Paths became optional.** A 3.1 document has to contain at least one of `paths`, `components` or `webhooks` rather than always a `paths` object, which is what allows a document that only publishes reusable schemas. Two smaller additions turn up in almost every real document. The Info Object gained a `summary` field, and the License Object gained an SPDX `identifier` that is mutually exclusive with `url`. ## What 3.2 added Version 3.2 leaves the schema model alone and extends what a document can describe. **Methods beyond the fixed list.** A Path Item Object gained `additionalOperations`, a map keyed by the HTTP method as it is sent, for methods the specification does not give a field of its own. The QUERY method gets a named field alongside `get` and `post`, pointing at the IETF draft that defines it. **A parameter for the whole query string.** Alongside the existing `query` location there is now `querystring`, which treats the entire string as one value described by a media type. That is how a document can finally describe an API that expects JSON or a JSONPath expression in the query string. **Streaming and sequential media types.** A Media Type Object gained `itemSchema`, which describes each item of a repeating structure such as newline-delimited JSON or a server-sent event stream, rather than pretending the body is a single document. If you are writing a document today, the question is not whether 3.2 is better but whether the tools you depend on read it. That is the same question as the 3.1 upgrade, one release later. ## What an upgrade actually touches Converting a document upward is mostly mechanical, and the parts that are not are worth knowing before you start. The mechanical part is `nullable`, the exclusive bounds, and moving anything that the older dialect could not express into its natural form. Converters handle all of that. The part that is not mechanical is downstream. A code generator pinned to 3.0 may reject the file or, worse, parse it and quietly ignore keywords it does not know, which produces types that compile and are wrong. A renderer may drop `examples` it cannot place. So the order that works is to check the consumers first, convert second, and regenerate everything once rather than discovering the gap through a client library. The other thing conversion cannot do is improve the document. Descriptions, examples and error responses that were missing in 3.0 are still missing in 3.1, and those are what decide whether anything generated from the file is worth reading. ## In Routebase Specifications are authored as OpenAPI 3.0, 3.1 or 3.2, and new ones default to 3.2. Some style-guide rules apply to 3.0 documents only and carry a badge saying so, because a rule about `nullable` has nothing to check in a 3.1 document. The upgrade shows up where it is most often needed, which is at import. A file that declares 3.0 while using 3.1 keywords fails validation with the offending lines listed, and instead of leaving you to find every occurrence the wizard offers the conversion as one button. _Screenshot: A document that declares 3.0 and uses 3.1 keywords is a recognisable failure, so the importer names it and offers the upgrade rather than listing the lines and stopping._ The same conversion is available as an import option for any 3.0 file, where it upgrades the nullable syntax and the exclusive bounds to the 3.1 form. The [API Design Settings guide](https://docs.routebase.dev/api-design-settings/) covers choosing the version, and [Import and Export](https://docs.routebase.dev/import-export/) covers the conversion. ## Frequently asked questions ### What is the difference between OpenAPI 3.0 and 3.1? The schema model. In 3.0 the Schema Object is an extended subset of an old JSON Schema draft, which is why it needs its own nullable keyword and why a few JSON Schema keywords are unsupported. In 3.1 the Schema Object is a superset of JSON Schema 2020-12, so null becomes an ordinary type, exclusiveMinimum becomes a number, and any keyword JSON Schema defines is available. ### How do you express a nullable field in OpenAPI 3.1? You give the property two types, writing type as a list of the real type and null. The nullable keyword does not exist in 3.1, because JSON Schema 2020-12 already had a way to say it. Converting a 3.0 document means rewriting every nullable true into that list form, which is mechanical and something most converters do for you. ### Is OpenAPI 3.2 out? Yes. Version 3.2.0 was released on 19 September 2025 and a patch release, 3.2.1, followed on 10 September 2026. It builds on the 3.1 schema model rather than replacing it. What it adds includes the QUERY method, a way to declare operations for methods the specification does not name, a querystring parameter location and support for streaming media types. ### Should I upgrade from OpenAPI 3.0 to 3.1? Upgrade when your generators support it, since the main gain is that your schemas become ordinary JSON Schema and stop needing translation. The main risk is downstream, because a code generator or a renderer that only understands 3.0 will fail or silently drop what it cannot read. Check the tools you actually run before converting the file everything else depends on. --- # OpenAPI Schemas — Routebase > Objects, arrays and primitives, allOf against oneOf and anyOf, enums with meaning, formats, nullability in both dialects, and examples that stay true. Canonical page: https://routebase.dev/guides/openapi/openapi-schemas/ Chapter 4 of 10 · OpenAPI · Last reviewed 2026-09-13 by The Routebase Team. Most of the effort in an OpenAPI document goes into schemas, and most of the disappointment with generated output traces back to them. A schema that says `type: object` and stops produces documentation that says nothing and a mock that returns nothing. ## The four shapes a schema takes Every schema is one of four things, whatever the tooling calls them. An **object** has named properties and a list of which ones are required. A **primitive** is a string, a number, an integer or a boolean, optionally narrowed by an enum or by bounds. An **array** is an ordered list with an item schema. A **composition** is built from other schemas with `allOf`, `oneOf` or `anyOf`. The one rule worth memorising is that an array must define its items. A schema with `type: array` and nothing else is valid in the loosest sense and useless to everything downstream. ## Objects and required Properties and required are separate lists, which surprises people who expect a flag on each property. ```yaml Order: type: object required: [id, status, total] properties: id: type: string format: uuid status: type: string enum: [PENDING, PAID, SHIPPED, CANCELLED] total: type: number format: double note: type: string description: Free-text note the customer added at checkout. ``` Required means the property must be present, not that it must be non-empty and not that it is always useful. A property that is absent from `required` is optional for a request and, more importantly, optional for a response, which means every client has to handle it being missing. Marking response fields required is how you promise they will always be there. ## Composition without the confusion The three combining keywords differ only in how many members must match, and picking the wrong one produces types nobody can use. **`allOf` means every member matches.** It is how you express shared structure, so a `PaidOrder` can be an `Order` plus a payment block. Most code generators turn it into inheritance or into a merged type. **`oneOf` means exactly one member matches.** It is the right choice for a value that is genuinely one thing or another, such as a card payment or a bank transfer. Generators turn it into a union or a discriminated type. **`anyOf` means at least one member matches.** It is rarely what you mean. If two members can both match, no generator can decide which type to produce, so the result tends to be an untyped blob. For `oneOf` and `anyOf` a `discriminator` names the property that says which member applies, which is what turns a union into something a generator can switch on. ```yaml Payment: oneOf: - $ref: "#/components/schemas/CardPayment" - $ref: "#/components/schemas/BankTransfer" discriminator: propertyName: method mapping: card: "#/components/schemas/CardPayment" transfer: "#/components/schemas/BankTransfer" ``` ## Enums that mean something An enum lists the allowed values and says nothing about what they mean. A reader who sees `PARTIALLY_FULFILLED` learns the spelling and nothing else. Put the meaning next to the values, because the alternative is that every consumer guesses. A short description that names each value and its consequence is enough, and it is the difference between a status field a client can act on and one they have to ask about. Two extension fields are widely understood for this. `x-enumNames` carries a readable label per value and `x-enumDescriptions` carries an explanation, and generators that know them produce named constants instead of bare strings. ## Nullability depends on the dialect This is the one schema question where the specification version changes the answer. In OpenAPI 3.0 you set `nullable` to true, and it only takes effect when `type` is explicitly set in the same schema. In OpenAPI 3.1 the keyword does not exist, and you give the property two types instead. ```yaml # OpenAPI 3.0 cancelledAt: type: string format: date-time nullable: true ``` ```yaml # OpenAPI 3.1 cancelledAt: type: [string, "null"] format: date-time ``` Quoting `"null"` in YAML matters, because an unquoted null is the null value rather than the string naming the type. The [version chapter](https://routebase.dev/guides/openapi/openapi-3-0-3-1-3-2/) covers the rest of the differences. ## Formats and real constraints Format is a hint, and whether it is enforced depends on the validator. Treat `format: uuid` as documentation for the reader and the generator, and add a `pattern` or explicit bounds where the value genuinely has to match. The formats worth using are the ones tooling recognises, such as `date`, `date-time`, `uuid`, `email`, `uri`, `int32`, `int64` and `double`. Inventing your own is allowed and achieves nothing unless you also control the tool that reads it. ## Examples that stay true An example is the part of a schema a reader trusts most and the part most likely to be wrong, because nothing forces it to match the schema it sits under. Two habits keep them honest. Generate the example from the schema rather than typing it, so a structural change is reflected automatically. And validate examples as part of linting, since an example that no longer matches its schema is a defect a machine can find. Both are covered in [validating and linting](https://routebase.dev/guides/openapi/validating-and-linting-openapi/). ## In Routebase Schemas are edited as structures rather than as YAML, with the kind selector deciding whether you get a property table, a primitive editor, an item type or a composition operator. _Screenshot: The kind selector at the top switches between object, primitive, array and composition, and the table below it is the properties block of the schema._ Enum values carry an optional label and description that export as `x-enumNames` and `x-enumDescriptions`, so the meaning travels with the file rather than living only in the workspace. The example panel generates a sample payload from the structure and can be regenerated after a change, and a usage count on every schema tells you what a change would touch before you make it. The [Schemas guide](https://docs.routebase.dev/schemas/) covers all four kinds in detail. ## Frequently asked questions ### What is a schema in OpenAPI? A schema describes the shape of a piece of data, meaning its type, its properties, which of them are required and what values they may take. Schemas are used for request bodies, for responses and for parameter values. In OpenAPI 3.1 a schema is JSON Schema 2020-12, and in 3.0 it is a modified subset of an older draft. ### What is the difference between allOf, oneOf and anyOf? All three combine schemas and they differ in how many members have to match. With allOf the data must satisfy every member, which is how composition and inheritance are expressed. With oneOf it must satisfy exactly one, which is how you describe a value that is either this or that. With anyOf it must satisfy at least one, which is the loosest and the least useful for generated code. ### How do you document what an enum value means? The enum keyword only carries the allowed values, so the meaning has to go somewhere else. The usual place is the schema description, written as a short list of the values and what each one implies. Some tooling also reads the extension fields x-enumNames and x-enumDescriptions, which keep the label and the explanation attached to the value itself. ### What does format do in OpenAPI? Format refines a type with a hint such as uuid, date-time, email or int32. Validators may or may not enforce it, so it is best understood as a signal to generators and readers rather than a constraint you can rely on. Where a value really must match a shape, add a pattern or explicit bounds next to the format. --- # Parameters, Request Bodies and Responses — Routebase > The four parameter locations, how a request body is described, responses per status code with headers and examples, and the errors documents omit. Canonical page: https://routebase.dev/guides/openapi/openapi-parameters-request-bodies-and-responses/ Chapter 5 of 10 · OpenAPI · Last reviewed 2026-09-13 by The Routebase Team. An operation has three moving parts, which are what goes in as parameters, what goes in as a body, and what comes back. Most documents get the first two roughly right and leave the third half finished. ## The four parameter locations | Location | Where the value travels | Required | |---|---|---| | `path` | Inside the URL, filling a `{variable}` in the template | Always | | `query` | After the question mark | Optional unless marked | | `header` | An HTTP request header | Optional unless marked | | `cookie` | Inside the cookie header | Optional unless marked | Path parameters are always required, because the URL means nothing without them, and the specification says so rather than leaving it to convention. Every `{variable}` in a path has to have a matching declaration, and a mismatch is one of the few things a validator catches without any judgement involved. ```yaml parameters: - name: orderId in: path required: true description: Public identifier of the order. schema: type: string format: uuid - name: pageSize in: query description: Items per page, from 1 to 100. schema: type: integer format: int32 minimum: 1 maximum: 100 default: 20 ``` Three small habits pay for themselves here. Give every parameter a description, because the name alone rarely says what a value is for. Give optional parameters a default where one exists, since a reader otherwise has to guess what happens when they leave it out. And put real bounds on anything numeric, because `maximum: 100` documents a limit that your service already enforces silently. Header parameters have one trap. The specification says that a header parameter named `Accept`, `Content-Type` or `Authorization` is ignored, because those are described by the content map and by the security schemes instead. ## Request bodies In OpenAPI 3 a body is not a parameter. It is its own field on the operation, with a required flag and a map keyed by media type. ```yaml requestBody: required: true description: The order to place. content: application/json: schema: $ref: "#/components/schemas/CreateOrderRequest" examples: minimal: summary: One line item, no shipping options value: customerId: 550e8400-e29b-41d4-a716-446655440000 items: - productId: 7c9e6679-7425-40de-944b-e07fc1f90ae7 quantity: 2 ``` The media type map is the point of the structure. An operation that accepts JSON and multipart form data describes both under the same body, each with its own schema, instead of pretending there is one shape. Note that `examples` in the plural is a map of named examples, while `example` in the singular is a single value. Named examples are worth the extra nesting, because a reader learns more from a minimal case and a full case than from one example trying to be both. ## Responses per status code Responses are keyed by status code as a string, plus an optional `default` for everything not listed. Each one needs a description, and each one that has a body needs a schema. ```yaml responses: "201": description: The order was created and priced. headers: Location: description: URL of the created order. schema: type: string format: uri content: application/json: schema: $ref: "#/components/schemas/Order" "422": description: The order was rejected because an item is out of stock. content: application/problem+json: schema: $ref: "#/components/schemas/Problem" ``` The quotes around the status code are not decoration. In YAML a bare `201` is a number, and the specification defines these keys as strings, so quoting them avoids a class of parser disagreement that is tedious to debug. ## The part most documents skip Error responses are where a reference stops being a list of endpoints and starts being useful. A document that lists only the success case tells a client author nothing about what to do when the call fails, so they find out in production. The useful minimum per operation is one response for a rejected credential, one for a malformed or invalid request, and one for a missing resource where that can happen. Two things make those responses worth reading. The description should say what caused the failure and what the caller can do about it, rather than repeating the name of the status code. And the body should be a shared schema rather than a fresh shape per endpoint, so a client can write one error handler. [RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html) defines problem details and the `application/problem+json` media type for exactly this, and it obsoleted the older RFC 7807 in July 2023. ## Response headers Headers on a response are documented in their own map, and they are the place where operational behaviour becomes visible. A `Location` on a created resource, rate-limit headers on a success and a correlation identifier on an error are all part of the contract, even though nobody thinks of them as part of the body. They are also the most duplicated part of a document, because the same three headers appear on every response. That is what components and header policies are for, which the [reuse chapter](https://routebase.dev/guides/openapi/openapi-components-and-reuse/) covers. ## In Routebase Parameters are a table on the operation, and the designer keeps path parameters in step with the URL. Add `{orderId}` to the path and the parameter appears, remove it and the parameter goes, and a path parameter is marked required automatically because it cannot be anything else. _Screenshot: Both parameter locations in one table, with the path parameter required by construction rather than by the author remembering to tick a box._ Responses are added per status code, and a quick-add scaffolds the set that matches the method, so a POST starts with its created case and its four failure cases rather than with one success. Response headers can be defined inline, linked to a reusable header component or inherited from a header policy, and each inherited one can be overridden or excluded per response. The [Parameters](https://docs.routebase.dev/parameters/), [Responses](https://docs.routebase.dev/responses/) and [Header Policies](https://docs.routebase.dev/header-policies/) guides cover the three surfaces. ## Frequently asked questions ### What are the parameter locations in OpenAPI? There are four, which are path, query, header and cookie. A path parameter fills a variable in the URL template and is always required. A query parameter follows the question mark. A header parameter is an HTTP request header, and a cookie parameter travels in the cookie header. OpenAPI 3.2 adds a fifth location, querystring, which describes the whole query string as one value. ### How do you define a request body in OpenAPI 3? A request body is its own object on the operation rather than a parameter, which is one of the changes version 3 made. It carries a description, a required flag and a content map keyed by media type, and each media type entry holds a schema and optional examples. That structure is what lets one operation accept JSON and form data with different shapes. ### Should every endpoint document its error responses? Yes, because a consumer writing a client has to decide what to do when the call fails, and an undocumented failure becomes a guess. The useful minimum is one authentication failure, one validation failure and one not-found where it applies, each with a body schema and a description that says what caused it and what to try next. ### Can one response have several content types? Yes. The content field of a response is a map keyed by media type, so a single status code can describe a JSON body and a CSV body with different schemas. The same applies to request bodies, which is how an operation documents that it accepts both JSON and multipart form data. --- # Components and Reuse — Routebase > What lives under components, how a reference works, when extracting something pays off and when it is premature, and what changes once it is shared. Canonical page: https://routebase.dev/guides/openapi/openapi-components-and-reuse/ Chapter 6 of 10 · OpenAPI · Last reviewed 2026-09-13 by The Routebase Team. A document without reuse repeats the same error response forty times, and one with too much reuse sends a reader through four indirections to find a string. The useful position is in between and it is easier to find than it looks. ## What lives under components | Map | Holds | |---|---| | `schemas` | Data structures used by bodies, responses and parameters | | `responses` | Whole responses with their description, content and headers | | `parameters` | Parameter definitions reused across operations | | `requestBodies` | Request bodies reused across operations | | `headers` | Response header definitions | | `examples` | Named example values | | `securitySchemes` | How the API authenticates callers | | `links` | Relationships between operations | | `callbacks` | Requests the API makes back to the consumer | Nothing under `components` has any effect on its own. A schema nobody references is inert, which is why a lint rule for unreferenced components is one of the more useful ones to leave on. ## How a reference works A reference replaces an object with a pointer. The common form is local, addressing a location inside the same document. ```yaml responses: "404": $ref: "#/components/responses/NotFound" "200": description: The order was found. content: application/json: schema: $ref: "#/components/schemas/Order" ``` Two details cause most of the trouble. A reference can point at another file, which is how a large description is split across teams, and every tool that reads the result has to resolve those files. And in OpenAPI 3.0 a reference follows the JSON Reference rules, under which anything written beside the `$ref` is ignored, so adding a description next to a reference silently does nothing. The 3.0 way around it is to wrap the reference in an `allOf` with the extra fields as a second member. ## When to extract, and when not to The signal is the second occurrence. One inline schema sits where the reader is already looking, and a second copy of it is two definitions that will disagree eventually. Three cases are worth extracting on sight, because a second occurrence is certain. The error body qualifies because every operation returns one, and the pagination envelope qualifies because every list endpoint returns one. So does the authentication scheme, since it is referenced from the security requirement rather than written out. The case against extracting early is readability. A response whose body is a reference to a schema whose properties are references to three more schemas is technically tidy and genuinely hard to read. Names help more than structure here, so a component with an obvious name is worth more than a deep hierarchy with precise ones. ## Naming components Component names are part of what generators produce, so they end up as class names in somebody's client library. That makes two things worth doing. Pick one convention and hold to it, which across the ecosystem usually means PascalCase, and name a component by what the thing is rather than by where it is used. `Order` survives a refactor, while `GetOrderResponse200` documents a call site that may well move. Names also have to be unique within their map, which is the reason imported documents from code-first stacks often arrive with namespaced names such as `Acme.Orders.Contracts.Order`. Shortening them is worth doing at import time, when you can still check that the short names stay unique. ## Sharing across documents The specification scopes components to one document, so sharing across APIs is a question the format leaves open and teams answer in one of two ways. **External references** keep one definition and point at it from everywhere. A change reaches every consumer at once. That is the strength when the definition is a genuine standard and the risk when it is not, since every consumer inherits a change none of them asked for. **A library that copies** places a snapshot into each document and records where it came from. Each consumer updates when it chooses, so nobody is broken by somebody else's edit, and the cost is that versions coexist for a while. Neither is wrong. The question to settle first is whether a change to the shared `Money` type should reach twelve APIs on the same day or over the next quarter. ## In Routebase The Components section of the designer holds the same maps the specification has, each with a usage badge showing how many places reference the item. _Screenshot: Every reusable definition of a specification version in one place, with a reference count on each one so the blast radius of a change is visible before you make it._ Extraction works from where the duplication is. An inline response becomes a component with one action, and the endpoint is relinked automatically rather than left pointing at a copy. A project-wide view groups schemas across specifications by their structure rather than by their name, which is what finds the three teams who each wrote their own address type. For sharing across projects there is a library at organisation level. It copies a definition into the specification that links it, records the version that was linked and shows an update indicator when the library moves ahead. Accepting the update is one click and staying behind is a decision rather than an accident. The [Components](https://docs.routebase.dev/components/) and [Shared Library](https://docs.routebase.dev/shared-library/) guides cover both levels. ## Frequently asked questions ### What are components in OpenAPI? Components is the top-level object holding definitions you reference from more than one place. It has separate maps for schemas, responses, parameters, examples, request bodies, headers, security schemes, links and callbacks. Nothing in components takes effect on its own, because a component only does something once an operation references it. ### How does $ref work in OpenAPI? A reference replaces an object with a pointer to another one. The usual form is a local pointer such as a hash followed by the path through the document, for example to a schema under components. A reference can also point at another file, which is how large descriptions are split, at the cost of needing every consuming tool to resolve external references. ### When should you extract a schema into components? When the same shape appears in a second place, and not before. One inline body is easier to read where it is used, while the same body written twice is two things that can drift apart. The signal to extract is the second occurrence rather than a feeling that a shape looks reusable. ### Can components be shared between APIs? Not by the specification itself, which scopes components to one document. Sharing across documents is done either with external references or with a library that copies a definition into each document and tracks where it came from. The question that decides between them is whether every consumer must move at the same moment or on its own schedule. --- # Validating and Linting OpenAPI — Routebase > Validation asks whether a document is legal OpenAPI, linting whether it is good. What each catches, which rules find real defects, what blocks a release. Canonical page: https://routebase.dev/guides/openapi/validating-and-linting-openapi/ Chapter 7 of 10 · OpenAPI · Last reviewed 2026-09-13 by The Routebase Team. Two different questions get asked of the same file, and running one and calling it the other is how a document ends up technically valid and unusable. ## Validation answers one question A validator compares your document against the specification and tells you whether it is legal. That question has a correct answer, so two validators should agree. What it catches is worth knowing, because it is narrower than people assume. It finds a missing required field such as a response description, and it finds a path template containing `{orderId}` with no matching parameter declaration. It finds a `$ref` pointing at a component that does not exist, and it finds a keyword the declared version does not support, which is what happens when a 3.0 document uses `const` or `prefixItems`. What it does not catch is everything about quality. A document where every response is an untyped object, no operation has a description and no error is documented passes validation without a word. ## Linting answers the other one A linter checks the document against conventions rather than against the specification, so the rules are yours and there is no universal correct answer. The useful rules fall into five groups, and most tools organise them roughly this way. **Naming.** Path segments, path and query parameter names, schema names, property names, enum values and operation identifiers each follow one convention. The value is not tidiness, it is that a reader can predict the next name, and a generator produces types that look like the rest of the codebase. **Completeness.** Operations have a summary and a description, parameters and schemas have descriptions, the document has a server URL and a version. These are the rules that decide whether generated documentation is readable. **Best practice.** Operation identifiers are unique, declared path parameters match the template, two paths do not collide, list endpoints have pagination parameters, endpoints declare at least one error response. **Security.** The server URL uses HTTPS, an API key is not carried in a query parameter, endpoints reference a security scheme, and schema properties do not look like passwords or card numbers. **Structure.** Arrays define their items, enum values match the declared type, no response that forbids a body declares one, and examples validate against their schemas. ## The rules that are worth an error The distinction that matters is between a rule about taste and a rule about something breaking downstream. Five examples of the second kind, each of which produces a real defect rather than an inconsistency. **Duplicate operation identifiers.** Generators use them as method names, so a duplicate produces a client that does not compile or one that silently loses a method. **Two paths that are the same route.** OpenAPI ignores the name of a path placeholder, so `/items/{id}` and `/items/{itemId}` are one path declared twice, and the second declaration is unreachable. **An array without an items schema.** Every generator produces an untyped list, and every mock returns an empty one. **An example that contradicts its schema.** Readers trust examples more than schemas, so a stale example is worse than no example. **A body on a 204 or a 304.** RFC 9110 forbids a message body on those statuses, so a document that declares one makes generators emit deserialisation code that will never run. Everything else is real and belongs at warning, where it gets reported and fixed without stopping a release that is otherwise fine. ## Severities are the policy Rules are only half a style guide, and the severity assigned to each one is the other half. Error should mean that the release stops, warning should mean that somebody reads it, and info should mean that it is a hint worth having. A style guide where everything is an error stops being read within a month, because the only way to ship is to ignore it. Once people ignore the noisy rules, they stop seeing the important ones. That is also why enforcement belongs at the publishing step rather than at every save. Checking as you type is helpful, and blocking as you type is how people learn to work around the tool. ## Where linting fits in a release A style guide that runs on somebody's laptop is a suggestion, while the same rules running before a merge and before a publish are a contract. The practical arrangement has two points. The rules run continuously while somebody edits, so violations are fixed where they were made, and they run again when a version is released, where error-level violations stop it. Anything between those two points is optional. ## In Routebase Validation and linting are separate in the product for the same reason they are separate in this chapter. An imported file is validated against the specification, with the errors listed above an editor so the file can be fixed in place, and the style guide runs continuously against the specification you are editing. _Screenshot: Every rule carries a category, a severity you set per organisation and per project, and where the convention is configurable a dropdown that decides what the rule checks._ The built-in rules cover the five categories above, and each one has a severity you can change for the organisation and override per project. Where a rule enforces a naming convention the convention itself is a setting, so a team that has always written `/userProfiles` keeps the check instead of turning it off. Custom rules add checks of your own on a target, a field and a condition. Violations surface in an issues panel in the designer with per-severity filters, on the tree next to the endpoint that caused them, and in the publish dialog. With enforcement on, error-level violations block the release, and warnings can be published after a confirmation. The [Style Guide guide](https://docs.routebase.dev/style-guide/) covers the rules, the severities and the quality score built on them. How the same rules become a standard that several teams share is the subject of the [API governance guide](https://routebase.dev/guides/api-governance/). ## Frequently asked questions ### What is an OpenAPI validator? A validator checks a document against the specification and answers one question, which is whether the file is legal OpenAPI. It catches a missing required field, a path parameter that is declared nowhere, a reference that points at something absent and a keyword the declared version does not have. A document can pass validation and still be almost useless to a reader. ### What is the difference between validating and linting an OpenAPI file? Validation is objective and linting is a matter of policy. A validator has one correct answer because the specification defines it, while a linter checks the conventions your team chose, such as naming, required descriptions and a consistent error shape. Both are worth running, and only the first one has a right answer everybody agrees on. ### Which OpenAPI lint rules actually catch bugs? The ones that describe something a machine downstream will get wrong. Duplicate operation identifiers break generated clients, and two paths that differ only in the name of a placeholder are the same route. An array without an items schema produces an untyped list, an example that contradicts its schema misleads every reader, and a body on a 204 makes generators emit dead code. ### Should lint errors block a release? Some of them, and the way to decide is to ask what happens downstream if the rule is violated. A rule whose violation produces broken generated code belongs at error severity and should block. A rule about naming style is real and should not stop a release on its own, so warning is the honest level for it. --- # Importing Postman and Insomnia Collections — Routebase > Why a Postman or Insomnia collection is not an API contract, what an importer can infer from example data, and the work left after the import. Canonical page: https://routebase.dev/guides/openapi/importing-postman-and-insomnia-collections/ Chapter 8 of 10 · OpenAPI · Last reviewed 2026-09-27 by The Routebase Team. Teams usually arrive at OpenAPI holding something else, because a collection of requests already exists, it works, and converting it looks like a file format problem. It is not one, and knowing why saves a week of surprise. ## Two different kinds of document A collection is a record of calls, because somebody made a request, it worked, and it was saved so that it could be made again. Everything in it is a concrete instance, meaning this URL, these headers, this body. A contract is a set of statements about every call, not one of them. It says which fields are always present, which are optional, what the allowed values are and what happens when the request is rejected. _Figure: An example is evidence that one call looked a certain way once, while a schema is a claim about every call, which is why the step between them is inference rather than translation._ The gap between the two is not notation, because the second document contains information that the first one never held. ## What an importer can work out A good importer gets further than people expect, because the structure of a collection maps cleanly onto the structure of a document. Requests become operations, since a method and a URL are exactly what an operation is. The path is recoverable, with the caveat that a concrete `/orders/7c9e6679` has to be generalised into `/orders/{orderId}` by something or someone. Folders become tags or a folder tree, and headers that appear on every request are candidates for security schemes or common parameters. Query parameters are visible in the URLs that were saved with each request. And the response bodies produce schemas by inference, so an example that is an object with six fields becomes a schema with six properties, each typed from the value that happened to be there. ## What it cannot work out Inference is the whole difficulty, because it can only see what the examples happened to contain. **Optionality is invisible.** A field present in the one saved example looks required, and a field the API sometimes returns is simply absent from the schema. **Null teaches nothing.** A field that was null in the example has no type at all, and an importer either guesses or leaves it open. **Enums become strings.** A status that was `PAID` in the example becomes a string, and the other four values do not exist. **Numeric shapes are coincidence.** A price that happened to be a round number becomes an integer, and the first decimal value breaks a generated client. **Error responses are missing.** People save the calls that worked. A collection with forty requests usually contains no 401, no 422 and no 404, so the whole failure half of the contract has to be written. **Scripts have no destination.** Pre-request scripts and test scripts describe behaviour around a call rather than the call itself, and a contract has nowhere to put them. ## The work after the import The import is the cheap part, and the value comes from the pass afterwards. Four steps make the difference between a converted collection and a contract. Go through the inferred schemas and decide what is required, since that is the single most valuable statement in the document and no importer can make it for you. Turn the strings that are really enums into enums, with the values and what they mean. Add the error responses, at minimum one rejected credential and one rejected request per operation. And write the descriptions, because a generated reference with no prose is a list of field names. None of that needs to happen at once. An imported document that is honest about being incomplete is already better than a collection, since it can be validated, linted and checked against the running API. ## In Routebase The specification wizard takes an OpenAPI file, a Postman collection or an Insomnia export, and the collection formats go through the same preview and the same validation as everything else. The product page for [migrating from Postman](https://routebase.dev/migrate-from-postman/) walks the move end to end, from the preview to the generated test cases. _Screenshot: Collections come in through the same wizard as OpenAPI files, and the folder structure of the collection becomes the folder tree of the specification._ Where a schema was inferred rather than declared, the import says so in as many words, with the note that schemas were inferred from example data and may be incomplete. That is deliberate, because the failure mode worth avoiding is a document that looks finished and is not. Afterwards the workspace is where the four steps above happen. The style guide will tell you which operations still lack a description and which endpoints have no error response, so the remaining work is a list rather than a feeling. The [Import and Export guide](https://docs.routebase.dev/import-export/) covers the flow, and our post on [migrating from Postman to an OpenAPI-first workflow](https://routebase.dev/blog/migrating-from-postman-to-openapi-first/) covers the move as a project rather than as an import. ## Frequently asked questions ### Can you convert a Postman collection to OpenAPI? You can convert the structure, meaning the requests, their URLs, their methods, their headers and their folder layout. What cannot be converted is the part a collection never had, since a collection stores example bodies rather than schemas. An importer infers a shape from those examples, and the result is a starting point rather than a finished contract. ### What is the difference between a Postman collection and an OpenAPI file? A collection records calls somebody made, while an OpenAPI document states what the API promises. The difference shows up in what each one can answer. A collection can tell you that this request returned that body once, and a contract can tell you which fields are always present, which are optional and what the error cases look like. ### What gets lost when you import a collection? Everything the collection never recorded. Optional fields look required or vanish entirely depending on the example, and a field that happened to be null gets typed from that null. Enums become plain strings, and error responses exist only for the failures somebody happened to capture. Scripts and environment logic have no equivalent in a contract at all. ### Should we keep our Postman collection after moving to OpenAPI? You can, and the thing to avoid is maintaining both as sources. Pick one place where a change is made and generate the other from it, since an OpenAPI document exports as a collection whenever somebody wants one. Two hand-maintained descriptions of the same API is the arrangement that produced the drift in the first place. --- # What You Derive From OpenAPI — Routebase > Reference docs, mocks, contract tests, monitors and code samples all come from one document. What each needs from it, and where generation stops helping. Canonical page: https://routebase.dev/guides/openapi/what-you-derive-from-openapi/ Chapter 9 of 10 · OpenAPI · Last reviewed 2026-09-27 by The Routebase Team. The argument for writing a contract is not that the file itself is valuable. It is that several other things stop being written by hand once it exists. One operation from a fictional orders API shows how many of the sections below read the same few lines. ```yaml /orders/{orderId}: get: operationId: getOrder # client method name, reference page anchor summary: Get an order # reference navigation and search responses: "200": description: The order. content: application/json: schema: $ref: "#/components/schemas/Order" # mock body, test and monitor assertion "404": description: No order with this id exists. # reference prose, a mock condition ``` ## Reference documentation The most direct derivation. Every operation, parameter, response and schema in the document becomes a page or a section, complete by construction because it is a projection rather than a copy. What the generator needs from you is the prose, since summaries, descriptions, enum meanings and error explanations are the parts no tool can invent. The [API documentation guide](https://routebase.dev/guides/api-documentation/) covers what to write and what the generated layer cannot do for you. ## Mock servers A mock answers calls against the documented contract before the implementation exists, which is what lets a frontend start on the day the design is agreed rather than on the day the backend ships. Response schemas do the work. A generator builds one rule per documented response, and fills each field from its type and format, so a `date-time` produces a timestamp and a field named `email` produces something that looks like one. Where the document says less, the mock returns less, which makes the quality of the mock an unusually honest measure of the quality of the schemas. What a generator can read out of a schema, what it can never know, and how to make the result behave like a real network are covered in the [API mocking guide](https://routebase.dev/guides/api-mocking/). ## Contract tests A test that asserts the live API still matches the document can be derived, because the document states what to assert. The status code exists, the response validates against its schema, the required fields are present, the types are right. What cannot be derived is everything the contract never described. Whether the total equals the sum of the line items, whether a cancelled order can be paid, whether three calls in sequence leave the system consistent. Those are business rules, and [contract testing against integration testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) covers where the line falls. ## Monitors The same validation that runs in a test run can run on a schedule against production, which turns a monitor from an uptime check into a continuous contract check. The difference in what you learn is large. An uptime monitor tells you the endpoint answered, while a monitor validating against the schema tells you it answered with what you documented. The second one is how a field quietly dropped in a deploy surfaces in minutes rather than in a consumer's bug report. ## Code samples A request sample in cURL and in the languages your consumers use is mechanical, since the document already holds the method, the URL, the parameters, the headers and a body example. Generated samples have one advantage over written ones that is easy to underrate. They cannot go stale, because they are rebuilt from the document every time the reference is published. ## Where generation stops Two limits are worth stating plainly rather than discovering. **Generated client libraries are shaped by the document.** Generators exist and they work, and what they produce inherits every gap in the input. Untyped objects produce dictionaries, missing operation identifiers produce method names built from the path, and absent enums produce strings. The fix is upstream every time. **A contract describes one style of API.** OpenAPI describes HTTP APIs. Event-driven systems have AsyncAPI and GraphQL has its own schema language, and a document for one of those is not an OpenAPI document. [Versioning GraphQL, gRPC and events](https://routebase.dev/guides/api-versioning/versioning-graphql-grpc-and-events/) covers what changes when the protocol does. ## In Routebase The derivations above are features of the workspace rather than separate tools, and they all read the same specification. The [API-first development](https://routebase.dev/api-first-development/) page walks through that workflow from the reviewed contract to the environment that reports what it runs. Documentation portals take their API reference from a published specification version. Mock rules are generated from a specification with one action, and a rule generated from a draft keeps projecting the current schema until you take ownership of it. Test cases are created in bulk from specification endpoints with their contract assertions already attached. Monitors are generated per endpoint from a specification and linked to it, which is what lets every check validate the response against the schema. _Screenshot: Monitors are generated per endpoint from the specification and stay linked to it, which is what lets a scheduled check validate the live response against the documented schema._ Code samples in the published portal cover cURL, HTTPie, JavaScript, Python, C#, Go, Java, Ruby and PHP, and which of them appear is a setting. Client SDK and server stub generation is not part of the product, and the export is a complete OpenAPI document, so the generator you already run keeps working on it unchanged. ## Frequently asked questions ### What can you generate from an OpenAPI file? Reference documentation, a mock server, contract tests, uptime and schema monitors, request samples in several languages, and client or server code. Each of those reads the same document, so the quality of all of them is decided by how complete the document is rather than by the tool that reads it. ### Can you generate a mock server from OpenAPI? Yes, and the response schemas are what make it worth anything. A generator builds a response for each documented status code and fills the fields from their types and formats, so a field described as a date-time produces a plausible timestamp. An operation whose response is an untyped object produces an empty mock, which is the clearest signal that a schema needs work. ### Can OpenAPI replace writing tests? It replaces one kind of test rather than all of them. Contract assertions, meaning status code, response shape, required fields and types, can be derived from the document because the document states them. Whether the totals add up, whether the state machine allows a transition and whether a workflow across three calls holds together are business rules the contract never described. ### Does OpenAPI generate SDKs? The specification does not generate anything, and several generators produce client libraries from a document. What comes out is shaped by what went in, so a document with named schemas, enums and operation identifiers produces usable types, while one built from untyped objects produces a client that returns dictionaries. --- # OpenAPI Descriptions for AI Agents — Routebase > What a coding agent reads from an OpenAPI document, the four questions a description must answer, and why fields treated as decoration decide the call. Canonical page: https://routebase.dev/guides/openapi/openapi-descriptions-for-agents/ Chapter 10 of 10 · OpenAPI · Last reviewed 2026-09-27 by The Routebase Team. An agent reading your API has exactly one source, which is the document. It cannot ask a colleague, it will not find the wiki page, and it does not know which of your two order endpoints the team stopped using last spring. That makes description fields the part of the contract with the highest leverage, and they are usually the part filled in last. ## The four questions A description that answers these four is enough for somebody to make the call correctly on the first attempt, whether that somebody is a person or a model. **What does this actually do.** The answer is not a restatement of the method and the path, since `POST /orders` reads as create an order without any help. What a reader does not know is that prices are taken from the catalog at the moment of the call, so the totals in the response are the authoritative ones. **What has to be true first.** Preconditions are invisible in a schema, and none of them are derivable from types. A cancellation may only work while the order is unshipped, an endpoint may require a verified account, and a call may have to follow another one. **What do the values mean.** An enum value carries its meaning only for the person who invented it. `PARTIALLY_FULFILLED` needs one line saying what the caller should do about it. **What happens when it fails.** A documented 422 with a description saying which condition produces it and what to change is the difference between a retry that works and a retry loop. One operation from a fictional shop answers all four, and each answer sits in the field closest to the question it settles. ```yaml /orders: post: operationId: createOrder summary: Place an order description: > Creates an order from the items in the request. Prices are taken from the catalog at the moment of the call, so the totals in the response are the authoritative ones. The customer needs a verified account. responses: "201": description: The order was created with the status PENDING. "422": description: > An item is out of stock or no longer in the catalog. The error names the SKU, so remove that item or lower its quantity and retry. components: schemas: OrderStatus: type: string enum: [PENDING, PARTIALLY_FULFILLED, FULFILLED] description: > PARTIALLY_FULFILLED means some items have shipped and the rest are back-ordered. The order can no longer be cancelled as a whole. ``` ## The fields that carry it Descriptions live in more places than people use, and the ones closest to the value are the most effective. The **operation summary** is one line and appears in navigation, so it should name the action rather than the resource. The **operation description** is where the four questions get answered. **Parameter descriptions** say what a value is for and what range is sensible, which is where a default belongs in prose as well as in the schema. **Property descriptions** explain fields whose names are ambiguous, and every API has more of those than its authors think. **Enum descriptions** carry the meaning of each value. **Response descriptions** say what caused this outcome rather than repeating the status code. The useful discipline is that the answer goes where the question is asked. A note about idempotency belongs on the operation that needs it, not on a concepts page a reader reaches later or never. ## What makes descriptions decay Descriptions rot for a specific reason, which is that nothing breaks when they go wrong. A type change breaks a client, and a stale sentence about a precondition that no longer applies breaks nobody until somebody follows it. That asymmetry means description quality has to be maintained deliberately. Two things work, which are a lint rule that requires them and a review step where the person approving a change reads the prose alongside the schema. ## Writing for an agent is writing for a stranger There is no separate register for machine readers, and the advice people give for it is the advice good technical writing already followed. Be specific rather than complete. Say the constraint rather than gesturing at it. Name the other operation when there are two similar ones. Put the unit in the description of a numeric field, because `total` of 30.75 is ambiguous and a sentence saying the totals are in the currency named by the currency field is not. The one thing that is genuinely different is the cost of ambiguity. A person who does not understand a description asks or experiments, while a model fills the gap with the most plausible thing and returns it with the same confidence as a correct answer. Our post on [API descriptions an LLM can use](https://routebase.dev/blog/api-descriptions-llms-can-use/) goes into that further, and the [documentation for agents chapter](https://routebase.dev/guides/api-documentation/api-documentation-for-ai-agents/) covers the portal side of the same question. ## In Routebase The description field in the designer is an editor rather than a text box, because for many operations the description is the documentation. The product page for [agent-ready APIs](https://routebase.dev/agent-ready-apis/) shows how descriptions, errors and the published portal fit together. _Screenshot: The precondition a schema cannot express, written on the operation it applies to, where both a reader and an agent will meet it._ Callouts, tables, code blocks and Mermaid diagrams all render in the published reference and travel in the exported document as Markdown. Enum values carry a label and a description per value, which export as `x-enumNames` and `x-enumDescriptions`. Style-guide rules cover the presence of summaries, descriptions on operations, parameters and schemas, so the gaps are a list rather than an impression. The same document is what the MCP server hands an agent, so the descriptions a person reads in the portal and the ones an agent works from are the same strings. The [Endpoints guide](https://docs.routebase.dev/endpoints/) covers the editor, and the [MCP Quickstart](https://docs.routebase.dev/mcp-quickstart/) covers the agent side. ## Frequently asked questions ### How do you write OpenAPI descriptions for an LLM? Write them for a competent stranger who cannot ask a follow-up question, because that is what an agent is. Say what the operation does, what the preconditions are, what the values mean and what happens when it fails. The difference from writing for a person is that an agent will not infer the missing half from context and will confidently produce something wrong instead. ### What does an agent read from an OpenAPI file? The same fields a reference renderer reads, which are the summary, the description, parameter and property descriptions, enum values, examples and the documented responses. An agent has no other source, so anything your team knows and the document does not say is simply absent from what it can work with. ### Do enum descriptions matter for AI tools? More than almost anything else of that size. A status field listing five uppercase strings tells a model the spelling and nothing about which one to send or what it implies. A one-line meaning per value turns a guess into a decision, and it is a few minutes of work per enum. ### Is a good OpenAPI document enough for an agent to call an API? For a single call, often yes, since the document holds the URL, the shape and the auth requirement. For a sequence it usually is not, because ordering, idempotency and which of two similar operations to use are rarely written down anywhere. Those belong in the description of the operation they apply to rather than in a separate page. --- # API Mocking: A Complete Guide — Routebase > What API mocking is, how a mock server is generated from an OpenAPI contract, how to give it data, errors and state, and where a mock stops being evidence. Canonical page: https://routebase.dev/guides/api-mocking/ Guide overview · 10 chapters · Last reviewed 2026-09-13 by The Routebase Team. A mock server answers. That is the whole trick, and it is also where the trouble starts, because something that answers is easy to mistake for something that works. This guide covers what a mock is for and how one is derived from a contract instead of written by hand. It also covers how to make it behave enough like the network it replaces that the client survives the real thing. It also covers the sentence most articles on the subject leave out, which is where a mock stops being evidence. ## What a mock is actually for Three jobs come up over and over, and they are worth separating because each one wants a different mock. **Unblocking a consumer.** The frontend, the mobile app or the neighbouring service needs something at a URL today, and the provider ships in six weeks. This is the job the word usually refers to, and it is the one that tolerates the least fidelity. **Making rare conditions ordinary.** Production produces a `429`, a timeout and an empty list eventually and at inconvenient moments. A mock produces them on demand, which is the only practical way to build the handling for them. **Arguing about a shape while it is cheap.** A request against a mock is the fastest way to find out that a field is missing or nested one level too deep. Finding that out from a running mock costs an edit, while finding it out after release costs a version. _Figure: The same request answered by a mock and by the real service. The mock can be right about the shape and about the conditions, because both are configured. It cannot be right about the behaviour, because there is no behaviour behind it, and that is the one column that decides whether the feature works._ ## The family it belongs to Several things get called mocks, and the words matter here because they set expectations about what a green result means. | Name | What it does | What it is good for | |---|---|---| | Stub | Returns a fixed answer for a given call | Getting a consumer past a dependency | | Mock | A stub that also records how it was called | Asserting that something was invoked | | Fake | A real implementation with a shortcut inside | Exercising logic without the infrastructure | | Sandbox | The provider's own deployment with test data | Checking the provider's behaviour, not just its shape | | Record and replay | Captured real traffic, played back | Reproducing something that already happened | | Service virtualisation | A modelled stand-in for a whole system | Load and integration work across many dependencies | A mock server sits between the first two and the fifth. Tools in the category include WireMock, Prism, Mockoon and Beeceptor, and they differ mostly in where the response comes from and in how much behaviour you can configure on top of it. ## Where the body comes from decides the rest Every property that makes a mock useful or dangerous follows from one question, which is what produced the response body. A body typed by hand is a second opinion about the API. It starts correct and then diverges, because it lives in a repository the provider team does not read and gets edited by whoever needs a field this afternoon. Nothing announces the moment it starts disagreeing with the contract. A body derived from the contract cannot disagree while it is still derived. That is a real property with an exact edge, because the moment somebody edits the body by hand the derivation stops and the rule belongs to them. [Keeping mocks in sync](https://routebase.dev/guides/api-mocking/keeping-mocks-in-sync/) is the chapter on where that edge sits. ## The short answer If you take one rule from this guide, take this one. Derive the mock from the contract, and then configure it to behave worse than you expect production to behave. The rest of the guide is that rule taken apart. | Chapter | Answers | |---|---| | [Mocking an API from OpenAPI](https://routebase.dev/guides/api-mocking/mock-api-from-openapi/) | What a generator can read out of a schema, and what it cannot | | [Which rule answers](https://routebase.dev/guides/api-mocking/mock-request-matching/) | Method, path, query and header matching, and priority as a tiebreak | | [Mock data worth testing against](https://routebase.dev/guides/api-mocking/mock-data-generation/) | Static, generated and fixture data, and what each one hides | | [One endpoint, many answers](https://routebase.dev/guides/api-mocking/conditional-mock-responses/) | Conditional responses instead of a rule per case | | [Errors, latency and rate limits](https://routebase.dev/guides/api-mocking/simulating-errors-latency-and-rate-limits/) | Making the mock unpleasant on purpose, and why that is the point | | [Stateful mocks](https://routebase.dev/guides/api-mocking/stateful-mocks/) | When a mock needs memory, and when memory makes it a bad backend | | [Keeping mocks in sync](https://routebase.dev/guides/api-mocking/keeping-mocks-in-sync/) | Following a draft, pinning a version, and what regeneration overwrites | | [Mocks in frontend work](https://routebase.dev/guides/api-mocking/mocking-for-frontend-development/) | CORS, tokens, base URLs, and the switch to the real backend | | [When not to mock](https://routebase.dev/guides/api-mocking/when-not-to-mock/) | Where a mock proves nothing, and what takes over there | | [What to look for in a tool](https://routebase.dev/guides/api-mocking/api-mocking-tools/) | Criteria as questions rather than a list of vendors | Two neighbouring subjects live elsewhere. The document the mock is generated from is covered in the [OpenAPI guide](https://routebase.dev/guides/openapi/), and the data a mock serves is the same data your tests use, which [test data](https://routebase.dev/guides/api-testing/api-test-data/) covers in full. ## In Routebase Every project gets one mock server with its own public base URL, and it is either answering or switched off without losing a line of configuration. _Screenshot: The rules, the base URL, the coverage against the specification and the live request log sit in one window, so what the mock answered and why it answered that way are never two tools apart._ Rules can be generated from a specification in one step, and the response bodies come from the schemas rather than from a text editor. On top of that sit the parts that make a mock resemble the network, which are conditional responses, simulated errors, latency, rate limits and state. Start with the [Mock Server](https://docs.routebase.dev/mock-server/) guide in the product documentation, or read on. The [API mocking feature page](https://routebase.dev/api-mocking/) has the short version of how mocking fits into the rest of the lifecycle. ## Frequently asked questions ### What is API mocking? API mocking is standing up something that answers HTTP requests the way a real API would, before that API exists or while it is unavailable. A mock has the routes, the status codes and the response shapes of the real thing, and none of its logic. The point is that a consumer can be built, demonstrated and tested against the interface while the implementation behind it is still being written. ### How do you mock an API from an OpenAPI specification? You read the paths and generate one rule per operation, then build each response body from the response schema of the status code you want. A field typed as a string with a date-time format produces a timestamp, and a field named email produces something shaped like an address. Everything the document leaves untyped comes back empty, which makes a generated mock an unusually honest report on the quality of your schemas. ### What is the difference between a mock, a stub and a fake? A stub returns a canned answer and has no opinion about who called it. A mock is a stub that also records the calls, so a test can assert that something was invoked in a particular way. A fake is a working implementation with a shortcut inside it, such as an in-memory store standing in for a database. In everyday API work the word mock has absorbed all three, and a mock server is usually a stub with configuration. ### Can you test an API against a mock server? You can test a consumer against a mock server, and that is what one is for. You cannot test the provider that way, because a passing run against a mock is a statement about the mock and about nothing else. The moment you want evidence that the real service behaves, you need requests that reach the real service, which is what contract tests in a pipeline and monitors against a live environment are for. ## Chapters in this guide 1. [Mocking an API from an OpenAPI Contract](https://routebase.dev/guides/api-mocking/mock-api-from-openapi/index.md): Why mocks are derived rather than written, what a generator reads from paths, status codes and schemas, what it cannot know, and why coverage matters. 2. [Which Rule Answers a Mock Request](https://routebase.dev/guides/api-mocking/mock-request-matching/index.md): A mock server is a router first. What can be matched, why rules overlap, how priority breaks the tie, and what should happen when nothing matches. 3. [Mock Data Worth Testing Against](https://routebase.dev/guides/api-mocking/mock-data-generation/index.md): Static, generated and fixture data as three sources with three failure modes, why a field reading string ruins a layout, and how locale breaks a client. 4. [Conditional Mock Responses](https://routebase.dev/guides/api-mocking/conditional-mock-responses/index.md): How to get a valid case, a not-found and a validation failure out of one route without a rule per outcome, what to branch on, and what the fallback is. 5. [Simulating API Errors, Latency and Rate Limits](https://routebase.dev/guides/api-mocking/simulating-errors-latency-and-rate-limits/index.md): Latency with a range, failures at a probability, a dead socket instead of a clean 500, and the 429 nobody handles until it happens in production. 6. [Stateful Mocks: When the Attempt Needs Memory](https://routebase.dev/guides/api-mocking/stateful-mocks/index.md): Why a create followed by a list breaks every stateless mock, what state buys you in a cart or a wizard, and where memory turns a mock into a backend. 7. [Keeping Mocks in Sync With the Spec](https://routebase.dev/guides/api-mocking/keeping-mocks-in-sync/index.md): A mock behind the contract is worse than no mock. The three states of a generated rule, why a published version should freeze, and what regeneration replaces. 8. [Mocks in the Frontend Workflow](https://routebase.dev/guides/api-mocking/mocking-for-frontend-development/index.md): Starting on day one, the base URL as configuration instead of a code branch, CORS and tokens in a browser, and what changes at the real backend. 9. [When Not to Mock an API](https://routebase.dev/guides/api-mocking/when-not-to-mock/index.md): A passing run against a mock is a statement about the mock. Four questions mocking cannot answer, what takes over for each, and proxy mode in between. 10. [What to Look For in an API Mocking Tool](https://routebase.dev/guides/api-mocking/api-mocking-tools/index.md): Eight questions about where a mock's responses come from, what happens when the contract changes and who can reach it, with two exercises. --- # Mocking an API from an OpenAPI Contract — Routebase > Why mocks are derived rather than written, what a generator reads from paths, status codes and schemas, what it cannot know, and why coverage matters. Canonical page: https://routebase.dev/guides/api-mocking/mock-api-from-openapi/ Chapter 1 of 10 · API Mocking · Last reviewed 2026-09-27 by The Routebase Team. Writing a mock by hand is quick once and expensive afterwards, because the contract keeps moving and the handwritten copy does not. Deriving the mock from the contract removes the copy, which removes the thing that drifts. ## What a generator can read An OpenAPI document carries more mechanical detail than most people use, and a mock generator uses almost all of it. **The paths and methods** become the rules. Each operation is one route the mock will answer, with the path parameters left in place so `/orders/{orderId}` matches any id. **The documented status codes** decide what a rule returns. An operation usually declares a success and several failures, and the generator needs one of them as the default, which is nearly always the lowest success code. **The response schema** becomes the body. Every property is walked, and each one gets a value from its type and its format, so an `integer` produces a number and a `string` with `format: date-time` produces a timestamp. Required fields are present and optional ones may or may not be. **The field names** decide how plausible those values look. A generator that only reads types fills every string with the same placeholder, while one that also reads names produces an address for `email` and a city for `city`. That difference is the subject of [mock data](https://routebase.dev/guides/api-mocking/mock-data-generation/). A response schema from a fictional orders API and one body a generator could build from it show how a generator turns each property into a value. ```yaml # From the contract Order: type: object required: [id, email, createdAt] properties: id: { type: string, format: uuid } email: { type: string, format: email } total: { type: number } createdAt: { type: string, format: date-time } ``` ```json { "id": "5b7c1e0a-9d3f-4f6a-8c21-7e4d2a9b6f10", "email": "maria.keller@example.com", "createdAt": "2026-03-14T09:26:53Z" } ``` The optional `total` is missing from this body, which is allowed, and the next generated body may well include it. ## What it cannot know Everything a generator leaves out has the same cause, which is that a document describes operations one at a time. **Which response is the normal one.** An operation with a `200`, a `404` and a `409` documented gives no hint about which of them a caller should expect on a Tuesday. The generator picks the success, and the other two need [conditional responses](https://routebase.dev/guides/api-mocking/conditional-mock-responses/) to appear at all. **What connects two calls.** The order you just created should be in the next list response, and the token from the login should be accepted by the next request. Nothing in a specification states that, so a generated mock answers both calls correctly and inconsistently. **What makes something fail.** The document says a `422` exists and describes its body. It does not say that the quantity has to exceed stock, so the failure never fires on its own. **Anything about time or scale.** A generated response arrives instantly and contains as many items as the generator felt like producing. Real latency and a list long enough to break a layout are configuration rather than derivation. ## The generated mock reports on your schemas There is a useful side effect here that is worth naming, because it turns an annoyance into a signal. An operation whose response schema is a typed object produces a body full of plausible values. An operation whose response is declared as a bare object with no properties produces `{}`, and one with no response schema at all produces nothing worth sending. The mock is not being unhelpful, it is showing you exactly how much of your contract is actually described. That makes a first generation run a cheap audit. Generate everything, call each route once, and the empty bodies are a list of the schemas that need work before anyone downstream can rely on them. ## Coverage is the number to watch A mock with rules for most of your API is more dangerous than one with rules for none of it, because the gaps are invisible until somebody hits one. An uncovered endpoint returns a `404`, and a `404` from a mock looks exactly like a mistake in the caller's URL. The consumer team loses an afternoon to a path that was simply never generated, usually after the specification grew an endpoint and nobody re-ran the generation. So the measure to keep in front of you is the share of endpoints in the current version of the contract that an active rule answers. When that number drops, the reason is almost always that the contract moved, which makes it an early warning rather than a score. ## In Routebase A mock server can be created straight from a specification, and the generation runs again whenever the contract grows. _Screenshot: Coverage is measured against the current version of every specification in the project, and the uncovered endpoints are listed by method and path with a one-click way to generate the rules that are missing._ The **Generate Mock Rules** dialog takes a specification, an optional version filter and a switch that skips endpoints which already have a rule. Re-running it after the contract grows adds the new routes and leaves your edits alone. Generated bodies are built with Smart Mock, which maps each schema field to a generator by name and type rather than filling every string with the same value. Analytics keeps coverage in view with the uncovered endpoints listed by method and path, and **Generate Missing Rules** closes the gap without a second pass over the whole specification. The same measure feeds the mock coverage bar on the project dashboard. The [Mock Server](https://docs.routebase.dev/mock-server/) guide covers generation and coverage, and [Schemas](https://docs.routebase.dev/schemas/) covers the structures the bodies are built from. ## Frequently asked questions ### Can you generate a mock server from an OpenAPI file? Yes, and the generation is mechanical. Every path and method in the document becomes a rule, the status code you pick becomes the rule's response, and the response schema for that code becomes the body. Nothing in that chain requires a decision from you, which is exactly why the result is only as good as the document it read. ### What does a generated mock get wrong? It gets nothing wrong, and it leaves a great deal out. A generator sees one operation at a time, so it cannot know which of three documented responses is the ordinary one or what makes an error fire. It also cannot know that the id in a created order has to appear in the next list call. Those are relationships between calls, and a document describes calls individually. ### Should mock responses come from examples or from schemas? Schemas scale and examples read better. A schema produces a body for every field including the ones nobody wrote an example for. A handwritten example carries meaning a type cannot, such as a realistic order total or a status that makes sense next to a date. Most setups want schemas as the default with examples winning where somebody bothered to write one. ### What does mock coverage mean? It is the share of the endpoints in your contract that an active rule actually answers. The number matters because an uncovered endpoint does not announce itself, and a consumer hitting it gets a 404 that looks like a bug in their own code. Coverage is the only measure that turns a growing specification into a visible gap rather than a surprise. --- # Which Rule Answers a Mock Request — Routebase > A mock server is a router first. What can be matched, why rules overlap, how priority breaks the tie, and what should happen when nothing matches. Canonical page: https://routebase.dev/guides/api-mocking/mock-request-matching/ Chapter 2 of 10 · API Mocking · Last reviewed 2026-09-27 by The Routebase Team. Before a mock server is a source of data it is a router. Something has to take an incoming request and decide which of your configured answers it gets, and that decision is where most confusing mock behaviour comes from. ## The four things a request can be matched on Matching runs from coarse to fine, and each level exists because the level above it was not selective enough. **The method.** A route with a `GET` and a `POST` is two rules, not one. A wildcard that accepts any method is useful for a catch-all and misleading anywhere else, because it will happily answer a `DELETE` with a list. **The path pattern.** Parameters stay as placeholders, so `/orders/{orderId}` answers for every id. This is the level most mocks stop at, and it is why they can only ever give one answer per route. **The query string.** Matching on query parameters separates `?status=open` from `?status=archived`, and a wildcard on the value matches any `limit` while still requiring the parameter to be there. **The headers.** This is the level that makes a mock resemble an API rather than a file server. A rule that requires an `Authorization` header and a rule that does not are the difference between a client that handles `401` and one that has never seen it. ## Overlap is normal, not a mistake Once you are matching on more than a path, several rules will qualify for the same request, and that is the intended state rather than a misconfiguration. The common case is exactly the authenticated one, and it looks like this. One rule answers `/orders` with a list, a second answers `/orders` with a `401` when the token is missing, and a request carrying a valid token satisfies the first but not the second. A request without one satisfies only the second. The other common case is a fixed path sitting under a parameterised one. A rule for `/orders/summary` and a rule for `/orders/{orderId}` both accept the same request, because `summary` is a perfectly good value for an id, and nothing about the patterns says which of them was meant. ## Priority is the tiebreak, and it is a decision When two rules qualify, something has to choose, and the only maintainable answer is an explicit order you control. The rule of thumb is that the more specific rule wins. A rule with a header condition beats the same path without one, and a literal path segment beats a parameter in the same position. That ordering is not automatic in most tools, which means putting it in place is part of setting the mock up rather than something that happens to you. Three requests against a small rule set show which rule should win, where the `401` rule on `/orders` carries no condition of its own and the list rule requires the header. | Request | Rules that qualify | Rule that should win | |---|---|---| | `GET /orders/summary` | `/orders/summary` and `/orders/{orderId}` | `/orders/summary`, since a literal segment beats a parameter | | `GET /orders` with an `Authorization` header | `/orders` requiring the header and `/orders` without a condition | The rule requiring the header, which returns the list | | `GET /orders` without the header | `/orders` without a condition | The only candidate, which returns `401` | The practical consequence is worth stating plainly, because it saves a great deal of time. If a mock answers with the wrong body and that body is itself correct, the problem is nearly always the order rather than the rule. Checking which rule actually matched is faster than reading either body. ## What should happen when nothing matches An unmatched request is the one case where the default behaviour is actively unhelpful. A `404` is correct and uninformative, because it covers two very different situations. Either the path is not in your contract at all, which is a caller mistake, or it is in the contract and no rule was generated for it, which is your gap. The caller sees the same response in both cases and reasonably assumes the first. Two things fix that asymmetry. A request log turns the ambiguity into a fact, because an unmatched request appears there with no rule attached. Proxy mode removes the question entirely by forwarding anything unmatched to a real backend, which [when not to mock](https://routebase.dev/guides/api-mocking/when-not-to-mock/) covers as the middle path between a mock and the real service. ## In Routebase A rule matches on its method and path pattern, and **Advanced Matching** adds the query and header conditions underneath. _Screenshot: Query parameters and headers are matched as JSON patterns with an asterisk standing for any value, so one rule can require that a token is present without caring which token it is._ Both patterns are JSON objects where `*` matches any value, so `{"Authorization": "Bearer *"}` requires a credential without pinning it to one. Rules carry a priority that you set by ordering them in the tree, either by dragging or from the rule menu. Moves are scoped to the path folder, so reordering two `/orders` rules never disturbs the `/users` rules between them. The tree colours each rule by state, so an inactive rule and one that has drifted from its source specification are visible without opening either. When something answers unexpectedly, the request log names the rule that matched, which turns a guess into a lookup. The [Mock Server](https://docs.routebase.dev/mock-server/) guide covers matching, priority and the rule tree. ## Frequently asked questions ### How does a mock server decide which response to return? It walks its rules, keeps the ones whose conditions the request satisfies, and picks a winner among them. Method and path do most of the filtering, while query parameters and headers narrow it further where two rules would otherwise be identical. When more than one rule still qualifies, an explicit priority decides, which is why the order of your rules is configuration rather than an accident. ### Can a mock server match on request headers? A useful one can, because that is how you get two different answers from one route. Matching on an Authorization header lets the same path return data when a token is present and a 401 when it is not. That is the case every client has to handle and almost no mock offers. The same mechanism covers content negotiation, API version headers and feature flags. ### What happens when no mock rule matches a request? The mock returns a 404, and that response is genuinely ambiguous. It means either that the path does not exist in your contract or that nobody generated a rule for it, and the caller cannot tell those apart from the outside. The log is what separates them, and proxy mode is what removes the question by forwarding unmatched requests to a real backend. ### How do you mock an authenticated endpoint? Add two rules on the same path. One matches when the credential header is present and returns the data, the other matches the same path without that condition and returns the 401 your contract documents. Give the specific rule the higher priority, and the client that forgets its token gets the response it would get in production rather than a cheerful 200. --- # Mock Data Worth Testing Against — Routebase > Static, generated and fixture data as three sources with three failure modes, why a field reading string ruins a layout, and how locale breaks a client. Canonical page: https://routebase.dev/guides/api-mocking/mock-data-generation/ Chapter 3 of 10 · API Mocking · Last reviewed 2026-09-13 by The Routebase Team. A mock that returns the right shape with the wrong values is still useful, and it is much less useful than people assume. Almost every layout bug, sorting bug and formatting bug that surfaces on integration day was invisible against the mock because the data was too tidy. ## Three sources, three different problems Response bodies come from one of three places, and mixing them is normal once you know what each one is for. | Source | Strength | What it hides | |---|---|---| | Static | Exact, readable, stable across runs | Every request returns the same tidy case | | Generated | Variety, plausible values, unlimited volume | Nothing can assert on a value that changes | | Fixture | One record set shared by mocks, tests and docs | Only as good as the records somebody curated | Static is where most mocks start and where most of them stay. Generated is what makes a list view honest, because twenty different names reveal a column that only fits fifteen characters. Fixtures are what let a test assert on a value at all, since an assertion against a generated name is an assertion that fails eventually. The mixed case is the one worth reaching for. Real reference records supply the ids, names and prices your tests depend on, and generated values fill everything nobody asserts on, so the response is stable where it matters and varied everywhere else. ## The placeholder problem A schema-driven generator that reads only types fills every string field with the same value, and that value is usually the word `string`. The response validates. It is also a uniform grid of five-character cells. Nothing there reveals that the product name column truncates, that the sort is lexical rather than numeric, or that a currency field renders without a separator. The frontend built against it looks finished and has never met a real value. Reading the field name fixes most of that. A field called `email` produces something with an at sign in it, `price` produces a decimal, `createdAt` produces a timestamp, and the result is a response somebody can judge. That mapping is a lookup from name patterns to generators, which means it is configurable and worth configuring for the field names your domain actually uses. ## The cases that only appear on purpose Plausible values are the floor rather than the ceiling, because the states that break clients are the ones at the edges. **The empty list.** Every collection endpoint returns one eventually, and the zero state is the screen nobody built. A mock that always returns rows guarantees it stays unbuilt. **The long value.** Names, addresses and titles have a real distribution and it has a long tail. One deliberately long record in your fixture set finds more layout bugs than a hundred generated short ones. **The missing optional field.** A field marked optional in the schema will be absent in production, and a mock that always includes it teaches the client to assume it is there. **The large page.** A list of three behaves nothing like a list of five hundred, either for the layout or for the rendering cost. ## Locale and time are a quiet failure Two generator settings cause more integration surprises than their size suggests, because they are set once and then forgotten. Generated names, cities and addresses follow a locale. A frontend developed against English test data and deployed to a German market meets longer words, different address shapes and a different sorting order on the same day as everything else. Timestamps are worse, because the format is invisible in a rendered screen. A client built against ISO 8601 strings and pointed at an API returning Unix timestamps fails on every date field at once. The mock that could have caught it was configured with the other format. The same applies to the timezone, where a date rendered in local time is off by a day for part of the world exactly often enough to be dismissed as flaky. None of that is exotic. It is a handful of settings that decide whether the mock produces the shapes your client will actually meet. ## In Routebase A rule's body is produced in one of four modes, and the choice is per rule rather than per server. _Screenshot: Locale, time format and timezone are set once for the organisation and inherited by every new mock server, and the matching table underneath is what turns a field name into a generator rather than a placeholder._ **Static Body** returns exactly what you typed, with JSON validation and a format button. **Dynamic** treats the body as a template where `{{faker.*}}`, `{{request.*}}` and `{{state.*}}` placeholders resolve on every request, so `{{request.path.id}}` echoes the id that was asked for. **Fixture Reference** serves a project test-data fixture directly, and **Smart Mock** uses fixture values first and fills the rest with generated ones. Fixtures can be transformed on the way out with a pipe chain, so `where:role=admin | first | toJson` serves one record rather than the whole set, and the same fixture backs your test assertions. The faker catalogue covers people, contact details, identifiers, dates, numbers, addresses, business fields, web values, colours, text, finance and media, and the generated values follow the locale, time format and timezone configured for the server. Which generator a field gets is decided by matching rules. The built-in patterns ship grouped by category and can be toggled individually. Your own rules match exactly, by wildcard or by regular expression, with a live preview showing the value a pattern would produce. Custom rules apply at generation time, so a banner offers to regenerate the affected rules once you change them. The [Mock Server](https://docs.routebase.dev/mock-server/) guide covers body modes and matching rules, [Mock Server Settings](https://docs.routebase.dev/mock-server-settings/) covers locale and time, and [Test Data](https://docs.routebase.dev/test-data/) covers the fixtures both halves share. ## Frequently asked questions ### How do you generate realistic mock data? Map each field to a generator by its name as well as its type, so a field called email produces an address and a field called city produces a city. Type alone is not enough, because every string in the schema then comes back as the same placeholder and the result tells you nothing about how the real values will look. Names carry the meaning, and a generator that reads them turns a valid response into a plausible one. ### Should mock data be random or fixed? It depends on who is reading the response. A person building a screen wants variety, because identical rows hide the layout problems that real data will cause. An automated test wants the same value every run, since an assertion against a random name is an assertion that fails on a schedule. The usual answer is generated data for development and fixed reference data wherever something asserts on a value. ### Can mock data and test data come from the same place? They should, and the argument is drift rather than convenience. When the mock serves one set of records and the tests assert on another, the two copies diverge and nothing reports it. Pointing both at the same fixture means a change to that data changes what the mock returns and what the tests expect in the same commit. ### Why do mock responses look fine and still break the client? Because valid and realistic are different properties. A response full of three-character strings, single-item lists and identical timestamps satisfies every schema and exercises none of the cases a layout has to survive. The states that break a client are the long name, the empty list, the missing optional field and the date in another timezone, and none of those appear unless the mock produces them on purpose. --- # Conditional Mock Responses — Routebase > How to get a valid case, a not-found and a validation failure out of one route without a rule per outcome, what to branch on, and what the fallback is. Canonical page: https://routebase.dev/guides/api-mocking/conditional-mock-responses/ Chapter 4 of 10 · API Mocking · Last reviewed 2026-09-27 by The Routebase Team. A real endpoint has more than one answer. It returns the record, or a not-found, or a validation failure, and which one you get depends on what was in the request. A mock that returns the same `200` regardless is teaching the client that only one of those exists. ## The wrong way to get variety The obvious fix is a rule per outcome, and it stops working at about three outcomes. Every variant duplicates the path, the method and usually most of the body. Every new variant has to be inserted at the right point in the priority order, and the order is now load-bearing in a way nobody wrote down. Worst of all, the rules match on the same criteria, so the only thing distinguishing them is their position, which makes a drag in the wrong direction a silent behaviour change. Conditions solve the same problem inside a single rule. The route is declared once, the variants sit under it in an explicit order, and the rule's own response is the fallback when none of them applies. ## What is worth branching on Four sources cover nearly everything, and each one corresponds to a class of behaviour a client has to handle. **A path parameter** separates the ids that exist from the ids that do not. This is the single most valuable condition to configure, because unknown identifiers are the most common real failure and the least commonly mocked one. **A body field** is how validation becomes testable. A quantity over a limit, a missing required field or a malformed date can each return the documented `4xx` instead of the cheerful success that a generated mock hands out. **A query parameter** covers filters, paging and sorting, where the interesting answers are the empty result and the last page rather than the first one. **A header** covers version negotiation and feature flags, though a credential header usually belongs in [matching](https://routebase.dev/guides/api-mocking/mock-request-matching/) rather than in a condition, since the whole rule differs rather than just the body. Conditions combine, and the combination mode matters. Requiring all of them is the safe default for describing one precise situation, while matching any of them is for grouping several inputs that should produce the same answer. ## Which answer belongs at the bottom The fallback is the response you get when nothing matched, and choosing it is a design decision rather than a leftover. For a collection endpoint the fallback is normally the success, because listing is the ordinary case and the variants are filters. For a single-resource endpoint the fallback should usually be the `404`, with conditions promoting the handful of ids your data actually contains. That inversion is the one that makes a client honest, because the developer is then forced to handle the not-found on day one instead of discovering it after the backend arrives. A single-resource rule on a fictional orders API shows the inversion, with two known ids promoted and the not-found as the answer at the bottom. | Order | Condition on `GET /orders/{orderId}` | Response | |---|---|---| | 1 | `orderId` equals `ord_100` | `200` with a paid order | | 2 | `orderId` equals `ord_101` | `200` with a shipped order | | Fallback | No condition matched | `404` with the documented error body | The same logic applies to writes. Let the default be the documented failure and let a well-formed body earn the success, and the error path gets built while somebody is still looking at that screen. ## Keep the set small Conditions are cheap to add and each one is a line of behaviour somebody has to maintain, so the set is worth pruning. The test is whether the variant corresponds to a state the client has to render. A `404`, an empty list, a validation failure and a conflict each earn their place because each one is a different screen. A second success variant that differs only in which fields are populated usually does not, since the client renders both the same way and the variety belongs in [the data](https://routebase.dev/guides/api-mocking/mock-data-generation/) instead. ## In Routebase Every rule has a **Conditional Responses** section, and each entry there is a set of conditions plus the response it overrides to. A condition takes a source of query parameter, request body, header, path parameter or HTTP method, a path written in dot notation for nested body fields such as `user.address.city`, an operator and a value. The operators cover equality, containment, prefixes and suffixes, regular expressions, existence and numeric comparison, so a quantity above a threshold and a missing field are both expressible without a script. Conditions inside one entry combine with **Match ALL** or **Match ANY**. The entry's **Response Override** replaces the status code, the content type and the body, and anything left empty falls back to the rule's own response. A typical single-resource rule ends up as a `404` by default with one condition promoting the ids in your fixtures to a `200`, which is the shape the [Mock Server](https://docs.routebase.dev/mock-server/) guide walks through. ## Frequently asked questions ### How do you return different mock responses for the same endpoint? Put the variants inside one rule as conditions on the request rather than spreading them over several rules. Each condition looks at a query parameter, a body field, a header, a path parameter or the method, and the first one that matches overrides the status code and the body. The rule's own response stays as the fallback for everything that matched nothing. ### How do you mock a 404 for an unknown ID? Invert the default. Make the rule's own response the 404, then add a condition that recognises the one or two ids your fixtures actually contain and overrides them to a 200 with the record. Every other id falls through to the not-found, which is what a real API does and what a mock returning 200 for any id never teaches the client. ### Should you use one rule per response or conditions inside one rule? Use conditions when the variants share a route and differ by what is in the request, because that keeps them in one place and removes the ordering question. Use separate rules when the variants differ by something the matcher already understands, such as the presence of a credential header, since that belongs in matching rather than in a branch. ### Can a mock respond based on the request body? A capable one can, and it is the only way to exercise validation. A condition that reads a field in the posted body with dot notation lets a quantity above a threshold return the 422 your contract documents. The client's error handling is then built against a response it will actually receive. --- # Simulating API Errors, Latency and Rate Limits — Routebase > Latency with a range, failures at a probability, a dead socket instead of a clean 500, and the 429 nobody handles until it happens in production. Canonical page: https://routebase.dev/guides/api-mocking/simulating-errors-latency-and-rate-limits/ Chapter 5 of 10 · API Mocking · Last reviewed 2026-09-27 by The Routebase Team. A client that has only ever seen fast, successful responses has not been built for the network. Every state it is missing is a state the mock declined to produce, and each one arrives at once when the real backend appears. ## The four conditions worth reproducing Four properties of a real API have nothing to do with the shape of the response body, and all four are configuration rather than derivation. **It is slow, and unevenly so.** Latency is not one number. A range is what surfaces the request that finishes after the one that started later, the spinner that appears for forty milliseconds and flickers, and the component that unmounts before its response arrives. **It fails.** Not on a button you press, but occasionally, while attention is somewhere else. That is the difference between proving an error component renders and finding out what a retry does to a form somebody had half filled in. **It refuses.** A request ceiling over a window produces the `429` that most clients handle worst, because the condition is invisible in development and unavoidable once real usage arrives. **It breaks rather than answers.** A clean `500` is a response, and a connection that hangs until it times out or resets outright is not. Those take different paths through every HTTP client, and only one of them is usually tested. ## Why probability beats a switch Triggering a failure deliberately tests the thing you were already thinking about, which is the error screen. Everything else that failure touches is discovered by accident. A request failing mid-flow reveals that a form loses its contents on retry, that two components refetch the same resource independently, or that an optimistic update never gets rolled back. None of those are visible when you press the fail button and then look at the error state you expected. A probability changes who finds the problem and when. Set it low enough that work continues and high enough that a failure lands within an hour, and the bugs arrive while somebody is in the middle of something rather than while they are auditing. ## The failures worth distinguishing Not all failures are the same shape, and treating them as one category is how half the handling gets skipped. | Failure | What the client sees | What it tests | |---|---|---| | `500` or `502` | A response with a status and usually a body | The error path and the message it renders | | `503` | A response, sometimes with a retry hint | Whether the client backs off or hammers | | `504` | A response after a wait | Whether the wait blocked the interface | | Timeout | Nothing, until the client's own deadline | Whether there is a deadline at all | | Connection reset | An abrupt transport error | The path that most clients never exercise | The last two are the valuable ones and the ones most mocks cannot produce. A client with a well-tested `500` handler frequently has no timeout configured at all, which means a hung request holds a spinner open forever and nobody notices until a real network does it. ## Rate limits deserve their own pass Rate limiting is the condition with the widest gap between how common it is in production and how often it is handled in a client. The mechanics are simple enough. A ceiling over a window, a `429` once it is exceeded, and a `Retry-After` telling the caller when to come back. What a mock adds is the chance to find out what your client does with that, which is frequently to retry immediately and make the situation worse. It is also the cheapest way to find accidental request volume. A screen that calls the same endpoint from four components will trip a low ceiling in development, where the fix is ten minutes, rather than in production, where the fix is an incident. ## Turning it up and down A permanently hostile mock gets switched off, which returns you to the comfortable one. The workable pattern is two postures. Everyday development runs with modest latency, a low failure probability and a rate limit that only a genuine mistake will hit, so the conditions are present without being the subject. Then a deliberate session turns the failure rate up, drops the ceiling and adds a timeout, and a developer spends an afternoon inside the conditions on purpose. The reason to bother with either posture is the same. Integration day is mostly a catalogue of conditions the mock declined to show you, and every one of them you meet early is one you do not meet in the week before launch. ## In Routebase Each rule carries its own behaviour, so one endpoint can be slow and unreliable while the rest of the mock stays quick. _Screenshot: Error simulation, latency and rate limiting are sections of a single rule, and the two entries at the bottom of the error list are the ones a status code cannot express, because a timeout and a reset never arrive as a response at all._ **Error Simulation** takes a probability and an error type, where an empty probability means every request. The types cover `500`, `502`, `503` and `504`. Beyond those sit a timeout that holds the connection open before closing it and a connection reset that aborts immediately, which are the two failures a status code cannot express. **Delay Settings** take a fixed delay in milliseconds plus an optional random maximum added on top, so responses vary the way they vary on a real network rather than arriving on a metronome. **Rate Limiting** caps a rule at a number of requests per second, minute or hour and answers everything past the ceiling with `429` and a `Retry-After` header until the window resets. Because all three are per rule, a realistic profile is a mixture rather than a global setting. The checkout endpoint can be the slow and occasionally failing one while the reference data stays instant, which is closer to production than any single number would be. The [Mock Server](https://docs.routebase.dev/mock-server/) guide covers errors, delays and rate limits. ## Frequently asked questions ### How do you simulate API errors in a mock server? Configure the failure as a probability rather than as a switch you flip while watching. A rule that fails one request in ten produces failures while somebody is working on an unrelated screen, which is when you find out what a retry does to a half-filled form. Triggering an error on demand only proves that the error component renders. ### Why would you add latency to a mock server? Because a response that arrives in three milliseconds hides every problem that timing causes. No loading state gets built, a spinner that flickers for forty milliseconds is never noticed, and two requests that race are never out of order. A fixed delay with a random component on top reproduces the variability that makes those failures appear. ### How do you test how a client handles HTTP 429? Give the mock rule a request ceiling over a window and let the client exceed it. Rate limits are the condition frontends handle worst, because they are invisible in development and unavoidable in production. A mock that enforces one turns 429 from something the team read about into something the interface has already survived. ### How often should a mock fail? Often enough to be met by accident and rarely enough that work continues, which for most teams is a single-digit percentage. A mock failing half its requests gets switched off within a day, and a mock that never fails teaches the client that failure does not happen. The failure rate is a setting worth raising deliberately for a session rather than leaving high permanently. --- # Stateful Mocks: When the Attempt Needs Memory — Routebase > Why a create followed by a list breaks every stateless mock, what state buys you in a cart or a wizard, and where memory turns a mock into a backend. Canonical page: https://routebase.dev/guides/api-mocking/stateful-mocks/ Chapter 6 of 10 · API Mocking · Last reviewed 2026-09-27 by The Routebase Team. Most mocks are stateless, and for most endpoints that is correct. It stops being correct the moment the thing you are building is a sequence, because a sequence is defined by the second request knowing about the first. ## The flow every stateless mock fails Create something, then list. The list is unchanged, because the list rule has one template and the create rule never touched it. Two calls against a fictional cart show the difference, and only the second answer lets the screen behind the add button be built honestly. ```txt POST /cart/items { "sku": "TEA-01", "quantity": 2 } -> 201 Created GET /cart -> stateless mock { "items": [{ "sku": "MUG-07", "quantity": 1 }] } -> stateful mock { "items": [{ "sku": "TEA-01", "quantity": 2 }] } ``` That single behaviour is enough to make an entire class of feature unbuildable against a mock. That covers a cart that never fills, a wizard whose second step does not know what the first one submitted, a status that stays `pending` forever and an upload that never appears in its collection. The developer works around it by hard-coding the next screen, and the workaround is thrown away on integration day along with whatever it was hiding. ## What state buys Three situations justify the extra machinery, and they have in common that the interesting behaviour lives between the calls rather than inside one. **A collection that grows.** Adding an item and seeing it in the next read is the minimum a create-and-list screen needs to be built honestly, including the ordering and the empty state on either side of it. **A value that advances.** An order that moves from `pending` to `confirmed` on the next poll lets you build the polling, the intermediate rendering and the terminal state. A mock that returns `confirmed` immediately lets you build none of that. **A key that has been seen before.** Idempotency only exists as behaviour across two requests. A mock that records the keys it has answered can return the original response to a repeat, which is the only way a client's retry logic gets exercised before production. ## Where memory makes things worse State is a slope, and the far end of it is a second implementation of your backend with none of the tests. The first condition is easy to justify and the fifth is not. Once the mock is validating that the quantity is available, recalculating a total, rejecting a transition from one status to another and expiring a reservation after a timeout, the mock has business logic. Business logic in a mock has two problems. It is a guess about what the real service will do, and it will be maintained by whoever the guess inconveniences next. There is also a practical limit. A mock's state is usually shared by everyone pointing at that mock, so two developers working on the same flow interfere with each other. A test suite running in parallel sees whatever the other run left behind. That is tolerable while the state is a list of three items and intolerable once somebody is asserting on it. The line worth holding is that a mock may remember and should not decide. Recording what happened is what makes a sequence buildable, while judging whether it was allowed is the provider's job and the thing your [contract tests](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) will check against the real service. ## Keep it resettable Any mock with memory needs an obvious way back to the starting position, because the value of a reproducible flow disappears the moment the state has drifted. In practice that means a defined initial state that a reset returns to, and a habit of resetting before a demo or a test run rather than after something has gone wrong. It also means being deliberate about how much is remembered, since a mock holding a few records is easy to reason about and one holding a session's worth of history is not. ## In Routebase A rule can be given **State Management**, which turns it from a template into something that remembers. The state starts from an **Initial State** written as JSON, such as a counter at zero and an empty array. Response bodies read it with `{{state.variableName}}` placeholders alongside the usual faker and request values, so a list rule can return whatever has accumulated rather than a fixed set. Mutation happens through a `__state__` block in the body template, which is how a `POST` rule records what it was sent and a subsequent `GET` rule reflects it. Because state sits on the rule rather than on the server, a flow can be stateful exactly where it needs to be while every other endpoint stays a stateless template that nobody has to reset. The [Mock Server](https://docs.routebase.dev/mock-server/) guide covers initial state, reads and mutation. ## Frequently asked questions ### What is a stateful mock? A stateful mock remembers something between requests, so a POST changes what the following GET returns. Without that, a mock answers every call from the same fixed template and a create followed by a list shows no sign that anything was created. State is what makes a multi-step flow buildable before the backend exists. ### When does a mock need state? Whenever the feature you are building is a sequence rather than a screen. A cart, a checkout, a multi-step form, a status that moves from pending to confirmed and anything involving an idempotency key all depend on the second request knowing about the first. A read-only list or a detail view needs nothing of the sort. ### What are the limits of a stateful mock? State turns a mock into a small implementation, and an implementation has to be maintained and reasoned about. Once the rules are enforcing invariants, rejecting conflicts and calculating derived values, you are writing the backend twice and the copy has no tests. That is the point where the flow belongs against the real service. ### How do you mock an idempotent endpoint? Keep the keys you have already seen and branch on whether the incoming one is among them. A first request records the key and returns the created resource. A repeat of the same key returns that same response without creating anything again, which is exactly what the client's retry logic has to be built against. --- # Keeping Mocks in Sync With the Spec — Routebase > A mock behind the contract is worse than no mock. The three states of a generated rule, why a published version should freeze, and what regeneration replaces. Canonical page: https://routebase.dev/guides/api-mocking/keeping-mocks-in-sync/ Chapter 7 of 10 · API Mocking · Last reviewed 2026-09-13 by The Routebase Team. A mock that has fallen behind the contract is not neutral. It is confidently wrong, and every consumer built against it is being taught a shape that no longer exists. That makes synchronisation the property that decides whether a mock stays useful after week two. It is also the property most setups have no answer for, because the mock was generated once and then quietly became a copy. ## Three states, and only one of them is stable A rule that came from a specification can be in one of three relationships with it, and confusion here is the source of most mock surprises. _Figure: The three states a generated rule can be in. Following means the body is produced from the current schema on every request, so it cannot fall behind. Pinned means the rule is deliberately frozen against a published version and the tooling reports when the contract moves. Detached means somebody edited the body, which is a choice rather than an accident and stays in force until the rule is regenerated._ **Following.** The body is projected from the current schema each time the rule answers, so a field added this morning is in the response this afternoon. Nothing is stored, which means nothing can be stale. **Pinned.** The rule is attached to a published version and answers that shape on purpose. This is the correct state for anything a consumer outside the team relies on, because a published version that changes underneath somebody is not a version at all. **Detached.** Somebody edited the body by hand. The rule now belongs to them, and no schema change will touch it again until it is regenerated. The state that causes trouble is a fourth one, which is a rule that was generated once by a tool with no concept of any of this. It looks derived, it is actually detached, and nothing will ever tell you which. ## Why following is not always the goal The instinct is to make everything follow, and it is the wrong instinct for anything published. While a contract is still a draft, following is exactly right. The mock moves with the design, the frontend sees each change on its next request, and nobody has to remember to regenerate. That is the state a design-first workflow wants for the whole of the design phase. Once a version is published, consumers depend on it. A mock that silently adopts the newest shape stops representing what those consumers actually receive, which makes it useless for reproducing their problems. Freezing it is the correct behaviour, and the thing you want from the tooling then is not synchronisation but detection. The neighbouring decision, which is how a contract gets a new version at all, is covered in the [versioning guide](https://routebase.dev/guides/api-versioning/). ## What a detection should tell you A banner saying that something has changed is not much better than silence, because the next question is always which part. A useful report names the version the rule is frozen at and the version the specification has reached, then lists what actually differs between them. A field added is a different problem from a field removed, and a type change is a different problem again. Without that breakdown, pulling the mock forward is an act of faith. The second half is what happens when you accept. Regeneration rebuilds the body from the newer schema, which means any manual edits in that body are gone. Seeing the current body next to the proposed one before applying is the difference between an update and a loss. ## Keeping the loop small Two habits keep the drift from accumulating in the first place. Re-run generation when the contract grows rather than when something breaks. A new endpoint arrives without a rule and returns a `404` that looks like a caller mistake, which is a slow and annoying way to find out that the specification moved. Treat a manual edit as a decision rather than a shortcut. When a generated body is nearly right, changing the schema is almost always better than changing the body, because the schema change also reaches the documentation, the tests and everyone else reading the contract. ## In Routebase The state of a rule is visible in the tree rather than something you have to infer. Each row carries a colour for active, inactive, following the draft and out of sync with its source. A rule generated from a draft version is in the **following** state. Its body editor is read-only, because the stored value is only the last snapshot and the response is projected from the current draft on every request. **Customize** takes ownership and stops the live updates, which is the deliberate move into the detached state. A rule pinned to a published version gets **drift detection** instead. When the specification's latest published version moves past the one the rule is frozen at, a banner says so and names both versions. _Screenshot: The banner states which version the rule is frozen at and which one the contract has reached, so the rule is not silently stale and not silently updated either._ **Review Changes** lists what differs between the two versions with the old and the new value beside each other, and **Sync from Spec** re-points the rule and regenerates its body. **Re-Generate with Smart Mock** does the same on demand from the rule menu, and both show the current body beside the proposed one before anything is applied. The [Mock Server](https://docs.routebase.dev/mock-server/) guide covers the three states and the diff. ## Frequently asked questions ### How do you keep a mock server in sync with an OpenAPI specification? Keep the rule derived from the document rather than copied out of it, so the response is produced from the current schema instead of from a snapshot somebody pasted. Where the contract has been published and must not move, the rule should freeze against that version and report the difference when the specification moves on. Silent synchronisation and silent staleness are both worse than a visible diff. ### What happens to a mock when the API specification changes? It depends on what the rule is attached to. A rule following a draft picks the change up on the next request, because the body is projected from the schema rather than stored. A rule pinned to a published version keeps answering the old shape on purpose, and the only correct behaviour then is to flag that the contract has moved. ### Should a mock follow the draft or a published version? Follow the draft while you are designing, because that is when you want the mock to move with every change. Pin to a published version once somebody outside the team depends on it, since a version that shifts underneath a consumer is not a version. Most projects need both at once, which is why the choice belongs on the rule rather than on the server. ### Does regenerating a mock rule overwrite manual changes? Yes, and it has to. Regeneration rebuilds the body from the schema, so anything typed into that body by hand is replaced. The useful arrangement is that a manual edit takes the rule out of the derived state deliberately, and pulling it back in is a step somebody takes with a before-and-after comparison in front of them. --- # Mocks in the Frontend Workflow — Routebase > Starting on day one, the base URL as configuration instead of a code branch, CORS and tokens in a browser, and what changes at the real backend. Canonical page: https://routebase.dev/guides/api-mocking/mocking-for-frontend-development/ Chapter 8 of 10 · API Mocking · Last reviewed 2026-09-27 by The Routebase Team. The strongest argument for a mock is a calendar one. A contract agreed on Monday can have a callable implementation of itself by Monday afternoon, which means the client work starts weeks before the provider does. Getting that benefit without paying for it later comes down to a few decisions about how the client reaches the mock. ## The base URL is configuration, never a branch The single most expensive mistake is a conditional in application code that chooses between the mock and the real API. It looks harmless. It creates a code path that only exists in development, so the path that will run in production is the less tested of the two. It also spreads, because the second conditional is always easier to add than the first one was, and eventually the mock-only branch is doing something the real branch does not. The rule is that nothing above the transport layer knows which server is answering. One base URL, supplied by configuration, changed by an environment variable. The client is then identical in both cases and switching is a deployment concern rather than a code change. A fetch call from a fictional shop front end shows the difference, and the branch in the first version has already started to skip the credential. ```txt // Before: application code decides which server answers const res = USE_MOCK ? await fetch('https://mock.example.com/orders') : await fetch('https://api.example.com/orders', { headers: authHeaders() }) // After: nothing above the transport knows, the environment decides const res = await fetch(`${API_BASE_URL}/orders`, { headers: authHeaders() }) # .env.development API_BASE_URL=https://mock.example.com # .env.production API_BASE_URL=https://api.example.com ``` ## What a browser needs that a test runner does not Calling a mock from a terminal is trivial. Calling it from a page is where two extra things appear. **Cross-origin access.** Your development server and the mock are different origins, so the browser will not read the response unless the mock allows the origin explicitly. This is worth setting up on the first day rather than debugging on it, because the failure arrives as a policy message and reads like a problem with the request. **A credential, sometimes.** A mock on a public URL is reachable by anyone with the address. The data is invented, so that is usually fine, and where it is not, a token required on every request closes the door without changing how the client calls it. The important part is that the token is supplied the same way the real credential will be, so the code that attaches it is the code that ships. ## Where the mock lives matters more than it looks A mock that runs on one developer's machine and a mock that lives at a shared address are two different tools. A local mock is private, fast and invisible to everyone else. It cannot be opened by a designer, attached to a preview deployment or called from a pipeline, and each teammate has their own slightly different copy of it. A hosted mock has one address that everybody, including automation, can reach. Everyone sees the same behaviour, a preview build can point at it, and a pipeline can run against it without provisioning anything. The trade is that its state and configuration are shared. One person turning on a failure probability is doing it for everybody. ## Using the log as the debugger A frontend integrating against anything spends most of its debugging time on one question, which is whether the request that was sent is the request that was meant. A mock is in an unusually good position to answer that, because it can record exactly what arrived. A request log showing the method, the path, the query string, the headers and the body turns a guess about a serialisation bug into a fact in about ten seconds. It also settles the most common confusion. That is a `404` where the path was subtly wrong rather than the rule missing. ## The day you switch If the mock was doing its job, switching is uneventful. What remains is worth naming so it is not a surprise. Authentication is the big one, because the mock accepted whatever it was given and the real service will not. Expect to spend the switch day on tokens, refresh behaviour and redirects rather than on rendering. After that come the things a comfortable mock hid, which are latency, failures and limits. Those should have been configured long before, which is what [making the mock unpleasant](https://routebase.dev/guides/api-mocking/simulating-errors-latency-and-rate-limits/) is about. A team that did it meets a short list of genuine surprises, and a team that did not meets every missing state in the same week. ## In Routebase The mock server has a stable public base URL per project, so the same address works from a laptop, a preview deployment and a pipeline without anyone provisioning anything. The [API-first development](https://routebase.dev/api-first-development/) page shows where that URL sits in the workflow, next to the tests and monitors that wait for the backend the same way. _Screenshot: Every request the mock handled is listed with its status and timing, and the entries that no rule matched are visible as 404s next to the ones that were answered, which is usually the fastest way to tell a wrong path from a missing rule._ **CORS** is switched on per server with an explicit list of allowed origins, so your development host and your preview domain can call it from a browser. **Require Access Token** adds a token that callers send as a bearer header or as a query parameter. Regenerating it at any time revokes the previous one immediately. Expanding a log entry shows whether the response came from a rule or was proxied, which rule matched, and the full request and response headers and bodies, each copyable. The log filters by method, path, status class and source. It narrows to a single rule while that rule is selected. The API designer's **Try It** panel can target the mock directly, so a request can be checked against the mock and against a real environment from the same screen. [Mock Server Settings](https://docs.routebase.dev/mock-server-settings/) covers CORS and tokens, and the [Mock Server](https://docs.routebase.dev/mock-server/) guide covers the log. ## Frequently asked questions ### How do you use a mock API for frontend development? Point the client at the mock through the same configuration that will later point it at staging, then build against it as though it were real. The rule that makes this work is that no application code knows which one it is talking to. A conditional around the base URL becomes a second code path that only the mock ever exercises. ### Why does a mock server need CORS? Because a browser refuses a cross-origin request unless the server that answers it says otherwise, and a mock on its own domain is cross-origin to your development server. Without the right origin allowed, the request fails before the response is read, and the console message is about the policy rather than about the API. Every browser-facing mock needs the origins your app runs on listed. ### Should a mock server be public? A mock on a public URL is the easiest thing to share with a teammate, a preview deployment or a pipeline, and it is also readable by anyone who guesses the address. Since a mock carries invented data rather than customer data, that is usually acceptable, and where it is not, requiring a token on every request closes it without changing how anyone calls it. ### What breaks when you switch from a mock to the real API? Authentication, latency and the error cases, roughly in that order. The mock accepted whatever credential it was handed and answered instantly, while the real service refuses, redirects and takes its time. Everything else is usually small, which is precisely why the mock should have been slow, occasionally broken and rate limited well before that day. --- # When Not to Mock an API — Routebase > A passing run against a mock is a statement about the mock. Four questions mocking cannot answer, what takes over for each, and proxy mode in between. Canonical page: https://routebase.dev/guides/api-mocking/when-not-to-mock/ Chapter 9 of 10 · API Mocking · Last reviewed 2026-09-27 by The Routebase Team. Every technique has a sentence that describes its limit, and for mocking the sentence is short. A mock only knows what you told it, so anything it tells you back is something you already knew. That is not a weakness to work around. It is the definition, and the trouble starts only when a result from a mock is read as evidence about the service the mock stands in for. ## The four questions a mock cannot answer Each of these looks like something a mock covers, and in each case the mock is answering a different question than the one being asked. **Does the provider behave as documented?** The mock was built from the documentation, so of course it matches it. Whether the implementation matches is a question only the implementation can answer, which is what contract tests against a real deployment are for. **How long does it take?** A configured delay is a number you chose. It tells you how your client behaves at that latency, which is useful, and it tells you nothing about the service. Performance is measured against the thing being measured. **Does authorisation refuse what it should?** A mock returning `403` for a request without a token is performing a rule you wrote. The real question is whether the provider enforces the same rule, and a stand-in cannot be the witness for that. **Will the integration actually work?** Two systems fail to integrate over the details neither document mentions, such as an encoding, a redirect, a header a proxy strips or a timeout further up the chain. The mock has none of those, because it is not the system. ## What takes over, and where The replacement is never one thing, because the questions above belong to different moments. | Question | Answered by | Running against | |---|---|---| | Can the consumer handle this shape | The mock | Nothing real, by design | | Does the provider still match the contract | Contract tests | A deployed environment | | Does the whole path work end to end | Integration tests | Real services, real data | | Is it still true in production | Monitors | The live environment | The two guides next door cover the second and fourth rows in full. [Contract testing against integration testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) is the distinction that matters most here, and [API monitoring](https://routebase.dev/guides/api-monitoring/) is the same check moved to the other side of the release. ## The shape of the mistake The failure mode is worth naming precisely, because it is rarely a decision anybody made. A team mocks a dependency in a unit test, which is correct. The mock gets reused in an integration test, which is now an integration test with the integration removed. The suite goes green, the coverage number goes up, and the one thing nobody is testing is the boundary that both services meet at. The tell is a test that fails when you break the mock and passes when you break the service. If you cannot say which of those it would catch, it is a consumer test with a misleading name. ## Proxy mode as the middle path Integration rarely happens on one day, and for the weeks in between there is a position between a full stand-in and the real service. A proxy forwards anything the mock has no rule for to a real backend. The endpoints you are working on are mocked, the endpoints that already work are real, and the client does not change at all. It is the most useful mock setting during the handover period, because it moves the boundary between invented and real without moving any code. It also has an honest limit. A response that came through a proxy is a real response, and a response that came from a rule is not, so a run that touches both proves whatever its real half touched. Keeping track of which is which is the whole job, and a log that marks each response with its source is what makes that possible. ## In Routebase **Proxy Mode** is a per-server setting with a target URL, available on the Starter plan and above. Unmatched requests go to the backend you name, proxied responses are marked as such in the request log, and switching it off puts the mock back in charge without touching a rule. _Screenshot: Proxy mode sits on the server rather than on a rule, so the endpoints you have mocked stay mocked and everything else reaches the backend you name, without a change anywhere in the client._ Where the mock stops, two other parts of the same contract take over. Test suites run against a real environment and validate the response against the version that environment is pinned to, and monitors do the same on a schedule after the release. Both read the specification the mock was generated from, so the stand-in and the checks that replace it are describing the same interface rather than two copies of it. Four things the mock deliberately does not do are worth stating plainly. It does not record live traffic and replay it, and it answers HTTP rather than GraphQL, gRPC or WebSocket traffic. It runs as a hosted service rather than inside your own network, and it does not verify a consumer's expectations against a provider the way a consumer-driven contract tool does. What it does instead is stay attached to the contract everything else in the lifecycle is generated from. That is the property which keeps the mock, the documentation, the tests and the monitors describing one interface. The [Mock Server Settings](https://docs.routebase.dev/mock-server-settings/) guide covers proxy mode, and the [Test Suites](https://docs.routebase.dev/test-suites/) guide covers the checks that run against the real service. ## Frequently asked questions ### Does a passing test against a mock prove anything about the API? It proves something about the consumer, which is that it can handle the response it was given. It proves nothing about the provider, because the provider was not involved, so a suite that is entirely green against mocks is compatible with a service that has been broken for a week. The two questions need two different setups and confusing them is how outages reach production with a full board of passing checks. ### What is the difference between mocking and contract testing? Mocking gives a consumer something to call, while contract testing checks that a real response still matches the agreed description. One stands in for the provider and the other interrogates it, which is why a mock belongs in development and a contract test belongs in a pipeline against a running deployment. ### When should you use a real API instead of a mock? Whenever the question is about the provider rather than about the consumer. That covers verifying that an endpoint behaves as documented, measuring how long it actually takes, checking that authorisation refuses what it should refuse, and anything where a third party's real semantics are the subject. A mock answers none of those, because a mock only knows what you told it. ### What is proxy mode on a mock server? Proxy mode forwards any request that no mock rule matches to a real backend, so the endpoints you are working on are mocked and everything else reaches the live service. It is the practical middle position during integration, since it lets a client be partly on the stand-in and partly on the real thing without a change in the client itself. --- # What to Look For in an API Mocking Tool — Routebase > Eight questions about where a mock's responses come from, what happens when the contract changes and who can reach it, with two exercises. Canonical page: https://routebase.dev/guides/api-mocking/api-mocking-tools/ Chapter 10 of 10 · API Mocking · Last reviewed 2026-09-27 by The Routebase Team. A mock earns trust in its first week and loses it on the day the contract changes while the mock keeps answering the old shape. Whether that happens depends mostly on where its responses come from, which is the first of the questions below. ## Eight questions for a mocking tool ### 1. Where does the response body come from This is the first question because everything else follows from it. A tool where bodies are typed by hand is a text editor with routing. A tool that generates them from a schema removes the copy that drifts, and one that can also serve curated records removes the choice between plausible and stable. Ask specifically whether the schema is read at request time or only once at generation, since those two answers differ enormously three weeks later. ### 2. What happens when the contract changes The question that separates a mock from an archive. Ask whether a rule can keep following its source, whether it can be pinned deliberately, and what the tool does when a pinned rule falls behind. A tool with no concept of the source document gives the same answer to all three, which is nothing, and the staleness becomes somebody's afternoon. ### 3. How much of the network can it imitate Ask which of latency, failure, timeout, connection reset and rate limiting the tool can produce. Then ask the sharper version, which is whether it can produce them at a probability rather than on a button. A failure you trigger while watching tests the screen you were already thinking about. A failure that lands at random tests everything else, and only the second one finds the half-filled form and the retry that made things worse. ### 4. Can it remember anything Ask whether a rule can hold state across requests, and whether that state can be reset to a defined starting point. Without it, every flow that involves a sequence is unbuildable against the mock, which covers carts, wizards, polling and anything idempotent. With it, ask who shares the state, because a single shared memory across a team behaves very differently from one per caller. ### 5. Which requests can it tell apart Ask what the matcher can see. Method and path is the floor, and query parameters and headers are what let one route answer differently for an authenticated and an unauthenticated caller. Then ask how ties are broken when two rules both qualify, since the answer is either an explicit priority you control or an implicit order you will eventually fight. ### 6. Who can reach it Ask where the mock runs and who can call it, because this decides how many of your problems it can solve. A process on one laptop cannot be called by a designer, a preview build or a pipeline. A reachable address can be, at the cost of sharing its configuration. Ask about cross-origin access, since a mock that a browser refuses to read is a mock a frontend cannot use, and ask how it is closed off if it needs to be. ### 7. What does it tell you about what it did Ask whether there is a log, and then ask what is in an entry. A list of paths and status codes is a start. An entry showing the headers and body that arrived, plus which rule matched and why, is what turns most integration debugging into a lookup. The second most useful thing a log can show is a request that matched nothing at all. ### 8. What exactly is metered Two questions catch most surprises, and both are about the meter rather than the headline price. Ask what is counted, since requests, rules, endpoints, seats and servers all get used as meters and each one rewards a different behaviour. Then ask what happens at the limit, because a mock that stops answering mid-sprint is a different risk from one that sends an invoice. ## A scorecard for mocking tools | Criterion | Question | Weight it if | |---|---|---| | Body source | Generated from the schema, or typed | Your contract changes more than rarely | | Contract drift | Following, pinning, and a diff when it moves | Anything outside the team depends on a version | | Network realism | Latency, failures, timeouts, limits, at a probability | The client has to survive production | | State | Memory across requests, and a reset | You are building a flow rather than a screen | | Matching | Query and header conditions, explicit priority | One route needs more than one answer | | Reach | A callable address, cross-origin access, a way to close it | Anyone but you needs to call it | | Log | Headers, bodies, matched rule, unmatched requests | You will debug against it | | Metering | What is counted, and what happens at the limit | Usage will grow | ## Two exercises that settle it faster A feature grid takes an afternoon and tells you less than these two. **Generate the whole thing from your own specification.** Not a sample API. Your document, including the endpoints with the weakest schemas, and then call each route once. The empty bodies show you both the tool's ceiling and your document's floor. **Then change one field and watch.** Rename a property in the specification and see what the mock does. Whether it follows, reports the difference or says nothing at all is the behaviour you will actually be relying on, and it is the one thing no feature page describes accurately. ## In Routebase The mock is generated from the specification the rest of the lifecycle already uses, so the first criterion is the one it is built on. Rules come off the contract in one step and their bodies are produced from the response schemas. A rule generated from a draft projects the current schema on every request rather than storing a snapshot. A rule pinned to a published version reports the difference when the contract moves and shows it field by field before anything is regenerated. The rest sits in the same workspace. Matching covers query and header patterns with an explicit priority order, and each rule carries its own delay, failure probability, rate limit and optional state. Conditional responses give one route as many answers as it needs. The server has a stable public address with configurable origins and an optional access token, and the log records every request with the rule that matched it. The chapters from [generating a mock](https://routebase.dev/guides/api-mocking/mock-api-from-openapi/) through [when not to mock](https://routebase.dev/guides/api-mocking/when-not-to-mock/) work through each of those in turn. ## Frequently asked questions ### What should you look for in an API mocking tool? Ask where the response body comes from, what happens to it when the contract changes, and how much of the network the tool can imitate. Then ask who else can reach the mock, because a stand-in only one person can call stops being useful as soon as a second team needs it. Those four separate the tools that survive from the ones that are abandoned after a month. ### Is a mock server better than a local mock library? They solve different halves. A library inside the consumer's test suite is fast, private and perfect for unit tests. A server on a reachable address can be called by a browser, a teammate, a preview deployment and a pipeline. Teams that ship a real interface usually end up with both, and the mistake is expecting either one to do the other's job. ### Do you need a paid API mocking tool? Not for a handful of static responses, since a small local server covers that and costs nothing. The cost appears later as maintenance, when the contract has moved several times and somebody has to notice which of the handwritten responses no longer match. What you are paying for in a larger tool is the derivation and the drift report rather than the ability to return JSON. ### How do you evaluate a mocking tool quickly? Generate the whole mock from your own specification rather than from a sample, then change a field in that specification and see what the tool does about it. Whether the mock moves, reports the difference or stays silent tells you more than every feature on the page, because that behaviour is what you will be relying on in three months. --- # API Documentation: A Complete Guide — Routebase > What API documentation is made of, why it drifts from the API, what separates docs people use from docs they abandon, and how to publish them. Canonical page: https://routebase.dev/guides/api-documentation/ Guide overview · 10 chapters · Last reviewed 2026-09-13 by The Routebase Team. Your API documentation is the only part of your API that most people meet before they decide whether to use it. That makes it a product surface, and it is usually maintained like an afterthought. This guide covers what belongs in API documentation, how to write the parts that a generator cannot write for you, how to keep it true while the API keeps moving, and how to publish it. Every chapter stands on its own, so you can start with the one that matches your situation. ## Three layers that do different jobs Almost every complaint about API documentation comes from one layer being asked to do another layer's work. The **reference** is the complete, mechanical description of the surface, meaning every endpoint, every parameter, every response and every error. It is looked at rather than read, it has to be exhaustive, and it is the layer a machine can generate from your contract. The **guides** walk one reader through one task, from an empty editor to a working call. They are read once, they are allowed to be opinionated, and they are the layer that decides whether somebody gets to their first success today or next week. The **concepts** explain the model behind the API. A reader who does not know what your API means by an order, an idempotency key or a webhook delivery attempt will misuse endpoints that are documented perfectly. _Figure: The reference is generated from the contract and is complete by construction. The guides and the concept pages are written once and then maintained deliberately, which is why the three layers age at very different speeds._ ## Why documentation drifts In most setups the documentation is a copy. The API is defined in one place, usually in code or in an OpenAPI document, and it is described somewhere else in prose that a person typed. Two copies of the same fact only stay equal while somebody keeps making every change twice. That person is busy during exactly the releases where the change matters most, so the gap opens quietly and nobody finds out until a consumer builds against a field that no longer exists. The fix is not more discipline. The fix is removing the second edit wherever the fact is mechanical, which is what [generated reference documentation](https://routebase.dev/guides/api-documentation/keeping-api-documentation-up-to-date/) does, and then spending the recovered attention on the writing that no generator can produce. ## What separates documentation people use Four properties show up in every set of docs that developers actually like, and none of them is about visual design. The first call works. A reader who can paste one request and get a real response inside five minutes will forgive a lot afterwards. A reader who is still hunting for a base URL after twenty minutes is already evaluating somebody else. Every error has a way out. An error table that lists status codes without saying what caused each one and what to do next is a list of bad news. Examples are real. A response example that was written by hand two releases ago is worse than no example, because a reader trusts it and builds against it. The answer is where the question is. Auth belongs on the endpoint that needs it, the retry rule belongs next to the rate limit header, and the migration note belongs on the deprecated field. ## Documentation, developer portal, API reference The three terms get used interchangeably, and the distinction that matters is small. **Documentation** is the content. An **API reference** is the generated layer of it. A **developer portal** is the site that carries the content for external readers, usually with search, a version switcher, code samples, a playground and your own branding. Teams with a public API tend to say developer portal, while teams with an internal API tend to say docs, and both mean the same body of work. The real decision behind the word is not which one you build. It is who hosts the result, which [publishing and hosting](https://routebase.dev/guides/api-documentation/publishing-and-hosting-api-documentation/) covers. ## The short answer If you take one rule away, take this one. Generate everything that can be derived from your contract, write the part that cannot, and publish both from one place so there is never a second copy to forget. The rest of the guide is that rule taken apart. | Chapter | Answers | |---|---| | [What belongs in API documentation](https://routebase.dev/guides/api-documentation/what-belongs-in-api-documentation/) | The pages nearly every API needs, and what each one has to deliver | | [How to write it](https://routebase.dev/guides/api-documentation/how-to-write-api-documentation/) | Summaries, descriptions, examples, enums and errors that answer the real question | | [Keeping it up to date](https://routebase.dev/guides/api-documentation/keeping-api-documentation-up-to-date/) | Generated reference, pinned snapshots, doc versions and changelogs | | [Interactive documentation](https://routebase.dev/guides/api-documentation/interactive-api-documentation/) | What a playground must do, which servers it may show, and what never belongs in docs | | [Documentation for agents](https://routebase.dev/guides/api-documentation/api-documentation-for-ai-agents/) | The `llms.txt` convention, Markdown twins, content negotiation and how to check what an agent receives | | [Publishing and hosting](https://routebase.dev/guides/api-documentation/publishing-and-hosting-api-documentation/) | Subdomains, your own domain, internal against public, and taking a version back | | [Docs as code](https://routebase.dev/guides/api-documentation/api-docs-as-code/) | Markdown in the repository against an editor in the portal, and what syncing costs | | [Measuring documentation](https://routebase.dev/guides/api-documentation/measuring-api-documentation/) | Failed searches, reader feedback and the numbers worth acting on | | [Structure and navigation](https://routebase.dev/guides/api-documentation/api-documentation-structure-and-navigation/) | Trees against flat lists, search, versions and branding that stays out of the way | | [Choosing a tool](https://routebase.dev/guides/api-documentation/api-documentation-tools/) | The criteria that decide this, without a vendor list | ## In Routebase Routebase builds the documentation portal out of the same workspace the API lives in. Written pages and generated API references sit in one content tree, so a guide about pagination and the endpoint it describes are two nodes of the same version rather than two systems. _Screenshot: Written pages, folders and the generated API reference live in one tree per documentation version, and the page on the right is edited in the same place it is published from._ The reference comes from a published specification version rather than from prose, the portal carries your branding on your own domain, and every build also emits the machine-readable files an agent can read. Start with the [Documentation Overview](https://docs.routebase.dev/doc-overview/) in the product documentation, or read on. The [API documentation feature page](https://routebase.dev/api-documentation/) has the short version of how the portal fits into the rest of the lifecycle. ## Frequently asked questions ### What is API documentation? API documentation is everything a developer needs to call your API successfully without asking you. It has three layers that do different jobs. The reference lists every endpoint, parameter, response and error. The guides walk somebody through a task from start to finish. The concept pages explain the model behind the API, meaning what an order is, what a webhook delivery is and what happens when one fails. ### What should API documentation include? Beyond the endpoint reference, most APIs need a Getting Started page that ends in a working first call, an Authentication page, and a page listing the environments and base URLs. After that come an error reference with a way out of every error, rate limits with a retry strategy, webhooks with signature verification, client libraries where they exist, and a changelog. Each of those answers a question that otherwise reaches your support inbox. ### Why does API documentation get out of date? Because in most setups the documentation is a copy. The API is defined in one place and described in another, so every change has to be made twice by somebody who remembers to do it. Generating the reference from the contract removes the second edit, and what remains is the writing that no generator can do for you. ### What is the difference between API documentation and a developer portal? The words are used for the same thing in most conversations. Documentation is the content, while a developer portal is the site that carries it, usually with search, a version switcher, a playground and your branding on top. If your API has external consumers you end up needing both, and the decision is not which one to build but who hosts the result. ## Chapters in this guide 1. [What Belongs in API Documentation](https://routebase.dev/guides/api-documentation/what-belongs-in-api-documentation/index.md): The pages nearly every API needs beyond the endpoint reference, what each must deliver, and how to tell a working page from one that only looks complete. 2. [How to Write API Reference Documentation](https://routebase.dev/guides/api-documentation/how-to-write-api-documentation/index.md): Summaries against descriptions, the questions a description has to answer, examples per response, enum values with meaning, and errors a reader can act on. 3. [Keeping API Documentation Up to Date](https://routebase.dev/guides/api-documentation/keeping-api-documentation-up-to-date/index.md): Why documentation drifts from the API, what to generate and what to write, how pinned snapshots and doc versions work, and where a changelog comes from. 4. [Interactive API Documentation](https://routebase.dev/guides/api-documentation/interactive-api-documentation/index.md): What a try-it playground needs to be useful, which servers and credentials it may carry, how code samples earn their place, and what must never appear. 5. [API Documentation for AI Agents](https://routebase.dev/guides/api-documentation/api-documentation-for-ai-agents/index.md): What an agent can read from a documentation site, the llms.txt proposal, Markdown versions and content negotiation, and how to check what an agent receives. 6. [Publishing and Hosting API Documentation](https://routebase.dev/guides/api-documentation/publishing-and-hosting-api-documentation/index.md): Where documentation lives, subdomain against your own domain, who may read it, how to take a version back, and the settings that decide how it is found. 7. [API Docs as Code](https://routebase.dev/guides/api-documentation/api-docs-as-code/index.md): Markdown in the repository against an editor in the portal, what each arrangement buys, what keeping both in step costs, and where the contract lives. 8. [Measuring API Documentation](https://routebase.dev/guides/api-documentation/measuring-api-documentation/index.md): The signals that show whether documentation works, why failed searches are your best backlog, how to read reader feedback, and which numbers to ignore. 9. [API Documentation Structure and Navigation](https://routebase.dev/guides/api-documentation/api-documentation-structure-and-navigation/index.md): Trees against flat lists, how readers actually find a page, what a version switcher has to do, and branding that supports the content instead of competing. 10. [What to Look For in API Documentation Tools](https://routebase.dev/guides/api-documentation/api-documentation-tools/index.md): Nine questions about where a documentation tool gets its reference, how its versions follow the API, and what readers and their agents can find. --- # What Belongs in API Documentation — Routebase > The pages nearly every API needs beyond the endpoint reference, what each must deliver, and how to tell a working page from one that only looks complete. Canonical page: https://routebase.dev/guides/api-documentation/what-belongs-in-api-documentation/ Chapter 1 of 10 · API Documentation · Last reviewed 2026-09-13 by The Routebase Team. The endpoint reference is the part everybody builds first, and it is never the part that decides whether somebody succeeds. The pages around it are. ## The inventory Nearly every API that people integrate against ends up needing the same small set of pages, because readers get stuck in the same small set of places. | Page | The question it answers | What makes it fail | |---|---|---| | Getting Started | How do I make this work at all? | It stops before a request that actually returns something | | Authentication | How do I prove who I am? | It shows the header without saying how to get the credential | | Environments | Which host do I call? | It lists one base URL and leaves the others to support | | Error Codes | What went wrong and what now? | Status codes with no cause and no action | | Rate Limits | How hard may I push? | Limits without headers, headers without a retry rule | | Webhooks | How do I receive events? | Payloads without signature verification | | Client libraries | Is there something I can install? | Install commands that are a version behind | | Changelog | Did anything change for me? | A work log rather than a consumer-facing record | ## Getting Started has one job The page has to end in a call that works, and everything on it is either serving that or getting in the way. That means four things in order. The reader learns what they need before they start, then how to obtain a credential, then which host to send to, then one complete request they can paste. Finish with the response they should see, because a reader who gets something different needs to know immediately that they are off track. Resist the urge to be complete here. Every concept you introduce on this page is a chance for the reader to stop, and there are nine other pages where that concept fits better. ## Authentication answers two questions, not one Most authentication pages explain how to send the credential and forget to explain how to get one. Both halves matter, and the acquisition half is where readers stall. Say where the credential is created, what permissions it can carry, how long it lives and what happens when it expires. If tokens are refreshed, show the refresh call in full rather than describing it. The [API authentication guide](https://routebase.dev/guides/api-authentication/) covers the methods themselves, and [security schemes in OpenAPI](https://routebase.dev/guides/api-authentication/openapi-security-schemes/) covers how they are declared in the contract so the reference can render them. ## Environments and base URLs A single host in the documentation is a reasonable default and a common source of support load, because the reader in front of you is usually not in the environment you documented. List every environment a consumer may legitimately reach, with its base URL and one sentence saying what it is for. Say plainly which one is safe to experiment against, and say what is different about it, since a sandbox that silently skips payment capture will surprise somebody eventually. ## Errors need a cause and a way out An error reference that lists status codes and their standard meanings has documented HTTP rather than your API. What a reader needs is your application error code, the condition that produced it, and the action that resolves it. A machine-readable error format helps here, because a consistent body shape means a consumer can handle errors generically instead of matching on strings. The [problem details format in RFC 9457](https://www.rfc-editor.org/rfc/rfc9457.html) is one widely used shape for that, retrieved 2026-09-13. ## Rate limits are useless without the retry rule Publishing a number tells a consumer when they will be rejected. It does not tell them what to do about it. The useful version has three parts. Name the limit and the window, name the response headers that report the remaining budget, and state the retry behaviour you want, including whether you send `Retry-After` and whether you expect backoff. Without that third part every consumer invents their own retry loop, and the aggressive ones make your limit worse. ## Webhooks are documentation for code you cannot see With a webhook the roles are reversed, because your consumer writes the receiver and you are the caller. That makes four things mandatory. Publish the event catalogue with an example payload per event, and publish the signature scheme in enough detail that somebody can verify a request without guessing. Then publish the retry and backoff policy, and say how long you keep retrying before you give up. Delivery order and duplicate delivery deserve a sentence each, because assuming both is the most common integration bug on the receiving side. ## The changelog is a consumer document A changelog written from your sprint is a work log. A changelog written from the contract is a tool. Entries need a date, a classification the reader can scan, the exact surface that changed, and an action. The [changelogs and migration guides](https://routebase.dev/guides/api-versioning/api-changelogs-and-migration-guides/) chapter of the versioning guide covers the format in full. ## In Routebase Routebase ships the specialized pages as page types rather than as blank documents, so creating a page starts from the structure that page is supposed to have. The set covers Getting Started, Authentication, Environments, Error Codes, Rate Limits, Webhooks, SDKs and Libraries, and the Changelog, and each of them exists once per documentation version. _Screenshot: Creating a page starts from a page type, and each specialized type carries the sections that kind of page is expected to have._ Every type then opens a template picker with several variants, so a Getting Started page can start minimal with a single cURL example or as a full tutorial with error handling. Organizations can add their own templates on top, which is how a house structure gets applied across projects without anybody copying a page by hand. The [page templates guide](https://docs.routebase.dev/doc-templates/) lists what each variant contains. ## Frequently asked questions ### What pages should API documentation have? Beyond the endpoint reference, plan for Getting Started, Authentication, Environments and base URLs, Error Codes, Rate Limits, Webhooks if you send them, client libraries if you ship them, and a Changelog. Each of those exists because a reader gets stuck at that exact point, and every one you leave out becomes a support conversation you have repeatedly. ### What should a Getting Started page contain? It has to end in a request that works. That means the prerequisites, how to get a credential, the base URL for the environment you want people to start in, one complete copyable call, and the response they should see. Anything that does not move the reader toward that first response belongs on a different page. ### Do I need an API documentation template? A template helps because it turns a blank page into a set of questions you already know the answers to. The value is in the section headings rather than the prose, since a reader scanning for the retry rule finds it in the same place on every API that uses the same structure. Write the sections your API actually has and delete the rest. ### How much documentation does an internal API need? Less reference and the same amount of concept. Internal consumers can ask you about a parameter, so the generated reference plus a short Getting Started often covers the mechanical half. What they cannot get by asking is the model behind the API and the rules that are not visible in the schema. That is exactly the part teams skip, because everybody in the room already knows it. --- # How to Write API Reference Documentation — Routebase > Summaries against descriptions, the questions a description has to answer, examples per response, enum values with meaning, and errors a reader can act on. Canonical page: https://routebase.dev/guides/api-documentation/how-to-write-api-documentation/ Chapter 2 of 10 · API Documentation · Last reviewed 2026-09-27 by The Routebase Team. The reference is the layer a generator can build for you, and that is exactly why the writing in it matters. The structure arrives for free, so what is left is the part that carries meaning. ## The schema already says the shape Look at what a reader gets from the contract without any prose. They get the path, the method, every parameter with its type, the request body, the response codes and the shape of each body. That is the mechanics, and it is complete. What the reader still does not know is what the operation means in your system, what it changes, what they need to have done first, and what will bite them. Everything you write in the reference should be aimed at that gap. Prose that repeats the type of a field is filler that pushes the useful sentence below the fold. ## Summary and description do different jobs A summary is one line, and it appears in navigation, in search results and in the collapsed list of an endpoint group. Keep it a verb phrase that names the operation, such as `Create an order`, and keep it under about ten words so it does not get truncated somewhere you are not looking. The description is the body. It carries the rules, the side effects, the preconditions and the warnings, and it is the only place where your API can explain itself. ## What a description has to answer Four questions cover almost every endpoint. **What does this do in my domain?** Not `creates an Order resource`, but what actually happens, including anything the caller is now committed to. **What changes on the server?** Name the side effects a reader cannot see, such as an email that goes out, a webhook that fires, or an inventory reservation that expires after a while. **What must be true before calling it?** Preconditions, required permissions, and any ordering constraint between this operation and another. **What goes wrong here specifically?** Not the generic error table, but the failure this endpoint produces that surprises people. A description that answers those is usually three to six sentences, and it is worth more than three pages of restated types. ## Examples per response, not per endpoint One example body at the top of an endpoint is the norm and it is rarely enough, because the interesting cases are the ones that are not the happy path. Give each documented response its own example. The `200` shows a realistic object with plausible values, the `422` shows what a validation failure actually looks like, and the `409` shows the conflict shape. Readers write their error handling against those bodies, so a missing one means somebody is guessing. Values matter more than people expect. An example full of `string` and `0` is structurally correct and teaches nothing, while an example with a real-looking identifier, a real currency code and a plausible timestamp answers three questions at once. The same response example for a fictional order shows the difference, first as a generator fills it from types and then as a writer fills it. ```txt # Structurally correct, and it teaches nothing { "id": "string", "total": 0, "currency": "string", "createdAt": "string" } # The format of the id, the currency code and the timestamp are now visible { "id": "ord_8f3k2m", "total": 42.50, "currency": "EUR", "createdAt": "2026-03-14T09:26:53Z" } ``` ## Enums need meanings and a growth rule A list of allowed values tells a reader what will be accepted. It does not tell them what to expect back or what to do with it. Document each value with its meaning, and where the values form a lifecycle, say which transitions exist. A consumer building a state machine against your `status` field will otherwise infer one from the values they happen to observe. Then say what happens when the list grows. If you may add a value in a future release, say so plainly, because that sentence is what allows a careful consumer to write a tolerant reader instead of a switch statement that throws. ## Errors that leave the reader somewhere The endpoint-level error documentation is where the reader arrives under pressure, which is the strongest argument for putting effort into it. Every documented failure wants three things, meaning the condition that caused it, the application-level code that identifies it, and the next step. Where the next step is a different call, link it. Where the next step is a change of input, name the field. ## Descriptions are read by machines too Everything above serves a human reader, and one property serves a second audience for free. A description that states the domain meaning, the side effects and the preconditions is also what an agent needs in order to choose an operation correctly, because the agent has the schema and nothing else. Vague summaries are the single most common reason an agent calls the wrong endpoint. Our post on [API descriptions that language models can use](https://routebase.dev/blog/api-descriptions-llms-can-use/) goes into what that changes about how you word them. ## In Routebase The reference in Routebase is rendered from the specification, so summaries, descriptions, parameters, examples and error responses come from the contract and cannot disagree with it. The description editor is a rich editor rather than a plain text box, so a warning about idempotency renders as a callout and a token flow renders as a diagram in the published reference. _Screenshot: Endpoint descriptions are written in the same editor as the guide pages, so a precondition can be a callout and a flow can be a diagram rather than a paragraph._ Where a note belongs to the documentation rather than to the contract, each endpoint in an embedded reference carries its own notes field, so a portal-side annotation does not change the specification other teams consume. The [Endpoints guide](https://docs.routebase.dev/endpoints/) covers the description fields, and [Responses](https://docs.routebase.dev/responses/) covers examples per status code. ## Frequently asked questions ### How do you write a good API endpoint description? Answer the four questions the schema cannot answer. Say what the operation does in business terms, what it changes on the server, and what the caller has to know before calling it. Then say what goes wrong here specifically rather than repeating the generic error table. A description that restates the endpoint name has cost the reader a click and told them nothing. ### What is the difference between a summary and a description? The summary is one short line that identifies the operation in a list, so it works best as a verb phrase such as Create an order. The description is the prose under the title, where the rules, the side effects and the caveats live. Tooling shows them in different places, which is why a long summary looks broken in navigation and a one-word description looks empty on the page. ### Should API examples be generated or written by hand? Generate the shape and write the values. A generated example is always structurally correct and always full of placeholder text that teaches nothing, while a hand-written example is meaningful and slowly goes out of date. Writing realistic values into the contract itself gives you both, because the example travels with the schema and is regenerated with it. ### How do you document enum values? List the values and say what each one means, since the list alone only tells a reader what is allowed rather than what to expect. Where values represent a lifecycle, say which transitions are possible, because a consumer writing a state machine against your status field will otherwise guess. Also say what happens when you add a value later, which is the question every tolerant reader needs answered. --- # Keeping API Documentation Up to Date — Routebase > Why documentation drifts from the API, what to generate and what to write, how pinned snapshots and doc versions work, and where a changelog comes from. Canonical page: https://routebase.dev/guides/api-documentation/keeping-api-documentation-up-to-date/ Chapter 3 of 10 · API Documentation · Last reviewed 2026-09-13 by The Routebase Team. Every team with stale documentation started with correct documentation. The interesting question is not how it got wrong, it is why it was always going to. ## Documentation drifts because it is a copy Your API exists as code, and it is described as prose. Those are two representations of the same facts, kept equal by a person who remembers to edit both. That arrangement fails predictably rather than randomly. It fails during a large release, because the change is big and the deadline is close. It fails when the person who wrote the page has left. It fails on the second change to a field rather than the first, because the first one was still fresh. And it fails silently. Nothing breaks when documentation goes wrong, no test turns red, and the only signal is a consumer who built against something that is no longer true. ## Split the facts before you fix the process The way out starts by separating two kinds of content that get maintained as though they were one. **Derivable facts** already exist in the contract. Paths, methods, parameters, types, required flags, response codes, schema shapes and security requirements are all mechanically knowable, and writing them a second time in prose creates a copy with no benefit. **Authored meaning** exists nowhere else. Why the endpoint exists, what a caller is committing to, which order operations go in, what a value means in your business, and what to do when something fails are things no generator can infer. Generating the first kind is what buys the attention to keep the second kind true. Teams that write both by hand end up with a reference that is stale and concept pages that were never written. The [OpenAPI guide](https://routebase.dev/guides/openapi/what-you-derive-from-openapi/) covers what a contract can feed and where that stops. ## A snapshot beats a live feed Generating the reference raises an obvious next question, which is how current the generated output should be. Regenerating from whatever the contract says right now sounds like the strongest form of freshness, and it is the version that hurts. Your contract has work in progress in it, so a documentation portal that follows it live will publish a field nobody has released and an endpoint somebody is still arguing about. The arrangement that holds is a pin. The documentation references one released version of the contract, that reference does not move on its own, and the system tells you when a newer released version exists. Updating is then a decision somebody makes, with a diff they can read, rather than a side effect of somebody else's commit. _Figure: The contract keeps moving while the published reference stays pinned to a released version, so the documentation only changes when somebody accepts the newer one. The gap between the two stays visible rather than silent._ ## Version the documentation on its own clock Documentation versions and API versions are different lifecycles, and treating them as one causes two familiar problems. If the docs can only change when the API changes, typos and missing explanations wait for a release. If the docs change freely while consumers are still on an older contract, the page a consumer reads describes an API they are not calling. The arrangement that solves both is a documentation version with its own draft and published states, which carries a pinned reference to a contract version. You correct prose in a draft as often as you like, you publish when it is ready, and a reader on the older API can still reach the documentation that matches it. The [running several versions](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/) chapter of the versioning guide covers what that costs on the API side. ## Let the diff write the changelog Once the documentation is bound to contract versions, the changelog stops being a memory exercise. Comparing the version you were pinned to with the one you are moving to produces every added endpoint, every removed field and every type change. Every new enum value comes with it, already classified as breaking or additive. That is the half people forget, and it is the half a machine never forgets. What the diff cannot see is a change of meaning behind an unchanged shape, so a tightened validation rule or a different reason for the same error still needs a sentence from a person. Generating the mechanical half is what leaves time for that sentence. ## Deprecation belongs in the docs, not only in the headers A deprecated field that is marked in the contract and not visible in the documentation is deprecated to machines only. The documentation version of a deprecation needs the same three things the API version needs, meaning what is going away, when it stops working, and what to use instead. Put it on the page for the affected endpoint rather than only in the changelog, because the reader who needs it is looking at the endpoint. The [deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) chapter covers the headers and the timeline. ## In Routebase A documentation version in Routebase carries pinned snapshots of published specification versions. Editing a specification afterwards does not change what your readers see, and when a newer version is published the reference shows an update banner with the version it could move to. _Screenshot: Each documentation version opens on an overview that says where it stands, what is waiting for a decision, and how much of the embedded reference actually carries a description._ Versions run through draft, review and live, with exactly one version live at a time and published versions locked so nobody edits what consumers are reading. Cloning a version to start the next one offers to pull the newest published specification versions into the clone, which keeps the snapshot update an explicit step. Changelog entries are generated from the comparison between two specification versions and edited before they go out. The [Documentation Versioning guide](https://docs.routebase.dev/doc-versioning/) covers the lifecycle, and the [Changelog guide](https://docs.routebase.dev/doc-changelog/) covers the generated entries. ## Frequently asked questions ### Why is API documentation always out of date? Because it is a copy. The API is defined in one place and described in another, so staying correct depends on somebody making the same change twice during the release where they are busiest. The structural half of that second edit can be derived from the contract, and once it is, the only writing left is the part that was never mechanical. ### Should API documentation be generated from OpenAPI? The reference should be, because every fact in it already exists in the contract and typing it a second time only creates a way for the two to disagree. The guides and the concept pages should not be, since no generator can explain why an endpoint exists or what a consumer is committing to by calling it. ### Should documentation follow the API automatically? Not without a step you control. A reference that regenerates on every contract change will happily publish an unreleased field to your consumers. The useful arrangement pins the documentation to a released version and tells you when a newer one exists. The update stays a decision, and the decision stays visible. ### How do documentation versions relate to API versions? They are separate lifecycles that reference each other. You can correct a sentence in the docs without touching the API, and you can release a patch of the API without rewriting a page. What ties them together is the reference, which is pinned to one released contract version, so a documentation version always states which API it describes. --- # Interactive API Documentation — Routebase > What a try-it playground needs to be useful, which servers and credentials it may carry, how code samples earn their place, and what must never appear. Canonical page: https://routebase.dev/guides/api-documentation/interactive-api-documentation/ Chapter 4 of 10 · API Documentation · Last reviewed 2026-09-27 by The Routebase Team. A reader who can send a request from the documentation page is a reader who stops reading and starts integrating. That is the whole argument for interactive documentation, and most of the work is making sure the request they send can succeed. ## What the reader is being saved from Without a playground the path from reading to trying has several steps. The reader copies a URL, opens another tool, retypes the parameters, works out which header carries the credential, and gets a 401 because they guessed the scheme. Every one of those steps is a place to give up, and none of them teaches anything about your API. A request builder that is filled from the contract removes all of them, which is why the feature earns its place even though it is the flashiest thing on the page. ## The playground only works if the request can succeed An interactive console pointed at a host that refuses every call is worse than no console, because the reader concludes your API is broken rather than that the demo is. Three things decide whether the first attempt can work. The reader needs a host that answers, which usually means a sandbox or a public environment rather than production. They need a credential, so either the page accepts one they already have or the environment permits anonymous reads. And they need the request to be complete, which means required headers are prefilled rather than left as an exercise. Where you cannot offer a reachable environment, point the playground at a mock of the same contract. A mocked response is honest as long as the page says so, and it still proves the shape. ## Choose the servers deliberately The list of hosts in your documentation is a security decision as much as a usability one. Publish the environments you want strangers to reach, and nothing else. Internal hostnames in a public portal are an invitation, and they tend to arrive there by accident, because a contract that was written for internal use carries them in its server list. Say what each host is for, since the difference between a sandbox that fakes payments and a production host that does not is the kind of thing a reader finds out the expensive way. The server list of a fictional orders API does both, since each host says what it is for and the internal one never reaches the published document. ```yaml servers: - url: https://sandbox.api.example.com/v1 description: Sandbox. Payments are simulated and no money moves. - url: https://api.example.com/v1 description: Production. Orders are real and cards are charged. # Left out of the public document on purpose # - url: https://orders.internal.example.net/v1 ``` ## Code samples are the part people take with them The playground proves a call works, while the code sample is what ends up in the reader's editor, so it is worth being deliberate about which languages you offer. Generated samples in several languages cost nothing to keep true, because they are derived from the same contract the reference is. Their weakness is that they show one call rather than a working integration, and they never show the retry, the pagination loop or the error branch. That is the job of a written guide, and the two work together rather than replacing each other. One decision that comes up here is whether to generate client libraries. Generated samples and generated SDKs are different commitments, since a published SDK is a package you now version, support and deprecate on its own timeline. ## Never publish a working credential Everything on a documentation page is public the moment the page is, including the parts you assume nobody reads. Keep literal secrets out of examples, out of environment configuration that gets published, and out of screenshots. Screenshots are the common failure, because a token is easy to miss in an image and trivial to read afterwards, and a published page lives on in caches long after you delete it. Where an example needs to show a credential, use a placeholder that is obviously a placeholder. A reader understands `YOUR_API_KEY` immediately, and nobody can use it. ## In Routebase The playground in a Routebase portal is a feature you switch on per portal, and the servers it offers are chosen explicitly rather than inherited. You tick the project environments whose name and base URL may be exposed, and only those two values ever leave the workspace. The variables and the auth configuration behind an environment stay where they are. _Screenshot: Switching the playground on reveals the environment list, and only the environments you tick are offered to readers as selectable servers._ If no environment is opted in, the portal falls back to the project environment that carries the role of feeding the public docs, and then to the servers declared in the specification itself. Code examples are generated per endpoint, and the languages shown on the portal are the ones selected in the documentation settings. The [Publishing guide](https://docs.routebase.dev/doc-publishing/) describes the feature toggles and how the base URLs are resolved at publish time. ## Frequently asked questions ### What is interactive API documentation? It is documentation where the reader can send a real request from the page instead of copying an example into another tool. The page carries a request builder that is filled from the contract, so the parameters, the body shape and the required headers are already correct. The reader then sees the actual response from the server they picked. ### Is an API playground worth it? It is worth it when the reader can reach a server that will answer them. A playground pointed at production with no credential turns every first attempt into a 401, which teaches the reader that the feature is broken. Give it a safe environment, or a mock, and it shortens the distance between reading and working code. ### Which base URL should the documentation show? The one a reader can actually call, which is usually a sandbox or a public environment rather than the internal host your team uses. If several are legitimate, let the reader pick and say what each one does. A reader who copies a sample against the wrong host debugs an authorization error that has nothing to do with their code. ### What should never appear in API documentation? Any working credential, any internal hostname that consumers are not meant to reach, and any example containing real customer data. Screenshots are the usual leak, because a token that is hard to spot in an image is trivial to read once the page is published and cached. --- # API Documentation for AI Agents — Routebase > What an agent can read from a documentation site, the llms.txt proposal, Markdown versions and content negotiation, and how to check what an agent receives. Canonical page: https://routebase.dev/guides/api-documentation/api-documentation-for-ai-agents/ Chapter 5 of 10 · API Documentation · Last reviewed 2026-10-06 by The Routebase Team. An agent reading your documentation is doing what a new developer does, with two differences. It cannot ask a colleague, and it will not scroll past a wall of navigation to find the sentence that matters. That makes this a formatting problem before it is anything else. ## What an agent actually receives When an assistant fetches a documentation page, it gets HTML. Inside that HTML the useful content is wrapped in navigation, a sidebar, a cookie banner and whatever the framework emitted. Converting that back to clean text is possible and lossy. Tables come out mangled, code blocks lose their language, and the parts that carried meaning visually lose it entirely. Every wasted token also costs context that the agent needed for your actual content. So the first thing an agent-friendly documentation site does is offer the content without the page around it. ## The llms.txt conventions The [llms.txt proposal](https://llmstxt.org/) covers both halves, and it is a proposal rather than a web standard, retrieved 2026-09-13. The first half is an index. A file at `/llms.txt` carries a short description of the site and a curated list of links, so an agent that lands on your root can see the shape of the documentation without crawling it. The file stays small on purpose, because it is meant to fit in a context window while the detail waits behind the links. The proposal fixes the order of the parts. An H1 is the only required section, a blockquote with a short summary follows it, and sections under H2 headings then list the links with optional notes. An index for a fictional orders API follows that order. ```txt # Orders API > REST API for placing, tracking and cancelling orders. All amounts are > in minor units of the currency named on the order. ## Guides - [Getting started](https://docs.example.com/getting-started.md): First authenticated call in five steps - [Authentication](https://docs.example.com/authentication.md): API keys and OAuth 2.0 client credentials ## API reference - [Create an order](https://docs.example.com/reference/create-order.md) - [Cancel an order](https://docs.example.com/reference/cancel-order.md): Only before shipping ## Optional - [Changelog](https://docs.example.com/changelog.md) ``` The proposal treats the section named Optional as the part an agent may skip when its context is short. The second half is a Markdown version of each page, served next to the HTML. The proposal suggests appending `.md` to the URL, or `index.md` where the URL has no filename. An agent that follows a link from the index then gets the content rather than the chrome. A single-file variant is common as well, where the whole site is concatenated into one Markdown document. It suits an agent that would otherwise fetch twenty pages one at a time. ## The same URL, in Markdown A `.md` link only helps an agent that knows the convention and finds the link. Most agents start from a URL they were given, and that URL points at the HTML page. HTTP already has a mechanism for this, called proactive content negotiation and defined in [RFC 9110, section 12](https://www.rfc-editor.org/rfc/rfc9110.html#name-content-negotiation). The client names the formats it accepts in the `Accept` header, and the server picks the representation that fits. A documentation site that honours `Accept: text/markdown` therefore serves the Markdown version on the normal page URL, so an agent never has to know where the twin lives. The llms.txt proposal doesn't cover this, while the Agent-Friendly Docs Spec checks it as part of Markdown availability. The difference is visible from a terminal, since the same address answers with a different content type depending on the header. ```bash curl -sI https://docs.example.com/authentication/ | grep -i content-type # content-type: text/html; charset=utf-8 curl -sI -H "Accept: text/markdown" https://docs.example.com/authentication/ | grep -i content-type # content-type: text/markdown; charset=utf-8 ``` Once one URL has two representations, every cache in between has to keep them apart. Both responses should therefore carry `Vary: Accept`, which tells a cache that the answer depends on that request header, as [section 12.5.5](https://www.rfc-editor.org/rfc/rfc9110.html#name-vary) of the same RFC describes. If either response leaves it out, a shared cache can hand the HTML to an agent or the Markdown to a browser. ## Lead every page back to the index An agent that arrives on a single page has no reason to look for `/llms.txt` unless the page tells it to. A short sentence at the very top does that job, saying that the site can be read as Markdown and where the index lives. In the HTML it is hidden visually and from screen readers, and in the Markdown version it stands right under the title. Links inside the Markdown need the same care. A root-relative link such as `/authentication/` works in a browser, because the browser knows the host. Once an agent has copied the Markdown into a prompt or a file, the host is gone, so the Markdown version should carry absolute links. Position matters as well. An agent reads from the top, so a page whose content begins only after a long navigation or a sidebar spends part of the agent's context before it says anything useful. ## Generated reference pages have to be text This is where documentation platforms usually fall down, and it is worth checking on your own site. Written pages are easy, because they were Markdown before they were HTML. Generated endpoint pages are not, since they are often assembled from a schema at render time into a component tree that has no text representation at all. The result is a site where the guides are readable and the reference, which is the part an agent needs most, is a blank. A generated endpoint page that serves properly needs its path, its method, its parameters, its bodies and its errors written out as text. Schema references have to be resolved rather than left as pointers an agent would follow and reassemble. ## Robots and discovery An agent that has not been told where your index lives has to guess, and `robots.txt` is the file it already reads. Point it at your sitemap and at your `llms.txt`, which costs one line each. The llms.txt proposal also describes link relations that let a page advertise its own Markdown twin, using `rel="alternate"` with the Markdown media type. ## Check what an agent receives The [Agent-Friendly Docs Spec](https://agentdocsspec.com/spec/web/) collects these points into checks you can run against your own site. It is published under CC BY 4.0, and its companion tool [afdocs](https://afdocs.dev) runs 28 checks in seven categories, from the index and the Markdown versions to page size, redirects and bot protection. ```bash npx afdocs check https://docs.example.com --format scorecard ``` The tool samples a set of pages on every run, so two runs can land on different pages and report different findings. Run it more than once before you read a single result as the state of the whole site, and look at the individual checks rather than only at the score. ## The writing still decides the outcome Formatting gets the content to the agent. It does not make the content good. Everything in [how to write API reference documentation](https://routebase.dev/guides/api-documentation/how-to-write-api-documentation/) applies twice over here, because an agent has no intuition to fall back on. A summary that restates the endpoint name leaves it choosing between two operations that look identical, and an enum without meanings leaves it guessing what a status value implies. ## Reading is only half of it Everything above assumes the agent is a consumer of your documentation. The other case is an agent that maintains it. An assistant that can read the content tree, write a page, and publish a version is doing the same job a technical writer does, under the same permissions and with the same review step. That is worth setting up carefully rather than quickly, since documentation is a publishing surface and an agent with write access to it is publishing on your behalf. ## In Routebase Every portal build in Routebase emits the machine-readable outputs alongside the HTML, and they are not a switch you turn on. A build that fails to produce them fails. The product page for [agent-ready APIs](https://routebase.dev/agent-ready-apis/) puts these files next to the descriptions and errors an agent reads first. There is an index at `/llms.txt`, a single-document version of the whole portal at `/llms-full.txt`, and a Markdown twin at `{slug}/index.md` for every page. Reference pages emit generated Markdown covering the path, the method, the parameters and both bodies with schema references resolved, so an endpoint page is readable as text rather than only as a rendered widget. The `robots.txt` of the portal points at the sitemap and at the index. Every portal also answers `Accept: text/markdown` on the URLs of its content pages, so an agent gets the Markdown version without knowing that the twin exists. Each page opens with a sentence that points agents at the index, and the Markdown versions use absolute links throughout. Portals last built before October 5, 2026 pick up the sentence and the absolute links with their next build. Our own documentation scored 100 out of 100 on the Agent-Friendly Docs Scorecard in a run with afdocs on October 6, 2026. You can run the same scorecard on any of your portals from the Agent Readiness card in the portal settings. It shows the score and every check that did not pass, together with what to change, and an agent can start it over the Routebase MCP server. Our own product documentation runs on this, so the files are open to check rather than to take on trust. The [index](https://docs.routebase.dev/llms.txt), the [full document](https://docs.routebase.dev/llms-full.txt) and the [Markdown twin of any page](https://docs.routebase.dev/doc-overview/index.md) all answer right now. Readers get the same thing through the page actions menu, which offers the page as Markdown, the OpenAPI document as a download, and a hand-off into an assistant. Beyond that, the documentation module is reachable over the Routebase MCP server, so an agent can read the content tree, write pages into a draft version and publish it under the permissions its key carries. The [Publishing guide](https://docs.routebase.dev/doc-publishing/) documents the emitted files, and the [Documentation Overview](https://docs.routebase.dev/doc-overview/) covers the agent side. ## Frequently asked questions ### What is llms.txt? It is a proposed file at the root of a site that gives an agent a short description and a curated list of links to clean Markdown versions of the pages that matter. The idea is that the file stays small enough to fit in a context window while the detail waits behind the links. It is a proposal rather than a web standard, and it is currently at v2 according to llmstxt.org, retrieved 2026-09-13. ### How do I make my API documentation readable by AI agents? Serve a Markdown version of every page next to its HTML, keep an index at /llms.txt that points at those versions, and serve the Markdown version on the normal page URL whenever a request asks for text/markdown. Then make sure your generated endpoint pages are text rather than a component tree that only renders in a browser. After that the useful work is the same work that helps humans, which is descriptions that say what an operation means rather than restating its name. ### How can I check whether my documentation is readable by AI agents? Run the checks of the Agent-Friendly Docs Spec against your site with its companion tool afdocs. The tool samples pages and reports on the index, the Markdown versions, page size, redirects and bot protection, and it rates the result with a score. Because each run samples different pages, run it more than once before you treat one result as the state of the whole site. ### Is an OpenAPI file enough for an agent? It is enough to construct a syntactically valid call and not enough to choose the right one. The contract carries shapes, while the reason an endpoint exists, the order operations go in and the meaning of a status value live in the prose around it. An agent that only has the schema guesses at exactly the points where a new developer would guess. ### Does publishing for agents hurt the documentation for people? No, because the two overlap almost entirely. Clean structure, complete examples and descriptions that explain rather than repeat are what both audiences need. The only agent-specific work is serving the content in a format that does not have to be scraped out of a page. --- # Publishing and Hosting API Documentation — Routebase > Where documentation lives, subdomain against your own domain, who may read it, how to take a version back, and the settings that decide how it is found. Canonical page: https://routebase.dev/guides/api-documentation/publishing-and-hosting-api-documentation/ Chapter 6 of 10 · API Documentation · Last reviewed 2026-09-27 by The Routebase Team. Documentation that is not reachable is not documentation. This chapter is about the step between having the content and having a site your readers can open. ## Reachability is the first requirement The reader you care about most has not signed up yet. They are deciding whether your API can do the thing they need, and they are doing it from a search result. That rules out a few common arrangements. Documentation behind the product login excludes exactly that reader. Documentation in a wiki that requires an account does the same. Documentation in a repository is readable but arrives without search, without navigation and without a version switcher, so it works for contributors and not for consumers. ## Subdomain or subfolder Two addresses are conventional, and both are defensible. A subdomain such as `docs.example.com` is what most teams use. The documentation is usually a separate build with its own deploy cadence, and a subdomain keeps that separation clean. A subfolder such as `example.com/docs` keeps everything on one host, which concentrates the search authority your content earns instead of splitting it. The cost is a proxy in front of two systems and a rewrite rule somebody has to maintain. What matters more than the choice is that the address is yours. A documentation site on a vendor's domain sends the ranking and the links you earn to that vendor, and moving later costs you both. ## Your own domain means DNS and a certificate Serving on your own domain is a short sequence that people get wrong in the same three places. You add a record pointing your subdomain at the host, you prove you own the domain, usually with a second record, and then a certificate is issued for it. DNS propagation takes minutes rather than seconds, so a verification that fails on the first attempt is usually not a mistake. The two records for a fictional `docs.example.com` look like this in a zone file, with the target host and the token both supplied by whoever hosts the documentation. ```txt docs.example.com. 3600 IN CNAME example-docs.hosting-provider.example. _verify.docs.example.com. 3600 IN TXT "token-issued-by-the-host" ``` The part worth checking afterwards is monitoring. A certificate that is not renewed takes your documentation offline with a browser warning, which is the worst possible failure for a page whose job is establishing trust. ## Internal and public are different audiences Plenty of documentation is written for readers inside the company, and it stays useful only if it can say things a public page cannot. That makes the boundary worth enforcing rather than remembering. Internal pages name internal hosts, describe unreleased work and sometimes explain why a design is the way it is. Publishing one of those by accident is not a formatting problem. The arrangement that holds is one where publishing is an explicit action and where the default state of new content is not public. You also want to see at a glance which versions are readable from outside. ## Be able to take it back Two different situations get confused here. Sometimes a single version has to stop being readable, for example because it went out early or because it describes an API that has been withdrawn. Sometimes the whole site has to go offline. The first is a visibility change and the second is a shutdown, and a platform that offers only deletion for either one leaves you rebuilding content to recover from a mistake. Check which one you have before you need it. ## Let the build tell you what happened A documentation site is a deployment, so it deserves the things you expect from a deployment. A record of what was built, when, from which version and with what result is what turns "the page is wrong" into an answer. A build log is what turns a failed publish into a fix. Without either, a stale portal looks identical to a portal that failed to build three days ago. ## The settings that decide whether you are found Two small things are easy to leave at their defaults and expensive to leave wrong. The first is the metadata, meaning the title and the description that search engines and link previews use, plus a share image. A documentation site is a landing page for every search that ends in your API, and an empty description is a wasted result. The second is scripts. Analytics and a support widget usually want a tag in the page, and a portal that offers no place for one leaves you choosing between measurement and a hosted site. ## In Routebase Publishing in Routebase runs as one guided flow rather than as three settings pages. The dialog shows the remaining steps for the version in front of you, moves it through review, locks the content, and deploys it to the portal. _Screenshot: Publishing runs as one flow from draft to a deployed portal, and each step names what it changes before it runs._ Every portal gets a subdomain under `docs.routebase.dev`, and a custom domain can be connected on top. The app shows the DNS records to create, verifies them, and issues the certificate, after which it keeps checking the domain health. Published versions carry an internal or public flag, so a version can be live for your team without being deployed to the portal, and a public one can be pulled back. Build history keeps every build with its status and its log, and the advanced settings carry the title, the description, the share image and custom head or body scripts. The [Publishing guide](https://docs.routebase.dev/doc-publishing/) covers the flow, and [Custom Domains](https://docs.routebase.dev/custom-domains/) covers the domain setup. ## Frequently asked questions ### Where should API documentation be hosted? On a host your readers can reach without an account, on a subdomain of the domain they already associate with you. A documentation site behind the same login as the product locks out the person who is evaluating whether to sign up. A site on a vendor domain hands the search ranking you earn to somebody else. ### Should docs be on a subdomain or a subfolder? A subdomain such as docs.example.com is the common arrangement because the documentation is usually a separate build with its own deployment. A subfolder consolidates search authority onto one host, which is the argument for it, at the cost of a reverse proxy in front of two systems. Both work, so pick the one your infrastructure will keep working in two years. ### How do internal and public API documentation differ? In who may read them rather than in how they are written. Internal documentation can name internal hosts and describe unreleased work, which is exactly why it must not be published by accident. The safest arrangement is one where publishing is a deliberate step and where the default state of a new version is not public. ### Can you unpublish API documentation? You should be able to, and it is worth checking before you need it. Taking a version back covers two different cases, one where a single version should stop being readable and one where the whole site should go offline. A platform that only offers deletion for either leaves you rebuilding to recover. --- # API Docs as Code — Routebase > Markdown in the repository against an editor in the portal, what each arrangement buys, what keeping both in step costs, and where the contract lives. Canonical page: https://routebase.dev/guides/api-documentation/api-docs-as-code/ Chapter 7 of 10 · API Documentation · Last reviewed 2026-09-27 by The Routebase Team. Documentation either lives where the code lives or where the writing happens, and almost every team eventually wants both. This chapter is about what each side is actually good at and what the bridge between them costs. ## Why put documentation in the repository The argument is proximity. A change to the API and the change to its documentation belong to the same pull request, so the second one is visible while the first is still being reviewed. That buys four things. Documentation changes get reviewed by the people who know whether they are true. They ship on the same branch as the code, so a feature behind a flag does not get documented early. They are versioned with the code, so the documentation for an old release is recoverable. And they are editable in whatever the author already uses. The cost is the audience. A support engineer who noticed that a page is wrong will not open a pull request to fix a sentence. A technical writer who has to learn a branching model before their first edit will write somewhere else. ## Why put documentation in an editor The argument on the other side is contribution. An editor with a preview lets anybody who knows the product fix a page, which is where most documentation improvements actually come from. It also handles the things plain files handle badly, meaning images, embedded diagrams, reusable snippets and a preview that matches what the reader will see. The cost is that nothing in the code review asks whether a page still holds. Documentation in an editor goes stale in exactly the way the [keeping it up to date](https://routebase.dev/guides/api-documentation/keeping-api-documentation-up-to-date/) chapter describes, because the prompt to change it is gone. ## What a bridge between the two costs Pulling pages into files and pushing them back is straightforward to describe and has three places where it gets interesting. **Identity.** Something has to decide which local file corresponds to which remote page. A slug is the usual answer, which means renaming a file moves a page rather than editing it, and a moved page breaks links that were published against the old address. **Concurrency.** Somebody may have edited a page in the editor since you pulled. A sync that overwrites their change quietly is worse than one that stops and tells you, so the version token that detects it matters more than the convenience of a force flag. **Deletion.** A page that exists remotely with no local counterpart is ambiguous. It might be a page somebody added in the editor, or a file you deleted on purpose. Treating that case as a deletion means a mistyped directory can empty a documentation version in one command, which is why the safe default is to report it and change nothing. Four situations a push can meet show where the safe answer differs from the convenient one. | Local file | Remote page | Safe action | |---|---|---| | Changed since the pull | Unchanged since the pull | Push the change | | Changed since the pull | Edited by somebody since the pull | Stop and report the conflict | | Renamed from `auth.md` to `authentication.md` | Published at the old slug | Move the page and report the old address that now breaks | | Missing | Exists | Report it and change nothing | ## Where the contract itself lives The same question applies to the OpenAPI document, and the answer follows how your team works rather than a principle. A code-first team generates the contract from annotations, so it belongs in the repository where those annotations are. A design-first team writes the contract before the implementation, so it belongs in the tool where that design happens and is published from there. The arrangement to avoid is the third location, where the contract sits in a place neither the implementers nor the designers open. ## In Routebase Routebase supports both directions, and the CLI is the repository side of it. `routebase docs pull` writes a documentation version into a folder of Markdown files with YAML frontmatter, and `routebase docs push` writes local changes back. ```bash routebase docs pull --project --dir docs routebase docs push --project --dir docs --dry-run ``` The three hard parts above are settled explicitly. Pages are matched by slug within their parent folder. The frontmatter carries a concurrency token from the moment you pulled, so a page edited in the app is rejected rather than overwritten. And push never deletes, because a `--dir` pointed one level too deep would otherwise clear a version in one command. The dry run prints the whole diff without writing anything, which is the cheapest way to catch a rename before it becomes a moved page. Meanwhile the Doc Hub in the app stays usable, because the two are views of the same pages rather than competing copies. Generated API references are skipped by the pull, since they come from your specifications and there is no Markdown to edit. Our own product documentation runs this way. The pages live as Markdown next to the code, a merge to the main branch pushes them into the portal's draft version, and publishing stays a separate step that somebody triggers. The [Docs as Code guide](https://docs.routebase.dev/docs-as-code/) covers the commands, the frontmatter and the conflict behaviour in full. ## Frequently asked questions ### What does docs as code mean? It means treating documentation like source code. The pages are plain text files in the repository, changes arrive as pull requests, review happens in the same place code review happens, and a merge deploys them. The point is not the file format but the workflow, since a documentation change that goes through review alongside the code change it describes is far harder to forget. ### Is docs as code better than a documentation editor? They fail in different places. A repository workflow keeps documentation close to the change that made it necessary and locks out anybody who does not work in git. An editor lets the whole team contribute and drifts from the code because nothing in the pull request asks for it. Which one costs you more depends on who writes your documentation. ### Can you use both a repository and a portal editor? Yes, and the question to settle first is which side wins a conflict. Pulling pages into files, editing them and pushing them back works as long as edits made in the portal in the meantime are detected rather than overwritten. Silently discarding a colleague's change is worse than a failed command. ### Where should the OpenAPI file live? Wherever the change to it happens at the same moment as the change to the API. For a code-first team that is the repository, and for a design-first team it is the design tool that publishes versions. What is worth avoiding is the arrangement where the contract lives in a third place that neither side updates. --- # Measuring API Documentation — Routebase > The signals that show whether documentation works, why failed searches are your best backlog, how to read reader feedback, and which numbers to ignore. Canonical page: https://routebase.dev/guides/api-documentation/measuring-api-documentation/ Chapter 8 of 10 · API Documentation · Last reviewed 2026-09-27 by The Routebase Team. Documentation is unusual among product surfaces because success is almost invisible. A reader who found what they needed leaves without a trace, so most of what you can measure is people struggling. That is fine, as long as you measure the struggling deliberately. ## Failed searches are the best list you will get Your documentation search records what readers expected to find. The subset that returned nothing is the most actionable list in the whole toolbox. Each entry is a reader who believed something should exist, written in their vocabulary rather than yours. That makes the list useful twice, once as a backlog of missing pages and once as a glossary. A term that readers type repeatedly and your pages never use is a naming problem you can fix in an afternoon. Three entries from the failed searches of a fictional orders API show the three kinds of fix the list produces. | Search with no result | What the reader was looking for | Fix | |---|---|---| | `refund` | The page exists and is called Reversals | Use the reader's word in the title and the text | | `webhook retry` | Retry behaviour is not documented anywhere | Write the missing page | | `sandbox key` | The answer sits in the authentication page under another heading | Add the term to that section so search finds it | Read it weekly rather than quarterly. The terms are seasonal, and the ones that follow a release are telling you something about that release. ## Feedback is the only per-page signal Analytics tell you which pages are visited. They cannot tell you whether the visit worked, and a rating on the page can. Keep the ask small, because a thumbs up or down with an optional comment is something a reader will actually do. The comments are where the value is, since they name the specific missing thing. The failure mode is collecting them for a year and never opening the list, which turns a measurement into decoration. One caution about reading the results. Negative feedback clusters on the hardest pages rather than the worst ones, so an authentication page with a poor rating may be doing a good job on a genuinely difficult subject. Compare a page against its own history rather than against the pages next to it. ## Support tickets are documentation bugs Every question your team answers more than twice is a page that did not do its job. The useful habit is cheap. When somebody answers a question, they note which page should have contained the answer. After a month you have a ranked list of documentation defects, ranked by how much time they cost. This is also the signal that catches the failure the others miss, which is documentation that is present, correct and unfindable. ## The numbers that mislead Three metrics get reported often and decide very little. **Page views** measure traffic and interest. A high-traffic page is worth keeping correct and tells you nothing about whether it works. **Time on page** is ambiguous in both directions, because a long visit can mean thorough or lost. **Coverage percentages** are a floor rather than a target. Knowing that every endpoint carries a description is worth having, since a missing description is a certain defect. It does not tell you whether the descriptions are any good, and a team that optimises the number will get sentences that repeat the endpoint name. ## Measure the first call If you only instrument one thing, instrument the path from landing on the documentation to a successful first request. That is the moment your API is won or lost, and it is measurable through your own API rather than through the documentation site. It is also the number that moves when the Getting Started page actually improves. ## In Routebase A published portal reports page views, unique visitors and search behaviour, including the search terms that returned no results, which is the content-gap list described above. The feedback dashboard sits next to it and groups pages by how readers rated them. _Screenshot: Reader feedback arrives per page with the comment attached, which turns a rating into a specific thing to fix._ The version overview adds endpoint coverage for the embedded reference, meaning how many of the endpoints in it carry a description, so a missing one is visible before a reader finds it. Feedback can be switched off per portal if you would rather not collect it. The [Publishing guide](https://docs.routebase.dev/doc-publishing/) covers the analytics and feedback panels. ## Frequently asked questions ### How do you measure documentation quality? By the questions your documentation failed to answer rather than by how much of it people read. Searches that returned nothing name the page you have not written, negative feedback on a page names the section that is unclear, and repeated support questions name both. Page views tell you what is popular, which is rarely the same as what is working. ### What are content gaps in documentation? They are search terms that readers typed into your documentation and that returned no results. Each one is a reader who expected something to exist and did not find it, expressed in their own vocabulary rather than yours. That also makes the list a good source of the words your pages should use. ### Should documentation pages have feedback buttons? Yes, as long as somebody reads the results. A thumbs up or down with an optional comment costs a reader almost nothing and produces the one signal that is attached to a specific page. The failure mode is collecting it for a year without looking, at which point it is a widget rather than a measurement. ### Is time on page a useful documentation metric? Rarely, because it is ambiguous in both directions. A long visit can mean the page was thorough or that the reader could not find the sentence they needed. Treat it as a prompt to look at a page rather than as a verdict on it, and reach for the signals that carry an explicit question instead. --- # API Documentation Structure and Navigation — Routebase > Trees against flat lists, how readers actually find a page, what a version switcher has to do, and branding that supports the content instead of competing. Canonical page: https://routebase.dev/guides/api-documentation/api-documentation-structure-and-navigation/ Chapter 9 of 10 · API Documentation · Last reviewed 2026-09-27 by The Routebase Team. Readers reach a documentation page in one of three ways. They search, they follow a link from an error message or a colleague, or they work through a guide in order. A structure that only serves one of those makes the other two harder than they need to be. ## Two halves that behave differently The written guides and the generated reference want different navigation, which is the first structural decision. Guides have a reading order. Somebody new to your API should be able to start at the top and work down, so the order carries meaning and the page count stays small enough to see. The reference has no order. Nobody reads it front to back, and every entry is a destination arrived at from outside. What it needs is precise addresses and reliable search rather than a sequence. Putting both under one undifferentiated tree gives you a guide section buried under a hundred endpoints, or an endpoint list that pretends to be a curriculum. ## How to split the reference Once the reference is its own half, one decision remains, which is how much goes on a page. **One page per endpoint** gives every operation an address. That is what makes a support answer linkable and what makes a search result land on the exact thing. It is the right default for anything beyond a handful of operations. **One page per group** puts a whole resource on one page, which suits a small API where seeing everything about orders at once is genuinely helpful. **One page for everything** is convenient early because the browser's own search works across the whole contract. It stops being convenient at about the point the page takes a second to render. ## Navigation, search and the page itself Three mechanisms carry a reader, and they cover different failures. Navigation serves the reader who is browsing and wants to know what exists. Search serves the reader who knows what they want and uses their own words for it, which is why [failed searches](https://routebase.dev/guides/api-documentation/measuring-api-documentation/) are worth reading. A table of contents on the page serves the reader who has arrived at the right page and now has to find one paragraph in it, which matters most for long reference pages. Breadcrumbs are the quiet fourth one. A reader who arrived from a search result has no idea where they are. One line of context above the title fixes that. ## Version switching is part of navigation As soon as more than one version of your API is in use, the reader's first question is which one they are looking at. The switcher has to be visible rather than tucked away, the current version has to be obvious without opening it, and older versions have to remain reachable at stable addresses. Links to a documentation page live in tickets and internal wikis for years, and a version switch that breaks them trades one problem for a worse one. The address plan of a fictional orders API shows the decisions of this chapter together, with the guides in reading order, one page per endpoint and every version at a stable address. ```txt /guides/getting-started/ # read in order, top to bottom /guides/authentication/ /guides/handling-errors/ /reference/v2/orders/create-order/ # one address per operation /reference/v2/orders/cancel-order/ /reference/v1/orders/create-order/ # older version, same pattern, still reachable ``` ## Branding that stays out of the way A documentation portal should look like yours, and the return on that stops quickly. Your logo, your colours and your typeface do the work of telling a reader whose API this is. Beyond that, decoration competes with content that the reader is already concentrating on. Two things are worth more than any visual flourish, meaning a dark mode that is genuinely readable and code blocks with contrast high enough to read at a glance. If a reader has to think about the interface, the interface has taken attention away from the API. ## In Routebase Portal appearance is edited in a theme editor with a live preview. The layout and colour decisions are then made against the rendered portal rather than against a form. _Screenshot: The theme editor renders the portal while you configure it, so navigation, typography and colour are judged on the page a reader will see._ Structurally, written pages and folders sit in one content tree. A root-level folder can be promoted to a section, which becomes a top-level tab in the published portal. That is how the guides and the reference end up as separate areas rather than as one long list. Each embedded specification can be rendered per endpoint, per folder or on a single page, and the reference can follow the specification's own folders or a flat list. Search, the table of contents and the version switcher are portal features you switch on per portal. The switcher carries a limit for how many versions stay browsable. The [Branding guide](https://docs.routebase.dev/doc-branding/) covers themes and layout, and the [Documentation Overview](https://docs.routebase.dev/doc-overview/) covers the tree and sections. ## Frequently asked questions ### How should API documentation be structured? Separate the written guides from the generated reference at the top level, because they are browsed in completely different ways. Readers move through guides in a rough order and jump straight into the reference from a search or a link, so mixing the two produces a navigation tree where neither behaviour works well. ### Should the API reference be one page per endpoint or one page per group? One page per endpoint suits large APIs, since each endpoint gets its own address that a search result and a support answer can link to. One page per tag suits small APIs, where a reader can see a whole resource at once. A single page for everything is easy to search in the browser and becomes unusable once the contract grows. ### Does documentation need a version switcher? It does as soon as consumers are still on an older contract, which is almost immediately for a public API. Without one, the page a reader arrives at describes the API you are shipping rather than the API they are calling, and the mismatch is invisible to them. ### How much branding belongs on a documentation portal? Enough that a reader recognises whose API they are reading, which is your logo, your colours and your typeface. Beyond that, branding competes with the content, and a documentation page is read by somebody who is already trying to concentrate on something difficult. --- # What to Look For in API Documentation Tools — Routebase > Nine questions about where a documentation tool gets its reference, how its versions follow the API, and what readers and their agents can find. Canonical page: https://routebase.dev/guides/api-documentation/api-documentation-tools/ Chapter 10 of 10 · API Documentation · Last reviewed 2026-09-27 by The Routebase Team. Documentation tools look alike on the pet store sample. The difference shows the first time the contract changes, because the reference then follows, refuses to follow or asks you. The questions below test for that moment and for the rest of a portal's life after launch. ## Nine questions for a documentation tool ### 1. Where does the reference come from Ask whether the endpoint reference is generated from your contract, and then ask the sharper question, which is what happens when the contract changes. There are three behaviours and they age very differently. A tool that imports a contract once gives you a reference that starts drifting immediately. A tool that renders whatever the contract says right now will publish unreleased work to your consumers. A tool that pins to a released version and tells you a newer one exists keeps the update a decision. The [keeping it up to date](https://routebase.dev/guides/api-documentation/keeping-api-documentation-up-to-date/) chapter covers why the third behaviour is the one to look for. ### 2. Are documentation versions independent of API versions Two failures come from getting this wrong, and most tools have exactly one of them. If documentation can only change when the API does, a typo waits for a release. If documentation always shows the newest content, a consumer still on an older contract reads a page that describes an API they are not calling. Ask whether you can publish a documentation change without an API release, and whether a reader can reach the documentation for the version they are on. ### 3. Who is allowed to edit a page This decides where your documentation improvements come from, and the answer is rarely the one on the pricing page. If editing requires a pull request, your contributors are the people who already write code, and a support engineer who spotted a wrong sentence will not be one of them. If editing only happens in a browser editor, the change that a code review would have prompted never gets prompted. The arrangement worth asking for is both, which means an editor for the people who write prose and a round trip to files for the people who work in a repository. The [docs as code](https://routebase.dev/guides/api-documentation/api-docs-as-code/) chapter covers what that bridge costs. ### 4. What can a reader's agent read More of your readers now arrive with an assistant in the loop, and this criterion is cheap to check and rarely answered on a feature page. Fetch the tool's own documentation site and look for an index at `/llms.txt` and a Markdown version of a page. Then check the part that usually fails, which is whether the generated endpoint pages are available as text or only as a rendered widget. A site where the guides are readable and the reference is a blank has solved the easy half. ### 5. Where does it live, and is the address yours Ask three things about hosting. Can you serve on your own domain, is the certificate handled for you, and what happens to that domain if your plan changes. The address matters beyond appearance. Every link and every search result your documentation earns accrues to the host it is on, so documentation on a vendor domain is an asset you are building for somebody else. ### 6. Can you control who reads it Most teams need both an internal and a public audience eventually, sometimes for the same API. Ask whether visibility is a property of a version rather than of the whole site, whether a new version is private by default, and whether you can take a published version back without deleting it. The last one is the difference between a mistake and an incident. ### 7. Does it tell you what readers could not find A documentation tool that reports page views is reporting traffic. The signal you can act on is the search that returned nothing, followed by feedback attached to a specific page. Ask whether failed searches are recorded and exposed, because that list is the closest thing to a backlog that writes itself. The [measuring documentation](https://routebase.dev/guides/api-documentation/measuring-api-documentation/) chapter covers what to do with it. ### 8. What comes out if you leave Ask what the export contains, in what format, and whether it round-trips. The weak version of this promise is a dump you cannot import anywhere. The useful version is your pages as Markdown with their structure intact, plus your contract in its original form. Ask while you still have leverage, which is before you sign. ### 9. What exactly is metered Two questions catch most of the surprises, and both are about the meter rather than the headline price. Ask what is counted, since seats, projects, hosted sites, page views and custom domains are all used as meters and they reward very different behaviour. Then ask what happens when you cross the line, because a plan that stops serving your documentation is a different risk from one that sends an invoice. ## A scorecard for documentation tools | Criterion | Question | Weight it if | |---|---|---| | Reference source | Generated from the contract, and pinned to a released version | Your contract changes more than rarely | | Version independence | Can docs change without an API release, and the reverse | You have external consumers | | Contribution model | Editor for writers, round trip to files for engineers | More than one kind of person writes | | Agent readability | Index, Markdown per page, reference pages as text | Your readers arrive with assistants | | Hosting | Your own domain, handled certificate | The documentation is public | | Access control | Visibility per version, private by default, retractable | You document anything internal | | Reader signals | Failed searches and per-page feedback | You intend to improve the docs | | Export | Pages and contract, in a format that round-trips | Always | | Pricing shape | What is metered, and what happens at the limit | Your traffic or your team will grow | ## Publish one real API, then change the contract A documentation tool proves itself over a release cycle rather than on launch day, so the test has to include one. **Publish one real API.** Not the pet store sample. Take an API with real authentication, a deprecated field and at least one endpoint whose behaviour needs explaining, and get it published in each candidate. **Then change the contract.** Add a required field, deprecate something, release it, and watch what the tool does. Whether the reference follows silently, refuses to follow, or asks you is the single behaviour that determines how true your documentation will be in six months. ## In Routebase Routebase was built around the first two criteria. The reference is a pinned snapshot of a published specification version, so it never shows unreleased work and never drifts quietly, and an update banner tells you when a newer release is available. Documentation versions run on their own lifecycle with one live at a time, so prose can be corrected without an API release and a reader on an older contract still has a version that matches. The rest sits in the same workspace. Pages are written in an editor and can be pulled into Markdown files and pushed back through the CLI, so both kinds of contributor have a way in. Every build emits the machine-readable files an agent reads, including generated Markdown for endpoint pages. Portals run on a Routebase subdomain or on your own domain with an issued certificate. Published versions carry an internal or public flag and can be retracted, and the analytics panel reports the searches that returned nothing. Specifications export as OpenAPI 3.0, 3.1 or 3.2 in YAML or JSON, and documentation pages come out as Markdown. If you are weighing Routebase against a specific tool, the comparison pages carry the row-by-row detail, including the rows where we do not win. Start with [ReadMe](https://routebase.dev/readme-alternative/), [Mintlify](https://routebase.dev/mintlify-alternative/), [Swagger](https://routebase.dev/swagger-alternative/) or [Stoplight](https://routebase.dev/stoplight-alternative/), or see what the portal covers on the [API documentation page](https://routebase.dev/api-documentation/). ## Frequently asked questions ### What should you look for in an API documentation tool? Ask where the reference comes from, whether documentation versions are independent of contract versions, who on your team is able to edit a page, and what a reader's agent can read. Then ask what comes out if you leave. Those decide whether the tool still fits after the first release, while the features that demo well tend to matter only on the first afternoon. ### Do I need a documentation tool if I have OpenAPI? A contract gives you a reference, and a reference is one of the three layers readers need. What it does not give you is the guides, the concept pages, the hosting, the search and the version switcher, which is the work a documentation tool is actually doing. A renderer pointed at a file covers the first part of that and none of the rest. ### Should documentation live in the same tool as the API design? It removes the step where somebody exports a contract and imports it somewhere else, which is the step that gets skipped under deadline. The trade-off is that you are choosing one vendor for two jobs, so it is worth checking that the documentation half would stand on its own if you only needed that. ### How do you compare documentation tools fairly? Publish one real API in each candidate, including the authentication and at least one deprecated field, and then change the contract and watch what the tool does. A launch looks much the same in every tool, while a release cycle shows you which one will still be telling the truth in six months. --- # API Testing: A Complete Guide — Routebase > What API testing is, which methods exist, and how they fit together into a strategy that catches breakage before your consumers do. Canonical page: https://routebase.dev/guides/api-testing/ Guide overview · 12 chapters · Last reviewed 2026-09-12 by The Routebase Team. An API test sends a request and checks the answer. That description of API testing is short enough to hide almost everything that makes the practice worth doing. The interesting question is never whether the request went through, because that part rarely surprises anyone. It is what you are willing to promise about the answer, and how you find out when that promise quietly stops being true. This guide covers the methods, the strategy that ties them together, and how to run each one. Every chapter is written to stand on its own, so you can read the one you need and follow the links out from there. ## API testing is not UI testing without a browser The difference is not only speed, although a suite that finishes in under a second per case changes how often people bother to run it. The bigger difference is what the test can actually see when something goes wrong. A UI test observes rendered output, so when it fails you know a page broke and you start bisecting to find out where. An API test observes the interface itself, which means a failure names the endpoint, the status code, the field and the value that was wrong. There is no rendering layer to blame, and no timing flake from an animation that had not finished when the assertion ran. That precision comes with a cost, and it is better stated early. An API test only checks what you asked it to check, whereas a person looking at a screen notices things nobody thought to assert. Every method in this guide is a different answer to the question of how to ask for more without making the suite fragile. ## The specification is the oracle Every test needs an oracle, meaning the thing that decides whether an answer is correct. Most functional tests carry their oracle inline, because the expected status code and the expected field value are written straight into the test. That works well enough, and it also means the test knows only what its author knew on the day they wrote it. A specification moves the oracle outside the test. When a case is linked to a documented endpoint, the response is validated against the schema that endpoint promises, so a field that changed type fails the test without anyone editing the test. The specification becomes the thing you maintain, and the tests follow it. This is the single highest-leverage decision in an API testing strategy, and it is why [contract testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) gets a whole chapter to itself. Everything else in this guide gets sharper once an oracle outside the test exists. ## The map of methods Seven methods cover the ground between a single request and a live production API, and each one finds a class of defect that the others cannot see. | Method | What it proves | What it cannot see | |---|---|---| | [Functional](https://routebase.dev/guides/api-testing/functional-api-tests/) | One request returns the expected status, headers and values | Whether the shape still matches what you documented | | [Contract](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) | The response still matches the specification | Whether the values are correct for this business case | | [Workflow](https://routebase.dev/guides/api-testing/api-integration-testing/) | A multi-step flow holds together and passes state correctly | Anything a single call already covers | | [Data-driven](https://routebase.dev/guides/api-testing/api-test-data/) | The same logic behaves across many inputs and edge values | Interactions between separate calls | | [Performance](https://routebase.dev/guides/api-testing/api-performance-testing/) | Latency and error rate hold up under concurrency | Correctness, because a fast wrong answer still passes | | [Security](https://routebase.dev/guides/api-testing/api-security-testing/) | Authorization and input handling resist abuse | Business logic flaws a scanner cannot recognise | | [Production monitoring](https://routebase.dev/guides/api-testing/api-monitoring-and-contract-drift/) | The deployed service still behaves after the release | Anything before the change reaches production | Two chapters sit alongside the methods, not inside them. [Test data](https://routebase.dev/guides/api-testing/api-test-data/) is what makes every method deterministic. [Environments, auth and secrets](https://routebase.dev/guides/api-testing/api-testing-environments/) is what lets one suite run against all of them. ## Effective testing is mostly about three decisions ### What you assert, and what you deliberately do not The most common way to end up with a suite nobody trusts is to assert too much. A full body comparison fails whenever anything changes, including the things you did not care about. People then start ignoring red runs. The opposite failure is asserting only the status code, which passes happily while the payload turns to nonsense. The useful middle is to assert the contract plus the handful of values this particular test exists to prove. Schema validation covers the shape of the response, while two or three targeted field assertions cover the behaviour. The chapter on [functional tests](https://routebase.dev/guides/api-testing/functional-api-tests/) works through the specifics of each assertion type. ### Where each test runs Tests are cheap in some places and expensive in others. A strategy is largely a routing decision. | Stage | What runs there | Why | |---|---|---| | Local, while developing | A handful of cases against a mock or a dev environment | Feedback in seconds, no shared state to corrupt | | Every pull request | Functional plus contract tests against a preview or staging environment | A regression caught here costs a rebase instead of a rollback | | Nightly or weekly | The full suite, load tests and the complete security profile | These need time, and nobody should wait for them in review | | Production, continuously | Read-only synthetic checks and contract validation | The only place that tells you the truth about the live service | The pull-request row is where the gate belongs, which [automating API tests in CI/CD](https://routebase.dev/guides/api-testing/automated-api-testing-in-ci-cd/) covers in detail. ### How tests stay deterministic A flaky test is worse than no test, because it trains the team to press rerun and stop investigating. Three causes account for most of it. All three have the same shape, which is shared mutable state. Tests that depend on data another test created will fail when the order changes. Tests that depend on data a human created will fail when someone cleans up the environment. Tests that assert on timestamps, generated identifiers or ordering that the API never promised will fail at random. The fix is to own your data per run, which [test data](https://routebase.dev/guides/api-testing/api-test-data/) explains through fixtures, seeds and snapshots. ## Drift is a permanent condition, not an incident Between two deploys the specification still promises one thing and the running service has quietly started returning another. Nothing is down, every uptime check is green, and the mismatch surfaces when a consumer breaks. That is something to plan for, not to react to. Contract tests catch it in the pipeline, and [production monitors](https://routebase.dev/guides/api-testing/api-monitoring-and-contract-drift/) catch it afterwards by validating live responses against the contract the environment is supposed to be serving. Together they turn a category of silent breakage into something with a first-seen date and an owner. ## In Routebase Routebase gives every one of these methods a home in one workspace, so a test case written for a pull request is the same object a scheduled run and a contract check use later. _Screenshot: The test runner holds suites and scenarios on the left, the cases of the open suite in the middle, and the results of a run on the right._ Test suites hold cases with declarative assertions, so there are no test scripts to maintain for the ordinary work. Cases chain into scenarios that pass extracted values downstream, and a suite runs once per row of a data set when you need many inputs. The same suite switches from functional to performance mode when you want a load profile instead of a single pass. Security scanning runs the OWASP API Security Top 10 from 2023 against the same environment, and monitors keep validating the live service against the published contract after the release. The CLI and the GitHub Action run any of it in a pipeline and exit non-zero when something fails. Start with the [Test Suites guide](https://docs.routebase.dev/test-suites/) in the product documentation, or read on for the method you need. If you want to see the whole thing running, the [API testing feature page](https://routebase.dev/api-testing/) has the short version. ## Frequently asked questions ### What is API testing? API testing exercises an interface directly over HTTP instead of driving a user interface. A test sends a request and then checks the answer, which covers the status code, the headers, the body, the shape of that body against the contract, and how long the response took. Because there is no browser in the way, the tests run in seconds, they say precisely which endpoint broke, and they can run against every environment from a laptop to a production monitor. ### What are the main types of API testing? Functional tests check that one request returns the right answer. Contract tests check that the answer still matches the specification. Workflow tests chain several calls into a business flow and pass values between them. Data-driven tests repeat one suite across many input rows. Performance tests measure behaviour under load. Security tests probe for authorization and input-handling flaws. Production monitoring keeps checking after the release. Each finds a different class of defect, so no single one replaces the others. ### Where should API tests run in the delivery pipeline? Fast functional and contract tests belong on every pull request against a preview or staging environment, because that is where a regression is cheapest to fix. Longer suites, load tests and the full security profile belong on a nightly or weekly schedule where they have time to be thorough. Production gets read-only synthetic checks and contract validation rather than a write-heavy suite. ### Do I need an OpenAPI specification to test an API? No. A test case is a plain HTTP request with assertions, so functional, workflow, data-driven and performance tests work against any API. A specification becomes necessary for contract testing, because a contract test needs a documented shape to validate against. Once a specification exists, it also generates suites, monitors and mock servers, which is why teams that start without one tend to add one later. ## Chapters in this guide 1. [Types of API Testing, and Where Each One Fits](https://routebase.dev/guides/api-testing/types-of-api-testing/index.md): Functional, contract, workflow, data-driven, performance, security and production tests, with what each one finds, what it misses, and where it belongs. 2. [Contract Testing vs. Integration Testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/index.md): What a contract test proves, what an integration test proves, why neither replaces the other, and how drift opens up between a spec and the running service. 3. [Functional API Tests: What to Assert](https://routebase.dev/guides/api-testing/functional-api-tests/index.md): How to choose assertions that catch real breakage without turning every unrelated change into a red run, plus negative cases, extraction and chaining. 4. [API Integration Testing With Scenarios](https://routebase.dev/guides/api-testing/api-integration-testing/index.md): Testing multi-step flows where each call depends on the last, covering state between steps, asynchronous work, conditional branches and idempotency. 5. [API Test Data and Data-Driven Runs](https://routebase.dev/guides/api-testing/api-test-data/index.md): How to make API tests deterministic, which means owning the data each run needs, cleaning up after it, and repeating one suite across many input rows. 6. [API Testing Environments, Auth and Secrets](https://routebase.dev/guides/api-testing/api-testing-environments/index.md): Run one suite against development, staging and production without editing it, guard the environments nobody may write to, and keep credentials out of tests. 7. [API Performance Testing: Load, Stress and Soak](https://routebase.dev/guides/api-testing/api-performance-testing/index.md): Load, stress and soak profiles, why the p95 beats the average, how to turn a latency budget into a pass or fail, and where a load test must never point. 8. [API Security Testing](https://routebase.dev/guides/api-testing/api-security-testing/index.md): How security tests fit into an API test suite, from authorization tests with two identities and fuzzing to the cadence of scans and where automation stops. 9. [Automated API Testing in CI/CD](https://routebase.dev/guides/api-testing/automated-api-testing-in-ci-cd/index.md): Where the gate belongs, why exit codes are a contract, how to make a failure readable in the pipeline, and how to fix flakiness before people learn to rerun. 10. [Testing APIs in Production](https://routebase.dev/guides/api-testing/api-monitoring-and-contract-drift/index.md): Why testing does not stop at the release, what scheduled checks and live contract validation add to a suite, and where the monitoring guide takes over. 11. [Testing an API With an AI Agent Over MCP](https://routebase.dev/guides/api-testing/testing-with-an-agent-over-mcp/index.md): What an agent can reliably derive from a specification, what it must not decide on its own, and why the permission model matters more than the model does. 12. [What to Look For in API Testing Tools](https://routebase.dev/guides/api-testing/api-testing-tools/index.md): Nine questions that separate a testing tool your pipeline can rely on from one that only demos well, from spec validation to CI exit codes. --- # Types of API Testing, and Where Each One Fits — Routebase > Functional, contract, workflow, data-driven, performance, security and production tests, with what each one finds, what it misses, and where it belongs. Canonical page: https://routebase.dev/guides/api-testing/types-of-api-testing/ Chapter 1 of 12 · API Testing · Last reviewed 2026-09-12 by The Routebase Team. Most articles about the types of API testing read like a taxonomy exercise with no reader in mind. This one is organised around a more useful question. What class of defect does each method catch, and what will it happily let through. If you only read one thing here, read the column that says what each method misses. Every method has such a gap, and those gaps are where production incidents come from. ## The seven methods at a glance | Method | Catches | Misses | Typical place | |---|---|---|---| | Functional | Wrong status, wrong values, missing headers, broken error paths | Shape changes nobody asserted on | Pull request | | Contract | Renamed fields, changed types, dropped required properties | Values that are wrong but well-formed | Pull request | | Workflow | State that does not carry between calls, broken multi-step flows | Anything one call already proves | Pull request or nightly | | Data-driven | Edge values, boundary conditions, per-input behaviour | Interactions between separate calls | Pull request or nightly | | Performance | Latency regressions, error rate under concurrency, resource limits | Correctness of any kind | Nightly or pre-release | | Security | Authorization gaps, injection surfaces, misconfiguration | Business-logic abuse a scanner cannot model | Nightly, plus a light pass per pull request | | Production monitoring | Real outages, contract drift after deploy, stale data | Anything before the release | Continuously | ## Functional tests A functional test sends one request and asserts on the answer that comes back. It is the method everything else builds on, and it is also the one most likely to be done badly. Done well, it asserts the status code, the two or three fields that carry the behaviour under test, and the response header that matters. Done badly, it either compares the whole body, which turns every unrelated change into a red run, or it asserts only that the status was 200, which passes while the payload degrades into nonsense. Functional tests are also where negative cases live. An API that returns the right thing for good input and something undefined for bad input is only half tested, so the 400, the 401, the 403 and the 404 deserve cases of their own. Read more in [functional tests](https://routebase.dev/guides/api-testing/functional-api-tests/). ## Contract tests A contract test validates the response against the specification instead of against an expectation written into the test. That single change moves the oracle outside the test, so a field that changed type fails without anyone touching the test file. The method needs a specification to exist, and that is the one prerequisite the other methods do not have. In exchange it catches the entire class of defect that functional tests structurally cannot see, because a functional test only knows about the fields its author named. Contract testing is often confused with integration testing, and the two answer different questions. [Contract testing vs. integration testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) works through the distinction and both sides of the consumer and provider relationship. ## Workflow and scenario tests Real APIs are used in sequences, and the sequence is where the interesting defects hide. A client registers, logs in, creates an order and then reads it back, and each step depends on something the previous step produced. A workflow test chains those calls and passes values between them, so it catches the defects that only appear in combination. A resource is created but cannot be read back, a token is issued but not accepted, or an identifier changes format between the create response and the read path. None of those show up when each endpoint is tested on its own. The cost is that workflow tests run slower and break more often than single-request tests, so use them for the flows that carry the business and not for everything you own. See [workflow and scenario tests](https://routebase.dev/guides/api-testing/api-integration-testing/). ## Data-driven tests Some questions are about inputs, not about the endpoint. Whether a price field accepts zero, whether an email validator rejects the awkward cases, or whether a search behaves at its page-size boundary. All of these are the same request repeated with different values. Writing one test per value produces a suite that nobody maintains. A data-driven run writes the case once and iterates over a table of rows instead, and the expected outcome can be a column too, so one case asserts different results for different inputs. Running one case across a table of rows is the cheapest way there is to raise coverage of edge cases. The mechanics are covered under [test data](https://routebase.dev/guides/api-testing/api-test-data/). ## Performance tests Performance testing answers a question correctness testing never asks. How does the API behave when many callers arrive at once. Three traffic profiles cover most of what a team needs to know. | Profile | What it does | What it answers | |---|---|---| | Load | Sustained traffic at expected volume | Does the service hold its latency budget on a normal day | | Stress | Traffic raised until something gives | Where the ceiling is, and how the service fails when it gets there | | Soak | Moderate traffic over a long period | Whether memory, connections or caches degrade over hours | The measurement that matters is the p95 and not the average, because the average hides the tail that users actually notice. A run that averages 120 ms with a p95 of 3 seconds is a bad run, and the average alone will not say so. See [performance testing](https://routebase.dev/guides/api-testing/api-performance-testing/). ## Security tests Security testing overlaps with functional testing at one point only, namely the authorization check. Everything else it does is different in kind, because it probes for behaviour nobody intended instead of behaviour someone specified. Automated scanning covers the mechanical categories well, and those categories are where most real breaches start. They are missing authorization on an object or a function, input handling that accepts what it should reject, misconfiguration, and information exposure. It cannot model your business rules, so a scanner will never notice that a refund endpoint lets a user refund somebody else's order if both users are legitimately allowed to call it. That gap is why authorization deserves hand-written negative tests alongside the scanner. [API security testing](https://routebase.dev/guides/api-testing/api-security-testing/) covers both halves. ## Production monitoring Every method above runs before or during a release, which means none of them watches the live service. Production monitoring is the only one that observes the thing your customers are actually using. Production monitoring does two jobs at once, and most teams only collect the first. Synthetic checks answer whether the service is up and how fast it is responding, and contract validation on those same checks answers whether the deployed service still matches the contract it is supposed to serve. The second job is the one most teams skip, and it is the one that catches drift. See [testing in production](https://routebase.dev/guides/api-testing/api-monitoring-and-contract-drift/) for monitors, drift events and alerting that people do not learn to ignore. ## Choosing what to build first If you are starting from nothing, build in this order, because each step makes the next one cheaper. 1. Functional tests for the happy path of every endpoint you own, generated from the specification where one exists. 2. Contract validation on those same cases, which costs almost nothing once the cases exist. 3. Negative cases for authorization and validation, because those are the failures that reach customers. 4. Workflow tests for the two or three flows that carry your revenue. 5. A CI gate, so all of the above runs without anyone remembering to. 6. Monitoring and drift detection on the deployed environment. 7. Performance and the full security profile on a schedule. Teams that invert this order tend to end up with an impressive load-test setup and no idea at all when a field quietly changed type. ## In Routebase The methods above are not separate tools in Routebase. A test case is one HTTP request with declarative assertions, and the method is decided by what you do with that case. _Screenshot: A finished run lists every case with its status, the status code the service returned and how long it took._ Link the case to a designed endpoint and it becomes a contract test, because a Schema Validation assertion checks the live response against the endpoint's documented schema. Add the case as a step in a scenario and it becomes part of a workflow, passing extracted values to later steps. Attach a data set to the suite and the same cases run once per row. Flip the runner from functional to performance mode and the same suite runs a load profile with iterations, threads and a per-case breakdown. Security scanning runs against the same environment through scan profiles, and monitors keep validating the deployed service afterwards. One request, written once, serving whichever method you need. The [Test Suites guide](https://docs.routebase.dev/test-suites/) covers cases, assertions and run modes in detail. ## Frequently asked questions ### How many types of API testing are there? Seven methods cover the practical ground. They are functional, contract, workflow, data-driven, performance, security and production monitoring. Longer lists usually split one of these into named variants, so load, stress and soak testing are three profiles of performance testing, not three separate methods. What matters is not the count but the coverage question, meaning whether every class of defect your API can produce has a method that would catch it. ### What is the difference between functional and contract API testing? A functional test carries its expectation inside the test, so it asserts that this endpoint returns this status and this value. A contract test validates the response against the published specification instead, so it fails when the shape of the answer changes even though nobody edited the test. Functional tests prove behaviour, contract tests prove the promise, and a serious suite runs both on the same request. ### Which API tests should run on every pull request? Run the fast, deterministic ones, meaning functional and contract tests against a preview or staging environment. They finish inside a normal review wait and they catch the regressions that are cheapest to fix before merge. Load tests, the full security profile and long soak runs belong on a nightly or weekly schedule, because a gate people wait ten minutes for is a gate somebody eventually switches off. --- # Contract Testing vs. Integration Testing — Routebase > What a contract test proves, what an integration test proves, why neither replaces the other, and how drift opens up between a spec and the running service. Canonical page: https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/ Chapter 2 of 12 · API Testing · Last reviewed 2026-09-27 by The Routebase Team. Both names get used loosely, and the looseness costs teams real coverage. A test suite described as "our contract tests" that only checks status codes is not doing contract testing at all. An integration suite that asserts on every byte of every response is doing a bad job of both. The distinction is simple once you name what each one is comparing against. ## What each test compares against A **contract test** compares a real response against a written specification. Its oracle lives outside the test, so the test itself contains almost no expectations. When the specification says the response has a required `id` of type string and an `amount` of type number, the test asserts exactly that, and it does so without anyone typing those field names. An **integration test** compares real behaviour against expected behaviour across component boundaries. Its oracle lives inside the test, because somebody decided what the correct answer is for this input in this system state. It exercises the service together with its database, its queue and whatever else it depends on. _Figure: The same change of one field type leaves a test with its own expectations green, and fails the test that validates against the published contract._ | | Contract test | Integration test | |---|---|---| | Oracle | The published specification | The expectation written into the test | | Fails when | The shape of the answer changes | The meaning of the answer is wrong | | Speed | One request, no state setup needed | Often needs data, ordering and cleanup | | Maintenance | Follows the specification automatically | Edited by hand whenever behaviour changes | | Blind to | Values that are wrong but well-formed | Shape changes nobody thought to assert on | ## The case each one cannot make Take an endpoint that returns an order total. ```json { "orderId": "ord_9f2", "total": 4200, "currency": "EUR" } ``` A contract test confirms that `orderId` is a string, `total` is a number and `currency` is present. It will pass if `total` becomes 42, or 420000, or the total of somebody else's order, because all three are numbers. An integration test confirms that the total is 4200 for this order, given the three line items the fixture created. It will pass if `total` quietly changes from a number to a string containing "4200", because the assertion coerced the value before comparing. It will also pass on a response that has grown several undocumented fields. Neither test is wrong. They are answering different questions, and a team that only runs one of them has a blind spot shaped exactly like the other. ## Consumer side and provider side Contract testing has two directions, and the vocabulary trips people up because the same words describe both. **Provider-side contract testing** asks whether the service still returns what its published specification promises. You run it against your own API, in a deployed environment, and it is the direction that concerns most teams most of the time. It protects every consumer at once, including the ones you have never met. **Consumer-side contract testing** asks whether a client still sends and expects what it claims to. A consumer records the requests it makes and the response shape it relies on, and the provider verifies that its service satisfies every recorded expectation. This direction shines when a small number of known consumers depend on an internal service, because it tells the provider precisely which changes would break whom. The two are complementary, not competing. Provider-side testing against the specification scales to unknown consumers, while consumer-side testing gives you a per-consumer impact answer for the ones you know about. ## Contract tests need a specification, and that is the point The prerequisite is real. Without a written contract there is nothing for a contract test to validate against, so a team with no specification cannot do contract testing no matter which tool they buy. This is often read as a barrier, and it is better understood as the actual work. Writing the specification forces the questions nobody had answered. Is that field optional, what does the error body look like, and which status code does the conflict case return. The tests are almost a side effect once those answers exist in a machine-readable form. If your API has no specification yet, generating one from the running service is a reasonable starting point, and it helps to know what you get. A generated specification describes what the service does today, including the accidents, so it makes an excellent baseline for drift detection and a poor statement of intent until somebody reviews it. ## Drift, and why code generation does not prevent it Drift is the gap between the contract you published and the responses your service actually returns. It rarely arrives as a decision. Someone adds a field for a new feature, someone else makes an optional field required in the database and the serializer starts omitting nulls, a library upgrade changes how dates are formatted. Every one of those ships green, because nothing in the pipeline was comparing the response against the document. Generated clients are frequently offered as the answer, and they solve a narrower problem than people assume. Generation guarantees that your client code matches the contract **at the moment of generation**. It says nothing about the running service, so a client generated from version 2.1 and a server that has quietly moved past 2.1 will compile perfectly and fail at runtime. The contract has to be checked against the live service, and that is the whole job of a contract test. It is also what turns a compatibility claim into a checked fact, which is why [backward compatible change](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/) leans on it. ## Where each one runs | Test | Where it belongs | Why | |---|---|---| | Contract, provider side | Every pull request, against a preview or staging environment | Fast, no data setup, catches shape breakage before merge | | Contract, continuous | Against the deployed environment, on a schedule | Catches drift introduced by anything the pipeline did not see | | Integration | Every pull request for the core flows, nightly for the long tail | Slower and state-dependent, so the fast ones go in the gate | A useful rule is that contract tests belong wherever the service is reachable, including production, because they read and do not write. Integration tests that create data belong in environments you are willing to have data in. ## A contract test against an unbuilt endpoint Design-first teams hit a specific annoyance here. Generate a suite from a fresh specification and the suite is red from its first run, and it stays red until the service catches up. People get used to red, and that is exactly when the first real failure gets missed. The two situations are machine-distinguishable, so a good runner distinguishes them. Nobody answering at all, whether through a refused connection, a timeout or a 404 on a path the contract says exists, means not implemented yet. An answer that arrives but does not match the schema means broken. Only the second one deserves red. ## In Routebase Link a test case to a designed endpoint and Routebase adds a Schema Validation assertion automatically, then validates every live response against that endpoint's documented response schema. A field that changed type, a required property that went missing or an undocumented shape all fail the run, even when the status code is still 200. _Screenshot: A case linked to a designed endpoint carries the method and the specification version, and an unlinked case carries nothing._ Linking also stores a snapshot of the endpoint's contract together with the version it came from. When the specification later moves, opening the case shows a banner naming what changed across path, method, request body and response schemas, and **Sync from Spec** brings the case forward. Drift never fails a run by itself, because it signals that the test and the documentation have parted ways, not that the service is broken. The **Import** button generates a whole suite from a specification, with assertions derived from each endpoint's contract. Cases whose endpoint is not implemented yet report as **Pending** in amber with their own counter, and pending never fails the run, so a fresh design-first suite is not red. The [API-first development](https://routebase.dev/api-first-development/) page puts that pending state next to the mock and the monitors that wait the same way. In the case list a linked case carries the method and the specification version it was linked against, while an unlinked case carries nothing. A suite that asserts plenty of status codes and validates few actual contracts is therefore visible at a glance. Details and the full drift workflow are in the [Contract Testing guide](https://docs.routebase.dev/contract-testing/). ## Frequently asked questions ### What is the difference between contract testing and integration testing? A contract test checks the shape of an interaction against a written specification, so it fails when a field is renamed, retyped or dropped. An integration test checks behaviour across real components, so it fails when the system produces the wrong answer even though the shape is perfect. Contract tests are fast and precise about form, integration tests are slower and precise about meaning, and a service that ships confidently runs both. ### Does contract testing replace integration testing? No, because the two fail for different reasons. A response can match its schema exactly and still contain the wrong total, the wrong currency or somebody else's order. A contract test will pass on all three, since every value is well-formed. Contract testing removes a whole class of breakage from the integration suite's job, which lets the integration tests concentrate on behaviour rather than on shape. ### Do generated clients prevent API contract drift? No. Code generation guarantees that the client matches the contract at the moment of generation, and it says nothing about the running service. A client generated from version 2.1 and a server that has quietly moved past it will compile perfectly and fail at runtime. Only a check against the live service closes that gap, which is the job of a contract test. ### Do I need code generation to keep clients in sync with the contract? Generated clients guarantee that your code compiles against the contract you generated from, and that is all they guarantee. Nothing about generation forces the running service to keep returning what the contract said on generation day. A generated client and a drifted server compile cleanly and fail at runtime, which is precisely the case contract tests against the live service exist to catch. --- # Functional API Tests: What to Assert — Routebase > How to choose assertions that catch real breakage without turning every unrelated change into a red run, plus negative cases, extraction and chaining. Canonical page: https://routebase.dev/guides/api-testing/functional-api-tests/ Chapter 3 of 12 · API Testing · Last reviewed 2026-09-12 by The Routebase Team. Functional testing is where most REST API testing starts, and it is the method most likely to be done in a way that quietly stops working. The mechanics are trivial, because you send a request and check the answer. The judgement is not, because what you check decides whether the suite is a signal or a chore. ## The assertion budget Think of each test as having a budget. Every assertion you spend buys coverage of one failure mode and costs maintenance on every unrelated change that happens to touch it. Spend too little and the test passes while the API degrades. A case asserting only that the status was 200 stays green while the body loses half its fields. It stays green when the total is wrong by a factor of a hundred, and when the endpoint starts returning an empty array for every query. Spend too much and the test fails constantly for reasons nobody cares about. Whole-body comparisons are the classic overspend, because they assert on generated identifiers, timestamps, field ordering and every property somebody adds later. Three false alarms is roughly how long it takes a team to start pressing rerun and stop investigating. _Figure: Four of these five readings of one response are worth asserting, and the fifth is the full-body comparison that turns every unrelated change into a red run._ ## What a well-shaped case asserts | Assertion | Why it earns its place | |---|---| | Status code | The cheapest signal there is, and the first thing that changes when something breaks | | Schema against the contract | Catches every shape change at once, without naming a single field by hand | | Two or three field values | Proves the behaviour this test is actually about | | Content type | Matters when clients dispatch on it, and it is a one-line check | | A latency ceiling | A rough guard that turns a pathological regression into a failure instead of a slow green | The schema line is what lets the field assertions stay few. Without it you end up naming fields defensively, because that is the only way to notice a rename. With it the shape is covered structurally, and the remaining assertions can concentrate on meaning. ## Assert on values, not on documents Two ways to check that a response contains the right customer name. ```txt # Fragile Body equals {"id":"cus_31","name":"Ada Lovelace","createdAt":"2026-09-12T09:14:22Z", ...} # Durable JSON Path $.name equals Ada Lovelace ``` The second one fails for exactly one reason, and the failure message names the field, the expected value and what actually arrived. The first one fails whenever anything in the document changes, and the failure message is a diff you have to read. There is one case where the whole-document check is right, and it is narrower than people think. The response is a small, fully specified, stable object, and you genuinely mean that nothing else may appear. Such responses exist, and they are far rarer than the number of tests written that way suggests. ## Negative cases are half the suite An API that handles valid input correctly and undefined input unpredictably is half tested. The unpredictable half is where customers meet the bugs, because their client sends the malformed request, not yours. Four paths deserve a case on nearly every endpoint that has them. | Path | Expected | What it proves | |---|---|---| | Missing or malformed input | 400 with a described error body | Validation runs before the handler, and the error is machine-readable | | No credential | 401 | The endpoint is actually protected, and not only in the router config you last read | | Valid credential, wrong permission | 403 | Authorization is enforced per caller and not only per route | | Unknown identifier | 404 | The service does not leak a 500, and it does not silently return an empty success | The 401 and 403 cases deserve special attention, because they are the two assertions most often assumed and never tested. An endpoint that returns 200 to an unauthenticated caller is a production incident, and the test that would have caught it is one line long. Error bodies deserve a shape check of their own, for the same reason successful ones do. If your errors follow a documented format, validate them against it. An error path that returns a bare string while the contract promises a structured body breaks clients exactly when they are already having a bad day. ## Extraction and chaining Many tests need something a previous request produced, such as the identifier of a resource you just created. Hard-coding that identifier makes the test depend on data somebody else maintains. That is the most common source of a suite which works on one environment and not another. Extraction solves the problem without any shared setup. The create case captures a value from its response, and every later case references it by name. The chain then owns its data, so it runs anywhere without a prepared database. ```txt Case 1 POST /orders extract $.id → orderId Case 2 GET /orders/{{orderId}} assert $.status equals pending ``` Three sources cover nearly everything. Those are a value from the JSON body selected by JSONPath, a response header, and the status code itself. The status code is useful more often than people expect, because it lets a later step branch on what happened and not on what was supposed to happen. ## Keeping runs deterministic Three habits account for most of the difference between a suite people trust and one they rerun. **Own your data.** A test that reads a record somebody created by hand in staging will fail the week that record is cleaned up. Create what you need, reference it by the identifier you extracted, and clean it up afterwards. **Do not assert on things the API never promised.** Array ordering without an explicit sort is not contractual, and neither is the exact value of a generated identifier or the precise timestamp of an action. Asserting on any of them is asserting on an accident. **Use dynamic values for anything that must be unique.** A test that registers `test@example.com` works once. A test that registers a generated address works every time, which matters more than it sounds when the same suite runs on a schedule. ## In Routebase A test case in Routebase is one HTTP request with a set of declarative assertions, so there are no test scripts to maintain for ordinary work. Six assertion types cover the whole ground between a status code and a schema. Those are Status Code, Body, Header, Latency in milliseconds, JSON Path and Schema Validation. Each one combines with ten operators, from `equals` and `contains` through `matches regex` and `exists` to the four numeric comparisons. _Screenshot: Five assertions cover the status code, one header, one field, the latency budget and the response schema._ Schema Validation is the one that needs no target and no expected value, because it validates the response against the linked endpoint's documented schema. That is the assertion that keeps the others few. Every assertion carries an on and off checkbox, so you can mute one without deleting it. When a case is linked to a designed endpoint, the JSON Path field suggests paths from that endpoint's response schema, each with its type, and free text stays available for expressions the schema cannot enumerate. The Extract tab captures values into variables from the JSON body, a response header or the status code, and later cases reference them as `{{variableName}}`. Dynamic tokens such as `{{$uuid}}`, `{{$timestamp}}` and `{{$randomEmail}}` handle the values that must differ every run. Results show the assertions that passed and failed side by side with expected against actual, the exact request that went out after substitution, and a timing breakdown across DNS, connect, TLS, first byte and download. The full reference is in the [Test Suites guide](https://docs.routebase.dev/test-suites/). ## Frequently asked questions ### What should an API test assert? Assert the status code, the shape of the response against the contract, and the two or three field values that carry the behaviour this test exists to prove. Add a latency ceiling as a rough guard and a content-type check where the media type matters. Everything beyond that tends to cost more in maintenance than it returns in defects caught, because it fails on changes that were never the point of the test. ### Why do full response body comparisons make tests flaky? A whole-body comparison asserts on every field, including generated identifiers, timestamps, ordering the API never promised, and any field somebody adds next quarter. Each of those produces a red run that has nothing to do with a defect. After the third false alarm people start rerunning instead of investigating, and the suite stops being a signal. ### How do you test error responses in an API? Write a case per error path you care about, with the status code as the assertion and the error body shape validated like any other response. Four cases belong on nearly every endpoint. Malformed input should return 400, an absent credential should return 401, a valid credential without permission should return 403, and an unknown identifier should return 404. Those four paths are where undefined behaviour reaches customers most often. ### Should API tests use JSONPath assertions? Yes, for the specific values a test is about. A JSONPath assertion names one field, so it fails for one reason and the failure message says which field and what value arrived. That is far easier to act on than a diff of two large JSON documents, and it survives unrelated additions to the response. --- # API Integration Testing With Scenarios — Routebase > Testing multi-step flows where each call depends on the last, covering state between steps, asynchronous work, conditional branches and idempotency. Canonical page: https://routebase.dev/guides/api-testing/api-integration-testing/ Chapter 4 of 12 · API Testing · Last reviewed 2026-09-12 by The Routebase Team. Single-request tests prove that each endpoint works on its own, and that is a genuinely useful thing to know. They cannot prove that the endpoints work together, which is what API integration testing is for, and a surprising share of production defects live in exactly that gap. A resource is created and comes back with an identifier the read endpoint does not accept. A token is issued and then rejected by the very service that issued it. A status field moves to `processing` and never leaves. Every one of those passes a per-endpoint suite and fails the first real client. ## What a workflow test actually tests The unit under test is the sequence, not the individual request, and that changes what the assertions are for. A workflow test asserts three things that a single call structurally cannot. **State carries forward.** The identifier the create call returned is the identifier the read call accepts, in the same format, without a transformation nobody documented. **Order is respected.** The service rejects the steps that should not be possible yet. Reading a resource before it exists returns 404 and not an empty success, and confirming an order before payment returns a refusal. **The flow terminates.** The last step reaches the state the business expects, and that assertion is what gives the whole scenario its point. ## Designing a scenario worth having Start from a sentence a non-engineer would recognise. "A new customer signs up, adds an item to a basket, pays, and receives an order confirmation" is a scenario. "Test the orders API" is not, and it produces a scenario that drifts into a second functional suite. Then keep it to the steps that carry the story. A scenario with thirty steps takes a long time to run, breaks often, and tells you almost nothing when it breaks, because the failure could be anywhere. Six to ten steps is a comfortable range for a flow you want people to trust. Each step should still assert. It is tempting to let intermediate steps pass on any 2xx and put all the assertions at the end. That produces a scenario which fails at step nine for something that went wrong at step three. Assert enough on each step to localise a failure to the step that caused it. ## Passing values between steps The mechanism is extraction, which means a step captures something from its response into a named variable that later steps can reference. _Figure: A value extracted in one step is available to every later step, and a step whose variable no earlier step sets is the failure a reorder creates._ ```txt Step 1 POST /customers extract $.id → customerId Step 2 POST /baskets extract $.id → basketId body { "customerId": "{{customerId}}" } Step 3 POST /baskets/{{basketId}}/items Step 4 POST /orders extract $.id → orderId body { "basketId": "{{basketId}}" } Step 5 GET /orders/{{orderId}} assert $.status equals confirmed ``` Two failure modes show up before you have built many of these. The first is a variable that no earlier step produces, which usually means somebody reordered the steps. The symptom is a request with an unresolved placeholder in it, and the fix is to check the direction of every reference after any reorder. The second is a variable that carries a value from the previous run. That happens when variables persist beyond the scenario, and it makes a broken run look green because the old identifier still resolves to a real resource. Variables scoped to the run avoid it entirely. ## Waiting for asynchronous work Plenty of APIs accept a request, return 202, and do the work later. Testing those means waiting, and how you wait decides whether the test is stable. | Approach | When it works | What it costs | |---|---|---| | Poll a status resource until it is terminal | The API exposes progress, as most do | A few extra requests, and a deadline you have to choose | | Wait a fixed interval, then assert | No status resource exists | The interval that works today is the flake of next quarter | | Subscribe to a webhook and assert on delivery | The API pushes, and your runner can receive | Setup, plus a receiving endpoint the test can read | Polling is almost always the right answer where it is available. Give the loop a deadline and fail with a clear message when it expires. A failure reading "timed out waiting for order 4f2 to leave processing after 30 s" is far more useful than an assertion mismatch on a field that was never going to be filled in time. A fixed wait is a legitimate tool as long as it stays bounded and short. The mistake is treating it as a fix for a race condition instead of a placeholder until a status resource exists. ## Conditional steps Some flows branch, and a scenario that assumes only one branch will fail half the time against a realistic environment. A payment either succeeds outright or comes back asking for a second factor. A conditional step evaluates a variable an earlier step captured and decides whether to run. The most useful variable is usually the previous status code, because it says what happened and not what was supposed to. Keep the conditions simple, because one comparison per step is enough for the branches worth testing. A scenario that needs nested logic is usually two scenarios that would be clearer written separately. ## Idempotency deserves its own scenario Retries are not an edge case, because networks drop connections and clients give up waiting. A client times out, resends the same request, and the question is whether your API charged the card twice. The test is short and the assertion is easy to get wrong. Send the request, send it again with the same idempotency key, and then check the collection. A second 200 proves nothing on its own, because a duplicate resource also answers 200. What proves it is the count, so read back the collection and assert that exactly one record exists. Run the same scenario with a *different* key and assert that two records now exist, because an implementation that deduplicates everything is broken in the opposite direction. ## In Routebase A scenario in Routebase is an ordered list of steps, and each step is a reference to an existing test case, never a copy of one. Edit the case and every scenario using it picks up the change, and that is what keeps a growing set of flows maintainable. _Screenshot: A scenario chains ten steps, each one a reference to an existing case, with two waits and one conditional step._ Steps pass values through the response extractions defined on their cases, so a step that extracts `$.id` into `orderId` makes `{{orderId}}` available to every later step in URLs, headers, bodies, assertions and conditions. The step dialog lists **Variables in** and **Variables out** for each step, and it flags a variable that no earlier step sets, which catches a reorder before the run does. Wait steps insert a bounded pause of up to 300,000 milliseconds where an API needs one, and they show up in the results as their own row. Conditional steps compare a variable against a value with one of six operators and either execute or skip, with the skip reason shown on the result row. Run settings decide whether a failure stops the scenario, is ignored, or aborts the run, so a diagnostic pass can continue past the first red step. The results table shows one row per step with its status, the failure or skip reason inline, the variables it consumed and the ones it captured. A failing run opens on the first failed step, not at the top. Details are in the [Test Scenarios guide](https://docs.routebase.dev/test-scenarios/). ## Frequently asked questions ### What is a workflow test in API testing? A workflow test runs several API calls in order and passes values from one response into the next request. It proves that a business flow such as register, log in, create an order and read it back holds together end to end. Single-request tests cannot see these defects, because the failure only appears when the calls are combined. ### How do you test an asynchronous API? Send the request that starts the work, capture whatever handle the response gives you, then poll the status resource until it reports completion or until a deadline passes. Where the API offers no status resource, a bounded wait between steps is the honest fallback. Assert on the terminal state rather than on the wait itself, because a fixed sleep that happens to be long enough today becomes a flaky test tomorrow. ### How do you test idempotency in an API? Send the same request twice with the same idempotency key and assert that the second call returns the same result without creating a second resource. The check that carries the weight is a count, so read the collection afterwards and assert that exactly one record exists. A second 200 alone proves nothing, because a duplicate resource can also answer 200. ### Should every endpoint be covered by a workflow test? No. Workflow tests are slower, they depend on more state, and they fail for more reasons than a single-request test does. Use them for the flows that carry the business, which is usually signup, authentication, the primary create-and-read path and payment. Everything else is better served by functional and contract tests on the individual endpoints. --- # API Test Data and Data-Driven Runs — Routebase > How to make API tests deterministic, which means owning the data each run needs, cleaning up after it, and repeating one suite across many input rows. Canonical page: https://routebase.dev/guides/api-testing/api-test-data/ Chapter 5 of 12 · API Testing · Last reviewed 2026-09-12 by The Routebase Team. Ask a team why their API suite is unreliable and the answer is almost never about assertions. It is about API test data. Somebody deleted the record the tests read, two suites created the same email address, or last week's run left rows behind that make this week's count assertion fail. Test data management is the unglamorous half of API testing, and it quietly decides whether everything else in the suite can be trusted. ## The four problems, and what solves each | Problem | Symptom | What solves it | |---|---|---| | Tests need reference data | Hard-coded identifiers that break on every environment | Fixtures | | Tests need state to exist before they run | A suite that passes only after somebody prepares the environment | Seeds | | Runs leave the environment dirtier than they found it | Failures that only appear on the third run of the day | Snapshots and cleanup | | One case needs to cover many inputs | Twelve near-identical cases nobody maintains | Data sets | ## Fixtures are reference data, not test cases A fixture is a named blob of structured data that tests refer to by path rather than by value. Instead of typing `alice@example.com` into eleven separate requests, you define the user once and reference the field wherever you need it. ```yaml alice: email: alice@example.com role: admin bob: email: bob@example.com role: member ``` Two properties repay the indirection a fixture costs. The value exists in one place, so changing it changes every test at once. And the same data can feed more than tests, because a mock server that answers with the same records the tests assert on is a far better mock than one returning invented strings. The other half of that arrangement, which is where the rest of a mock response comes from, is covered in [mock data worth testing against](https://routebase.dev/guides/api-mocking/mock-data-generation/). The trap is putting *behaviour* into fixtures. A fixture holding an expected response body couples every test to the shape of that body, and the contract already does that job. Keep fixtures to inputs and reference data. ## Seeds set up and tear down A seed is an ordered sequence of HTTP calls that runs around a suite, not inside it. The pre-run seed creates whatever the tests need, and the post-run seed removes it again afterwards. Building setup out of the API's own endpoints instead of direct database writes is worth the small extra effort. Database seeding creates states the API itself could never produce, so your tests start passing against data that no real client could have caused. Going through the API keeps the setup honest and exercises the create path on the way. Two details separate a seed that helps from one that becomes its own maintenance problem. **Capture what you create.** A seed that creates a customer should capture the identifier the response returned, so the tests reference `{{customerId}}` rather than a value somebody pasted in. **Fail loudly on setup, quietly on cleanup.** A failed pre-run seed means the tests would run against the wrong state, so the whole suite should abort. A failed post-run seed means the environment is untidy, and that deserves a warning, not a red run. ## Snapshots reset a baseline Some environments cannot be rebuilt from scratch for every run, either because the setup is long or because parts of it are shared. A snapshot is a recorded known-good state that can be restored before a run. The important thing to understand about a snapshot is what it stores. It is not a database dump. It records which resources the setup created and how to remove them, so restoring means removing what is there and running the setup again to produce fresh data. That distinction matters for privacy, because the record holds identifiers and cleanup instructions and not the data itself. Snapshots are the right tool when your suite mutates state and those mutations accumulate across runs. They are unnecessary overhead in a suite where every test already creates and cleans up its own data. ## Data sets turn one case into many Some coverage questions are entirely about input values. Whether the discount field accepts zero, whether the email validator rejects the awkward addresses, whether pagination behaves at its boundary. Writing one case per value is how a suite grows into something nobody is willing to edit. A data set is a table attached to the suite instead, and the suite runs once per row with that row's values substituted in. | email | password | expectedStatus | |---|---|---| | valid@example.com | correct-horse | 200 | | valid@example.com | wrong | 401 | | not-an-email | correct-horse | 400 | | (empty) | correct-horse | 400 | Notice the third column. When the expected status is a column, one case asserts different outcomes for different rows, and that is what makes negative cases cheap. Without it you end up with a happy-path data set and a separate pile of hand-written failure cases. Rows should be independent. A data-driven run that relies on row three having created something in row two is a workflow test written in the wrong shape, and it breaks the moment somebody reorders the table. ## Choosing between a fixture and a data set The two look similar on the surface, and they solve genuinely different problems. | Use a fixture | Use a data set | |---|---| | The data is nested or structured | The data is flat, one row per case | | Several tests, mocks or docs share it | The point is to repeat one suite across inputs | | It describes *what things are* | It describes *what to try* | A useful check is whether the data would still make sense if you deleted every test. Reference data would still make sense, while a table of boundary values would not. ## In Routebase Routebase has all four concepts natively, so there are no external setup scripts to keep in step with your specifications. _Screenshot: Fixtures are versioned and tagged, so a suite can pin the data it was written against._ **Fixtures** are project-level structured data in a typed table or as raw YAML and JSON. A table-mode fixture links to one of your schemas, so its columns are the properties your API actually uses. Tests, seeds and mock rules reference them with `{{fixture.users.alice.email}}`, and pipes transform the value on the way, so `{{fixture.users | where:role=admin | pluck:email | toJsonArray}}` produces exactly the array you need. Every save is a version, and the history restores any earlier one. **Seeds** are ordered step lists with four step types. Those are an HTTP request, a fixture loop that fires one request per entry, a delay, and a reference to an existing test case. Steps can be built straight from a spec endpoint, and captures pull values from the response into variables that later steps and the suite's cases can read. **Dry Run** resolves everything and returns the planned call list without touching your API. **Snapshots** record a base seed's resources and the cleanup calls that undo them, so a restore removes what is there and re-runs the seed for fresh data. They store identifiers and cleanup instructions rather than personal data. **Data sets** attach to a suite as columns and rows, imported from CSV, JSON or TSV or edited inline. Reference a column as `{{data.email}}` anywhere a template is accepted, including an assertion's expected value. Results break down per row, so a run reports something like eight of ten rows passed and lets you expand the two that did not. Suite settings wire the pieces together with a pre-run seed, a post-run seed, a reset snapshot and a fixture scope. The full reference is in [Test Data](https://docs.routebase.dev/test-data/) and [Data-Driven Tests](https://docs.routebase.dev/data-driven-tests/). ## Frequently asked questions ### What is test data management for APIs? Test data management is the practice of making every run start from a state the test controls, rather than from whatever the shared environment happens to contain. It covers reusable reference data, setup and cleanup sequences that run around a suite, restore points that reset a known baseline, and tables of input rows that let one case cover many values. Without it a suite is only as reliable as the last person who cleaned up. ### What is the difference between a fixture and a data set in API testing? A fixture is one structured blob of reference data, often nested, that many tests, mocks and documents share. A data set is a flat table where each row drives one whole iteration of a suite. Use a fixture when the same reference data appears in several places, and use a data set when you want the same logic exercised across many inputs. ### How do you keep API tests from interfering with each other? Give each run the data it needs instead of relying on records somebody created by hand. Create resources in a setup step, reference them through variables the run captured, and remove them afterwards. Where creating everything is impractical, restore a recorded baseline before the run so the starting state is the same every time. ### What is data-driven API testing? Data-driven testing runs the same suite once for every row of a table, substituting each row's column values into the requests and the assertions. One login case then covers ten accounts, and one validation case covers every boundary value you care about. The expected outcome can be a column too, so a single case can assert 200 for valid rows and 400 for invalid ones. --- # API Testing Environments, Auth and Secrets — Routebase > Run one suite against development, staging and production without editing it, guard the environments nobody may write to, and keep credentials out of tests. Canonical page: https://routebase.dev/guides/api-testing/api-testing-environments/ Chapter 6 of 12 · API Testing · Last reviewed 2026-09-12 by The Routebase Team. A suite that only runs against one environment is a suite that will not be trusted for a release. The mechanics of wiring up API testing environments are simple, and the discipline that makes them safe is where teams get hurt. ## Nothing environment-specific belongs in a test The rule is short. If a value differs between development and production, it does not belong in the test. That covers more than the base URL. Account identifiers, tenant names, API versions in the path, feature flags, callback URLs and every credential fall on the same side of the line. A test that hard-codes any of them works in exactly one place, and the copy somebody makes for the next environment becomes a second test to maintain. ```txt # Tied to one environment GET https://api-staging.example.com/v2/tenants/acme-staging/orders # Runs anywhere GET {{baseUrl}}/v2/tenants/{{tenantSlug}}/orders ``` The second form has a second benefit that shows up later. When something breaks only on staging, you know it is the environment and not the test, because the test is identical in both places. ## An environment matrix that people actually use | Environment | What runs there | Writes allowed | Data | |---|---|---|---| | Local or development | Fast functional cases while writing code | Yes | Whatever the developer creates | | Preview per branch | Functional and contract tests in the pull-request gate | Yes | Created and cleaned by the run | | Staging | The full suite, load tests, the complete security profile | Yes | Seeded, reset regularly | | Production | Read-only synthetic checks and contract validation | No | Real customer data | The one row people argue about is production, and the argument is usually about whether a smoke test may create a test order. It may not, because that order becomes a line in the finance export that somebody has to explain and reverse. ## Protect production with a guard, not a convention "Do not point the write suite at production" is a convention, and conventions fail on a Friday afternoon when somebody picks the wrong entry in a dropdown. A guard is better. Mark the environment read-only, and let the runner refuse anything that is not a GET, a HEAD or an OPTIONS before the request is built. The refusal should be visible in the results as its own state and not as a failure, because nothing was sent and nothing was proven either way. One consequence matters before you switch such a guard on. APIs that read via POST, which covers search endpoints, GraphQL and report queries, cannot be exercised against a read-only environment either. The guard goes by the method and not by what the endpoint does with it, and that is the correct trade for a protection that has to be reliable. ## Authentication belongs to the environment Credentials differ per environment, and the tests should not know that. Configure authentication once per environment, and let the suites inherit it. Three levels cover essentially every real setup. | Level | Use it for | |---|---| | Environment | The default credential every suite uses in this stage | | Suite | A suite that genuinely needs a different identity, such as an admin-only area | | Case | The exception, usually a negative test that sends the wrong credential on purpose | The negative cases are the reason the third level exists. A test that proves an endpoint returns 401 without a credential needs a way to send no credential, and a test that proves 403 needs a valid credential belonging to somebody without permission. For the methods themselves, which cover keys, bearer tokens, OAuth grants and the signature-based schemes, see the [API authentication guide](https://routebase.dev/guides/api-authentication/). ## Secrets are references, not values A credential typed into a test is a credential that will eventually leave the building. It goes into an export, a copy between environments, a shared report or a screenshot in a support ticket. The alternative costs nothing. Store the credential as a secret variable on the environment, and reference it by name from the authentication configuration. The test then holds a reference, and the reference is safe to copy, share and read out loud. This has a practical side effect that people notice before they notice the security benefit. An authentication setup built from references is portable, so copying it to another environment works, because each environment resolves its own value. An authentication setup with a literal secret in it cannot be copied without either leaking the secret or arriving incomplete. Three habits round it out. **Rotate on a schedule, not after an incident.** A credential that has never been rotated is a credential nobody knows how to rotate. **Give the test account the least privilege it needs.** A suite that only reads should authenticate as an identity that can only read. A mistake in the suite then produces a 403 instead of deleted data. **Mask secrets in output.** A run report that prints the resolved request is enormously useful right up until it prints a token. ## In Routebase Environments in Routebase carry their own base URL, their own variables and their own authentication configuration, and every test request reaches the base URL as `{{baseUrl}}`. The same suite therefore runs against development, staging and production by switching the environment in the toolbar, with nothing in the cases to edit. _Screenshot: Secret variables live on the environment and stay masked everywhere they appear, so a test references the name and never the value._ Authentication is configured on the environment's Auth tab and inherited by suites, which show a badge naming what they inherited. A suite overrides it with Custom Auth or switches it off with No Auth, and the inheritance badges are colour-coded across the testing surface. **Test Authentication** sends a probe request with the configured credentials and reports the status, the status text and the response time. That is a quicker way to find a wrong client secret than a failing suite. Every credential field accepts a `{{VARIABLE}}` placeholder with autocomplete from the environment's variables, and secret variables follow the same encryption and masking rules everywhere. Copying an auth configuration to another environment masks the secrets and never carries OAuth tokens across. The copy is refused outright when the source holds a literal secret, with a message saying to configure that target by hand. That refusal is the product making the portable choice the easy one. An environment can be marked read-only under its Contract tab, and only GET, HEAD and OPTIONS may then be sent there. Everything else is refused before the URL is parsed and before a socket opens, so a blocked request leaves no trace on the target. The case is reported as **Blocked** with a muted badge and its own counter, and it is never folded into the failed count. A run in which nothing was sent comes back as a neutral notice and not a success. See [Environments](https://docs.routebase.dev/environments/) and [Project Auth](https://docs.routebase.dev/project-auth/) for the full picture. ## Frequently asked questions ### How do you run the same API tests against multiple environments? Keep everything environment-specific out of the test. The base URL, the credentials and any values that differ per stage live in the environment, and the test refers to them through placeholders. A case whose URL reads as a base-URL variable followed by a path then runs unchanged against development, staging and production, because only the environment behind it changes. ### Should you run API tests against production? Run read-only checks there and nothing else. Synthetic monitoring and contract validation on GET requests tell you the truth about the live service and cost customers nothing. A suite that writes belongs in a staging or preview environment, and the safest way to enforce that is a guard on the environment itself rather than a convention people are expected to remember. ### Where should API test credentials be stored? In secret variables scoped to the environment, referenced from the auth configuration by name. The test then contains a reference rather than a value, so nothing sensitive lands in an export, a copy between environments or a screenshot. A credential typed directly into a test is one that will eventually be committed, shared or pasted into a support ticket. ### How does authentication inheritance work in a test suite? Configure authentication once on the environment and let suites inherit it, so the same suite authenticates correctly wherever it runs. A suite that genuinely needs different credentials overrides the environment with its own configuration, and a suite testing the unauthenticated path switches authentication off entirely. Three levels are enough for almost every real setup. --- # API Performance Testing: Load, Stress and Soak — Routebase > Load, stress and soak profiles, why the p95 beats the average, how to turn a latency budget into a pass or fail, and where a load test must never point. Canonical page: https://routebase.dev/guides/api-testing/api-performance-testing/ Chapter 7 of 12 · API Testing · Last reviewed 2026-09-12 by The Routebase Team. Correctness testing asks whether the answer is right. API performance testing asks what happens when a thousand callers want that answer at the same moment, and the two have almost nothing in common except the request they send. ## Decide the budget before you run anything A load test without a target produces a number, and a number without a target produces an argument rather than a decision. Somebody says 400 milliseconds looks fine, somebody else remembers it used to be 200, and nobody can say whether the release should ship. A budget turns the run into a decision that answers itself. Write it down before the first test, in roughly this shape. > The orders endpoint answers within 300 ms at the p95, at 50 requests per second, with an error rate below 0.1 percent. Every part of that sentence does work. The endpoint names what is measured, the percentile says which requests count, the throughput says under what conditions, and the error rate stops a service from meeting its latency target by failing fast. ## Three profiles, three questions | Profile | Traffic shape | The question it answers | |---|---|---| | Load | Steady, at expected peak volume | Does the service hold its budget on a busy day | | Stress | Increasing until something breaks | Where is the ceiling, and how does it fail when crossed | | Soak | Moderate, sustained for hours | Does anything degrade over time | **Load** is the profile you run most often, and it is the one that belongs in a release checklist. It produces a straight pass or fail against the budget you wrote above. **Stress** is a discovery exercise rather than a gate. Its value is in how the service fails, because a service that sheds load with 503 responses and a `Retry-After` header is in far better shape than one that accepts everything and times out. Run it when capacity planning or before a campaign, rather than on every release. **Soak** catches the one thing the other two cannot, namely slow degradation. Connection pools that leak, caches that grow without bound and memory that never comes back all look perfect for the first ten minutes. ## Read the distribution, not the average The single most common mistake in an API performance report is presenting the results as a table of averages. | Metric | What it tells you | |---|---| | Average | Almost nothing on its own, because one slow request in a hundred barely moves it | | p50 | The typical experience | | p95 | The experience of the unlucky twentieth caller, and the source of most complaints | | p99 | The tail, which matters when one page makes many calls and therefore hits it often | | Max | Useful only as a hint about timeouts and outliers | A run averaging 120 ms with a p95 of 3 seconds is a bad run by any standard your users would recognise. The average will not say so, and a dashboard that only shows averages will let it ship. The error rate deserves equal billing. Latency measured over successful requests only, while a quarter of requests fail, is a meaningless number that looks excellent. ## Concurrency is not throughput Two settings get confused with each other regularly, and confusing them produces a test that measures something nobody asked about. **Concurrency** is how many requests are in flight at once, while **throughput** is how many complete per second. They are related through latency, so raising concurrency against a service that has stopped scaling raises latency instead of throughput. That relationship is the actual finding of most load tests, so push concurrency up in steps and plot throughput against it. The line rises and then flattens, and the point where it flattens while latency climbs is the saturation point. Everything beyond that point is queueing, not work. ## Make the test resemble the traffic A load test that hammers one endpoint with one identical request mostly measures your cache. Three habits keep the traffic shape close enough to reality that the numbers mean something. **Vary the input.** Requests that read the same record repeatedly hit warm paths that real traffic does not. Drive the load from a set of identifiers instead of from one. **Mix the operations.** Real traffic is mostly reads with some writes, and the writes are usually the expensive part. A read-only load test on a write-heavy API is a comfortable fiction. **Include the think time.** Back-to-back requests with zero delay produce a traffic shape no real client generates, and they mostly measure how fast your load generator is. ## Where a load test may point Never at production. A load test deliberately generates traffic beyond normal levels, so pointing it at production degrades the service for real customers to learn something a staging environment could have told you for free. Two further rules save trouble. Point it at infrastructure you own, because saturating a third-party sandbox is somebody else's incident. And tell whoever is on call before you start, because a load test and an outage look identical on a dashboard. ## Where it belongs in the pipeline Performance runs do not belong in the pull-request gate. They take minutes, they need a quiet environment to produce comparable numbers, and a gate people wait ten minutes for is a gate that eventually gets switched off. A nightly run against staging with a fixed profile is the version that works. Keep the profile identical between runs, because a performance number is only meaningful next to the previous one. Store the results as well, so a regression shows up as a trend and not as one bad night. ## In Routebase The Test Runner has a mode toggle. In **Functional** mode a suite makes one assertion-focused pass, and in **Performance** mode the same suite runs a load profile, so you never maintain a second set of requests for load testing. _Screenshot: Performance mode reuses the same suite and only changes how often and how concurrently it runs._ The Performance Config popover sets the profile. Iterations run from 1 to 10,000, threads from 1 to 50, and the delay between iterations from 0 to 60,000 milliseconds, where think time goes. The On Error behaviour decides whether a failure is ignored, skips to the next iteration, or aborts the run. Iterations run in parallel across threads while the cases inside one iteration run in order, so a chained flow keeps its sequence under load. Results report throughput in requests per second, the P95 response time and the error rate, with a per-case breakdown carrying average, minimum, maximum, P95, error percentage and count for every case in the suite. That breakdown is what turns "the suite got slower" into "the search endpoint got slower and everything else is unchanged". The mode applies to every run trigger, so a single case, a selection and a full run all follow it. Attach a data set and the load runs across your input rows instead of repeating one request. See the [Test Suites guide](https://docs.routebase.dev/test-suites/) for the run modes, and [Scheduling](https://docs.routebase.dev/scheduling/) for putting the nightly profile on a cron expression. ## Frequently asked questions ### What is API performance testing? Performance testing measures how an API behaves when many callers arrive at once, rather than whether a single request returns the right answer. It reports latency across a distribution, throughput in requests per second, and the share of requests that failed under load. The output is a set of numbers you compare against a budget, so the useful version of the practice starts by deciding what that budget is. ### What is the difference between load testing and stress testing? A load test applies the traffic you expect on a normal busy day and asks whether the service holds its latency budget. A stress test raises the traffic until something gives, and it asks where the ceiling is and how the service behaves when it is crossed. Load testing verifies a promise, stress testing discovers a limit, and a soak test then checks whether either result still holds after several hours. ### Why use the p95 instead of the average response time? The average hides the tail that users actually experience. A run averaging 120 milliseconds with a p95 of three seconds means one request in twenty took three seconds, and those requests belong to real people who will notice. Percentiles describe the distribution, so a latency budget written as a p95 or p99 target says something an average cannot. ### Should load tests run against production? No. A load test deliberately generates traffic beyond normal levels, so pointing it at production means degrading the service for real customers to learn something a staging environment could have told you. Run load tests against an environment you own and can afford to saturate, and keep production for read-only synthetic checks. --- # API Security Testing — Routebase > How security tests fit into an API test suite, from authorization tests with two identities and fuzzing to the cadence of scans and where automation stops. Canonical page: https://routebase.dev/guides/api-testing/api-security-testing/ Chapter 8 of 12 · API Testing · Last reviewed 2026-09-27 by The Routebase Team. API security testing looks for a control that is missing, not a feature that is present, and that inversion is what makes it feel different from the rest of a suite. A functional test asks whether the endpoint does what it should, while a security test asks whether it also does something it should not. This chapter is the short version, covering how security testing fits into a suite. The [API security guide](https://routebase.dev/guides/api-security/) takes the same ground one category at a time, with a chapter per OWASP identifier and separate chapters on running a scan, triaging what comes back and where automation stops. ## The map, not the checklist The OWASP API Security Top 10 from 2023 is the standard reference, and it is most useful as a map of where to look rather than a list to tick off. The [API security guide](https://routebase.dev/guides/api-security/#the-map-with-its-identifiers) carries the full map with the question each category asks and a chapter per identifier. Three of those ten are access-control failures, and they sit at the top because that is where the breaches are. If you do one thing from this chapter, make it the authorization work below. ## Authorization needs two identities This is the part a single-user test suite structurally cannot do. Every test in an ordinary suite authenticates as one identity, and an endpoint that returns everything to everybody looks perfect from inside one account. The method is to hold two identities and cross them. ```txt As user A POST /orders → 201, id = ord_a1 As user B GET /orders/ord_a1 → must be 404 or 403, never 200 ``` Two details decide whether the test is meaningful. **Pick identities from different tenants.** Two users in the same organisation may legitimately see each other's data, so a positive result there is noise. A user from another customer entirely is the case that matters. **Prefer 404 over 403 for objects that are not yours.** A 403 confirms the object exists, which hands an attacker a free existence oracle. Returning 404 for both "does not exist" and "not yours" gives nothing away. The same technique covers function-level authorization, with a privilege gap in place of a tenant gap. Call the administrative endpoint as a plain member and assert that it refuses. Property-level authorization is the third variation, and it runs in both directions. Read an object as a low-privilege user and check the response for fields they should not see. Then send an update containing a field they should not be allowed to set, and check that the service ignores it instead of applying it. ## Fuzzing finds what nobody thought to send Every input validation test you write covers a case somebody imagined. Fuzzing covers the ones you did not, by sending values that are structurally wrong for the schema and watching what happens. Two flavours behave differently. **Schema fuzzing** generates payloads that violate the documented types, lengths and formats, so it asks whether validation actually runs. **Mutation fuzzing** takes a valid payload and corrupts parts of it, which finds the handlers that validate the outer object and trust its contents. The signal to look for is not a 400. A 400 means validation worked. The signal is a 500, a stack trace in the body, a timeout, or a 200 that accepted something impossible. Fuzzing generates load, so point it only at environments you own, and give it a request budget. ## Where automated scanning stops Be clear about the boundary, because a green scan report is easy to over-read. A scanner reliably covers the mechanical categories, meaning missing authorization checks, weak input handling, misconfiguration, exposed inventory and the injection surfaces. It does this on every endpoint on every run, which no human does. It cannot model your business. A refund endpoint that lets any authenticated user refund any order they are allowed to view is a serious flaw, and it looks like correct behaviour to a scanner. Every request is authorized and every response matches the contract. Sequences that can be driven out of order, prices that can be manipulated between steps, and quotas that reset in a way somebody can exploit all live in the same blind spot. That gap is covered by people, either as a threat-modelling exercise on the flows that carry money or as a penetration test. Automated scanning is what makes their time worth spending, because it clears the mechanical findings first. ## Triage, or the scan stops being read A scanner that raises fifty findings on its first run against an existing API is normal, and the next thing that normally happens is that nobody looks at run two. Three habits prevent that. **Give every finding a status and a note.** Fixed, false positive and accepted risk are all legitimate outcomes, and each of them needs a sentence saying why. The sentence is what stops the same argument happening again in three months. **Gate on severity, and start high.** A build that fails on critical findings from day one is a build that stays green after the first fix. A build that fails on every low-severity informational finding is a build somebody disables in week two. **Let the tool reopen what returns.** A finding you marked fixed should come back automatically when a later scan sees it again. A fix that was quietly reverted is exactly the case nobody re-checks by hand. ## Where security testing runs | Cadence | Profile | Target | |---|---|---| | Every pull request | Passive scanners, modest time budget | Preview or staging | | Nightly or weekly | Full profile including authorization scanners and fuzzing | Staging you own | | Before a release | The full profile plus manual review of anything new | Staging | Keep the pull-request pass small enough to finish inside a normal review wait. The thorough pass has time overnight. That is where the fuzzers belong. ## In Routebase Routebase includes a scanner that tests running APIs against the OWASP API Security Top 10 from 2023. Because it reads your specification, it sends targeted probes at documented endpoints, parameters and request bodies instead of crawling blindly. That keeps the false-positive rate down and maps every finding back to the endpoint that produced it. _Screenshot: Scanner findings carry a severity, the method and path they were found on, and a status you can triage._ Thirteen scanners cover the categories, and the authorization ones work exactly as described above. The BOLA scanner creates a resource as one persona and reads it back as another. It skips endpoints without a matching create call instead of guessing. An enumeration fallback covers the read-only endpoints, with three guards that stop public catalogues being reported as breaches. The function-level scanner calls administrative-looking endpoints as a normal user, and the property-level scanner inspects responses per identity for fields that should not be there. Two fuzzers cover schema and mutation payloads, and they stay silent until you raise the fuzzing intensity above off. The identities are **personas**, meaning stored credentials with any of the supported auth schemes. A persona must carry real credentials, because a persona with none tests nothing. The guidance to use personas from different tenants for object-level checks is written down in the docs and not left as folklore. Findings carry a severity and a confidence, a reproduction `curl` command, the raw scanner evidence and remediation guidance for the category with code examples. Triage moves a finding through in progress, fixed, false positive, accepted risk or duplicate. Every resolving status requires a note. A later scan that sees the issue again reopens it automatically. Scans run from a profile, on a cron schedule or from a pipeline over the REST API or the CLI, and findings export as SARIF 2.1.0 for a code-scanning tool. The gate threshold is yours to choose, and the guidance is to start at critical on an existing API and tighten later. See [Security Overview](https://docs.routebase.dev/security-overview/), [Scanner Reference](https://docs.routebase.dev/scanner-reference/), [Personas](https://docs.routebase.dev/personas/) and [Security in CI/CD](https://docs.routebase.dev/security-in-cicd/). ## Frequently asked questions ### What is API security testing? API security testing probes an interface for behaviour nobody intended, which covers authorization that is not enforced per object, input handling that accepts what it should reject, and configuration that exposes more than it should. It differs from functional testing because it looks for the absence of a control instead of the presence of a feature. Most of it can be automated, and the part that cannot is business-logic abuse, which needs someone who understands what the API is for. ### What is API fuzzing? Fuzzing sends values that are structurally wrong for the schema and watches how the API reacts. Schema fuzzing violates the documented types, lengths and formats to check that validation runs at all. Mutation fuzzing corrupts parts of a valid payload to find handlers that trust the contents of an object they validated. A 400 means validation worked, so the signal to look for is a 500, a stack trace, a timeout or a 200 that accepted something impossible. ### How often should API security tests run? Run a small passive pass on every pull request, sized to finish inside a normal review wait. Run the full profile with authorization scanners and fuzzing nightly or weekly, because it needs the time. Before a release, run the full profile again and review anything new by hand, since that is where a scanner has not seen the flow before. ### Which environment should API security tests run against? Point them at a preview or staging environment you own. Fuzzing and the authorization scanners generate load and send requests nobody would send on purpose, so they need a request budget and a target where a crash harms nobody. The pull request pass can use the preview, and the thorough pass belongs on a staging environment that mirrors production. --- # Automated API Testing in CI/CD — Routebase > Where the gate belongs, why exit codes are a contract, how to make a failure readable in the pipeline, and how to fix flakiness before people learn to rerun. Canonical page: https://routebase.dev/guides/api-testing/automated-api-testing-in-ci-cd/ Chapter 9 of 12 · API Testing · Last reviewed 2026-09-12 by The Routebase Team. A suite that only runs when somebody remembers to click is a suite that runs on the days it is least needed. Automated API testing is not the sophisticated part of the discipline, and it is the part that decides whether any of the rest of it has an effect. ## The gate belongs before the merge Put the fast tests where a failure costs the least. That is the pull request, against a preview or staging environment, before anyone has built on top of the change. _Figure: Each stage runs what it can afford, and only the pull request holds a gate, because that is where a regression still costs a rebase._ | When | What runs | Why there | |---|---|---| | Pull request | Functional and contract tests, plus a light security pass | Finishes inside a review wait, and a fix is still a rebase | | Merge to main | The same suite against staging | Catches what only appears after integration | | After deploy | Smoke suite plus a contract check against the deployed environment | Confirms the release actually serves what it promised | | Nightly | Full suite, load profile, full security profile | Has time to be thorough, blocks nobody | The rule behind the table is that a gate must be fast enough that nobody resents it. Ten minutes is where people start looking for the flag that skips it, and a skipped gate protects nothing. ## Exit codes are a contract A test runner in a pipeline communicates almost entirely through its exit code, so the meaning of each code deserves the same care as an API response. The distinction that matters is between "the tests ran and failed" and "the run never happened". Both are non-zero, and they mean completely different things to whoever is looking at the red build. | Code | Meaning | What the pipeline should do | |---|---|---| | 0 | Everything passed | Continue | | 1 | Tests ran, something failed | Fail the build and show the report | | Higher | Configuration, network, authentication or a missing resource | Fail the build, and say the run did not happen | A pipeline that branches only on zero against non-zero will report an expired credential as a test failure. Somebody then spends an hour reading assertions before noticing the run never reached the API. Once published, those codes are part of your CI contract. Changing what a code means breaks every pipeline that branched on it, which makes it a breaking change even though no API was touched. ## Make the failure readable where people look The default output of most runners is a log, and a log is the worst place to read a test result. Every CI platform can render a structured report, and the format they all understand is JUnit XML. The difference is concrete. Without it, a reviewer sees a red step and opens 400 lines of output. With it, they see "3 of 47 tests failed" with the three names, the assertion that broke and the expected against actual values, in the pull request itself. Security results have their own format, namely SARIF. A code-scanning tool that ingests SARIF puts findings on the lines and routes they belong to, and it recognises the same finding across runs instead of reporting it as new each time. Upload both even when the gate fails. A failed step that also published its report explains itself, while a failed step that published nothing sends somebody digging through logs. ## Credentials for a pipeline The pipeline needs an identity, and it should not be a person's. Use a machine credential with only the permissions the step requires, which for a test run is the permission to execute tests in one project. A key that can also delete specifications is a key that will eventually be used by a script nobody reviewed carefully. Three practices repay the small effort. **Scope it to one project.** A credential restricted to a single project cannot touch the rest of the organisation, whatever the pipeline is asked to do. **Store it as a pipeline secret, never in the repository.** This is obvious and it still happens, usually inside a snippet somebody pasted from a working example. **Give it an expiry and rotate it.** A key with no expiry outlives the integration it was created for and stays valid long after the pipeline is gone. ## Flakiness is a defect, not weather The real cost of a flaky test is not the failed build. It is that people learn to press rerun, and after a few weeks that reflex applies to real failures too. Three causes account for most of it. **Shared mutable state.** Two pipelines running against the same environment create the same record, or one deletes what the other is reading. The fix is data the run owns, which [test data](https://routebase.dev/guides/api-testing/api-test-data/) covers. **Timing.** A wait that is long enough on a quiet afternoon is not long enough when the build agents are busy. Poll for the state you need with a deadline instead of sleeping for a duration. **Assertions on values the API never promised.** Array order without an explicit sort, generated identifiers and exact timestamps are not contractual, so asserting on them is asserting on luck. When one appears, quarantine it. Move it out of the gate so it stops blocking, keep it running so it stays visible, and fix the cause on a normal ticket. What must not happen is a permanent skip, because a permanently muted test is a deleted test with extra steps. ## Scheduled runs are not a substitute A cron schedule and a pipeline gate answer different questions, and teams sometimes buy one and expect the other. The gate answers whether this change is safe to merge. The schedule answers whether the deployed thing still works, including after changes nobody put through the pipeline, such as a configuration edit, a dependency update or an upstream provider changing behaviour. Run both. The schedule wants a notification path that reaches a human, because a nightly run that fails into an empty inbox is a cron job and not a test. ## In Routebase Every suite carries a CI/CD section that generates a ready-made snippet for GitHub Actions, Azure Pipelines, GitLab CI, Jenkins and Bitbucket Pipelines, each with its target filename. The snippet posts to the run endpoint with an API key, parses the response, and exits non-zero unless every test passed. Nothing has to be installed on the runner. _Screenshot: The generated snippet reads the key from your CI secret store, so no credential is written into the workflow file._ The `Routebase.Cli` test runner is the shorter path where installing a tool is acceptable. One command runs a suite against a named environment and writes JUnit XML that your platform renders as a native test report, so failed assertions appear as failed tests. Its exit codes are a published contract, with zero for success, one for a failed run, and separate codes for configuration, network, authentication and missing resources. A key that authenticates but lacks a permission exits with the authentication code in every command, and that is the most common pipeline misconfiguration there is. Security scans run from the same pipeline, either as three REST calls or as one CLI command. That command queues the scan, polls it, writes SARIF and sets the exit code from a severity threshold you choose. There is deliberately no server-side pass or fail verdict, because the threshold belongs to your team and not to the tool. Where a schedule fits better than a pipeline, a suite runs on a cron expression in a timezone and against an environment you pick. Project-wide webhooks then push the outcome to your own systems, with an HMAC signature on every delivery. Scheduled runs land in the same history as manual ones, with the same export and sharing options. Details are in [Scheduling](https://docs.routebase.dev/scheduling/), [CLI Overview](https://docs.routebase.dev/cli-overview/) and [CLI in CI/CD](https://docs.routebase.dev/cli-in-cicd/). ## Frequently asked questions ### How do you run API tests in a CI/CD pipeline? Give the pipeline a scoped credential, point it at a deployed environment, and run the suite as one step that exits non-zero when a test fails. Publish the results in a format your platform renders as a test report, so a reviewer sees which assertion broke instead of a wall of log output. The whole thing is usually three lines of pipeline configuration once the suite exists. ### What should an API test runner's exit codes mean? Exit zero for a run where everything passed and one for a run where the tests failed. Reserve the higher codes for the cases where the run never happened, such as a configuration problem, a network failure or a credential without the right permission. A pipeline that treats every non-zero code the same reports infrastructure problems as test failures, which sends people to debug the wrong thing. ### Should a failing API test block a merge? Yes for the fast, deterministic tests, because that is the entire reason to run them before merge. Contract and functional tests against a preview environment finish inside a normal review wait and catch the regressions that are cheapest to fix. Load tests, long soak runs and the full security profile belong on a schedule, since a gate that takes ten minutes gets disabled. ### How do you deal with flaky API tests in CI? Treat a flaky test as a defect in the test, not background noise, because the cost is that people learn to press rerun and stop investigating. Most flakiness comes from shared mutable state, from waits that are long enough today, or from assertions on values the API never promised. Quarantine the test so it stops blocking, fix the cause, and put it back, since a permanently muted test is a deleted test with extra steps. --- # Testing APIs in Production — Routebase > Why testing does not stop at the release, what scheduled checks and live contract validation add to a suite, and where the monitoring guide takes over. Canonical page: https://routebase.dev/guides/api-testing/api-monitoring-and-contract-drift/ Chapter 10 of 12 · API Testing · Last reviewed 2026-09-27 by The Routebase Team. Everything before this chapter runs before the release. API monitoring is what covers the only environment that tells you the truth, meaning the one your customers are using. This chapter covers what that means for a test strategy, and the [API monitoring guide](https://routebase.dev/guides/api-monitoring/) is the long version. Its chapters on [types of checks](https://routebase.dev/guides/api-monitoring/types-of-api-monitoring-checks/) and [contract drift](https://routebase.dev/guides/api-monitoring/api-contract-drift/) go deeper on the two questions below. ## Two questions, one mechanism A production check answers two questions with the same request, and most teams only collect the first answer. **Is it up, and how fast is it?** This is classic synthetic monitoring, and it produces uptime, latency over time and a history you can point at afterwards. **Does it still return what the contract promises?** This is contract validation on live responses, and it is the one that catches drift. Nothing is down, every status code is 200, and the shape of the answer has quietly changed. The second question costs almost nothing once the first one is set up, because the response is already in hand. Skipping it is how teams end up learning about a renamed field from a consumer. ## Synthetic checks and what they are for A synthetic check is a scripted request on a schedule. Its value over passive telemetry is coverage of paths nobody happens to be calling. Three design decisions matter. **Pick endpoints that mean something.** A health endpoint that returns 200 from a handler with no dependencies tells you the process is running and nothing else. Check the endpoints that touch the database, the queue and the upstream provider, because those are the ones that break. **Keep checks read-only.** A monitor that creates data creates data every minute, forever. Where a write path genuinely must be covered, give it a dedicated account and a cleanup path, and accept that it is a different kind of thing from a monitor. **Match the interval to the stakes.** One minute for the endpoints that carry the product, five or fifteen for the rest. Every check is real traffic, so a one-minute interval across the whole surface is a load pattern rather than a monitoring strategy. ## Validating the contract on live traffic Contract validation in production is the same idea as a contract test in the pipeline, applied to a response you were fetching anyway. _Figure: Drift is a span of time rather than an event, and every uptime check stays green from the moment it opens until a consumer breaks._ The design decision that decides whether it works is which version you compare against. There are two sensible answers and one wrong one. | Baseline | When it is right | |---|---| | The version this environment is pinned to serve | Almost always, because it is what the environment promised | | The latest published version | When nothing is pinned, as a fallback | | The newest draft | Never, because production is not supposed to serve your work in progress | The failure mode to watch for is a pin that has fallen behind. The environment now runs 2.1 while the pin still says 2.0, so the monitor keeps checking the old contract and drift against the newer one stays invisible. A monitoring setup that cannot tell you which contract it is checking against is not really checking anything. Keeping those pins honest across several live versions is the subject of [running multiple API versions](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/). ## Deviations, and which ones deserve to fail a check Not every mismatch is equal, and treating them alike produces either noise or blindness. | Deviation | Severity | Why | |---|---|---| | A required field is missing | Breaking | Every consumer that reads it fails | | A field changed type | Breaking | Deserialisation fails, often loudly and far downstream | | An enum returns a value the contract does not list | Breaking for strict consumers | Anything switching on the value falls through | | An undocumented field appeared | Informational | Most consumers ignore it, and strict ones do not | A useful default is to record everything and alert only on the breaking classes. Deviations still accumulate in the record with a first-seen date, so the informational ones are there when somebody asks how long that field has been arriving. ## The failure a contract check cannot see A contract check catches a field that changes shape. It cannot catch a field that keeps its shape and stops changing value. Consider a `lastUpdatedAt` frozen since Tuesday, a price feed that went stale after an upstream job died, or a counter that stopped counting. Every one of those passes schema validation perfectly, and every one is a real outage for whoever depends on the number. Watching specific values for freshness is the answer, and it pays off for the handful of fields where staleness is the actual failure mode. Doing it for everything is wasted effort, since most fields are supposed to sit still. ## Alerts people do not learn to ignore An alerting setup has one failure mode that matters above all others. People stop reading it. Four rules keep it useful. **Alert on sustained conditions.** A rule that fires after three consecutive failures beats one that fires on the first blip, because a single failed check is often a network hiccup. **Give every rule a cooldown.** A sustained outage should produce one notification and then be quiet, not one per check for two hours. **Suppress during planned work.** A deployment window that pages the person doing the deployment teaches everyone to mute the channel. **Keep the paging set small.** Most alerts belong in a channel somebody reads in the morning. The ones that wake a person up should be few enough that each one is worth it. One consequence deserves stating plainly. An authentication failure on a monitor is not an outage, because the service is fine and the credential expired. Treating those two as the same event is how a rotated token becomes a 3 a.m. incident. ## In Routebase A monitor is a scheduled check against one target, either a URL you type or an endpoint from your specification. Intervals run from 30 seconds to an hour, and each run is recorded as a check with its own timing breakdown. That breakdown covers DNS, connect, TLS, first byte and download, so network latency is separated from server time. _Screenshot: A drifting endpoint names the field, the type the contract promised and the type the service actually returned._ Linking a monitor to an environment applies that environment's variables and authentication to every check. A target URL written against the base URL variable then resolves correctly, and the check carries the configured credentials. **Generate from Spec** provisions monitors for a whole specification in one wizard, and it is idempotent, so re-running it after adding endpoints fills only the gaps. Contract validation runs on the same checks. Each response is validated against the version the environment pins, and where nothing is pinned it falls back to the latest published version. Every drift record names its baseline, so history stays honest after a pin moves, and the monitor detail page turns amber with a **Re-pin** button when the pin has fallen behind what is published. A deviation that keeps appearing becomes a drift event with a first-seen date, an observation count and a lifecycle you acknowledge and close. The Contract Drift page groups those events per endpoint, across every environment that saw them. **Watch this API for drift** does the whole setup from one dialog, provisioning endpoint-linked monitors with validation for a specification in one environment. Disabling it later turns validation off and leaves the monitors running as uptime checks, so no history is lost. Failed checks carry a structured reason, and an authentication failure gets its own badge instead of looking like an outage. A monitor whose endpoint has never answered reports as waiting for deployment and is excluded from every health figure, so a service that has not shipped yet does not report zero percent uptime. **Field freshness** watches specific JSONPaths for values that stop changing, and that is the failure a schema check cannot see. Alert policies carry rules for downtime, latency threshold, error rate and schema drift, each with a cooldown that defaults to 30 minutes. Policies are assigned per environment, per specification or per monitor, with the most specific winning, and maintenance windows suppress alerts during planned work. See [Monitors](https://docs.routebase.dev/monitors/), [Contract Drift](https://docs.routebase.dev/contract-drift/), [Alert Policies](https://docs.routebase.dev/alert-policies/) and [Maintenance Windows](https://docs.routebase.dev/maintenance-windows/). ## Frequently asked questions ### Is monitoring part of API testing? It is the part that runs after the release. The tests in a pipeline prove that a build matched the contract before it shipped, and a production check sends the same kind of request on a schedule to the environment your customers are using. That is the only environment that tells you the truth, so a test strategy that stops at the release leaves it unchecked. ### Why validate the contract in production when the tests already passed? A passing suite proves the build matched the contract when the suite ran. Production can still start returning a different shape later while every status code stays 200. Validating the response a monitor fetches anyway catches that at almost no extra cost, as long as it compares against the version the environment is pinned to serve. ### What can a contract check in production not catch? It cannot catch a field that keeps its shape and stops changing value. A timestamp frozen since Tuesday, a price feed that went stale or a counter that stopped counting all pass schema validation perfectly. Watching the few fields where staleness is the real failure mode covers that gap, and doing it for every field is wasted effort. ### How do you avoid alert fatigue from API monitoring? Alert on sustained conditions rather than on single events, so a rule that fires after several consecutive failures beats one that fires on the first blip. Give every rule a cooldown so a long outage produces one notification rather than a hundred, and suppress alerts during planned maintenance. Keep the set of things that page a human small enough that each one is worth waking up for. --- # Testing an API With an AI Agent Over MCP — Routebase > What an agent can reliably derive from a specification, what it must not decide on its own, and why the permission model matters more than the model does. Canonical page: https://routebase.dev/guides/api-testing/testing-with-an-agent-over-mcp/ Chapter 11 of 12 · API Testing · Last reviewed 2026-09-12 by The Routebase Team. Most of the work in building a test suite is transformation rather than judgement. Take an endpoint, read its documented status code, its response schema and its required fields, and produce a case that asserts exactly those things. Repeat for every endpoint. That is precisely the shape of work to hand to an agent, and it is also where the useful boundary sits. ## What an agent derives reliably Given a specification, an agent produces the mechanical layer of a suite without inventing anything. | Task | Why it works | |---|---| | A case per endpoint with the documented success status | The status is in the specification | | A schema check on each response | The schema is in the specification | | Assertions on the required fields | Required is a property of the schema | | A request body from the documented example or schema | Both are in the specification | | A scenario that chains create, read, update and delete | The path structure implies the order | | Sensible names and folder structure | Derived from paths and tags | None of that requires the agent to know what your business does. It requires the specification to be accurate. That is a different problem, and one you want solved anyway. ## What it must not decide alone Three categories need a person, and naming them explicitly matters because an agent will produce plausible output for all three. **What counts as correct behaviour.** The specification says the response has a `total` of type number. It does not say the total should be the sum of the line items minus the discount, and an agent that invents that rule has written a test that encodes a guess. **What to relax when a test goes red.** A failing assertion has two possible fixes. You change the service, or you change the test. Only one of those is usually right, and choosing wrongly turns a test suite into a record of what the service happens to do. **Where a write-heavy suite may point.** An agent asked to "run the tests" has no way to know that one environment in the list is production. The pattern that works is that the agent produces cases and diffs, and a person approves anything that changes what the suite promises. ## The permission model matters more than the model The interesting safety question about an agent is not how clever it is. It is what it is allowed to do when it is wrong. An agent operating through a credential that can only read specifications and execute tests in one project cannot delete a specification, however confidently it decides that would help. The blast radius is set by the credential and not by the prompt. That is the property you want. Three practices follow. **Scope the credential to one project.** Nothing else in the organisation is then reachable. **Grant only the operations the task needs.** Writing tests needs write access to testing, and it does not need publish rights on specifications. **Point it at an environment you can afford to have written to.** An agent that creates test data in staging is doing its job, and the same agent pointed at production is an incident. ## Where an agent is genuinely better than a person Two situations, and they have a common shape. **Bulk transformation.** Two hundred endpoints, each needing the same four assertions, is work a person does worse over time as attention degrades. An agent does the two hundredth exactly as it did the first. **Reconciliation.** Comparing a suite against a specification and reporting which endpoints have no coverage, which cases assert nothing beyond a status code, and which have drifted from the contract is tedious and mechanical. It is also the kind of review that never gets scheduled. Both are cases where the boring, consistent option beats the careful one, because the task rewards consistency rather than insight. ## In Routebase Every Routebase workspace includes an MCP server, and it covers the product's feature set, not a read-only slice. The product page for [agent-ready APIs](https://routebase.dev/agent-ready-apis/) covers the API side of the same story, from descriptions to error bodies. An agent connected to it works the same specifications, suites, cases and runs your team works, so nothing is transcribed between two systems. _Screenshot: A key for an agent grants named permissions instead of everything, and each permission can be held to a single project._ In practice an agent can read a specification, create a suite and add a case per endpoint with its assertions. It links each case to its endpoint so schema validation applies, runs the suite against an environment, and reads the structured results back. When something fails it can fetch the case detail, the resolved request and the assertion comparison. That is enough to propose a fix instead of guessing at one. The permission model is the part to understand before you connect anything. An agent authenticates with an API key carrying explicit scopes, or through an OAuth sign-in that follows your organization role. The enforcement happens in two places. Tool discovery advertises only what the credential allows, and the server checks again when a tool is called. A key can additionally be restricted to a single project, and a key restricted that way cannot reach the rest of the organisation regardless of what the agent is asked to do. Some limits are structural rather than a matter of permissions. There is no tool that changes a plan, buys seats or touches a payment method, and no tool that grants a role, invites a member or changes SSO configuration. Secret variables are write-only, because every read masks the value. Those are not settings you can loosen, and their being fixed is the point. The [MCP Quickstart](https://docs.routebase.dev/mcp-quickstart/) covers connecting a client, and [MCP Authentication](https://docs.routebase.dev/mcp-authentication/) covers scopes and what an agent can never do. ## Frequently asked questions ### What is MCP in the context of API testing? The Model Context Protocol is an open standard that lets an AI agent call tools exposed by a server, rather than guessing at an interface from documentation. For API testing that means an agent can read your specification, create test cases, run a suite and read the results back as structured data. The agent works the same objects your team works, so nothing has to be transcribed between the two. ### Can an AI agent write API tests? It can write the mechanical majority of them well, which is a case per endpoint with the documented status code, a schema check and assertions on the required fields. That work is a transformation of the specification rather than a judgement call, so it is exactly the kind of task to hand over. The cases that encode a business rule still need a person, because the specification does not say what the answer should be. ### Is it safe to let an AI agent run tests against my API? It is as safe as the credential you give it, which is why the permission model matters more than the model does. Give the agent a scoped credential limited to one project and to the operations it needs, and point it at an environment you can afford to have written to. An agent working under a narrow credential cannot exceed it, whatever it is asked to do. ### What should an AI agent not decide when writing tests? It should not decide what counts as correct business behaviour, what may be relaxed when a test goes red, or which environment a write-heavy suite may target. Those are judgement calls with consequences outside the test suite. A useful division is that the agent produces the cases and the diffs, and a person approves anything that changes what the suite promises. --- # What to Look For in API Testing Tools — Routebase > Nine questions that separate a testing tool your pipeline can rely on from one that only demos well, from spec validation to CI exit codes. Canonical page: https://routebase.dev/guides/api-testing/api-testing-tools/ Chapter 12 of 12 · API Testing · Last reviewed 2026-09-27 by The Routebase Team. An API testing tool shows its limits on the day a suite meets real authentication, chained state and a pipeline that has to trust its exit code. A demo API never gets there. The questions below probe for that day, and they apply to the tool you already have as much as to a new one. ## Nine questions for a testing tool ### 1. Can it validate against a specification Ask whether the tool can check a live response against a documented schema, and whether it does that continuously or only at import time. The difference decides how the suite ages. A tool that imports endpoints once gives you a starting suite that begins drifting the moment the specification moves. A tool that validates against the specification on every run catches the entire class of shape breakage without anyone editing a test. If your APIs have no specification, this criterion is a bet on where you want to be instead of where you are. It is usually a bet worth making. ### 2. Does it cover the authentication your APIs actually use Count the schemes across your estate before you look at any tool. Most teams find more than they expected, because the internal service uses a signed header, the partner API wants OAuth with a specific grant, and something old still runs on digest. A tool that covers the common cases and leaves you scripting the rest turns those exceptions into permanent maintenance. The [authentication guide](https://routebase.dev/guides/api-authentication/) covers the methods themselves. ### 3. What does it do about test data This is the criterion that separates a suite that survives from one that gets abandoned, and it is almost never in a feature comparison. Ask three questions. Where does reference data live, and can several tests share it without copying. How does state get created before a run and removed afterwards. Can one case run across many input rows without becoming many cases. A tool with no answer to those pushes the work into shell scripts beside the suite, and those scripts drift from the tests they support. ### 4. What contract does it offer CI A pipeline needs three things from a test runner. Those are an exit code that distinguishes a failed run from a broken one, a report format the platform renders natively, and a credential model that is not a person's login. Ask specifically whether the exit codes are documented and stable. A runner that changes what an exit code means in a minor release breaks every pipeline that branched on it, and you find out from a build that passes when it should not. ### 5. Declarative by default, scriptable when needed Most assertions are a status code, a field value or a shape. Writing those as code produces a codebase to maintain in a language chosen by whoever set the tool up. Most is not all, and the remainder is where a purely declarative tool becomes painful. A signature to compute, a value to transform between steps or a custom payload to build all need an escape hatch. The combination to look for is declarative by default with scripting available, because a tool offering only one of the two forces the wrong shape on half your tests. ### 6. Can the same suite run everywhere Check whether environment-specific values live in the environment or in the test. If a tool makes you duplicate a suite per stage, you will maintain that duplication forever. Related, and easy to overlook, is whether the tool can protect an environment from writes. A guard that refuses a write against production is worth more than a convention. ### 7. Does it see production A tool that stops at the pipeline covers the changes that went through the pipeline. Configuration edits, dependency updates and upstream providers changing behaviour do not, and those are ordinary causes of breakage. Ask whether the same contract you test against in CI is validated against the deployed service afterwards, and whether a mismatch produces a record with a first-seen date and not a line in a log. ### 8. What happens to your work if you leave Export is a criterion rather than an afterthought, and it is worth asking about while you still have leverage. Ask what comes out, in what format, and whether that format is one anything else reads. The sharper question is more specific than "can I export". It is whether the export round-trips, meaning whether what comes out could be imported somewhere and still run. A dump of internal identifiers meets the letter of the promise and gives you nothing you can move. ### 9. Does it price the way you will use it Two questions catch most of the surprises here, and both are about the meter rather than the headline price. Ask what exactly is counted, and what happens when you cross the line. A per-run or per-execution meter interacts badly with the thing you actually want, namely tests that run often. Check what a monitor costs when it runs every minute, and what a data-driven suite costs when it runs across two hundred rows. ## A scorecard for testing tools | Criterion | Question | Weight it if | |---|---|---| | Specification binding | Does it validate live responses against a documented schema | You have or want a specification | | Auth coverage | Does it cover every scheme in your estate | You have more than two | | Test data | Fixtures, setup, cleanup, per-row runs | Your tests write anything | | CI contract | Stable exit codes, native report format, machine credentials | You gate merges | | Assertion model | Declarative default with a scripting escape hatch | More than one person maintains the suite | | Environment model | One suite, many stages, with a write guard | You have more than one environment | | Production coverage | Contract validation on the deployed service | You deploy more than monthly | | Export | Does it round-trip | Always | | Pricing shape | What is metered | You intend to run tests often | ## Port one real suite, then run it for a week A feature list rewards whichever vendor wrote the longest one, and that is not the same as rewarding you. Two exercises give you an answer that survives the trial period. **Port one real suite.** Not a demo API, and not the simplest thing you own. Take a suite with authentication, chained state and a data-driven case, and rebuild it. You will learn more in an afternoon than from a month of comparison tables. **Run it in your pipeline for a week.** Wire the gate, break something on purpose, and see what the pull request looks like. The tool that produces a readable failure in the place people already look is the one that gets used. ## In Routebase Routebase was built around the first criterion. A specification is the oracle here, not a starting template. A test case links to a designed endpoint, and every run validates the live response against that endpoint's documented schema, so a shape change fails the test without anyone editing it. The same contract is validated against the deployed service afterwards by monitors, and a deviation becomes a drift record instead of a line in a log. The other criteria are covered in the same workspace. Ten authentication schemes are available at environment, suite and case level, with credentials referenced as variables instead of pasted in. Fixtures, seeds, snapshots and data sets handle test data natively. Assertions are declarative across six types and ten operators, with a scripting sandbox for the cases that need one. Environments carry their own base URL, variables and credentials, and one can be marked read-only so writes are refused before a socket opens. The CLI publishes stable exit codes and writes JUnit and SARIF, and specifications export as OpenAPI 3.0, 3.1 or 3.2 in YAML or JSON. If you are weighing Routebase against a specific tool, the comparison pages carry the row-by-row detail, including the rows where we do not win. Start with [Postman](https://routebase.dev/postman-alternative/), [Insomnia](https://routebase.dev/insomnia-alternative/), [Bruno](https://routebase.dev/bruno-alternative/), [Apidog](https://routebase.dev/apidog-alternative/), [Swagger](https://routebase.dev/swagger-alternative/), [Stoplight](https://routebase.dev/stoplight-alternative/), [ReadMe](https://routebase.dev/readme-alternative/) or [Mintlify](https://routebase.dev/mintlify-alternative/), or see what the testing side covers on the [API testing page](https://routebase.dev/api-testing/). ## Frequently asked questions ### What should you look for in an API testing tool? Ask whether it validates responses against a specification, whether it covers the authentication schemes your APIs actually use, and how it handles test data. Then ask what contract it offers your CI pipeline, and what happens to your work if you leave. Those five decide whether the tool still fits in two years. Features that demo well and only matter on the first afternoon are a poor basis for a decision that a team lives with daily. ### Do API testing tools need to support OpenAPI? They need it for contract testing, because a contract test validates a response against a documented shape and there is nothing to validate against otherwise. Functional, workflow and performance testing all work without a specification. The question to ask is not whether the tool reads OpenAPI, since most do, but whether it validates live responses against it or merely imports endpoints once and forgets where they came from. ### Should API tests be written as code or configured declaratively? Declarative assertions cover the large majority of cases and stay readable for people who do not maintain the suite, so they are the better default. Scripting matters for the remainder, which is usually a signature to compute or a value to transform between steps. The combination to look for is declarative by default with an escape hatch, because a tool offering only one of the two forces the wrong shape on half your tests. ### How important is CI integration when choosing an API testing tool? It is the difference between a tool that gets used and one that gets opened occasionally. Look for a runner that exits non-zero on failure, distinguishes a failed run from a run that never happened, and writes a report format your platform renders natively. Without those three, every pipeline that uses the tool grows a layer of glue that somebody has to maintain. --- # API Authentication: Methods and Trade-offs — Routebase > A map of every authentication method an API might use, what each one is actually for, where its weaknesses are, and how to choose between them. Canonical page: https://routebase.dev/guides/api-authentication/ Guide overview · 11 chapters · Last reviewed 2026-09-12 by The Routebase Team. Every API request that is not public has to answer one question before anything else happens. Who is asking, and API authentication is how the request answers it. The methods that answer it look very different from each other, and almost all of the difference comes down to three properties. Where the credential travels, what the server has to know to validate it, and how fast you can take it away again. This guide covers every method you are likely to meet, including the ones that predate the modern stack and the ones no tool sets up for you. Each chapter says what the method is for, where it goes wrong, and how to configure it in practice. Every security claim carries the RFC it comes from, because a confident wrong answer in an authentication guide is expensive. ## Authentication is not authorization The distinction sounds pedantic and it is the source of the most common serious flaw in APIs. **Authentication** establishes identity, and its failure mode is a 401. **Authorization** decides what that identity may do, and its failure mode is a 403. An endpoint that checks the first and forgets the second is the pattern behind broken object level authorization, which sits at the top of the OWASP API Security Top 10 from 2023. The caller is genuinely who they say they are, and they are reading somebody else's record. Everything in this guide is about the first question. The second one is covered in [testing authentication](https://routebase.dev/guides/api-authentication/api-authentication-testing/), because the only reliable way to know your authorization works is to send two identities at it. ## Where the credential travels, and why it matters | Location | Example | What to know | |---|---|---| | `Authorization` header | `Bearer eyJ…` | The default for good reasons, because it is not logged by default and not cached | | A custom header | `X-API-Key: …` | Equivalent in practice, and it needs a CORS entry for browser callers | | Query string | `?api_key=…` | Lands in access logs, browser history, referrer headers and shared URLs | | Cookie | `Set-Cookie: session=…` | Sent automatically by browsers, both the feature and the CSRF risk | | Request body | `{"token": "…"}` | Rare, awkward to cache and awkward to proxy, and it rules out GET | The query string row is the one that causes real incidents. A credential in a URL is also in the reverse proxy log, in the browser history and in the referrer header of the next outbound link. It ends up in the support ticket where somebody pasted the URL. RFC 6750 says exactly this about bearer tokens in URIs, and the reasoning applies to keys too. ## Transport is a precondition, not a method None of these schemes protect the credential in transit. TLS does that, and without it every method here is equivalent to shouting the password. Two specific consequences follow. Basic authentication is not "insecure" in the sense people usually mean, because it is exactly as secure as the channel underneath it. And a token that has travelled over plain HTTP once should be treated as compromised, because you have no way to know whether it was. ## Three situations, and what fits each Almost every real decision is one of these three. **A machine calling a machine.** A background job, a partner integration, a service in your own estate. There is no user, so there is nothing to delegate. An [API key](https://routebase.dev/guides/api-authentication/api-keys/) or the [client credentials grant](https://routebase.dev/guides/api-authentication/oauth-2-grant-types/) covers it, and the grant wins where you want short-lived tokens and central revocation. **Acting on behalf of a user.** A third-party application wants to read a user's data with their permission. This is what OAuth 2.0 was designed for, and [authorization code with PKCE](https://routebase.dev/guides/api-authentication/oauth-2-grant-types/) is the current answer. Add [OpenID Connect](https://routebase.dev/guides/api-authentication/openid-connect/) when you also need to know who the user is and not only what they permitted. **A browser talking to your own API.** The credential has to survive a page reload and it has to be unreachable from injected script. A cookie with `HttpOnly`, `Secure` and a sensible `SameSite` usually beats a token in local storage, which [mutual TLS, cookies and custom HMAC](https://routebase.dev/guides/api-authentication/mutual-tls-cookies-and-custom-hmac/) covers. ## The map of methods | Method | Built for | Chapter | |---|---|---| | API keys | Identifying a calling application | [API keys](https://routebase.dev/guides/api-authentication/api-keys/) | | HTTP Basic | Sending a username and password over TLS | [Basic and Digest](https://routebase.dev/guides/api-authentication/http-basic-authentication/) | | HTTP Digest | Password authentication without sending the password | [Basic and Digest](https://routebase.dev/guides/api-authentication/http-basic-authentication/) | | Bearer tokens | Carrying an issued token | [Bearer tokens and JWT](https://routebase.dev/guides/api-authentication/bearer-tokens-and-jwt/) | | JSON Web Tokens | Carrying signed claims the server can validate without a lookup | [Bearer tokens and JWT](https://routebase.dev/guides/api-authentication/bearer-tokens-and-jwt/) | | OAuth 2.0 | Delegated access without sharing the password | [OAuth 2.0 grants](https://routebase.dev/guides/api-authentication/oauth-2-grant-types/) | | OpenID Connect | Identity on top of OAuth 2.0 | [OpenID Connect](https://routebase.dev/guides/api-authentication/openid-connect/) | | OAuth 1.0, AWS SigV4, Hawk, NTLM | Signing the request, not sending a token | [Signature-based and legacy](https://routebase.dev/guides/api-authentication/request-signing/) | | Mutual TLS | Certificates as identity at the transport layer | [Mutual TLS and friends](https://routebase.dev/guides/api-authentication/mutual-tls-cookies-and-custom-hmac/) | | Session cookies | Browser sessions against your own API | [Mutual TLS and friends](https://routebase.dev/guides/api-authentication/mutual-tls-cookies-and-custom-hmac/) | Two further chapters cover the practice, not the methods. [Designing authentication into your OpenAPI spec](https://routebase.dev/guides/api-authentication/openapi-security-schemes/) is how consumers and agents learn which scheme an endpoint expects, and [setting it up in Routebase](https://routebase.dev/guides/api-authentication/setting-up-authentication-in-routebase/) is the end-to-end configuration walkthrough. ## The short version of the decision The full table lives in [choosing a method](https://routebase.dev/guides/api-authentication/choosing-an-api-authentication-method/), and this is the part most people need. - Machine to machine, inside your control: an API key, scoped and rotatable. - Machine to machine, where you want short-lived credentials: OAuth 2.0 client credentials. - On behalf of a user, any client type: OAuth 2.0 authorization code with PKCE, per RFC 7636. - You also need the user's identity: OpenID Connect. - Browser session against your own API: a cookie with `HttpOnly`, `Secure` and `SameSite`. - Very high assurance between known parties: mutual TLS, usually alongside one of the above. What should not be on that list is a custom scheme you designed. RFC 9700 documents what the OAuth working group has learned across two decades, and a scheme written in an afternoon has not learned any of it. ## In Routebase Routebase carries a catalogue of ten authentication schemes plus none, and the same catalogue appears everywhere authentication is configured. That means environments, test suites, individual test cases and security personas all use the identical editor, so a scheme you set up once behaves the same wherever you apply it. _Screenshot: The catalogue groups the schemes by family, and every entry configures the same way at environment, suite, case and persona level._ The catalogue covers Basic, Bearer and API Key, where the key travels in a header or a query parameter under a name you choose. It also covers OAuth 2.0 with four grant types, OAuth 1.0, JWT Bearer signed from a secret or a private key, Digest, AWS Signature V4, Hawk and NTLM. Every credential field accepts a `{{VARIABLE}}` placeholder resolved from the environment's variables, so the scheme lives in the configuration and the secret lives in a secret variable. Read on for the method you need, or jump straight to [setting up authentication in Routebase](https://routebase.dev/guides/api-authentication/setting-up-authentication-in-routebase/). The product documentation for the configuration surface is [Project Auth](https://docs.routebase.dev/project-auth/). What happens after the token is valid, meaning whether this caller may have this object, is the subject of the [API security guide](https://routebase.dev/guides/api-security/). ## Frequently asked questions ### What is API authentication? API authentication is how a request proves who or what is making it. It answers the question of identity, and that is separate from authorization, since authorization decides what the identity is then allowed to do. Most of the methods in use today differ in only three respects. Those are where the credential travels, whether the server has to store anything to validate it, and how quickly a compromised credential can be withdrawn. ### What are the main API authentication methods? API keys identify a calling application, HTTP Basic and Digest send a username and password, and bearer tokens carry a token that the server validates. JSON Web Tokens are bearer tokens that carry signed claims, so the server can validate them without a lookup. OAuth 2.0 issues those tokens through several grant flows, OpenID Connect adds identity on top of it, and signature-based schemes such as AWS Signature V4 sign the request itself instead of sending a token. ### What is the difference between authentication and authorization? Authentication establishes who is calling, and authorization decides what that caller may do. A request can be perfectly authenticated and still be refused, and that is the difference between a 401 and a 403. Confusing the two is how endpoints end up checking that somebody is logged in without checking that the object they asked for is theirs, and that is the most common serious API flaw there is. ### Which API authentication method should I choose? For machine-to-machine calls between services you control, an API key or the OAuth 2.0 client credentials grant covers it, with the grant preferred where you want short-lived tokens and central revocation. For acting on behalf of a user, use OAuth 2.0 authorization code with PKCE, and add OpenID Connect when you also need to know who the user is. For browser-facing sessions, a cookie with the right attributes usually beats a token in storage. ## Chapters in this guide 1. [API Keys: What They Are and What They Are Not](https://routebase.dev/guides/api-authentication/api-keys/index.md): How an API key differs from a user credential, why the query string is the wrong place for one, and what scoping, rotation and per-key rate limits buy you. 2. [HTTP Basic Authentication and Digest, Explained](https://routebase.dev/guides/api-authentication/http-basic-authentication/index.md): Why Base64 is not encryption, what Digest was designed to solve, where both still make sense, and the challenge-response mechanics behind them. 3. [Bearer Tokens and JWT](https://routebase.dev/guides/api-authentication/bearer-tokens-and-jwt/index.md): Opaque tokens against self-contained ones, what a JWT actually guarantees, the validation mistakes that keep recurring, and what RFC 8725 says about them. 4. [OAuth 2.0: The Grant Types, Explained](https://routebase.dev/guides/api-authentication/oauth-2-grant-types/index.md): The four roles, the grants that matter today, why PKCE is now required for every authorization code flow, and what RFC 9700 has retired. 5. [OpenID Connect](https://routebase.dev/guides/api-authentication/openid-connect/index.md): The identity layer on top of OAuth 2.0, why an ID token is not an access token, what discovery buys you, and when plain OAuth is the right answer instead. 6. [Request Signing: OAuth 1.0, AWS SigV4 and Hawk](https://routebase.dev/guides/api-authentication/request-signing/index.md): What request signing buys you over a bearer token, how nonces and timestamps stop replay, and where each of these four schemes still turns up. 7. [Mutual TLS, Cookies and Custom HMAC Schemes](https://routebase.dev/guides/api-authentication/mutual-tls-cookies-and-custom-hmac/index.md): Certificates as identity at the transport layer, cookies and CSRF, and why a home-grown signing scheme is usually a worse version of one that already exists. 8. [OpenAPI Security Schemes and Per-Endpoint Auth](https://routebase.dev/guides/api-authentication/openapi-security-schemes/index.md): Security schemes, per-operation requirements, scopes, and what consumers and agents can only learn from a specification that documents its authentication. 9. [Setting Up API Authentication in Routebase, End to End](https://routebase.dev/guides/api-authentication/setting-up-authentication-in-routebase/index.md): Configure credentials once per environment, inherit them everywhere, keep secrets in variables, and cover the pipeline, scans and agents from one setup. 10. [API Authentication Testing: The Negative Cases](https://routebase.dev/guides/api-authentication/api-authentication-testing/index.md): The negative cases worth writing, why 401 and 403 mean different things, and how two identities prove what a single-user suite structurally cannot. 11. [Choosing an API Authentication Method](https://routebase.dev/guides/api-authentication/choosing-an-api-authentication-method/index.md): A decision table across complexity, revocation, rotation, delegation, browser exposure and maturity, plus the four questions that usually settle it first. --- # API Keys: What They Are and What They Are Not — Routebase > How an API key differs from a user credential, why the query string is the wrong place for one, and what scoping, rotation and per-key rate limits buy you. Canonical page: https://routebase.dev/guides/api-authentication/api-keys/ Chapter 1 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. The API key is the oldest and most misunderstood credential on the list. It is trivially easy to build, and that simplicity is a feature. It also carries a set of properties people assume it has and it does not. ## What a key actually is A key is one opaque string that the caller sends on every request. The server holds a record saying which caller that string belongs to and what it may do, so the check is a lookup. That is the whole mechanism, and everything else follows from what it lacks. | Property | A key has it | Consequence | |---|---|---| | Identifies the caller | Yes | Good for attribution, quotas and per-caller limits | | Proof of possession | No | Anyone with the string is the caller | | Expiry | Only if you add one | A leaked key works until somebody revokes it | | Integrity over the request | No | The key does not sign anything, so TLS is doing all the work | | A user identity | No | It says which application, not which person | The last row causes the most confusion. A key identifies an integration, so an API that also needs to know which end user is affected has to carry that separately, whether as a parameter, a second header or a token. ## Header, not query string This is the one hard rule in the chapter. ```txt # Yes GET /v1/orders X-API-Key: rb_live_9f2a... # No GET /v1/orders?api_key=rb_live_9f2a... ``` A credential in the query string is written to the reverse proxy access log, kept in browser history and sent in the referrer header of the next outbound request. It travels along whenever anyone shares the URL. RFC 6750 makes the same argument about bearer tokens in URIs, and the reasoning transfers directly. Sometimes the query string is genuinely unavoidable, usually for a webhook target or an image URL that cannot carry headers. Treat that key as a separate, narrower credential with a short life and a single permission. Between the standard `Authorization` header and a custom one such as `X-API-Key` there is little to choose. `Authorization` is conventional and gets special handling by some proxies, and a custom header is unambiguous when a request already carries a user token. Browser callers need the header name in the CORS allow list either way. ## Scoping is what makes a key safe to hand out A key that can do everything is a key you cannot give to anything. Two dimensions of scoping do most of the work. **Permissions.** A key that only reads cannot delete, no matter what calls it. This turns a compromised build script from an incident into a log line. **Resource restriction.** A key limited to one project, tenant or account cannot reach the rest, whatever the caller asks. This is the dimension people forget, and it is the one that limits the blast radius when the permission model turns out to have a gap. The habit to build is one key per integration instead of one key per team. Revoking a key then stops one thing and not everything, and the last-used timestamp tells you whether that integration is still alive. ## Rotation is a mechanism, not an intention Every organisation intends to rotate keys, and the ones that manage it have built one thing, namely support for two live keys at once. Without overlap, rotation is a coordinated outage. Somebody has to revoke the old key and deploy the new one at the same instant across every consumer, so it gets postponed until an incident forces it. With an overlap in place, rotation becomes a routine nobody dreads. Issue the new key, let consumers adopt it, watch the old key's last-used timestamp go quiet, and then revoke it. Three supporting details make the difference. **Expiry dates.** A key with an expiry produces a warning before it becomes an incident. A key with none outlives the integration it was created for. **Last-used tracking.** This is what tells you a key is safe to revoke, and it is also how you find the keys nobody remembers issuing. **Show the key once.** A key the server can read back is a key that can be exfiltrated from the server. Store a hash, display the value once at creation, and make people generate a new one when they lose it. ## Rate limits belong per key A rate limit keyed to the IP address punishes everyone behind a shared address, which today means an office, a cloud provider region or a mobile carrier. Once you have per-key identity, use it. Per-key limits also give you something a global limit cannot. You see one integration misbehaving without it affecting the others. That signal is usually the first sign of a retry loop somebody deployed by accident. ## Detecting a leaked key Keys leak sooner or later, and most often they leak into a public repository. Two cheap measures reduce the damage. **Give keys a recognisable prefix.** A key that starts with a distinctive marker can be found by secret scanners, including the ones that scan public repositories and notify the issuer. A key that looks like a random base64 blob cannot. **Alert on impossible use.** A key issued to a build pipeline that suddenly calls from a residential address is worth a notification. So is one that was quiet for a month and then starts enumerating. ## In Routebase Two things need separating here, because both are called API keys. _Screenshot: The key name is yours to choose, and the value is a reference to an environment variable rather than the key itself._ **The keys your API uses.** In an environment's authentication configuration, the API Key type sends a key as either a header or a query parameter, with the key name entirely up to you. The value accepts a `{{VARIABLE}}` placeholder resolved from the environment's variables, so the key lives in a secret variable and the tests reference it. The same configuration works at suite and case level, and in a security persona. **The keys Routebase itself issues.** Under Settings, an API key gives machines access to your organisation for CI pipelines, the CLI and AI agents over MCP. Each key is either full access or scoped to individual permissions, and every selected permission can additionally be restricted to a single project. A key restricted that way cannot touch the rest of the organisation, whatever the caller asks it to do. The keys Routebase issues carry every practice described above. They start with a recognisable prefix, and the full value is shown exactly once at creation and never again. The list then shows only the prefix and the last-used timestamp, and an expiry is chosen at creation from never through to a year. Permissions can be edited later without re-issuing the key, and revoking one moves it to a separate list so the audit trail survives. See [Project Auth](https://docs.routebase.dev/project-auth/) for the scheme your API uses, [API Keys](https://docs.routebase.dev/api-keys/) for the keys Routebase issues, and [MCP Authentication](https://docs.routebase.dev/mcp-authentication/) for how scopes gate what an agent can even see. ## Frequently asked questions ### What is an API key? An API key is a single opaque string that a caller sends with every request to identify itself. It usually identifies an application or an integration rather than a person, and it carries no expiry, no signature and no proof that the sender is the party the key was issued to. Anyone holding the string is the caller as far as the server is concerned, which is why storage and rotation matter more for keys than for almost any other credential. ### Where should an API key be sent? In a request header, either the standard Authorization header or a dedicated one such as X-API-Key. Headers are not written to access logs by default, they do not appear in browser history, and they are not passed on in referrer headers. A key in the query string ends up in all three, which is why RFC 6750 advises against putting bearer credentials in URIs. ### How often should API keys be rotated? Often enough that rotation is a routine you have practised rather than an emergency you improvise. A ninety-day cycle suits most integrations, and the mechanism matters more than the interval, since a key you cannot rotate without downtime will not be rotated. Support two live keys at once so a caller can adopt the new one before the old one is revoked. ### What is the difference between an API key and a token? An API key is long-lived, opaque and usually tied to an application, so it is closer to a permanent name badge. A token is short-lived, issued through a flow, and often carries claims about who authorised it and what it may do. The practical consequence is that a leaked token expires on its own while a leaked key keeps working until somebody notices. --- # HTTP Basic Authentication and Digest, Explained — Routebase > Why Base64 is not encryption, what Digest was designed to solve, where both still make sense, and the challenge-response mechanics behind them. Canonical page: https://routebase.dev/guides/api-authentication/http-basic-authentication/ Chapter 2 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. HTTP Basic authentication and HTTP Digest predate almost everything else in this guide. You should understand them because you will meet them, and because the reasons they lost are the reasons the newer schemes look the way they do. ## Basic, and the Base64 misunderstanding HTTP Basic, defined in RFC 7617, concatenates the username and password with a colon, encodes the result with Base64, and sends it in the `Authorization` header. ```txt Authorization: Basic YWxpY2U6c3VwM3JzM2NyZXQ= ``` Base64 is an encoding, not encryption. Decoding requires nothing but the standard library, and there is no key involved. The credential is effectively in plaintext, and TLS is the only thing protecting it. That is not a reason to never use Basic. It is a reason to be precise about what it is, namely a way to put a username and password on a request. Over TLS, between two machines, with a generated secret instead of a human password, that is a perfectly reasonable arrangement. RFC 6749 specifies exactly this for client authentication at an OAuth token endpoint. Where Basic is a poor fit is anything user-facing. It has no logout, because the browser keeps sending the credential. It has no expiry, because the credential is the password. And it offers no way to revoke one session, because there are no sessions. ## Digest, and what it was solving Digest, originally RFC 2617 and modernised in RFC 7616, was designed for a world where TLS was not universal. Its goal was to authenticate with a password without ever sending the password. The exchange has two round trips. ```txt 1. GET /resource → 401 Unauthorized WWW-Authenticate: Digest realm="api", qop="auth", nonce="dcd98b7102dd2f0e", algorithm=SHA-256 2. GET /resource Authorization: Digest username="alice", realm="api", nonce="dcd98b7102dd2f0e", uri="/resource", qop=auth, nc=00000001, cnonce="0a4f113b", response="6629fae4939..." ``` The `response` value is a hash built from the username, the password, the realm, the server's nonce, the client's own nonce, a request counter and the method with the URI. The server computes the same hash and compares. Three properties fall out of that construction. **The password never travels.** An eavesdropper sees a hash that is useless for any other request. **Replay is bounded.** The server nonce and the counter mean a captured response cannot be replayed indefinitely. **Part of the request is covered.** With `qop=auth-int` the body is included too, so a proxy cannot alter it unnoticed. ## What Digest costs The properties above are real, and so are the trade-offs that made Digest lose. | Cost | Why it matters | |---|---| | Two round trips | Every unauthenticated request is a 401 followed by a retry | | Recoverable passwords on the server | The server needs the password or a realm-specific hash to verify, so it cannot store a modern one-way hash | | Weak default algorithm | The original specification used MD5, and RFC 7616 added SHA-256 that not every implementation supports | | Nonce state | The server has to track nonces and counters to make replay protection meaningful | | No delegation | There is no way to give a third party limited access without giving them the password | The second row is the decisive one. Storing passwords in a form the server can reverse or replay is the opposite of current practice, and once TLS became universal the whole point of not sending the password evaporated. ## Where you still meet them | Scheme | Where it turns up | |---|---| | Basic | Client authentication at OAuth token endpoints, internal service calls, CI credentials, plenty of vendor APIs | | Digest | Embedded devices, cameras, printers, network equipment, some SIP deployments, older enterprise systems | Neither is a good choice for a new public API, and both are common enough that a testing tool without them makes you write custom code for the one integration that needs it. ## Practical guidance If you use Basic, use a generated secret instead of a human password, put it behind TLS with no HTTP fallback, and give it the same rotation treatment an API key gets. Never accept it on a plain HTTP listener, even one that redirects, because the credential is already sent by then. If you integrate with Digest, negotiate SHA-256 where the other side supports it, expect the extra round trip, and store the credential exactly as you would a password. Do not attempt to build Digest into a new API of your own, because everything it offers is available with less complexity from a token scheme over TLS. ## In Routebase Both schemes are in the catalogue and both configure the same way as everything else, which means at environment, suite, case or persona level. _Screenshot: Digest needs the algorithm, and the remaining parameters are there for servers that want them set explicitly._ **Basic Auth** takes a username and a password, and it sends them Base64-encoded in the `Authorization` header. Both fields accept `{{VARIABLE}}` placeholders, so the password lives in a secret variable and not in the configuration. **Digest Auth** takes the username and password plus the algorithm, with MD5, MD5-sess, SHA-256 and SHA-256-sess available. The remaining Digest parameters are there when a server needs them set explicitly. Those cover the quality of protection, the nonce count, the client nonce and the opaque value, along with a switch to disable the automatic retry. Because both live in the same catalogue as the token schemes, a suite that has to talk to one legacy service and one modern one uses suite-level or case-level overrides, not a second tool. See [Project Auth](https://docs.routebase.dev/project-auth/) for the configuration surface. ## Frequently asked questions ### Is HTTP Basic authentication secure? It is exactly as secure as the connection underneath it and no more. Basic encodes the username and password with Base64, which is an encoding rather than encryption, so anyone who can read the request can read the credential. Over TLS that is acceptable for machine-to-machine calls, and over plain HTTP it is equivalent to sending the password in the clear. ### What is the difference between Basic and Digest authentication? Basic sends the password itself, encoded but not protected, on every request. Digest never sends the password, and instead answers a server challenge with a hash computed from the password, a server nonce and details of the request. Digest therefore survives an eavesdropper on a plain connection, at the cost of a second round trip and a server that must keep the password in a recoverable form. ### Is Digest authentication still used? It appears mainly in embedded devices, network equipment, older enterprise systems and some SIP deployments, where it was the standard answer before TLS was universal. RFC 7616 modernised it in 2015 with SHA-256, and new APIs still choose a token scheme instead. The reason to understand Digest is that you will have to integrate with something that speaks it. ### When should you use Basic authentication for an API? It suits machine-to-machine calls over TLS where the credential is a generated secret rather than a human password, and where the caller cannot easily manage a token flow. Client authentication at an OAuth token endpoint is the most common legitimate case, since RFC 6749 defines exactly that. Avoid it for anything user-facing, because it offers no logout, no expiry and no way to revoke one session. --- # Bearer Tokens and JWT — Routebase > Opaque tokens against self-contained ones, what a JWT actually guarantees, the validation mistakes that keep recurring, and what RFC 8725 says about them. Canonical page: https://routebase.dev/guides/api-authentication/bearer-tokens-and-jwt/ Chapter 3 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. Bearer tokens, and the JWT in particular, are the default of the modern API, because they separate the credential from the identity. The caller presents a token instead of a password, the token can be short-lived, and it can be issued by something other than the API that accepts it. That separation is what OAuth 2.0 needs to work at all, and it comes with a property that needs naming plainly. A bearer token grants access to whoever holds it, so anyone who obtains one is the caller. There is no second factor and no proof of possession in the base scheme. ## Opaque or self-contained Two kinds of token travel the same way and behave very differently. | | Opaque token | Self-contained token, usually a JWT | |---|---|---| | What it is | A random identifier | Signed claims the recipient can read | | Validation | A lookup in the issuer's store | A signature check, with no lookup | | Revocation | Immediate, because the store is authoritative | Hard, because nothing is consulted at validation time | | Scaling | The store is on the hot path | Nothing shared is on the hot path | | Leaks information | No, it says nothing on its own | Yes, since every claim is readable by whoever holds it | The trade is revocation against a lookup. An opaque token can be withdrawn the moment you decide to, while a JWT stays valid until it expires. Adding machinery to revoke one reintroduces exactly the lookup you were avoiding. The common resolution is short-lived JWTs plus a refresh token that is opaque and revocable. Access tokens live for minutes, so a leaked one has a narrow window, and the refresh token is checked against a store where it can be withdrawn. ## What a JWT is made of A JWT is three Base64url-encoded parts separated by dots, and each part has a distinct job. ```txt eyJhbGciOiJSUzI1NiIsImtpZCI6IjJhIn0 header .eyJpc3MiOiJodHRwczovL2F1dGguZXhhbXBsZSIsInN1YiI6InVzcl85MSIsImF1ZCI6ImFwaS5leGFtcGxlIiwiZXhwIjoxNzg5MDAwMDAwfQ payload .MEUCIQDf... signature ``` The header names the signing algorithm and usually a key identifier. The payload carries claims, and RFC 7519 registers the ones that matter for validation. | Claim | Meaning | Why you validate it | |---|---|---| | `iss` | Issuer | A token from another issuer is not yours to trust | | `sub` | Subject | Who the token is about | | `aud` | Audience | A token minted for another service must not work here | | `exp` | Expiry | The only thing limiting a leaked token | | `nbf` | Not before | Rejects a token presented too early | | `iat` | Issued at | Useful for age policies and for debugging | | `jti` | Token identifier | Lets you build a denylist for the tokens you must revoke | Signing proves the token was not altered. It does not hide anything, because a signed JWT is not encrypted and every claim is readable by anyone holding the token. Encryption is a separate specification, so until you reach for it, put nothing in a JWT you would not put in a log line. ## The validation mistakes that keep recurring RFC 8725 exists because these repeat, and it is worth reading in full if you validate tokens yourself. Four are responsible for most incidents. _Figure: Every gate a token owes the receiver, with the four this section walks through marked, because each of them lets the wrong token in._ **Trusting the algorithm in the header.** The token tells you how it was signed, and a naive validator believes it. Historically that allowed `alg: none`, meaning a token with no signature at all. It also allows key confusion, where a token signed with HMAC using the public RSA key as the secret is accepted by a validator expecting RSA. The fix is to pin the algorithm you expect, per key, and reject anything else before verifying. **Not checking the audience.** An identity provider issuing tokens for several services will happily give a caller a token for service A. If service B does not check `aud`, that token works there too. **Not checking the issuer.** This is the same argument with a wider scope. A validator that accepts any correctly signed token will accept tokens from whichever issuer happens to share a key with yours. **Sloppy expiry handling.** Not checking `exp`, or allowing an unbounded clock skew to accommodate a server whose clock was wrong once, turns expiry into decoration. A skew tolerance of a minute or two is reasonable, and an hour is not. A fifth mistake is architectural, not a coding slip, and it deserves naming. Long-lived access tokens are convenient, and they remove your ability to respond to a compromise, so the lifetime belongs in minutes and not in days. ## Rotating signing keys A signing key has to be replaceable at some point, and doing that without downtime needs two things in place beforehand. The header's key identifier says which key signed this token, so a validator can hold several. Publishing your public keys at a well-known location lets validators fetch them and pick up a new one without a deployment. The rotation then works in the usual overlapping shape. Publish the new key, start signing with it, keep accepting the old one until every token signed with it has expired, and then withdraw it. ## Refresh tokens An access token measured in minutes needs something to renew it, and that is the refresh token. Three properties deserve insisting on. **Keep it opaque and stored.** The point of a refresh token is that you can revoke it, which needs a lookup. **Rotate on use.** Issue a new refresh token every time one is redeemed, and invalidate the old one. RFC 9700 recommends this for public clients. **Detect reuse.** If a refresh token is presented twice, one of the two presenters is an attacker and you cannot tell which. Invalidating the whole chain is the safe response. ## In Routebase Two entries in the catalogue cover this ground, and they differ in who mints the token. _Screenshot: The preview decodes the token as you edit it, so a malformed claim shows up before a suite depends on it._ **Bearer Token** sends a token you already have in the `Authorization` header. The value accepts a `{{VARIABLE}}` placeholder, so the token lives in a secret variable, and a token minted by a pipeline can be injected at run time instead of being stored at all. **JWT Bearer** generates a signed token for the request. You pick the algorithm from HS256, HS384, HS512, RS256, RS384 and RS512, supply either a shared secret or a private key, and write the payload as JSON. A live preview shows the token payload as you edit it, which catches a malformed claim before a suite depends on it. Custom header parameters are available for the cases that need a key identifier or a type, and the token can be placed in a header or a query parameter. That combination covers both sides of a JWT integration. A suite testing an API that accepts JWTs mints its own token with the right claims. A negative case such as an expired token or a wrong audience is then a matter of editing the payload, and nobody has to issue you a bad token. Every field accepts variable placeholders, so the signing secret or private key sits in a secret variable and never in the configuration. See [Project Auth](https://docs.routebase.dev/project-auth/) for the editor, and [testing authentication](https://routebase.dev/guides/api-authentication/api-authentication-testing/) for the negative cases worth writing. ## Frequently asked questions ### What is a bearer token? A bearer token is a string that grants access to whoever presents it, which is what the word bearer means. RFC 6750 defines how it travels, namely in the Authorization header with the Bearer scheme. The token itself may be an opaque identifier the server looks up or a self-contained token such as a JWT, and the transport is identical either way. ### What is a JWT? A JSON Web Token, defined in RFC 7519, is a compact token carrying claims as JSON, signed so a recipient can verify it was not altered. It has three Base64url parts, which are a header naming the algorithm, a payload of claims, and a signature. Because the claims travel with the token, a server can validate it without a database lookup, and that property is both its main advantage and the source of most of its problems. ### Is a JWT encrypted? A signed JWT is not encrypted, so anyone holding it can read every claim by decoding the payload. Signing proves the token was not modified and says nothing about confidentiality. Encryption is a separate specification called JWE, so until you use it, never put anything in a JWT that you would not put in a log line. ### What are the most common JWT validation mistakes? Trusting the algorithm named in the token header, which allows the none algorithm and key confusion attacks. Not checking the issuer and the audience, so a token minted for a different service is accepted. Not checking expiry, or accepting an unbounded clock skew. RFC 8725 collects these as Best Current Practice, and the short version is to pin the expected algorithm and validate every registered claim you rely on. --- # OAuth 2.0: The Grant Types, Explained — Routebase > The four roles, the grants that matter today, why PKCE is now required for every authorization code flow, and what RFC 9700 has retired. Canonical page: https://routebase.dev/guides/api-authentication/oauth-2-grant-types/ Chapter 4 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. OAuth 2.0 has a reputation for complexity. Most of that reputation comes from trying to read about all of the grants at once. The framework itself is small, and the difficulty comes from what it had to cover. Browser applications, mobile applications, server-side applications and machines all differ in their ability to keep a secret. Start with the four roles, then pick the one grant your situation calls for and ignore every other one. ## The four roles | Role | Who it is | |---|---| | Resource owner | The user who owns the data, or nobody when a machine acts for itself | | Client | The application asking for access | | Authorization server | The thing that authenticates the owner and issues tokens | | Resource server | The API that accepts the token | The distinction that matters most is between the authorization server and the resource server. They are frequently the same deployment. Treating them as one concept is how people end up with an API that mints its own tokens and calls the result OAuth. A second distinction runs through everything below, and it decides which grant applies. A **confidential client** can keep a secret, because it runs on a server you control. A **public client** cannot, because its code ships to a browser or a phone where anyone can read it. ## Client credentials, for machines There is no user in this flow, so there is nothing to delegate and no redirect to perform. The client authenticates with its own credentials and receives an access token in return. ```txt POST /oauth/token Authorization: Basic base64(client_id:client_secret) Content-Type: application/x-www-form-urlencoded grant_type=client_credentials&scope=orders.read ``` This is the grant for a background job, a service-to-service call or a partner integration. It is the closest thing OAuth has to an API key, with two differences that are usually worth the extra step. The token is short-lived, so a leak has a deadline. Revocation happens centrally at the authorization server instead of in each API. The client credentials can travel two ways, either as HTTP Basic on the token request or as parameters in the body. RFC 6749 defines both and prefers the header. Some servers only accept one, so this is a setting and not a preference. ## Authorization code with PKCE, for everything with a user This is the grant to use whenever a person is delegating access to an application. It works for server-side web applications, single-page applications and mobile applications alike. _Figure: The front channel carries only a short-lived code through the browser, and the token appears on the back channel between two servers._ ```txt 1. The client generates a random code_verifier and derives code_challenge = BASE64URL(SHA256(code_verifier)) 2. Redirect the user to the authorization server GET /authorize?response_type=code&client_id=…&redirect_uri=… &scope=orders.read&state=xyz &code_challenge=…&code_challenge_method=S256 3. The user authenticates and consents 4. Redirect back with a short-lived code GET https://app.example/callback?code=…&state=xyz 5. The client exchanges the code for tokens POST /oauth/token grant_type=authorization_code&code=…&redirect_uri=… &client_id=…&code_verifier=… ``` Two parameters in that exchange do all of the security work, and both are easy to skip. **`state`** is a value the client generates and checks on return. It ties the callback to the request the client actually started, and that is what prevents cross-site request forgery on the redirect. **PKCE**, defined in RFC 7636, ties the code to the client. Because the challenge is sent at step two and the verifier only at step five, an attacker who intercepts the code at step four cannot redeem it. RFC 9700 extends this requirement from public clients to every authorization code flow, since the protection costs nothing. The redirect URI has to be registered in advance and matched exactly when the browser comes back. Wildcard or prefix matching is how authorization codes end up delivered to an attacker-controlled path. ## The two grants you should not use **Implicit.** It returned the access token directly in the URL fragment, so the token landed in the browser history, in anything reading the page, and potentially in a referrer header. There was no client authentication and no refresh path. RFC 9700 states plainly that it should no longer be used, and authorization code with PKCE covers the same case properly. **Resource owner password credentials.** The client collects the user's username and password and exchanges them for a token. That is the exact thing OAuth was invented to avoid, it defeats multi-factor authentication, and it makes every client a place where passwords are handled. RFC 9700 retires it too. Where you find it in the wild it is usually a first-party mobile application from before the alternatives were mature. Both still appear in tools and in vendor documentation, and both remain necessary on occasion when you integrate with something old. Knowing why they are retired is what lets you argue for a migration. ## Scopes, and where they stop A scope is a string the client requests and the authorization server may grant, and it appears in the resulting token. Two properties of a scope need stating clearly before you rely on one. Scopes are coarse by design, and that coarseness is the part people misread. `orders.read` says the client may read orders, and it says nothing whatever about whose orders. That second question is authorization on the resource server, and no scope answers it. An API that treats a valid scope as sufficient has broken object level authorization by construction. Scopes are a request, not a grant. A client asking for five scopes may receive three, so the token has to be read for what it carries and not for what was asked. ## Token lifetimes in practice | Token | Reasonable lifetime | Why | |---|---|---| | Access token | Minutes to an hour | It is a bearer credential, so its lifetime is your exposure window | | Refresh token | Days to months, rotated on use | It is revocable, so it can live longer safely | | Authorization code | Seconds, single use | It only has to survive one redirect | Refresh token rotation repays the implementation effort it costs. Issue a new refresh token on every redemption, invalidate the old one, and treat a reused token as a compromise of the whole chain. ## In Routebase OAuth 2.0 is one entry in the authentication catalogue, and it supports four grant types. Those are Client Credentials, Authorization Code, Authorization Code with PKCE and Password Credentials marked as legacy. The last one is there because integrations still require it, and the guidance above about not choosing it for new work stands. _Screenshot: Client credentials, scope and audience all accept variable references, and the token manager keeps what the grant returned._ The configuration covers everything a real provider is likely to ask for. There are fields for the token URL, the authorization URL and the callback URL, plus the client identifier and secret, the scope, the audience and the state. A header prefix is configurable, and client authentication travels either as a Basic header or in the request body. Custom parameters can be added to the token request, the authorization request and the refresh request separately. That is what makes a provider with a non-standard parameter workable without leaving the tool. A token manager sits below the form, per environment. Each stored token appears with its grant type and its expiry, and the controls beside it request a new one, refresh, copy or delete. Tokens belong to the environment that fetched them, and they deliberately never travel when an authentication configuration is copied to another environment, because the target has to fetch its own. Every credential field accepts a `{{VARIABLE}}` placeholder, so the client secret lives in a secret variable. **Test Authentication** fires one probe with the configured credentials and shows you what came back. That is the fastest way to find out that a token URL or a scope is wrong. See [Project Auth](https://docs.routebase.dev/project-auth/) for the editor and the token manager. ## Frequently asked questions ### What is OAuth 2.0? OAuth 2.0, defined in RFC 6749, is a framework for delegated access. It lets an application obtain a token to act on a resource owner's behalf without ever seeing that owner's password. The framework defines several flows, called grants, and choosing the right one for your client type is most of what using OAuth well consists of. ### Which OAuth 2.0 grant type should I use? Use client credentials when a machine calls on its own behalf with no user involved. Use authorization code with PKCE whenever a user is delegating access, regardless of whether the client is a web application, a mobile app or a single-page application. The implicit grant and the resource owner password credentials grant are both retired by RFC 9700 and should not be used in new work. ### What is PKCE and why is it required? Proof Key for Code Exchange, defined in RFC 7636, binds an authorization code to the client that requested it. The client sends a hash of a random secret when it starts the flow and the secret itself when it redeems the code, so a code intercepted in transit is useless to anyone else. RFC 9700 extends the requirement from public clients to every authorization code flow, because the protection costs nothing and closes a real interception path. ### Why was the OAuth implicit grant deprecated? It returned the access token directly in the URL fragment of a redirect, which exposed it to the browser history, to any script on the page and to referrer leakage. There was also no way to authenticate the client. Authorization code with PKCE achieves the same outcome for browser-based applications without those exposures. RFC 9700 states that the implicit grant should no longer be used. --- # OpenID Connect — Routebase > The identity layer on top of OAuth 2.0, why an ID token is not an access token, what discovery buys you, and when plain OAuth is the right answer instead. Canonical page: https://routebase.dev/guides/api-authentication/openid-connect/ Chapter 5 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. OAuth 2.0 answers what a client may do. It deliberately says nothing about who the user is, and for years people built their own answer on top of it, usually by calling some user-information endpoint and hoping the semantics matched. OpenID Connect standardises that. It is an identity layer on top of OAuth 2.0, specified as OpenID Connect Core 1.0, and it adds three things to a flow you already know. ## What OpenID Connect adds **An ID token.** A JWT containing claims about the authentication event, addressed to the client that asked for it. **A standard `openid` scope.** Requesting it is what turns an OAuth flow into an OpenID Connect flow, and further scopes such as `profile` and `email` ask for specific claim sets. **A discovery document and a key set.** Published at well-known URLs, so a client configures itself and picks up rotated signing keys without a deployment. Everything else is OAuth. The authorization code flow with PKCE is the same flow, the same redirect, the same code exchange. The token response carries an `id_token` alongside the access token. ## The distinction that trips people up An ID token and an access token are not interchangeable, and treating them as if they were is the most common OpenID Connect mistake. | | ID token | Access token | |---|---|---| | Answers | Who authenticated, and how | What the bearer may do | | Audience | The client that requested it | The API it is meant for | | Format | Always a JWT with defined claims | Whatever the authorization server chooses | | Sent to an API | No | Yes | | Validated by | The client | The resource server | The failure mode is sending the ID token to your API because it happens to be a JWT and it happens to contain the user's identifier. The API then validates a token whose audience is somebody else, which means the audience check either fails or was never implemented. If it was never implemented, the API will accept an ID token issued for any client at that provider. ## The claims to check An ID token is a JWT, so everything in [bearer tokens and JWT](https://routebase.dev/guides/api-authentication/bearer-tokens-and-jwt/) applies. OpenID Connect adds a few requirements of its own. | Claim | What to check | |---|---| | `iss` | It matches the issuer you configured, exactly | | `aud` | It contains your client identifier | | `exp` | It has not passed | | `nonce` | It matches the value you sent in the authorization request | | `azp` | Where present, it is your client identifier | | `at_hash` | Where present, it matches the access token you received | The `nonce` is the one people skip. It binds the ID token to the specific authentication request the client started, and it is what stops a token replayed from another session being accepted. One more claim deserves a warning. The `email` claim is not proof of an email address unless `email_verified` is true. An application that links accounts on the email claim alone will link them to whatever address somebody typed at the provider. ## Discovery, and why it matters more than it looks The discovery document lives at a well-known path under the issuer and publishes the endpoints, the supported scopes and response types, and the location of the signing key set. The convenience of not typing endpoint URLs is minor. The part that matters is the key set, because a client that reads it at runtime picks up a rotated signing key on its own. Without that, key rotation is a coordinated deployment across every client, which means it does not happen. Two practical notes. Cache the key set with a sensible lifetime instead of fetching it per request, and refetch when you see a key identifier you do not recognise. And read the discovery document over TLS from the issuer you configured, because a client that discovers its issuer from user input can be pointed at somebody else's. ## When plain OAuth is the better answer OpenID Connect is not a strict upgrade. It asks for identity, which means consent screens that mention personal data, and it hands you personal data you then have to store and protect. Use it when the identity is part of what you are building, so signing a user in, displaying their name, or linking a local account to an external one. Skip it when you only need permission to call an API on somebody's behalf. A calendar integration that reads and writes events needs delegated access, and it does not need to know the user's name and email unless it displays them. ## In Routebase OpenID Connect appears in two places, and they serve different purposes. _Screenshot: All four OpenAPI scheme types are available when you create a component, including OpenID Connect._ **In the specification.** A security scheme component of type `openIdConnect` documents that an endpoint accepts OpenID Connect, and it carries the discovery URL so consumers and agents know where to configure themselves from. Schemes are created once per specification and attached to endpoints, and one action assigns a scheme across all endpoints, a folder, a tag or a hand-picked selection. That last part matters more than it sounds, because an endpoint nobody got around to securing looks exactly like one that is deliberately public. **In testing.** An OpenID Connect deployment issues ordinary OAuth access tokens, so testing against it uses the OAuth 2.0 authentication type with the authorization code or client credentials grant. The Bearer type covers the case where a pipeline supplies the token. The ID token is a client-side concern and not something an API test sends. See [Components](https://docs.routebase.dev/components/) for security schemes in the designer and [Project Auth](https://docs.routebase.dev/project-auth/) for the test-side configuration. The chapter on [designing authentication into your specification](https://routebase.dev/guides/api-authentication/openapi-security-schemes/) covers the documentation side in full. ## Frequently asked questions ### What is OpenID Connect? OpenID Connect is an identity layer built on top of OAuth 2.0, specified as OpenID Connect Core 1.0. Where OAuth answers what a client is permitted to do, OpenID Connect answers who the user is, by adding an ID token containing verified claims about them. It reuses the OAuth authorization code flow, so a service that already speaks OAuth adds identity instead of replacing anything. ### What is the difference between an ID token and an access token? An ID token is a statement about who authenticated, addressed to the client that requested it, and it is always a JWT with a defined set of claims. An access token is a credential for calling an API, and its format is not the client's business. Sending an ID token to an API as if it were an access token is a common mistake, because the API is not its intended audience and validating it there proves the wrong thing. ### What is the OpenID Connect discovery document? It is a JSON document at a well-known URL that publishes everything a client needs to configure itself. That covers the authorization and token endpoints, the supported scopes and response types, and the location of the signing keys. It matters most for key rotation, since a client that reads the key set from discovery picks up a new signing key without a deployment. ### When should you use OpenID Connect instead of plain OAuth 2.0? Use OpenID Connect when your application needs to know who the user is, which covers signing somebody in, showing their name, or linking a local account to an external identity. Use plain OAuth 2.0 when you only need permission to call an API on their behalf and the user's identity is not part of what you are building. Asking for identity you do not need adds consent friction and personal data you then have to handle. --- # Request Signing: OAuth 1.0, AWS SigV4 and Hawk — Routebase > What request signing buys you over a bearer token, how nonces and timestamps stop replay, and where each of these four schemes still turns up. Canonical page: https://routebase.dev/guides/api-authentication/request-signing/ Chapter 6 of 11 · API Authentication · Last reviewed 2026-09-27 by The Routebase Team. Everything in the previous chapters sends a credential and trusts TLS to protect it in transit. The four schemes here take a different approach, called request signing. They sign the request itself with a secret that never leaves either end. That buys two properties a bearer token does not have. The signature covers the request, so nothing between the parties can alter it unnoticed, and a captured request cannot be replayed because it carries a timestamp and a nonce. The cost is complexity on both sides, and complexity in a signing implementation is where the bugs live. ## What a signature covers, and why nonces matter A signing scheme defines a canonical string built from the parts of the request that matter, computes a keyed hash over it, and sends the result. Three ingredients recur. **A canonical form.** Both sides must build the identical string from the same request, which means agreeing on header ordering, on how query parameters are sorted, and on how everything is encoded. Most signing bugs are canonicalisation bugs. **A timestamp.** The server rejects signatures outside a narrow window, usually a few minutes, so a captured request stops working quickly. This means both ends need a reasonably correct clock. **A nonce.** A value used once, remembered by the server for the length of the timestamp window. It closes the gap the timestamp leaves, since a request can otherwise be replayed freely inside the window. Some schemes also cover a hash of the body, which extends integrity from the envelope to the payload. ## OAuth 1.0 OAuth 1.0, specified in RFC 5849, solved delegated access in a world without universal TLS, so it signed every request instead of relying on the channel. The signature covers the method, the URL, and the request parameters sorted and encoded in a defined way, using a key built from the consumer secret and the token secret. Four signature methods exist. Those are HMAC-SHA1, HMAC-SHA256, RSA-SHA1 and a plaintext mode that only makes sense over TLS. OAuth 2.0 replaced it by dropping signing and depending on the transport, which made clients dramatically simpler. What remains is the installed base, so some established APIs still expect OAuth 1.0 and are not going to change. The parameters can travel in the `Authorization` header, in the request body or in the query string, and the choice is dictated by the server and not by preference. ## AWS Signature Version 4 AWS requires SigV4 on essentially every service API, so any client calling AWS implements it or uses a library that does. Its distinguishing feature is key derivation. Instead of signing with your secret access key, you derive a signing key from that secret plus the date, the region and the service name, and sign with the derived key. A signing key that leaks is therefore useful only for that one day, in that one region, for that one service. The canonical request covers the method, the path, the sorted query string, the signed headers, and a hash of the payload. Because the payload hash is included, the body is protected as well as the envelope. Four values are needed to configure it. Those are the access key, the secret key, the region and the service name, plus a session token when using temporary credentials. ## Hawk Hawk was designed as a lighter successor to the OAuth 1.0 signing mechanism for cases where a bearer token over TLS is not sufficient. It computes an HMAC over the method, the URI, the host, the port, a timestamp and a nonce, and it can optionally include a hash of the payload. Two algorithms are in common use, SHA-256 and SHA-1, and SHA-256 is the one to pick where you have the choice. Hawk mostly appears inside systems whose authors chose it deliberately, and seldom in public APIs, so you will meet it when integrating with one of those. ## HTTP Message Signatures RFC 9421, published in February 2024 on the standards track, is the general answer to a question the three schemes above each answered for themselves. It signs named components of a request or a response, such as the method, the target URI and chosen header fields. A creation time, an expiry, a nonce and a key identifier travel as parameters of the signature. A new design that needs signed requests should start from it rather than from a bespoke canonicalisation. ## NTLM NTLM is a Microsoft challenge-response protocol from the Windows networking world, and it authenticates a user account, not an application. The exchange is three messages, so the client announces, the server challenges, and the client responds with a hash derived from the password and the challenge. It is stateful in a way HTTP is not, because the handshake binds to a connection, and that is why NTLM behaves badly through proxies and load balancers. Kerberos replaced it inside Active Directory environments, and NTLM persists in older intranet applications and appliances. Where you meet it, you need a username, a password, and often a domain and a workstation name. ## Choosing between signing and a bearer token | Situation | Prefer | |---|---| | A public API over TLS with ordinary requirements | A bearer token, because the complexity is not free | | Requests that traverse something you do not control | Signing, because integrity is then yours and not the channel's | | Replay is a specific concern, such as payment instructions | Signing, for the nonce and the timestamp window | | The other side already requires a scheme | Whatever they require, since this is not a design decision | The last row covers most real cases. Nobody picks AWS Signature V4 on its merits, because they are calling an AWS service and that is what it requires. If you find yourself weighing a signing scheme for a new API of your own, note that these four are specified, reviewed and implemented in libraries. A scheme designed in-house has none of those properties, which the chapter on [mutual TLS, cookies and custom HMAC](https://routebase.dev/guides/api-authentication/mutual-tls-cookies-and-custom-hmac/) takes up. ## In Routebase All four are in the authentication catalogue, configurable at environment, suite, case and persona level like every other scheme. _Screenshot: OAuth 1.0 needs the signature method alongside the consumer and token credentials._ **OAuth 1.0** takes the consumer key and secret, the access token and token secret, and the signature method from HMAC-SHA1, HMAC-SHA256, RSA-SHA1 and plaintext. The remaining parameters are there for servers that need them set explicitly. Those cover the realm, the verifier, the timestamp, the nonce and the version. Three switches decide whether the parameters travel in the header, the body or the URL, whether a body hash is included, and whether empty parameters enter the signature. **AWS Signature V4** takes the access key, the secret key, the region and the service name, with a session token field for temporary credentials. **Hawk Auth** takes the authentication identifier and key plus the algorithm, either SHA-256 or SHA-1. The optional fields cover the user, the application and delegation identifiers, an extension value, and whether the payload hash is included. **NTLM Auth** takes a username and password plus the domain and workstation. Every field accepts a `{{VARIABLE}}` placeholder, so secrets live in secret variables and the configuration stays portable between environments. See [Project Auth](https://docs.routebase.dev/project-auth/) for the editor. ## Frequently asked questions ### What is request signing in API authentication? Request signing computes a cryptographic signature over parts of the request, typically the method, the path, selected headers, a timestamp and a nonce, using a shared secret or a private key. The secret itself never travels, and the signature covers the whole request, doing more than identify the caller. That gives integrity and replay resistance that a bearer token does not provide on its own. ### What is AWS Signature Version 4? It is the signing scheme AWS services require, and it signs a canonical form of the request with a key derived from your secret access key, the date, the region and the service name. The derivation is what limits the damage from a leaked signing key, since a key derived for one day, one region and one service is useless elsewhere. Any client calling an AWS API has to implement it or use a library that does. ### Is OAuth 1.0 still used? Rarely for new work, and it persists in long-lived integrations that never migrated, since OAuth 2.0 replaced it. OAuth 1.0 signed every request because it was designed before TLS was universal, and OAuth 2.0 dropped signing and relies on the transport instead. The practical reason to understand OAuth 1.0 is that some established APIs still expect it. ### What is Hawk authentication? Hawk is an HTTP authentication scheme that signs a request with an HMAC over the method, the URI, the host, the port, a timestamp and a nonce, and optionally over a hash of the payload. It was designed as a lighter successor to the OAuth 1.0 signing mechanism for cases where a bearer token over TLS is not enough. It appears mostly inside systems whose authors chose it deliberately, and seldom in public APIs. --- # Mutual TLS, Cookies and Custom HMAC Schemes — Routebase > Certificates as identity at the transport layer, cookies and CSRF, and why a home-grown signing scheme is usually a worse version of one that already exists. Canonical page: https://routebase.dev/guides/api-authentication/mutual-tls-cookies-and-custom-hmac/ Chapter 7 of 11 · API Authentication · Last reviewed 2026-09-27 by The Routebase Team. The previous chapters covered the schemes an API testing tool typically configures for you. This one covers three that sit outside that set, because a complete picture is worth more than a tidy one. ## Mutual TLS Ordinary TLS authenticates the server to the client. Mutual TLS adds the other direction, so the client presents a certificate during the handshake and the server verifies it against a trusted authority. Identity is therefore established before any HTTP is exchanged. The application receives a connection that is already authenticated, and it reads the subject from the certificate instead of parsing a header. **What it buys.** The credential never travels as a value that can be replayed, because possession of the private key is proven by the handshake. Nothing in the application layer can leak it, since there is nothing in the application layer to leak. It is the strongest commonly available option between parties who can manage certificates, which is why it is standard in payments, in healthcare integrations and increasingly inside service meshes. **What it costs.** A certificate lifecycle. Issuing, distributing, renewing and revoking certificates for every client is real operational work, and an expired certificate is an outage rather than a login prompt. Load balancers and proxies have to be configured to pass the client identity through. Forgetting that step is why an application suddenly cannot see who called. Mutual TLS is usually combined with something at the application layer, not a replacement for it. The certificate says which machine connected, and a token still says which user or which permission set is in play. For OAuth, RFC 8705 standardises that combination. It authenticates the client by its certificate and binds the access token to it, so a stolen token is useless without the private key. ## Session cookies For a browser talking to your own API on your own domain, a cookie is often the better answer than a token, and the reason is where the credential can be read from. A token in `localStorage` is readable by any script that runs on the page, which means any successful cross-site scripting becomes a stolen credential. A cookie marked `HttpOnly` is not readable by script at all. The attributes are the whole design. `HttpOnly` and `Secure` are defined in RFC 6265. `SameSite` comes from its successor, rfc6265bis, which in September 2026 was still an Internet-Draft in final review rather than a published RFC. | Attribute | Effect | |---|---| | `HttpOnly` | JavaScript cannot read the cookie, which removes the main exfiltration path | | `Secure` | The cookie is only sent over HTTPS | | `SameSite=Lax` | Sent on top-level navigations but not on cross-site subrequests, and a sensible default | | `SameSite=Strict` | Never sent cross-site, which breaks incoming links into authenticated pages | | `SameSite=None` | Sent cross-site, and it requires `Secure`, so use it only when you genuinely need a cross-origin session | | `Path` and `Domain` | Narrow the scope, and a cookie set on a parent domain is sent to every subdomain | Cookies bring their own problem, namely cross-site request forgery. Because the browser attaches them automatically, another site can cause the visitor's browser to send an authenticated request to yours. Three defences exist and they compose. **`SameSite`** removes most of the attack surface on its own, and it is not sufficient alone because browser behaviour and edge cases vary. **A token the attacking page cannot read**, either as a value the page must echo back in a header, or as a pair where a cookie and a header must match. **Checking the `Origin` header** on state-changing requests, because it is cheap and catches what the other two miss. The other consequence of cookies is that they are a poor fit for anything that is not a browser. A mobile application or a service-to-service call has no cookie jar semantics to rely on, and a token is simpler there. ## Custom HMAC schemes At some point somebody proposes a signing scheme of their own. It usually looks reasonable, and it usually has at least one of the following holes. **Ambiguous canonicalisation.** If the string being signed can be produced two ways from one request, an attacker can construct a second request with the same signature. Sorting rules, encoding rules and header selection all have to be defined precisely. **Nothing to stop replay.** A signature without a timestamp and a nonce is a bearer credential with extra steps, because a captured request can be sent again indefinitely. **Incomplete coverage.** A signature over the path but not the body lets a proxy change the body. A signature over the body but not the method lets a GET become a DELETE. **No key rotation.** A scheme with no key identifier cannot rotate keys without a coordinated cutover, so the keys never rotate. **Timing-sensitive comparison.** Comparing signatures with an ordinary string comparison leaks information through timing, and a constant-time comparison is required. Each of these is solved in the published schemes, and each solution was reviewed by people who attack protocols for a living. The current standard is RFC 9421, HTTP Message Signatures, which names the exact request components a signature covers. It carries a creation time, an expiry, a nonce and a key identifier, so replay protection and key rotation are part of the format. Where you need signed requests, take a published scheme instead of inventing another. The one legitimate case for a bespoke scheme is a narrow internal one where nothing published fits. Even then the shape should copy an existing specification closely enough that a reviewer recognises it. ## Where these three leave the tooling None of the three is a scheme a testing tool configures with a form field, and the reasons differ. Mutual TLS is a transport concern, so it is configured at the client or the proxy, not in a request. Cookies are managed by a browser, and a test that needs one usually authenticates first and carries the value forward. A custom HMAC scheme is by definition not standard, so it needs code. ## In Routebase Routebase does not set up mutual TLS, session-cookie authentication or a bespoke HMAC scheme, and the [catalogue](https://routebase.dev/guides/api-authentication/) covers the ten standard schemes instead. _Screenshot: Scripts run before the request and after the response, which is where a scheme without a built-in type gets built._ What is available for these cases still matters. For a **cookie-based** API, a test case authenticates through the login endpoint, extracts the cookie value from the response header, and passes it into later cases as a variable. That is the ordinary extraction and chaining described in [workflow tests](https://routebase.dev/guides/api-testing/api-integration-testing/). A scenario that starts with a login step and continues with authenticated calls covers the flow end to end. For a **custom signature**, the scripting sandbox on a test case runs a pre-request script that computes the value and sets the header before the request goes out. That is the escape hatch for anything the declarative catalogue does not name. For **mutual TLS**, there is no configuration surface, and a service that requires it is reachable from Routebase only through something that terminates the client certificate on your side. If one of these becomes a requirement for your team, it is worth telling us instead of working around it, because the catalogue grows from what customers actually run. See [Project Auth](https://docs.routebase.dev/project-auth/) for the schemes that are configured today. ## Frequently asked questions ### What is mutual TLS authentication? Mutual TLS extends the normal TLS handshake so the client presents a certificate as well as the server. Identity is then established at the transport layer, before a single byte of HTTP is exchanged, and the application receives an already-authenticated connection. It gives strong assurance between parties who can manage certificates, and its cost is exactly that certificate lifecycle. ### Should an API use cookies or tokens for authentication? For a browser talking to your own API on your own domain, a cookie with HttpOnly, Secure and SameSite is usually the safer choice, because it is unreachable from injected script. For anything that is not a browser, a token is simpler, since there is no automatic sending and therefore no cross-site request forgery to defend against. The decision follows the client rather than fashion. ### What is CSRF and how do cookies cause it? Cross-site request forgery is an attack where another site causes the visitor's browser to send an authenticated request to yours. It exists because browsers attach cookies automatically to requests for a domain, whatever page started them. The defences are the SameSite cookie attribute, a token the attacking page cannot read, and checking the Origin header, and a cookie-based API should use more than one of them. ### Should you build a custom HMAC authentication scheme? Almost never, because the published schemes already solved the problems you will meet and had their solutions reviewed. A custom scheme has to define canonicalisation, replay protection, key rotation and error handling correctly on the first attempt, and getting any one of them wrong is silent. Where you need signed requests, take an existing specification and implement it faithfully. --- # OpenAPI Security Schemes and Per-Endpoint Auth — Routebase > Security schemes, per-operation requirements, scopes, and what consumers and agents can only learn from a specification that documents its authentication. Canonical page: https://routebase.dev/guides/api-authentication/openapi-security-schemes/ Chapter 8 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. An API that authenticates and does not say how has made every consumer's first hour harder than it needed to be. Writing an OpenAPI security scheme is a small amount of work with an unusually wide reach, because everything downstream reads it. The rest of the document is covered in the [OpenAPI guide](https://routebase.dev/guides/openapi/). ## The two halves OpenAPI splits this into a definition and a requirement, and keeping those two straight makes the rest of the syntax obvious. A **security scheme** defines *a way* to authenticate. It lives under `components.securitySchemes` and is named, so `BearerAuth` or `ApiKeyAuth`. A **security requirement** says *which* of those a caller must satisfy. It appears at the top level as a default and on any operation as an override. ```yaml components: securitySchemes: BearerAuth: type: http scheme: bearer bearerFormat: JWT ApiKeyAuth: type: apiKey in: header name: X-API-Key security: - BearerAuth: [] # the default for every operation ``` ## The four types | Type | Covers | Key fields | |---|---|---| | `http` | Basic, Bearer, Digest and anything else in the HTTP authentication registry | `scheme`, and `bearerFormat` as a hint | | `apiKey` | A key in a header, a query parameter or a cookie | `in`, `name` | | `oauth2` | The OAuth flows, with their endpoints and scopes | `flows` | | `openIdConnect` | An OpenID Connect provider | `openIdConnectUrl` | Two notes on the details. The `bearerFormat` field is documentation and not validation, so writing `JWT` there tells a human what to expect and changes nothing mechanically. And `apiKey` with `in: cookie` exists, and a cookie-based session is usually better described that way than pretended to be a header. ## Per-operation requirements, and the empty array The top-level `security` field is a default, and any operation may override it. ```yaml paths: /health: get: security: [] # explicitly public responses: { '200': { description: OK } } /admin/users: get: security: - BearerAuth: [users.admin] # this operation needs a scope responses: { '200': { description: OK } } ``` The empty array is the part people miss. Omitting `security` on an operation means it inherits the default, and an empty array means the operation is deliberately open. That is the difference between an endpoint somebody chose to make public and one nobody got around to securing. In a specification those two look identical unless you say so. ## Alternatives against combinations The nesting here is easy to get wrong, and getting it wrong changes the meaning of the requirement entirely. ```yaml # EITHER of these satisfies the requirement security: - BearerAuth: [] - ApiKeyAuth: [] # BOTH are required together security: - BearerAuth: [] ApiKeyAuth: [] ``` A list of separate entries is a list of alternatives, and several schemes inside one entry must all be satisfied. The second form is rarer and it does appear, usually where a gateway key sits in front of a user token. ## Scopes belong in the specification An `oauth2` scheme declares its flows, and each flow lists the scopes that flow can issue along with a description. ```yaml components: securitySchemes: OAuth2: type: oauth2 flows: authorizationCode: authorizationUrl: https://auth.example.com/authorize tokenUrl: https://auth.example.com/token scopes: orders.read: Read orders orders.write: Create and modify orders ``` Operations then name the scopes they need, and a consumer reads the specification to find out which scopes to request. Without this they discover it by receiving a 403 and guessing, and that is a poor first hour with your API. Write the scope descriptions for a person who is deciding what to request. A description reading "Read orders" is useful, and one reading "orders.read scope" is not. ## What reads this, and why it is worth the effort The specification is not documentation in the sense of prose that somebody might read. It is an input to several things at once. | Consumer | What it does with the security definition | |---|---| | A documentation portal | Renders which scheme each endpoint expects, and configures its try-it console | | A generated client | Emits the right authentication parameter and header | | A mock server | Decides whether an unauthenticated call gets a 401 | | A contract test | Knows what to send to reach the endpoint at all | | An AI agent | Learns how to call your API without being told separately | The last row is the newest and it changes the calculation. An agent reading a specification with documented schemes can configure itself, and an agent reading one without them will guess, usually wrongly and sometimes confidently. ## Common mistakes **A scheme defined and never referenced.** It documents nothing at all, because no operation actually requires it. **No top-level default in a fully secured API.** Every operation then needs its own requirement, and the one somebody forgets is silently public. **Undocumented error responses.** An endpoint that can return 401 and 403 should document both, since a consumer handling them needs to know the body shape. **Scopes in the scheme but not on the operations.** The specification then says which scopes exist and not which ones any particular call needs. ## In Routebase Security schemes are components in the API Designer, created once per specification under the Security section and attached to endpoints from the endpoint editor. All four OpenAPI types are supported, so `http`, `apiKey`, `oauth2` and `openIdConnect` are all available, and each endpoint lists its assigned schemes as removable badges. _Screenshot: Assignment picks all endpoints, one folder, a tag or a hand-picked set, and it says what it will touch before you confirm._ The part that saves real time is assignment at scale. Attaching a scheme to sixty endpoints one badge at a time is the kind of task people skip, and a skipped endpoint looks exactly like a deliberately public one. **Assign to endpoints** does it in one step with four ways to pick targets, covering all endpoints, one folder, everything carrying a tag, or a hand-picked selection. Endpoints that already carry the scheme are marked as such and never silently skipped, and a preview shows what the assignment will touch before you confirm. The definitions then flow outward. The documentation portal renders which scheme each endpoint expects and configures its try-it console accordingly, which the [API documentation guide](https://routebase.dev/guides/api-documentation/what-belongs-in-api-documentation/) covers from the reader's side. The mock server answers 401 where the rules gate on an auth header. Try It offers a button that adds the demo header the endpoint's schemes ask for, so the 401 path stays testable by not clicking it. Export produces standard OpenAPI 3.0, 3.1 or 3.2, so the definitions travel to any generator you use. An agent working over MCP can add a security scheme and assign it, under the same permissions your team has. See [Components](https://docs.routebase.dev/components/) for the scheme editor and [Endpoints](https://docs.routebase.dev/endpoints/) for assignment and Try It. ## Frequently asked questions ### What is a security scheme in OpenAPI? A security scheme is a reusable definition of one way to authenticate against your API, declared once under components and referenced from operations. OpenAPI 3 supports four types. Those are http for schemes such as Basic and Bearer, apiKey for a key in a header, query parameter or cookie, oauth2 with its flows and scopes, and openIdConnect with a discovery URL. Documenting them is what lets a client, a code generator or an agent configure itself without asking anyone. ### How do you specify authentication per endpoint in OpenAPI? A top-level security field sets the default requirement for the whole API, and any operation can override it with its own security field. An operation with an empty security array is explicitly public, and that is the only way to say a specific endpoint needs no credential when a global default exists. Being explicit matters, because an endpoint nobody remembered to secure looks identical to one that is deliberately open. ### How are OAuth scopes documented in OpenAPI? The oauth2 security scheme declares its flows, and each flow lists the scopes it can issue with a human-readable description. An operation then names the scopes it requires when it references that scheme. The result tells a consumer exactly which scopes to request for the calls they intend to make, instead of leaving them to discover it by receiving a 403. ### Why document authentication in the API specification at all? Because every consumer otherwise has to be told separately, and the telling drifts from the truth. A documented scheme drives the try-it console in your portal, the generated client, the mock server behaviour and any agent that reads the specification. It also makes an unsecured endpoint visible, since an operation with no security requirement in an otherwise secured API stands out in review. --- # Setting Up API Authentication in Routebase, End to End — Routebase > Configure credentials once per environment, inherit them everywhere, keep secrets in variables, and cover the pipeline, scans and agents from one setup. Canonical page: https://routebase.dev/guides/api-authentication/setting-up-authentication-in-routebase/ Chapter 9 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. This chapter is the how-to, and it assumes you have picked a method already. The chapters before it cover the methods, and what follows is the configuration path from an empty project to a suite, a pipeline, a security scan and an agent all authenticating correctly. ## The shape of it Authentication in Routebase lives at the environment level, and everything else either inherits it or overrides it deliberately. | Surface | Where its credentials come from | |---|---| | Test suites and cases | The active environment, unless the suite or case overrides | | The API Designer's Try It | The selected environment | | Monitors | Their linked environment, applied to every check | | Security scans | Personas, which carry their own credentials | | The CLI and CI | The environment named in the command, with an optional per-run override | | An AI agent over MCP | Its own API key, separate from anything your API uses | Two of those need flagging early because they surprise people. Monitors do use the linked environment's authentication, and security scans do not, because a scan needs several identities and takes them from personas instead. ## Step 1, put the secret in a variable Do this before configuring authentication, because it changes what the rest looks like. Open the environment, go to its **Variables** tab, and create a secret variable for each credential value. A client secret, an API key, a password, a signing key, all of them belong here and not in the auth form. The payoff arrives immediately and it compounds later. Secret variables are encrypted and masked, and an auth configuration built from references is portable between environments, while one holding a literal secret is not. ## Step 2, configure the environment's auth Open the environment's **Auth** tab, which notes that test suites inherit this unless overridden, and pick the scheme. ```txt Auth Type OAuth 2.0 Grant type Client Credentials Token URL https://auth.example.com/oauth/token Client ID {{OAUTH_CLIENT_ID}} Client secret {{OAUTH_CLIENT_SECRET}} Scope orders.read orders.write Client auth Basic header ``` Every credential field takes a `{{VARIABLE}}` placeholder with autocomplete from the environment's resolved variables, and changes save as you type. For OAuth 2.0 a token manager appears below the form. It lists the stored tokens with their grant type and expiry, and it requests, refreshes, copies or deletes one. Tokens belong to that one environment and are never shared with another. ## Step 3, prove the credentials work Expand **Test Authentication** below the form, pick a method, enter a test URL and run the probe. Routebase reports the status code, the status text and the response time. Do this before a suite depends on the configuration. A wrong client secret found here takes a minute, and the same wrong secret found through a suite of forty red cases takes considerably longer to diagnose. ## Step 4, repeat for each environment, or copy Every environment carries its own credentials, so staging and production have separate configurations by design. **Copy to** on the Auth tab copies a configuration to another environment. Secrets are masked in transit, OAuth tokens never travel because the target fetches its own, and one case is refused outright. A source holding a literal secret cannot be copied, and the message says to configure the target manually. That refusal is the reason step one comes first. A configuration built from `{{VARIABLE}}` references copies without complaint, because each environment resolves its own values. ## Step 5, let suites inherit, and override where needed A suite's **Authentication** setting in its configuration sheet has three modes. _Figure: Authentication resolves from the outside in, so a suite and its cases inherit the environment until one of them overrides it._ _Screenshot: A suite inherits the environment's authentication until you override it, and the badge names what it resolved to._ | Mode | Behaviour | |---|---| | **Inherit from Environment** | The default, using whatever the active environment defines. A badge shows what was inherited | | **Custom Auth** | A suite-specific configuration using the same form and the same catalogue | | **No Auth** | No authentication headers for this suite, whatever the environment says | Inheritance badges are colour-coded across the testing surface, where blue means inherited, orange means custom and grey means none. A warning with a shortcut appears when a suite inherits from an environment that has no authentication configured. **No Auth** is not an edge case, and it is how the negative tests in [testing authentication](https://routebase.dev/guides/api-authentication/api-authentication-testing/) send no credential on purpose. ## Step 6, the pipeline A CI run authenticates twice, and separating the two saves confusion. **The run itself** authenticates with a Routebase API key, created under Settings, scoped to the permission the command needs and restricted to one project. Store it as a pipeline secret. **The requests the tests send** authenticate with whatever the named environment defines, exactly as they do in the browser. Where the pipeline holds a fresher credential, such as a token minted for this build, override it for that run instead of storing it. The override accepts bearer, basic and API key forms, applies to that run only, and is never persisted. ## Step 7, personas for security scans Security scanning uses **personas** instead of environment authentication, because the authorization scanners need more than one identity to compare. A persona is a named set of credentials using the same auth editor as everywhere else, and it must carry a real scheme, since none is rejected. Persona secrets are encrypted and never returned to the browser, so editing a persona's name leaves the stored credentials untouched, and changing the credentials means re-entering the configuration in full. **Test** on a persona card sends a probe to a chosen environment and reports whether the credentials reached the target. A 2xx, a 401 and a 403 all count as reached, because the question is whether they travelled and not whether they were accepted. For object-level checks, use personas that belong to different tenants entirely. For function-level and property-level checks, use personas with a clear privilege gap. ## Step 8, the specification Documenting the scheme in the specification is a separate act from configuring credentials, and it is what tells consumers, generated clients and agents how to authenticate. Create a security scheme component of the right type, then attach it to endpoints, using the bulk assignment across all endpoints, a folder, a tag or a selection. See [designing authentication into your specification](https://routebase.dev/guides/api-authentication/openapi-security-schemes/). ## Step 9, agents over MCP An agent authenticates to Routebase with its own API key or an OAuth sign-in, and that credential is entirely separate from anything your API uses. Give it explicit scopes and restrict it to one project. Scopes are enforced twice, because tool discovery only advertises what the credential allows and every call is checked again server-side. Secret variables are write-only over MCP, since every read masks the value, so an agent can set a credential and never read one back. ## A checklist - [ ] Every credential value is a secret variable, and no auth field holds a literal - [ ] Each environment has its own configuration, verified with Test Authentication - [ ] Suites inherit by default, and every override exists for a stated reason - [ ] At least one suite or case sends no credential, to cover the 401 path - [ ] The pipeline key is scoped to one project and one permission set - [ ] Personas exist for the authorization scanners, from different tenants - [ ] The specification documents the scheme, assigned to every endpoint that needs it ## Related product documentation [Project Auth](https://docs.routebase.dev/project-auth/) for the editor and inheritance, [Environments](https://docs.routebase.dev/environments/) for where configurations live, [Variables](https://docs.routebase.dev/variables/) for secrets, [Test Suites](https://docs.routebase.dev/test-suites/) for suite-level modes, [Personas](https://docs.routebase.dev/personas/) for scan identities, [CLI in CI/CD](https://docs.routebase.dev/cli-in-cicd/) for the pipeline and [MCP Authentication](https://docs.routebase.dev/mcp-authentication/) for agents. ## Frequently asked questions ### Where is authentication configured in Routebase? On the environment, under its Auth tab, so each environment of a project carries its own scheme and credentials. Test suites inherit that configuration by default, and a suite or an individual case overrides it when it needs a different identity. Security personas and the specification's security schemes are separate surfaces that use the same editor. ### How do you keep API credentials out of test configuration? Store the value as a secret variable on the environment and reference it from the credential field as a variable placeholder. The configuration then holds a reference instead of a value, so nothing sensitive appears in an export, a copy to another environment or a screenshot. Routebase refuses to copy an auth configuration that holds a literal secret, and that is what makes the referenced form the easy one. ### Can a test suite use different credentials from its environment? Yes. Suite authentication has three modes. It inherits from the environment, uses a custom configuration of its own, or sends no authentication at all. The third mode is what makes a negative test possible, since proving that an endpoint returns 401 requires a way to send no credential. ### How does a CI pipeline authenticate a Routebase test run? With an API key stored as a pipeline secret, scoped to the permission the command needs and restricted to one project. The key authenticates the run itself, while the credentials the tests send to your API come from the environment as usual. A pipeline holding a fresher credential can also override the auth for one run without persisting it anywhere. --- # API Authentication Testing: The Negative Cases — Routebase > The negative cases worth writing, why 401 and 403 mean different things, and how two identities prove what a single-user suite structurally cannot. Canonical page: https://routebase.dev/guides/api-authentication/api-authentication-testing/ Chapter 10 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. API authentication testing is the part most likely to be assumed rather than done, and the reason is structural. Every other test in the suite authenticates successfully, so the happy path is covered a hundred times over and the interesting paths are covered zero times. ## The negative cases, and what each one proves Five cases, one line of configuration each, covering the ways authentication actually fails. | Case | Expect | What it proves | |---|---|---| | No credential at all | 401 | The endpoint is genuinely protected | | A malformed credential | 401 | Validation rejects garbage rather than crashing | | An expired token | 401 | Expiry is enforced rather than decorative | | A token for a different audience | 401 | The audience claim is checked | | A valid credential without permission | 403 | Authorization is enforced per caller | The first one is the one people skip, and it is the one that catches an endpoint added to a router without its guard. A test asserting 401 on an unauthenticated call is one line and it prevents an incident category. The expired-token case is easier than it sounds when you can mint your own tokens, because you set the expiry claim in the past and send it. Without that ability you wait for a real token to expire, and that is why the test rarely gets written. ## 401 and 403 are different answers Returning the wrong one is a real defect, not a stylistic issue. **401 Unauthorized** means the request was not authenticated. The caller is unknown, or their credential was invalid or expired. RFC 9110 requires a `WWW-Authenticate` header on a 401, naming the scheme that would be accepted. A client seeing 401 should try to authenticate again. **403 Forbidden** means the caller is known and is not allowed to do this. Retrying with the same credential will not help, and a client seeing 403 should stop rather than loop. An API that returns 401 for an authorization failure sends every well-behaved client into a re-authentication loop that cannot succeed. An API that returns 403 for a missing credential tells the client not to bother authenticating at all, and that is equally unhelpful. ## Authorization needs a second identity This is the part a normal suite cannot do, and it is where the most serious flaws live. Every test in an ordinary suite authenticates as one identity. From inside that account, an endpoint that returns everything to everybody looks perfect, because everything it returns does belong to the caller. The method is to hold two identities and cross them. ```txt Object level (BOLA) As A POST /orders → 201, id = ord_a1 As B GET /orders/ord_a1 → must be 404, never 200 Function level (BFLA) As member GET /admin/users → must be 403, never 200 Property level As member GET /users/me → response must not contain internalNotes As member PATCH /users/me { "role": "admin" } → role must be unchanged afterwards ``` Three details decide whether these tests mean anything. **Use identities from different tenants for object-level checks.** Two users in the same organisation may legitimately see the same data, so a 200 there is not evidence of anything. **Use a privilege gap for function-level checks.** An owner and a plain member against an administrative endpoint is the shape. **Assert the effect, not only the status, for property-level writes.** A 200 on an update that silently ignored the forbidden field is correct behaviour, and a 200 that applied it is a privilege escalation. Only a follow-up read tells you which happened. ## 404 or 403 for somebody else's object Both are defensible and one is usually better. A **403** says the object exists and you may not have it. That is honest, and it hands an attacker an existence oracle. Iterating identifiers and recording which return 403 rather than 404 maps your data without ever reading a record. A **404** for both "does not exist" and "not yours" gives nothing away, and it is the better default for anything internet-facing. The exception is inside a trusted boundary, such as an internal API where the callers are your own services, where a clear 403 saves real debugging time and the enumeration risk is acceptable. ## What a scanner finds, and what only a test finds Automated scanning covers a specific and useful slice of this. | Found by a scanner | Found only by a test you wrote | |---|---| | An endpoint that returns 200 without a credential | A rule that the finance role may read but not export | | One identity reading another's object | A workflow that can be driven out of order to skip a check | | An administrative endpoint answering a normal user | A field that may be set at creation and not on update | | Sensitive fields in a response for a low-privilege caller | A quota that resets in a way somebody can exploit | The left column is mechanical, so a scanner does it on every endpoint on every run and never gets bored. The right column needs somebody who knows what the API is for, and no scanner will ever produce it. Run both. The scanner clears the mechanical findings so the human review has something useful left to do. ## Test the token itself, not only the endpoint Where you issue tokens, a few cases belong on the issuer side, not the consumer side. Assert that a token is rejected when its signature does not verify and when the algorithm in the header is not the one you expect. Assert the same for a token whose audience names another service, and for one whose expiry has passed. The algorithm case is the one worth writing by hand, because RFC 8725 exists precisely because validators keep trusting the header. ## In Routebase The three modes of suite authentication are what make these tests possible. A suite set to **No Auth** sends no credential regardless of the environment, so the 401 case is a configuration choice, not a workaround. A case-level override sends a deliberately wrong credential for the malformed and expired cases. The **JWT Bearer** type mints a token with any payload you write, so an expired token or a wrong audience is a matter of editing the claims. _Screenshot: A persona is a stored identity the scanners log in as, which is what makes a cross-tenant test possible._ For the multi-identity work, security **personas** hold the identities and the authorization scanners use them. The BOLA scanner creates a resource as the first persona and reads it back as the second, raising a critical finding when the second one succeeds. It skips endpoints with no matching create call instead of guessing. An enumeration fallback covers read-only endpoints with three guards, so a public catalogue behind auth is not reported as a breach. A second scanner calls administrative-looking endpoints as a plain member, and a third reads each response per identity looking for fields that identity should not see. Personas must carry a real auth type, because a persona with no credentials tests nothing, and the guidance to use different tenants for object-level checks is written into the product documentation, not left as folklore. Alongside the scanners, the business-logic cases are ordinary test cases and scenarios. A scenario that authenticates as one identity, creates something, then switches to a case configured with a second identity and asserts a refusal is exactly the test a scanner cannot write for you. See [Personas](https://docs.routebase.dev/personas/), [Scanner Reference](https://docs.routebase.dev/scanner-reference/) and [Test Suites](https://docs.routebase.dev/test-suites/), and the wider method in [API security testing](https://routebase.dev/guides/api-testing/api-security-testing/). ## Frequently asked questions ### How do you test API authentication? Write the negative cases, because the positive one is covered by every other test in the suite. Send no credential and assert 401, send a malformed one and assert 401, send an expired token and assert 401, and send a valid credential that lacks permission and assert 403. Each of those is one case, and together they prove the endpoint is protected rather than assumed to be. ### What is the difference between 401 and 403? A 401 means the request was not authenticated, so the caller is unknown or the credential was invalid, and it should carry a WWW-Authenticate header saying what would be accepted. A 403 means the caller is known and is not allowed to do this, so retrying with the same credential will not help. Returning 401 for an authorization failure sends clients into a pointless re-authentication loop. ### How do you test for broken object level authorization? Create a resource as one identity and then try to read it as a second identity from a different tenant. Anything other than a refusal is the flaw, and 404 is a better refusal than 403 because it does not confirm the object exists. A suite that authenticates as a single user cannot run this test at all, which is why the flaw survives so often. ### Should an API return 404 or 403 for a resource that belongs to someone else? A 404 is usually the better answer, because a 403 confirms the object exists and hands an attacker a free way to enumerate identifiers. Returning 404 for both a missing object and an object that is not yours gives nothing away. The exception is inside a trusted boundary where a clear 403 saves debugging time and the enumeration risk is acceptable. --- # Choosing an API Authentication Method — Routebase > A decision table across complexity, revocation, rotation, delegation, browser exposure and maturity, plus the four questions that usually settle it first. Canonical page: https://routebase.dev/guides/api-authentication/choosing-an-api-authentication-method/ Chapter 11 of 11 · API Authentication · Last reviewed 2026-09-12 by The Routebase Team. Most of this API authentication decision is made by two facts you already have. Who is calling, and what they are calling on behalf of. The table below is for the cases where that is not enough. ## Four questions that usually settle it **Is there a user delegating access?** If yes, you are in OAuth territory, and the only real question is which grant. If no, OAuth's redirect flows are answering a question you do not have. **Can the client keep a secret?** Anything running in a browser or shipped to a phone cannot, which rules out schemes that depend on a client secret staying private and makes PKCE mandatory. **How fast must you be able to revoke?** Immediately means an opaque token or a key you can withdraw centrally. Within minutes means short-lived tokens are sufficient. **Does the request need integrity beyond the channel?** Almost never, and where it does, a signature scheme is the answer and not a token. ## The decision table | Method | Complexity | Revocation | Rotation | Delegation | Browser exposure | Transport | Maturity | Typical use | |---|---|---|---|---|---|---|---|---| | API key | Very low | Immediate, per key | Manual, needs overlap | None | High if stored in the page | TLS required | Universal | Machine to machine, public API access | | HTTP Basic | Very low | Change the password | Manual | None | High | TLS required | Universal | Token endpoints, internal calls | | HTTP Digest | Medium | Change the password | Manual | None | Not applicable | Survives plain HTTP | Legacy | Devices, older systems | | Bearer, opaque | Low | Immediate | Automatic on expiry | Through the issuer | Medium | TLS required | Universal | Any token-based API | | JWT | Medium | Hard, needs a denylist | Automatic on expiry | Through the issuer | Medium | TLS required | Universal | Stateless validation at scale | | OAuth 2.0 client credentials | Medium | Central, at the server | Automatic on expiry | None | Low, no browser | TLS required | Universal | Service to service with central control | | OAuth 2.0 code with PKCE | High | Central, at the server | Automatic, refresh rotation | Full | Low, nothing in the page | TLS required | Universal | Third-party and first-party user access | | OpenID Connect | High | Central, at the server | Automatic | Full, plus identity | Low | TLS required | Universal | Sign-in and user identity | | OAuth 1.0 | High | Revoke the token | Manual | Full | Not applicable | Works without TLS | Legacy | Established integrations | | AWS Signature V4 | High | Rotate the access key | Derived keys, short-lived | None | Not applicable | Works without TLS | Universal in its niche | AWS service calls | | Hawk | Medium | Rotate the key | Manual | None | Not applicable | Works without TLS | Niche | Internal systems needing signatures | | NTLM | High | Change the password | Manual | None | Not applicable | Domain-bound | Legacy | Windows intranets | | Mutual TLS | High | Revoke the certificate | Certificate lifecycle | None | Not applicable | Is the transport | Universal | High-assurance, known parties | | Session cookie | Low | Delete the session | Automatic on expiry | None | Low with `HttpOnly` | TLS required | Universal | Browser to your own API | Two columns deserve a note. **Browser exposure** asks how much damage a cross-site scripting flaw does, so a cookie marked `HttpOnly` scores well because script cannot read it, and a token in storage scores badly. **Maturity** distinguishes methods you can expect any client library to support from ones that need custom work. ## By situation | Situation | Use | Why | |---|---|---| | A partner integration you both control | API key, scoped and rotatable | Lowest friction, and the scoping does the work | | A public API with many machine callers | API key, with OAuth client credentials as an option | Keys get people started, and OAuth serves the ones who want short-lived credentials | | A third-party app acting for your users | OAuth 2.0 authorization code with PKCE | The case OAuth was built for, per RFC 7636 and RFC 9700 | | Your own single-page application | Authorization code with PKCE, or a cookie session | Both avoid a long-lived token in browser storage | | Your own mobile application | Authorization code with PKCE | A mobile app is a public client and cannot hold a secret | | Service to service inside one estate | Client credentials, or mutual TLS in a mesh | Central revocation, or transport-level identity | | Payments or health data between known parties | Mutual TLS plus a token | Transport identity plus application authorization | | Something old that already speaks a scheme | That scheme | This is an integration task, not a design decision | ## Supporting two methods Plenty of APIs accept both a key and a token, and there is nothing wrong with that as long as two things hold. Every path enforces the same authorization. A second way in is a second place to get the object-level check wrong, and an attacker will find whichever path is weaker. The specification says which endpoints accept which. A caller cannot infer it, and [documenting security schemes](https://routebase.dev/guides/api-authentication/openapi-security-schemes/) is how you say it once. ## Migrating from one method to another A migration that begins with a cut-off date and no overlap becomes somebody's outage. The sequence that works has four steps. **Accept both.** Add the new scheme alongside the old one, with no deadline yet. **Instrument.** Record which callers use which, so you know who is affected before you announce anything. **Announce with a date, and give people a way to test.** A staging environment that only accepts the new scheme lets an integrator verify their change without switching production. **Withdraw, in stages.** New callers first, then the ones you have heard from, then the rest, watching the traffic on the old scheme go to zero. ## In Routebase Two of the decisions above show up directly in how Routebase is used. **Supporting several methods** is ordinary, not awkward. An environment defines the default, a suite overrides it where a different identity is needed, and a case overrides that again. A project talking to a legacy service with Digest and a modern service with OAuth handles both in one place, because both are in the same catalogue. **Migrating** is easier when both schemes can run side by side in the same suite. Configure the new scheme on a second environment, point the same suite at it, and compare the runs. Because environment-specific values live in the environment instead of in the tests, that comparison costs nothing but a dropdown. If you have decided which method you need, the setup path is in [setting up authentication in Routebase](https://routebase.dev/guides/api-authentication/setting-up-authentication-in-routebase/), and the configuration surface is documented in [Project Auth](https://docs.routebase.dev/project-auth/). ## Frequently asked questions ### Which authentication method is best for a public API? For machine callers, an API key with scopes and rotation covers most public APIs and is the lowest-friction option for the people integrating with you. Add OAuth 2.0 client credentials when you want short-lived tokens and central revocation, and add the authorization code flow with PKCE when third parties will act on behalf of your users. Most successful public APIs offer keys for the simple case and OAuth for the delegated one. ### Is OAuth 2.0 overkill for a simple API? It is when nobody is delegating anything, because OAuth exists to let one party act for another without sharing a password. A service calling your API on its own behalf gains short-lived credentials and central revocation from the client credentials grant, and it gains nothing from the redirect flows. Introducing OAuth for a case with no resource owner adds moving parts and answers a question you did not have. ### Can an API support more than one authentication method? Yes, and many do, with an API key for straightforward machine access and OAuth for delegated access. Document each scheme in your specification and say per endpoint which ones are accepted, since a caller cannot infer that. The cost is that every path needs the same authorization checks behind it, because a second way in is a second way to get it wrong. ### How do you migrate an API from one authentication method to another? Accept both for a period, instrument which callers use which, and only then withdraw the old one. Announce the deadline before you set it in code, and give integrators a way to test the new scheme without switching, such as a staging environment that only accepts the new method. A migration that starts with a cut-off date and no overlap becomes an outage for somebody. --- # API Security: A Complete Guide — Routebase > API security from the OWASP API Security Top 10 in 2023 through scanning a live API, triaging what comes back, gating a pipeline, and the limits of automation. Canonical page: https://routebase.dev/guides/api-security/ Guide overview · 12 chapters · Last reviewed 2026-09-13 by The Routebase Team. Most serious API flaws are not a broken login. They are requests that carried a valid token, passed every check the service performs, and should still have been refused. That is the ground this guide covers. Authentication asks who is calling, and everything after that asks what this particular caller may do with this particular object, function and field. ## Authentication is one question, authorization is three An API request passes through a sequence of decisions, and only the first one is about identity. _Figure: The first gate asks whether the caller is who they claim to be, and it is the subject of the API authentication guide. The three gates after it ask whether this caller may touch this object, call this function and see this field. The OWASP API Security Top 10 from 2023 puts a category on each of those three, which is why authorization dominates the top of the list._ A service can get the first gate exactly right and still hand a customer record to the wrong customer. That is not a rare edge case, because the identity check is centralised in a middleware while the object check lives in every handler that reads an object. ## The map, with its identifiers The OWASP API Security Top 10 is maintained by the Open Worldwide Application Security Project, and the current edition is from 2023. Each category has an identifier, and those identifiers are what scanners, reports and advisories speak in. | Category | The question it asks | Chapter | |---|---|---| | API1:2023 Broken Object Level Authorization | Can one caller reach another caller's object by changing an identifier | [Object level](https://routebase.dev/guides/api-security/broken-object-level-authorization/) | | API2:2023 Broken Authentication | Can the identity check itself be bypassed, replayed or worn down | [Authentication failures](https://routebase.dev/guides/api-security/api-authentication-failures/) | | API3:2023 Broken Object Property Level Authorization | Does a response carry fields this caller should not see, or accept fields they should not set | [Function and property level](https://routebase.dev/guides/api-security/function-and-property-level-authorization/) | | API4:2023 Unrestricted Resource Consumption | Can one caller exhaust memory, connections, cost or quota | [Resource consumption](https://routebase.dev/guides/api-security/unrestricted-resource-consumption/) | | API5:2023 Broken Function Level Authorization | Can an ordinary user call an administrative operation | [Function and property level](https://routebase.dev/guides/api-security/function-and-property-level-authorization/) | | API6:2023 Unrestricted Access to Sensitive Business Flows | Can a flow be automated at a scale the business never intended | [What a scanner cannot find](https://routebase.dev/guides/api-security/what-a-scanner-cannot-find/) | | API7:2023 Server Side Request Forgery | Can a URL in a request make your server fetch something internal | [Server side request forgery](https://routebase.dev/guides/api-security/server-side-request-forgery/) | | API8:2023 Security Misconfiguration | Do transport, headers, CORS and leftover endpoints give ground away | [Misconfiguration](https://routebase.dev/guides/api-security/api-security-misconfiguration/) | | API9:2023 Improper Inventory Management | What is still answering that nobody has thought about in a year | [Shadow and zombie APIs](https://routebase.dev/guides/api-security/shadow-and-zombie-apis/) | | API10:2023 Unsafe Consumption of APIs | Does your service trust the APIs it calls more than it should | [What a scanner cannot find](https://routebase.dev/guides/api-security/what-a-scanner-cannot-find/) | Three of the ten are authorization failures, and they occupy first, third and fifth place. If you only have budget for one part of this guide, spend it on those three. ## Where this guide starts and stops Three neighbouring subjects have their own homes, so this guide links to them instead of repeating them. **Identity is the authentication guide.** Choosing between bearer tokens, API keys, OAuth 2.0 and mutual TLS, and wiring the chosen one up correctly, is covered in [API authentication](https://routebase.dev/guides/api-authentication/). This guide starts at the point where the token is valid. **A penetration test is people.** A scanner runs the same probes against every endpoint on every push, and a tester brings a model of what your business is for. The two are complements rather than substitutes, and the [limits chapter](https://routebase.dev/guides/api-security/what-a-scanner-cannot-find/) is specific about which side of the line each category falls on. **A web application firewall is not a fix.** Filtering at the edge buys time against known payload shapes, and it cannot decide whether this caller owns this order. Several categories in the list above are invisible to a firewall by construction, because every request in the attack is well formed and correctly authenticated. ## The short answer If you take one working method from this guide, take this one. Hold two identities from different tenants, cross them against every endpoint that reads or writes an object, and make the result a build step rather than an afternoon someone volunteers for. Everything else here is that method extended over the other categories, plus the honest account of what it still misses. | Chapter | Answers | |---|---| | [Broken object level authorization](https://routebase.dev/guides/api-security/broken-object-level-authorization/) | Why the top category is invisible to a single-user test suite | | [Function and property level authorization](https://routebase.dev/guides/api-security/function-and-property-level-authorization/) | Admin endpoints without a role check, and fields that leak or over-accept | | [Authentication failures](https://routebase.dev/guides/api-security/api-authentication-failures/) | What breaks when the method is right and the validation is not | | [Unrestricted resource consumption](https://routebase.dev/guides/api-security/unrestricted-resource-consumption/) | Unbounded pages, oversized bodies and the missing limit | | [Server side request forgery](https://routebase.dev/guides/api-security/server-side-request-forgery/) | Why every URL field is an instruction to your server | | [Misconfiguration, TLS and headers](https://routebase.dev/guides/api-security/api-security-misconfiguration/) | The settings that give ground away before anyone attacks anything | | [Shadow and zombie APIs](https://routebase.dev/guides/api-security/shadow-and-zombie-apis/) | What is still answering that nobody remembers deploying | | [Running a scan](https://routebase.dev/guides/api-security/running-an-api-security-scan/) | Target, specification, identities, and what a scan does to the thing it scans | | [Triaging findings](https://routebase.dev/guides/api-security/triaging-security-findings/) | Severity against confidence, and the note that ends the argument | | [Security in CI/CD](https://routebase.dev/guides/api-security/api-security-in-ci-cd/) | A gate that is still switched on in month three | | [What a scanner cannot find](https://routebase.dev/guides/api-security/what-a-scanner-cannot-find/) | Business logic, multi-step abuse and the APIs you consume | | [Choosing a tool](https://routebase.dev/guides/api-security/api-security-testing-tools/) | The criteria that separate a scanner from a report generator | Two neighbouring guides carry part of this ground. The identity half is in [API authentication](https://routebase.dev/guides/api-authentication/), and the chapter on security testing inside [API testing](https://routebase.dev/guides/api-testing/api-security-testing/) is the short version of what you are reading now. ## In Routebase Routebase includes a scanner that tests running APIs against the OWASP API Security Top 10 from 2023. It reads your specification first, so it sends targeted probes at documented endpoints, parameters and request bodies rather than crawling for links that an API does not have. _Screenshot: The project score, the open findings by severity and a thirty day trend, recalculated from what is still open rather than from what a scan once reported._ The security area is a **Pro plan** feature, and every In Routebase section in this guide assumes it. Reading the dashboard, runs and findings needs the `security:read` permission that members already have, while editing profiles, triaging findings and starting scans need `security:write` and `security:execute`, which admins and owners have. The work splits into five pages. Scan profiles hold the configuration, scan runs hold the history, findings are the triage list, personas are the identities the authorization scanners act as, and the dashboard aggregates all of it into a score. Start with [Security Overview](https://docs.routebase.dev/security-overview/) in the product documentation, or read on. ## Frequently asked questions ### What is API security? API security is the work of making sure an interface only does what it was meant to do, for the callers it was meant to serve. It sits one layer past authentication, because most serious API flaws are found in requests that were correctly authenticated and should still have been refused. The standard map of that ground is the OWASP API Security Top 10, whose 2023 edition puts three authorization failures in its top five. ### What is the OWASP API Security Top 10? It is a list of the ten risk categories that appear most often in real API incidents, published by the Open Worldwide Application Security Project and last revised in 2023. Each category has an identifier such as API1:2023, and the identifiers are what security tools and reports refer to. Treat the list as a map of where to look rather than a checklist to tick off, because two APIs with the same ten boxes ticked can be in very different shape. ### How is API security different from web application security? A web application ships a user interface that limits what a caller can ask for, and an API ships the requests themselves. That removes the browser as a constraint, so the attacker works with the same primitives your own client does. It also means the classic scanner technique of crawling links finds almost nothing, because an API surface is described in a specification rather than linked from a page. ### Can an API security scanner replace a penetration test? No, because the two find different classes of problem. A scanner finds the mechanical categories on every endpoint on every run, which covers missing authorization checks, weak input handling and misconfiguration. A penetration test finds the flaws that need a model of your business, such as a sequence of legitimate calls that adds up to something you never intended. Running a scanner continuously is what makes the human time worth paying for. ## Chapters in this guide 1. [Broken Object Level Authorization](https://routebase.dev/guides/api-security/broken-object-level-authorization/index.md): API1:2023 is the flaw a single-user suite cannot see, why proving it takes two identities from two tenants, and why 404 beats 403 on a foreign object. 2. [Function and Property Level Authorization](https://routebase.dev/guides/api-security/function-and-property-level-authorization/index.md): API5:2023 and API3:2023, meaning the admin endpoint that forgot its role check and the body that carries fields this caller has no business with. 3. [Broken Authentication in APIs](https://routebase.dev/guides/api-security/api-authentication-failures/index.md): API2:2023 covers what breaks after the method is chosen, from tokens accepted without a valid signature to a login that answers a thousand guesses. 4. [Unrestricted Resource Consumption](https://routebase.dev/guides/api-security/unrestricted-resource-consumption/index.md): API4:2023 is a design failure, not an operations problem, covering unbounded pages, oversized bodies, missing limits and calls that cost money. 5. [Server Side Request Forgery](https://routebase.dev/guides/api-security/server-side-request-forgery/index.md): API7:2023 turns any URL field in a request body into an instruction your server carries out, which is why the defence is an allow list rather than a filter. 6. [Misconfiguration, TLS and Headers](https://routebase.dev/guides/api-security/api-security-misconfiguration/index.md): API8:2023 covers settings that give ground away before any attack, from cleartext transport and old TLS to wildcard CORS and a live debug endpoint. 7. [Shadow and Zombie APIs](https://routebase.dev/guides/api-security/shadow-and-zombie-apis/index.md): API9:2023 is about what is still answering that nobody remembers deploying, from an old version left running to a staging host with production data behind it. 8. [Running a Scan Against a Live API](https://routebase.dev/guides/api-security/running-an-api-security-scan/index.md): What a scan needs before it starts, what it does to its target, and why concurrency, delay and a time budget are courtesy settings, not performance ones. 9. [Triaging API Security Findings](https://routebase.dev/guides/api-security/triaging-security-findings/index.md): Severity against confidence, reproducing before reporting, a false positive versus an accepted risk, and what a security score is actually good for. 10. [API Security in CI/CD](https://routebase.dev/guides/api-security/api-security-in-ci-cd/index.md): Where a scan belongs in a pipeline, how to set a gate that stays switched on in month three, and why findings belong in the code host. 11. [What a Scanner Cannot Find](https://routebase.dev/guides/api-security/what-a-scanner-cannot-find/index.md): Business logic abuse, multi-step sequences and the APIs you consume are beyond a scanner, and knowing that line is what gives a green report meaning. 12. [What to Look for in an API Security Testing Tool](https://routebase.dev/guides/api-security/api-security-testing-tools/index.md): Eight criteria that decide whether a scanner is still being read in month three, written as questions to put to any tool including the one you already run. --- # Broken Object Level Authorization — Routebase > API1:2023 is the flaw a single-user suite cannot see, why proving it takes two identities from two tenants, and why 404 beats 403 on a foreign object. Canonical page: https://routebase.dev/guides/api-security/broken-object-level-authorization/ Chapter 1 of 12 · API Security · Last reviewed 2026-09-13 by The Routebase Team. An endpoint that reads an object has two jobs. It has to find the object, and it has to decide whether this caller is allowed to have it. The first job is in every codebase and the second one is optional in a way nobody intends. OWASP lists this as **API1:2023 Broken Object Level Authorization**, and its references name [CWE-639](https://cwe.mitre.org/data/definitions/639.html), Authorization Bypass Through User-Controlled Key, alongside [CWE-285](https://cwe.mitre.org/data/definitions/285.html), Improper Authorization. It has led the list since the first edition, and the OWASP page rates both its prevalence and how easily it is found as high. ## What it looks like from the outside The request is ordinary in every respect. It carries a valid token, it matches the documented path, and the response matches the documented schema. The only thing wrong with it is the identifier. A caller who holds a token for one account asks for an object that belongs to another, and the service answers, because the query filtered by object id and never by owner. That is why the flaw survives code review so comfortably. The handler looks correct in isolation, and what is missing is a clause nobody wrote. ## Why one identity proves nothing _Figure: The same endpoint under two test regimes. A suite that holds one identity asks for objects that identity created, so every assertion passes whether or not the ownership check exists. A second identity from another tenant asking for the same object is the only version of the test that can fail, and it is the version that tells you something._ This is a structural property of the test rather than a gap in anyone's diligence. If the only account in the run is the account that owns the data, then the ownership check and the missing ownership check produce identical output. The method that works has two steps and needs two identities. ```txt As user A POST /orders → 201, id = ord_a1 As user B GET /orders/ord_a1 → must be 404 or 403, never 200 ``` Two details decide whether the result means anything. **Pick identities from different tenants.** Two users inside one organisation may legitimately see each other's records, so a 200 there proves nothing and wastes the next hour. A user from a different customer entirely is the case that carries a real consequence. **Cover writes as well as reads.** An update or a delete that takes an identifier has exactly the same exposure, and it costs more when it is wrong. The read case is simply the easiest one to demonstrate. ## Prefer 404 over 403 on an object that is not yours When the check does fire, the status code you return is a second decision, and it leaks information if you get it wrong. A 403 says the object exists and you may not have it. That is a free existence oracle, so an attacker who can iterate identifiers learns which ones are real without ever reading a record. Returning 404 for both cases, meaning "does not exist" and "not yours", gives nothing away. The trade-off is honest rather than free. A 404 is harder to debug for a legitimate caller who genuinely lost access, so log the real reason on your side and keep the response uninformative. ## Fixing it where it cannot be forgotten The reason this category keeps coming back is that the fix is usually written per handler, and handlers are added by people in a hurry. The durable version pushes the check down to the layer that fetches data, so the ownership clause is part of every query by construction rather than by discipline. Whether that is a scoped repository, a row level policy in the database or a query filter applied by the framework depends on your stack. What matters is that a new endpoint inherits the check instead of needing it added. OWASP's own guidance for the category is the same shape. It asks for an authorization mechanism that is relied on rather than reimplemented, and for the check to run in every function that receives a client-supplied identifier. ## In Routebase The two identities are **personas**, which are stored credential sets that a scanner can send. A persona carries any of the supported auth types, and Routebase rejects one with no credentials, because an identity that authenticates as nobody tests nothing. _Screenshot: Two identities with the privilege gap written into their descriptions, so the person assigning them to a scanner a month later still knows which one is supposed to be refused._ The `api1-bola` scanner runs the create-then-read method above. For each `GET /resource/{id}` endpoint it looks for a matching create call on the collection path. It then creates a resource as the first assigned persona, extracts the id from the response and reads it back as the second. A 2xx on that second call raises a Critical finding. Endpoints with no matching create call are skipped rather than guessed at, which keeps the false-positive rate down. Those skipped endpoints are covered by a second scanner, `api1-bola-enum`, and it is deliberately more cautious because enumeration is weaker evidence. It abandons an endpoint whose identifiers are not sequentially readable, and it raises nothing when an unauthenticated request can already read the object. It also requires both personas to read the same distinct objects across several identifiers before it reports anything. It raises High at medium confidence rather than Critical, which is the honest grade for that evidence. Both scanners need at least two personas assigned, and the profile editor will not save with fewer. Assign personas from different tenants for the reason above. See [Security Personas](https://docs.routebase.dev/personas/) and the [Scanner Reference](https://docs.routebase.dev/scanner-reference/), and the [next chapter](https://routebase.dev/guides/api-security/function-and-property-level-authorization/) for the other two authorization categories. ## Frequently asked questions ### What is broken object level authorization? Broken object level authorization is an endpoint that checks whether you are logged in without checking whether the object you asked for belongs to you. Changing an identifier in the path or the body then returns somebody else's record. OWASP lists it as API1:2023, and its references name CWE-639, Authorization Bypass Through User-Controlled Key, and CWE-285, Improper Authorization. ### What is BOLA and how is it different from IDOR? BOLA is the name the OWASP API Security Top 10 gives the flaw, and IDOR, meaning insecure direct object reference, is the older name for the same failure in web applications. The mechanism is identical, because in both cases a user-controlled identifier reaches a data lookup that never asks who is allowed to see the result. The API case is more exposed, since the identifier is part of a documented contract rather than hidden behind a page. ### Why can a normal test suite not find BOLA? Because an ordinary suite authenticates as one identity, and an endpoint that returns everything to everybody looks perfect from inside a single account. Every assertion passes, the response matches the schema, and nothing in the run has a second identity to compare against. The flaw only becomes visible when a request made by one user is replayed by another. ### Do random identifiers such as UUIDs fix BOLA? No, they raise the cost of guessing and change nothing about the missing check. Identifiers leak through shared links, exports, logs, referrals and the other endpoints of your own API, and an attacker who holds one only needs the endpoint to answer it. Treat unguessable identifiers as a delay rather than a control, and put the ownership check in the query. --- # Function and Property Level Authorization — Routebase > API5:2023 and API3:2023, meaning the admin endpoint that forgot its role check and the body that carries fields this caller has no business with. Canonical page: https://routebase.dev/guides/api-security/function-and-property-level-authorization/ Chapter 2 of 12 · API Security · Last reviewed 2026-09-13 by The Routebase Team. The previous chapter was about the object. This one is about the two authorization checks that sit on either side of it, meaning the function being called and the individual fields moving in and out. ## Function level, or the admin endpoint nobody linked **API5:2023 Broken Function Level Authorization** is an operation that verifies the caller is somebody without verifying that they are allowed to do this. Its OWASP references name [CWE-285](https://cwe.mitre.org/data/definitions/285.html), Improper Authorization. It is common because administrative surfaces grow differently from public ones. An internal tool gets an endpoint, the endpoint is never linked from the customer-facing client, and the absence of a link starts doing the job of an access control. In a web application that is weak, while in an API it is nothing at all, since the path is written down in the specification you publish. The probe is a privilege gap rather than a tenant gap. Call the administrative operation with an ordinary member's credentials and assert that it refuses. A 401, 403 or 404 is the endpoint working, and a 2xx is the finding. OWASP's guidance for the category is worth quoting on the default. It asks that the enforcement mechanism "deny all access by default, requiring explicit grants to specific roles for access to every function". A deny-by-default design turns a forgotten check into a locked door rather than an open one. ## Property level, in both directions **API3:2023 Broken Object Property Level Authorization** merges two categories that the 2019 edition kept apart, namely excessive data exposure and mass assignment. The merge makes sense, because both are a missing check on a property. Its references name [CWE-213](https://cwe.mitre.org/data/definitions/213.html) for exposure and [CWE-915](https://cwe.mitre.org/data/definitions/915.html) for the modification side. **Reading too much** happens when a response is a serialised storage model. The client only renders three fields, so nobody notices that eleven went over the wire, and the extra eight include an internal note and a partner's tax identifier. The generic fix is a projection per operation, so a field reaches a response because somebody put it there. **Accepting too much** is mass assignment. A write endpoint binds the incoming body onto the model, and a caller sets a property the interface never offered, such as a role, a price or a verification flag. The fix is an allow list of writable properties per operation, because a deny list is one new column away from being wrong. Both directions need the same test shape. Read an object as a low-privilege identity and inspect the response for fields that identity should never see. Then send an update containing a field that identity may not set, and check that the service ignored it rather than applied it. ## Sensitive field names are a signal, not a verdict Field names carry intent, and a property called `passwordHash` or `creditCardNumber` in a public response is worth a look before anything else in the sprint. The signal is genuinely useful and it is not proof on its own. A field named `token` is sometimes a pagination cursor, and a field named `apiKey` on a self-service settings endpoint may be exactly the caller's own key, which they are entitled to read. Name matching finds candidates quickly and the context decides. This is also the one place in the category where a check can run before anything is deployed. A field name lives in the schema, so a rule over the specification can object while the design is being written rather than after the response has been served to somebody. ## In Routebase Two scanners cover this ground, and both need personas with a privilege gap rather than a tenant gap. `api5-bfla` classifies endpoints as administrative by path and by specification tag, matching segments such as `/admin`, `/internal`, `/management` and `/system`, then calls each one with the assigned normal-user persona. A 2xx is a Critical finding, while 400, 401, 403 and 404 are recorded as the endpoint refusing correctly. Endpoints with `admin` in the path that are meant to be public, such as a health probe, are the usual false positive. Scope the scan to a specification that reflects the surface you want tested. `api3-property-auth` walks each JSON response per persona and matches property names against a dictionary in two confidence tiers. Names like `password`, `passwordHash`, `ssn`, `creditCard`, `apiKey` and `refresh_token` raise High, while names like `internalNote`, `tax_id`, `phone_number` and `date_of_birth` raise Medium. Matched values are truncated to fifty characters in the evidence, so the finding never becomes a second copy of the data it is warning you about. The design-time half is a style guide rule. `no-sensitive-fields-in-schema` inspects top-level schema property names for terms including `password`, `secret`, `token`, `apikey`, `creditcard`, `ssn` and `taxid`, and it flags them while the schema is being edited. It ships at warning severity, and severity is set per organisation and overridable per project, so you decide whether it informs or blocks. See the [Scanner Reference](https://docs.routebase.dev/scanner-reference/) and the [Style Guide](https://docs.routebase.dev/style-guide/), while [consistency across an API](https://routebase.dev/guides/api-design/consistency-across-an-api/) covers how a convention becomes a check that runs without a reviewer. ## Frequently asked questions ### What is broken function level authorization? It is an operation that enforces authentication but not role, so an ordinary user who knows the path can call an administrative function. OWASP lists it as API5:2023 and its references name CWE-285, Improper Authorization. It usually appears when an admin area is protected by not being linked anywhere, which protects nothing in an API because the paths are published in the specification. ### What is broken object property level authorization? It is the same authorization failure moved down to the field. OWASP made it API3:2023 by merging two older categories, namely excessive data exposure and mass assignment, because both are a missing check on a property rather than on an object. Its references name CWE-213 for the read direction and CWE-915 for the write direction. ### What is mass assignment in an API? Mass assignment is a write endpoint that binds an incoming JSON body straight onto a model. A caller can then set fields the interface never offered them, such as a role, a price or an account balance. The defence is an explicit allow list of writable properties per operation. A deny list fails the first time somebody adds a field to the model and forgets the list. ### How do you stop an API returning fields a caller should not see? Shape the response for the caller instead of serialising the storage model and hoping. That means an explicit projection per operation and per role, so a new column on a table cannot become a new field in a public response by accident. The check that catches the rest is reading the same object as a low-privilege identity and comparing what comes back. --- # Broken Authentication in APIs — Routebase > API2:2023 covers what breaks after the method is chosen, from tokens accepted without a valid signature to a login that answers a thousand guesses. Canonical page: https://routebase.dev/guides/api-security/api-authentication-failures/ Chapter 3 of 12 · API Security · Last reviewed 2026-09-27 by The Routebase Team. The [authentication guide](https://routebase.dev/guides/api-authentication/) covers choosing a method and wiring it up. This chapter is about what still breaks when that part went well, which is the subject of **API2:2023 Broken Authentication**. Its OWASP references name [CWE-307](https://cwe.mitre.org/data/definitions/307.html), Improper Restriction of Excessive Authentication Attempts, and [CWE-204](https://cwe.mitre.org/data/definitions/204.html), Observable Response Discrepancy. ## Validating a token means deciding what you accept A token is a claim about identity that you chose to believe. Everything in this section is about the conditions under which you believe it. **The algorithm is your decision, not the token's.** A JSON Web Token declares its own signing algorithm in its header, and a verifier that reads that field from the token can be handed one that declares no signature at all. Pin the accepted algorithms in the verifying configuration, so the token gets no say in how it is checked. **Check the claims that bound the token.** Expiry, issuer and audience each exist to stop a perfectly valid token being used somewhere it was never meant for. A token minted for your staging tenant should not open production, and that is an audience check rather than a signature check. **Know what revocation you have.** A self-contained token is valid until it expires, so short lifetimes and refresh are what limit the damage of a leak. If you need immediate revocation, you need a check against state, and that is a design decision rather than a configuration flag. The [bearer tokens chapter](https://routebase.dev/guides/api-authentication/bearer-tokens-and-jwt/) covers the trade-off in full. ## The endpoints that hand out credentials need their own rules Login, token exchange, password reset and multi-factor verification are not ordinary endpoints, because a caller who fails them repeatedly is telling you something. **Limit attempts on both axes.** A per-address limit is defeated by an attacker who spreads a single common password across ten thousand accounts, and a per-account limit is defeated by an attacker with a large address pool. Counting both is what closes the gap. The [rate limiting chapter](https://routebase.dev/guides/api-design/api-rate-limiting/) covers how a limit is communicated once you have one. **Answer failures identically.** A response that distinguishes an unknown account from a wrong password confirms which addresses are registered, which is the observable discrepancy CWE-204 describes. One message and one status code for both cases. **Ask again before a sensitive change.** Changing the email address, changing the password, disabling second-factor authentication and minting an API key all convert a session into permanent access. Each of them should require the current password or a fresh factor. ## Where this shows up in the contract Some of this is visible before anything runs, because the specification says which scheme protects which operation. An API with no security scheme declared at all is a document that has not been asked the question. An operation with no security requirement, in a specification where other operations have one, is either deliberately public or an oversight, and it is worth being deliberate about which. An API key carried in a query parameter is a credential written into access logs, proxy logs and browser history, and moving it to a header costs nothing. ## In Routebase `api2-broken-auth` is a passive scanner and needs no personas. It runs two probes. The first sends `GET` endpoints a bearer token whose header declares that no signature algorithm was used. A 2xx response means the signature was not verified, and that raises a Critical finding at medium confidence. The second finds a login-shaped `POST` endpoint, matching paths such as `login`, `signin`, `authenticate` and `oauth/token`, then makes a short series of failed attempts and reports when no `429 Too Many Requests` ever appears. That one raises High at low confidence, because a gateway rate-limiting above the probe's threshold produces the same silence as no limit at all. Three style guide rules cover the contract side while you are still editing it. `must-define-security-scheme` asks that the specification declares at least one scheme. `must-have-auth-on-endpoints` flags an operation with no security requirement once other operations have one, and `no-api-key-in-query-param` objects to an API key scheme whose location is the query string. All three sit in the security category of the style guide with a severity you set. For the identity side, meaning schemes, grants and how each one is declared, see the [API authentication guide](https://routebase.dev/guides/api-authentication/) and [Components](https://docs.routebase.dev/components/) in the product documentation. The scanner behaviour is in the [Scanner Reference](https://docs.routebase.dev/scanner-reference/). ## Frequently asked questions ### What is broken authentication in an API? Broken authentication is an identity check that can be bypassed, replayed or worn down. OWASP lists it as API2:2023, and its references name CWE-307, Improper Restriction of Excessive Authentication Attempts, and CWE-204, Observable Response Discrepancy. The common cases are tokens accepted without proper validation, login endpoints with no attempt limit and sensitive account changes that never ask for the password again. ### What is the alg none JWT vulnerability? A JSON Web Token carries an algorithm field in its own header, and a library that trusts that field will accept a token whose header says no signature was used. The attacker then writes any claims they like. The fix is to pin the accepted algorithms in the verifying code rather than reading them from the token, which every current library supports. ### Should a login endpoint be rate limited? Yes, and it needs a stricter limit than the rest of the API, because an unlimited login endpoint turns a leaked password list into an account takeover campaign. OWASP names credential stuffing and brute force as the first scenario under API2:2023. Count failures per account as well as per address, since an attacker spreading one guess across many accounts stays under a per-address limit. ### Does a password change need the current password? It does, because otherwise a stolen session is permanently upgraded into ownership of the account. The same applies to changing the email address, disabling two-factor authentication and adding an API key. OWASP's second scenario for API2:2023 is exactly this, meaning an account takeover through an email change that asked for no confirmation. --- # Unrestricted Resource Consumption — Routebase > API4:2023 is a design failure, not an operations problem, covering unbounded pages, oversized bodies, missing limits and calls that cost money. Canonical page: https://routebase.dev/guides/api-security/unrestricted-resource-consumption/ Chapter 4 of 12 · API Security · Last reviewed 2026-09-13 by The Routebase Team. This category reads like an operations problem and it is a design problem. Nearly every instance is a bound that nobody decided, and a bound is part of the contract. OWASP lists it as **API4:2023 Unrestricted Resource Consumption**, with references to [CWE-770](https://cwe.mitre.org/data/definitions/770.html), [CWE-400](https://cwe.mitre.org/data/definitions/400.html) and [CWE-799](https://cwe.mitre.org/data/definitions/799.html). ## What gets consumed The obvious resource is compute, and it is rarely the expensive one. Memory goes first, usually to a response that was materialised in full before being serialised. Connections and worker threads follow, because a slow endpoint under load holds them. Storage grows quietly. The one that produces the largest number is third-party cost, since every request that fans out to a paid service, a model provider or an SMS gateway converts traffic straight into an invoice. That last case is why this category is worth taking seriously even on an API with no availability risk. Nothing goes down, and the month ends with a bill nobody can explain. ## The four bounds worth writing down **Page size.** A list endpoint with no cap will eventually be asked for everything, and the caller doing it is usually a client with a retry loop rather than an attacker. Document a default and a maximum, then clamp a larger request rather than serving it. The [pagination chapter](https://routebase.dev/guides/api-design/api-pagination-filtering-and-sorting/) covers the shapes. **Body size.** Enforce the limit before parsing, because a parser that has already allocated is a parser that has already lost. The correct refusal is `413 Content Too Large`, and the common failure is a 500, which tells an attacker that the payload reached something. **Request rate.** Per caller rather than per address, since addresses are shared by offices and rented by attackers. Expensive operations deserve a tighter budget than cheap ones, which is a per-endpoint decision. What a caller is told when they hit the limit is covered in [rate limits as a design decision](https://routebase.dev/guides/api-design/api-rate-limiting/). **Depth and fan-out.** Any parameter that multiplies work needs its own ceiling, including nested expansion, batch sizes, date ranges over a reporting endpoint and the number of items in a bulk write. Each of these is a small integer in a request body that turns into a large number of database round trips. ## Testing this without becoming the incident Two of these bounds can be checked with a single well-formed request, and one of them cannot. Asking a collection endpoint for an absurd page size, and sending a write endpoint a body larger than the documented maximum, are both single requests. They tell you whether the bound exists, they generate almost no load, and they are safe to run on every build. Checking a rate limit is different in kind, because the only way to observe a limit is to exceed it. That produces a burst against a live service, so it belongs on an environment you own, at a time you chose, rather than in the pull request pass. Treat it as opt-in and keep it opt-in. ## In Routebase `api4-resource-consumption` runs the two safe probes by default and keeps the third behind a switch. The unbounded pagination probe sends collection endpoints an implausible page size and reports a High finding when the response is a 2xx with an uncapped page rather than a refusal or a clamp. The oversized payload probe sends write endpoints a large body, sized by the profile's **Max probe payload** setting, which defaults to about one megabyte and is configurable from one kilobyte up to ten megabytes. It flags both a 2xx, meaning the body was accepted, and a 5xx, meaning it crashed something, because the healthy answer is a 413. The rate-limit burst is the opt-in. The profile carries an **Enable rate-limit probe** toggle that is off by default, and turning it on fires a short burst of requests at the first collection endpoint to see whether a `429` ever appears. It is off by default because a burst can stress a shared target, so turn it on only against an environment you own. The two fuzzing scanners belong to this category as well, and they sit behind a second gate for the same reason. `fuzz-schema` generates payloads that violate the declared types, lengths and formats, while `fuzz-mutation` starts from a request that provably worked and corrupts parts of it. Both send no requests at all while the profile's **Fuzzing intensity** is *Off*, even when they are selected, and raising the intensity enables more payload classes and a larger request budget. On the design side, the style guide rule `should-have-rate-limit-headers` checks whether a success response declares rate-limit headers at all, which is the contract half of the same question. See [Scan Profiles](https://docs.routebase.dev/scan-profiles/) for the limits and the two gates, and the [Scanner Reference](https://docs.routebase.dev/scanner-reference/) for what each probe sends. ## Frequently asked questions ### What is unrestricted resource consumption? It is an API that lets one caller consume memory, connections, storage, third-party cost or quota without a bound. OWASP lists it as API4:2023, and its references name CWE-770, Allocation of Resources Without Limits or Throttling, CWE-400, Uncontrolled Resource Consumption, and CWE-799, Improper Control of Interaction Frequency. The damage is often a bill rather than an outage. ### Should a list endpoint cap its page size? Yes, and the cap belongs in the contract rather than only in the code. Document a default and a maximum, then clamp anything larger instead of trying to serve it. An endpoint that honours a request for a million rows will be asked for a million rows, usually by a well-meaning client with a retry loop. ### Is rate limiting an infrastructure concern or an API design concern? The enforcement often sits in a gateway and the decision never does. Which operations are expensive, what a fair budget looks like and what a caller is told when they exceed it are properties of the interface, and a gateway cannot infer any of them. Design the limit and then choose where to enforce it. ### How large should an API request body be allowed to be? Large enough for the documented use and no larger, with the limit enforced before the body is parsed. A healthy service refuses an oversized body with 413 Content Too Large rather than accepting it or failing with a 500. Upload and bulk import endpoints need their own higher limit rather than raising the limit everywhere. --- # Server Side Request Forgery — Routebase > API7:2023 turns any URL field in a request body into an instruction your server carries out, which is why the defence is an allow list rather than a filter. Canonical page: https://routebase.dev/guides/api-security/server-side-request-forgery/ Chapter 5 of 12 · API Security · Last reviewed 2026-09-13 by The Routebase Team. Most of this guide is about requests your API answers. This chapter is about requests your API makes, because a field that holds a URL is an instruction that somebody else wrote. OWASP lists it as **API7:2023 Server Side Request Forgery**, and its reference is [CWE-918](https://cwe.mitre.org/data/definitions/918.html). ## Why your server is the attractive proxy The caller is outside and your service is inside. It resolves internal names, and it reaches addresses that are not routable from the internet. In a cloud environment it can often reach an instance metadata service that hands out credentials to whatever asks from the right place. A feature that fetches a URL on behalf of a caller lends all of that out. The attacker supplies a destination, your server makes the request with its own position and its own privileges, and the interesting part is whatever comes back. **Blind variants still work.** Even when the response body never reaches the caller, timing and status differences leak whether a host answered. That is enough to map an internal network patiently, so treat "we do not return the response" as useful hardening rather than as a fix. ## The fields nobody thinks of as URL fields Webhook and callback destinations are the obvious case, and they are the case teams already guard. The quieter ones are everywhere. They include an avatar URL on a profile update, an import-from-URL field, a renderer pointed at a page and a link preview. Anything that resolves a document reference or takes a file by location rather than by upload belongs on the same list. Each of them ends with your server making a request to a destination a caller chose. The question to ask about each field is not what it is called. It is whether anything in the system ever fetches it. ## Allow list, and the four other controls OWASP's guidance for this category is unusually specific, and the parts worth carrying into an API are these. **Keep an allow list of destinations, schemes and ports.** The feature exists to reach a known set of origins, so name them. This is the control that survives creativity, because it does not depend on predicting how an attacker will spell an internal address. **Do not follow redirects.** A destination that passed your check can answer with a redirect to one that would not have. Disabling redirection on the fetching client removes the whole class. **Use a maintained URL parser.** Parsing differences between the component that validates and the component that fetches are a standing source of bypasses, so let one well-tested library do both. **Separate the fetcher from the internal network.** A resource fetching function that runs where it cannot reach internal services has a much smaller blast radius when a check is wrong. **Do not return the raw response.** Serve what the feature needs, such as a stored image or a parsed field, rather than handing back whatever the destination said. ## In Routebase `api7-ssrf` reads request body schemas rather than guessing at fields. It inspects `POST` and `PUT` bodies for URL-shaped property names, including `url`, `uri`, `callback`, `webhook`, `redirect`, `target`, `endpoint`, `imageUrl` and `src`, which is one of the places where having a specification pays for itself. It then decides on two signals. A response that echoes markers from a well-known internal destination raises a Critical finding, because that is direct evidence the fetch happened and the content came back. A successful response that takes longer than five seconds raises a Medium finding at low confidence, since an outbound call is one explanation for the delay and ordinary network latency is another. The usual false positives follow from that design. A URL field validated server-side looks the same from outside as one that is not, and a field the server only stores and displays is never fetched at all. Both are worth marking as such with a note, which the [triage chapter](https://routebase.dev/guides/api-security/triaging-security-findings/) covers. Because the scanner works from the request body schema, a schema that documents its URL fields properly gets a better scan than one that types them all as free-form strings. See [Schemas](https://docs.routebase.dev/schemas/) for the modelling side and the [Scanner Reference](https://docs.routebase.dev/scanner-reference/) for the probe behaviour. ## Frequently asked questions ### What is server side request forgery in an API? It is a feature that fetches a URL supplied by the caller, used to reach something the caller could not reach directly. Your server sits inside the network and has credentials the caller does not, so it makes a very effective proxy. OWASP lists it as API7:2023 and its reference is CWE-918. ### Which API fields cause SSRF? Any field whose value becomes a request your server makes. Webhook and callback URLs are the obvious ones, and the quieter ones are avatar or image URLs, import-from-URL fields, PDF and screenshot renderers, link previews and anything that resolves a document reference. The risk comes from the fetch rather than from the field name. ### Why is a blocklist not enough to stop SSRF? Because a blocklist has to anticipate every spelling of a destination, and the address space offers many. Decimal and hexadecimal forms of an address, redirects to an internal host, DNS names that resolve inward and alternative schemes all get past a naive filter. An allow list of the destinations the feature actually needs does not have that problem. ### How do you test an API for SSRF safely? Check the behaviour rather than the exploit. For each URL field, ask whether the value is ever fetched, whether the destination is checked against an allow list, whether redirects are followed and whether the response body reaches the caller. Those four answers tell you the exposure without pointing a payload at anything. --- # Misconfiguration, TLS and Headers — Routebase > API8:2023 covers settings that give ground away before any attack, from cleartext transport and old TLS to wildcard CORS and a live debug endpoint. Canonical page: https://routebase.dev/guides/api-security/api-security-misconfiguration/ Chapter 6 of 12 · API Security · Last reviewed 2026-09-13 by The Routebase Team. Every other category in this guide needs something to be wrong in the code. This one only needs a setting to be wrong, which is why it is the cheapest ground to cover and the easiest to leave uncovered. OWASP lists it as **API8:2023 Security Misconfiguration**, and its references span [CWE-16](https://cwe.mitre.org/data/definitions/16.html) for configuration, [CWE-319](https://cwe.mitre.org/data/definitions/319.html) for cleartext transmission, [CWE-209](https://cwe.mitre.org/data/definitions/209.html) for error messages that carry sensitive information and [CWE-942](https://cwe.mitre.org/data/definitions/942.html) for permissive cross-domain policies. ## Transport, and the versions you still accept An API reachable over plain HTTP is an API whose tokens are readable by anyone on the path. That much is uncontroversial, and the part teams miss is that terminating TLS is not the end of the question. [RFC 8996](https://www.rfc-editor.org/rfc/rfc8996), which is Best Current Practice 195, deprecates TLS 1.0 and TLS 1.1 and states that negotiating either of them must not be permitted. A host that still completes a handshake with one of them fails that document and most compliance baselines built on it. The fix is a configuration change at the load balancer or reverse proxy rather than anything in your service. Two details make this easy to miss. A client that prefers a modern version will negotiate one, so everyday traffic looks fine while the old version stays available to whoever asks for it. And an HTTP client library normally hides the negotiated protocol, so checking this at all requires a deliberate handshake rather than an ordinary request. ## Headers that cost nothing Security headers do not fix a flaw. They remove a category of accident, and they are one line of configuration each. **Strict-Transport-Security**, defined in [RFC 6797](https://www.rfc-editor.org/rfc/rfc6797), tells a browser to use secure transport for this host from now on, which closes the window where a first request goes out over cleartext. **X-Content-Type-Options** with the value `nosniff` stops a browser second-guessing your content type, which matters the moment a response you consider data is rendered as something else. **Content-Security-Policy** is aimed at documents rather than JSON, so it belongs on any endpoint a browser renders, including a documentation portal or an embedded console. ## CORS, where the answer depends on the endpoint A wildcard in `Access-Control-Allow-Origin` is not automatically a finding, and it is not automatically safe either. On a genuinely public catalogue it is a deliberate decision that makes the API easier to use. On an endpoint that answers differently per caller, it lets any page in any tab read your responses through a visitor's browser. Because the specification forbids combining a wildcard with credentialed requests, cookie-authenticated APIs are partly protected by the rule itself, and APIs authenticated with a header token are not. The workable position is that a wildcard needs a reason, written down once, per surface rather than globally. ## What is still deployed that you forgot Debug routes, profilers, actuator and management endpoints, metrics, and a specification browser that was handy during development all have a way of surviving into an environment that faces the internet. Each of them is a different kind of gift. Some expose configuration, some expose internals, and some accept a command. The honest check is not whether you remember deploying them, because you do not, and it is whether a request to the usual paths gets an answer. Error responses belong in the same section. A stack trace, a database message or a framework page tells an attacker which components you run and often which version, and CWE-209 exists for exactly that. The [error design chapter](https://routebase.dev/guides/api-design/designing-api-errors/) covers what belongs in a failure body instead. ## In Routebase Two scanners split this category, because one of the checks cannot be made with an ordinary HTTP request. `api8-misconfig` runs four checks. It reports a base URL that uses plain `http://`, missing `Strict-Transport-Security`, `X-Content-Type-Options`, `X-Frame-Options` or `Content-Security-Policy` on endpoint responses, a response carrying `Access-Control-Allow-Origin: *`, and successful answers from the paths `/debug`, `/trace`, `/actuator` and `/actuator/health`. Header and CORS checks probe each endpoint with a `HEAD` request and fall back to `GET`. `api8-tls-version` exists because an HTTP client hides the negotiated protocol. It performs a dedicated TLS handshake against the target host once per run. A Medium finding at high confidence follows only when the host provably completes a handshake using TLS 1.0 or TLS 1.1. A plain-HTTP target is skipped rather than reported twice. One false positive is worth anticipating. A reverse proxy that adds security headers above the origin makes those headers invisible to a scan pointed at the origin, so point the scan at the proxied URL that your callers actually use. On the design side, the style guide rule `must-use-https-server` objects to a specification whose server URL is not `https`. Header policies are where a header set becomes a standard across specifications. They are a contract mechanism rather than a runtime one, so they apply headers to the responses in your specification rather than making your server emit them. See [Header Policies](https://docs.routebase.dev/header-policies/) and the [Scanner Reference](https://docs.routebase.dev/scanner-reference/). ## Frequently asked questions ### What is API security misconfiguration? It is the category for everything that is wrong in the configuration rather than in the code, which OWASP lists as API8:2023. Its references cover cleartext transmission in CWE-319, permissive cross-domain policies in CWE-942, error messages that leak internals in CWE-209 and general configuration weaknesses in CWE-16. None of these needs a flaw in your business logic to be exploitable. ### Which security headers should an API send? Strict-Transport-Security, defined in RFC 6797, so a browser never retries over cleartext. X-Content-Type-Options with the value nosniff, so a JSON response is never re-interpreted as something executable. For any endpoint a browser renders rather than parses, add a Content-Security-Policy. Headers are a layer rather than a fix, so send them and still fix what is underneath. ### Is TLS 1.0 still acceptable? No. RFC 8996, which is Best Current Practice 195, states that TLS 1.0 and TLS 1.1 must not be used and that negotiating them must not be permitted. Modern baselines also fail a host that still accepts them. Disable both at the load balancer or reverse proxy and serve TLS 1.2 and above. ### Is a wildcard CORS policy a vulnerability? It depends on what the endpoint serves and how it authenticates. Access-Control-Allow-Origin with a wildcard on a public catalogue is a design choice. The same header on an endpoint that answers per user lets any page read your data through a visitor's browser. Since a wildcard cannot be combined with credentials, the risk concentrates on APIs that authenticate with something other than cookies. --- # Shadow and Zombie APIs — Routebase > API9:2023 is about what is still answering that nobody remembers deploying, from an old version left running to a staging host with production data behind it. Canonical page: https://routebase.dev/guides/api-security/shadow-and-zombie-apis/ Chapter 7 of 12 · API Security · Last reviewed 2026-09-13 by The Routebase Team. This category is not about a flaw in an endpoint. It is about an endpoint nobody is thinking about, which is a different problem and often a larger one. OWASP lists it as **API9:2023 Improper Inventory Management**, with [CWE-1059](https://cwe.mitre.org/data/definitions/1059.html) as its reference. ## Two ways the list goes wrong **Zombies** are versions and endpoints that were replaced and never switched off. Version 1 keeps answering after version 2 ships, carrying the code it had on the day it was superseded, which means it misses every fix since. An attacker comparing the two versions gets a map of what was fixed and a live host that still has it. **Shadows** are endpoints that answer without being written down. A debug route, an internal tool, a one-off partner integration or a feature that shipped from a branch that never reached the specification. They are outside the process, so the reviews and tests that cover the documented surface do not cover them. Both are the same failure seen from two sides. The list of what you run and the set of what answers have drifted apart, and security work is being applied to the list. ## Non-production environments are part of the inventory OWASP's guidance is explicit about this, and it is the part teams underestimate. A staging or demo deployment usually has weaker controls, because that is what makes it convenient. When it also carries production data, or a copy of it, the weaker controls now protect real records. The guidance is that if production data must be used outside production, that deployment needs the same security controls as production, at which point the convenience has been paid for honestly. ## Retiring something is a process, not a deletion The reason zombies survive is that switching an old version off breaks a consumer you cannot enumerate, so nobody does it and the decision is deferred indefinitely. What breaks that cycle is announcing the end date before it arrives, signalling it on the responses themselves, and watching whether anyone is still calling. The mechanics of that are the subject of the versioning guide, which covers [deprecation and the Sunset header](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) and [running multiple versions at once](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/). The security argument for doing it is this chapter, because an old version that nobody plans to switch off is an old version nobody plans to patch either. ## In Routebase `api9-inventory` runs two discovery probes and raises Medium findings from both. The old-version probe reads the base URL, and where the path contains a version segment it requests every lower version down to zero. Anything that answers successfully is reported as a still-reachable old version. The shadow-endpoint probe sends `OPTIONS` to a small set of conventional paths, including `/admin`, `/api/internal`, `/health`, `/metrics` and `/openapi.json`. A path that answers with a 2xx, 401 or 403 is flagged as reachable but undocumented. Both probes produce expected findings on a healthy API, which is why they are Medium rather than higher. A health endpoint is meant to answer, a metrics endpoint is meant to answer to your monitoring, and an old version you are patching deliberately is a decision rather than an oversight. Mark those as accepted risk with the reason, and the next scan stops arguing with you. The other half is the retirement itself. A deprecation plan carries a sunset date, an optional successor endpoint and a migration guide. The intent to remove an endpoint then exists as a record with a date on it rather than as a conversation. _Screenshot: An endpoint being retired on a schedule, with the successor named and the migration guide part of the same record, which is what turns a still-reachable old version into a planned one._ See [Deprecation](https://docs.routebase.dev/deprecation/) for the retirement workflow, [Versioning](https://docs.routebase.dev/versioning/) for version aliases and status, and the [Scanner Reference](https://docs.routebase.dev/scanner-reference/) for the two probes. ## Frequently asked questions ### What is improper inventory management in an API? It is the gap between the APIs you believe you run and the endpoints that actually answer. OWASP lists it as API9:2023 and its reference is CWE-1059. The risk is not that an old endpoint exists, it is that nobody is patching, monitoring or reviewing something that still returns data. ### What is a zombie API? A zombie API is a version or an endpoint that was replaced but never switched off, so it keeps serving traffic from the codebase it had on the day it was superseded. It misses every fix applied to the current version, which makes it the easiest way into a service that is otherwise maintained. ### What is a shadow API? A shadow API is an endpoint that answers without appearing in the documentation or the specification. That usually means a debug route, an internal tool or a partner integration added outside the normal process. It is not covered by whatever reviews and tests the documented surface gets, because nothing in the process knows it is there. ### How do you keep an API inventory accurate? Make the specification the record and derive from it, so a documented endpoint and a deployed endpoint are the same list by construction. Then check the other direction periodically, meaning probe for endpoints and versions that answer but are not described. The first half prevents drift and the second half catches what bypassed the process. --- # Running a Scan Against a Live API — Routebase > What a scan needs before it starts, what it does to its target, and why concurrency, delay and a time budget are courtesy settings, not performance ones. Canonical page: https://routebase.dev/guides/api-security/running-an-api-security-scan/ Chapter 8 of 12 · API Security · Last reviewed 2026-09-13 by The Routebase Team. A scan is not an analysis. It is traffic, sent deliberately, at a system that will react to it, and that framing decides most of the configuration. ## The four things a scan needs **A reachable target.** The scanner runs somewhere and the API has to answer it, which means a deployed staging, preview or demo environment rather than a service bound to localhost. This is the most common reason a first scan finds nothing. **A description of the surface.** Without one, a scanner has to discover endpoints, and an API does not link to itself the way a website does. With a specification it knows every path, method, parameter and body schema, so it can send probes that fit the endpoint instead of generic noise. That difference shows up directly in the false-positive rate. **Identities.** Everything in the [object](https://routebase.dev/guides/api-security/broken-object-level-authorization/) and [function and property](https://routebase.dev/guides/api-security/function-and-property-level-authorization/) chapters needs credentials, usually two sets with a real gap between them. Without identities, the authorization scanners have nothing to compare and quietly do nothing. **A budget.** Concurrency, delay between requests and a wall-clock limit decide whether a scan is a background hum or a load test nobody scheduled. ## What a scan does to the thing it scans Being specific about this is what makes the difference between a scan that runs weekly and a scan that runs once. **Reads are cheap and writes are not.** The create-then-read method for object level authorization has to create something, and what it creates is a real record in the target environment. On a system with downstream effects, such as a webhook on creation or an email on signup, those effects happen too. **Fuzzing is load by design.** A fuzzer sends many mutated requests per endpoint on purpose, so pointing one at anything shared is how you become the incident you were trying to prevent. **Testing a limit means exceeding it.** There is no way to observe a rate limit without crossing it, which is why that probe belongs behind a switch and on an environment you own. **Some checks are naturally safe.** A missing header, a wildcard CORS policy, a deprecated TLS version and an old version still answering are each observable with one ordinary request. Those belong in the pass that runs on every change. ## Pacing is a courtesy setting Three numbers control how hard a scan pushes, and they are worth setting deliberately. Concurrency decides how many requests are in flight at once, delay decides the minimum gap between consecutive requests, and the time budget decides when the scan stops regardless of what is left. Lower concurrency with a higher delay is gentler, so anything sharing infrastructure with something that matters gets conservative values. The time budget has a second job. It makes an unbounded scan impossible, so a large surface produces a partial result on time instead of a complete result eventually. ## Two profiles, not one Most teams end up with two configurations, because the pull request pass and the thorough pass have incompatible requirements. | | On every change | Nightly or weekly | |---|---|---| | Scanners | The passive checks | Everything, including authorization and fuzzing | | Target | Preview or staging | Staging you own | | Budget | Short enough to finish inside a review wait | Long enough to be thorough | | Load probes | Off | On, where the environment is yours | The pull request pass exists to catch a regression while the change is still in review, so it is worth keeping it small enough that nobody is tempted to skip it. The thorough pass has all night. ## In Routebase A **scan profile** is the saved configuration, and it names the target environment, the API specification, the scanners to run, the personas assigned to each one that needs them and the pacing. _Screenshot: Each scanner carries the OWASP category it covers, and the ones that test authorization show how many identities they need and which have been assigned. A profile cannot be saved in a state where those checks would silently skip._ Three settings control the pacing. **Max concurrent requests** defaults to five in a range of one to fifty, and **Request delay** defaults to two hundred milliseconds. The **Time budget** defaults to six hundred seconds and is configurable from thirty seconds to an hour. When the budget is reached the scan stops and keeps the results it has. Two settings are off until you turn them on, and both are off because they generate load. **Enable rate-limit probe** adds the burst check described in [resource consumption](https://routebase.dev/guides/api-security/unrestricted-resource-consumption/), and **Fuzzing intensity** gates the two fuzzing scanners, which send no requests at all while it reads *Off*. Selecting a fuzzer without raising the intensity does nothing, which is deliberate. A profile runs on demand or on a cron schedule of its own, and a run shows its status, a progress bar measured in scanners completed, and counters for checks, passed, failed and open findings. Cancelling is cooperative, so work already in flight finishes and every finding detected up to that point is kept rather than discarded. Some limits are fixed rather than configurable. A scan processes up to five hundred endpoints, and a project holds up to ten personas and up to ten profiles on Pro. A project stores up to ten thousand findings, after which the oldest resolved ones are archived and open ones never are. See [Scan Profiles](https://docs.routebase.dev/scan-profiles/) and [Security Overview](https://docs.routebase.dev/security-overview/). ## Frequently asked questions ### What do you need before running an API security scan? Four things. A target the scanner can reach, which means a deployed environment rather than something on your laptop. A description of the surface, so probes go to real endpoints with real parameters. Credentials for the authorization checks, which means at least two identities. And a limit on how hard the scan is allowed to push, because a scan is traffic. ### Can you run a security scan against production? The passive checks are usually safe anywhere, while anything that generates load belongs on an environment you own and can restart. The deciding question is what happens if a probe succeeds, since a write that lands in production is a real record and a burst that trips a limit is a real outage. Run the full profile against staging and keep production to the read-only checks. ### How long does an API security scan take? It depends on the number of endpoints, the scanners enabled and the pacing you chose, so it is bounded by the time budget rather than predictable from the surface. A wall-clock budget matters more than the exact number, because a scan that has to finish inside a pull request needs a different configuration from one that runs overnight. ### Is it legal to scan an API you do not own? Point scans only at systems you own or have written permission to test. That covers your own deployments and a provider that has given you an agreed testing window, and it does not cover a third-party API you happen to integrate with. Unauthorised scanning is the kind of question that ends up with lawyers rather than engineers. --- # Triaging API Security Findings — Routebase > Severity against confidence, reproducing before reporting, a false positive versus an accepted risk, and what a security score is actually good for. Canonical page: https://routebase.dev/guides/api-security/triaging-security-findings/ Chapter 9 of 12 · API Security · Last reviewed 2026-09-27 by The Routebase Team. A scanner that raises fifty findings on its first run against an existing API is behaving normally. What happens next decides whether anyone ever reads run two. ## Severity and confidence are two different questions A single ranking hides the distinction that makes a list workable. **Severity** answers what it would cost if the finding is real. **Confidence** answers how much the evidence supports it. They move independently, and every combination means something different in practice. _Figure: High severity with high confidence is the work. High severity with low confidence is the verification queue, because the cost of the tool being right is what makes the check worth doing. Low severity with high confidence is a backlog item. Low severity with low confidence is where a list goes to die, and a gate that fires on it is a gate somebody switches off._ The practical rule falls out of the grid. Read severity to decide what to look at first and read confidence to decide how much to trust it before you act. ## Reproduce before you report A finding is a claim about behaviour, so the cheapest way to resolve an argument about it is to make the request again by hand. Reproduction does three things at once. It confirms the behaviour still exists, since the scan may have run before a deploy. It tells you the real conditions, which are often narrower than the report implies. And it gives whoever fixes it a starting point instead of a description. That is why the reproduction step belongs before the ticket rather than after it. Handing somebody a finding you have not reproduced is handing them your uncertainty along with the work. ## Four possible outcomes Every finding ends in one of four places, and each one needs a sentence. **Fixed** means the behaviour changed. **False positive** means the tool was wrong, and the sentence should say why, because the same detector will do it again next month. **Accepted risk** means the tool was right and you are not changing anything, which is a legitimate engineering decision when the exposure is bounded and the fix is disproportionate. **Duplicate** means another item already covers it. The sentence is the whole point. Six weeks later the question is never what the status was, it is why, and without a note the same debate runs again with less context than it had the first time. ## A score is a direction, not a verdict A single number is useful for two things. It shows a trend over weeks, and it gives someone who will not read a findings list something to react to. It cannot do the other job people ask of it. Two projects with the same score are not in comparable shape. A critical finding on a payment endpoint and one on an internal reporting tool move the number the same way and are not the same problem. Use the score to notice that something changed and then go and read what changed. The one property a score needs to be trustworthy is a published formula. A number you cannot reconstruct is a number you cannot argue with, and a number you cannot argue with gets ignored the first time it disagrees with you. ## In Routebase Every finding carries a severity and a confidence as separate fields, and the list sorts by severity with filters for status, severity and assignee. _Screenshot: The same scan producing four different outcomes, because a finding that is genuinely not applicable and a finding somebody decided to live with are different decisions and are recorded as different things._ The detail view has three tabs. **Overview** carries the scanner, the confidence, the assignee and the resolution note. **Evidence** carries a ready-to-run reproduction `curl` command, plus the raw scanner evidence as copyable JSON for pasting into an issue tracker. **Guidance** carries remediation for the OWASP category, with code examples in C#, TypeScript and Python where they exist, and reference links to OWASP and CWE. The status workflow is enforced rather than advisory. Moving between open and in progress is free, and moving to any resolving status, meaning fixed, false positive, accepted risk or duplicate, opens a dialog that requires a short note before it will save. Resolved findings cannot be reopened by hand, and a later scan that detects the same issue reopens it automatically. Bulk triage applies one status to a selection, and the server skips any item whose current status cannot legally make that transition rather than forcing it. The score is published rather than proprietary. It starts at one hundred and subtracts only for open findings. The penalties are twenty five per critical capped at sixty, ten per high capped at thirty, three per medium capped at fifteen and one per low capped at five. Two small bonuses add two points for a completed scan in the last seven days and three points for having at least one scheduled profile, and the result is clamped between zero and one hundred. Bands are good from eighty, fair from fifty and poor below that, and the same number feeds the project governance score as a weighted component that defaults to twenty percent. See [Security Overview](https://docs.routebase.dev/security-overview/). ## Frequently asked questions ### How do you triage API security findings? Sort by severity first and read confidence second, because severity says what it would cost and confidence says how likely the tool is to be right. Reproduce anything you are about to act on, since a finding you cannot reproduce is not yet a finding. Then give every closed item a status and a sentence explaining the decision. ### What is the difference between a false positive and an accepted risk? A false positive means the tool was wrong, so the behaviour it described does not exist. An accepted risk means the tool was right and you have decided not to change anything, usually because the exposure is bounded or the fix costs more than the risk. Recording them as the same thing loses the distinction that matters in three months. ### Should a security finding be reopened automatically? Yes, because a fix that was quietly reverted is exactly the case nobody re-checks by hand. If a later scan sees the same issue on the same endpoint, the item should come back rather than staying closed on the strength of an old decision. That also means closing something is a statement about today rather than forever. ### What is a security score good for? It is good for direction and for conversations with people who will not read a findings list. A score that has been falling for three weeks is a useful signal. What it cannot do is compare two projects or stand in for the list. One critical finding on a payment endpoint and one on an internal tool move the number identically and do not mean the same thing. --- # API Security in CI/CD — Routebase > Where a scan belongs in a pipeline, how to set a gate that stays switched on in month three, and why findings belong in the code host. Canonical page: https://routebase.dev/guides/api-security/api-security-in-ci-cd/ Chapter 10 of 12 · API Security · Last reviewed 2026-09-27 by The Routebase Team. A scan that runs when somebody remembers is a scan that runs after the incident. This chapter is about the version that runs on its own. ## The shape of the job Whatever tool you use, the pipeline step has the same four parts. It queues a scan against a deployed environment, since there has to be something running to probe. It waits, with a timeout that accounts for the scan's own time budget plus queueing. It reads the results and decides whether to fail. And it hands the results to something a reviewer will actually look at. The fourth part is the one that gets dropped, and dropping it is what turns a security gate into an obstacle. A build that fails without showing what failed teaches people to re-run it. ## Set the gate where it will survive The instinct is to fail on anything. The outcome of that instinct is a permanently red build, and then a pipeline configuration change that quietly removes the step. Start by failing on critical findings only. That gate is achievable, so it stays on, and a critical finding genuinely should stop a release. Once the existing backlog has been triaged and the critical count is a real zero, tighten to high. Tightening is a one-line change and rebuilding trust in a build everyone ignores is not. Two properties make a gate trustworthy. It should reflect your current triage state rather than one scan in isolation, so something you accepted last week does not come back as a blocker. And it should be deterministic, meaning the same posture produces the same verdict rather than depending on which scanner happened to finish inside the budget. ## Put the findings where the code is Security findings that live in a separate dashboard get read by the person who owns the dashboard. The format that moves them is SARIF, which code hosts read natively and render next to the code. Two details decide whether that integration is pleasant. Severity has to be expressed in the way the host expects, because most hosts bucket on their own numeric property rather than on a severity string. And every result needs a stable fingerprint, since without one the host treats every run as a fresh set of findings and the noise makes the feature useless. GitHub is a concrete case. Its SARIF documentation, retrieved 2026-09-27, reads a numeric `security-severity` string on the rule, where a score above 9.0 counts as critical and 7.0 to 8.9 as high. It matches results across runs through the `primaryLocationLineHash` entry in `partialFingerprints` and warns that users may see duplicate alerts without fingerprint data. It also needs at least one location before it displays a result, so an API finding points at the operation in the contract file. A trimmed result from a fictional scan of an orders API carries all three. ```json { "version": "2.1.0", "runs": [{ "tool": { "driver": { "name": "example-api-scanner", "rules": [{ "id": "bola-read", "properties": { "security-severity": "8.1" } }] }}, "results": [{ "ruleId": "bola-read", "message": { "text": "GET /orders/{orderId} returned an order owned by another customer." }, "locations": [{ "physicalLocation": { "artifactLocation": { "uri": "openapi.yaml" }, "region": { "startLine": 212, "startColumn": 5, "endLine": 212, "endColumn": 27 } }}], "partialFingerprints": { "primaryLocationLineHash": "3f9c0a7d21b64e58:1" } }] }] } ``` Upload the results even when the gate fails. A failed build with the findings attached is a conversation, and a failed build with a non-zero exit code is a mystery. ## Two cadences The pull request pass and the scheduled pass are different jobs with different constraints, and trying to make one configuration serve both produces something too slow for review and too shallow for the weekend. The pull request pass runs against a preview or staging deployment with the passive checks and a short budget, and its purpose is catching a regression while the change is still open. The scheduled pass runs nightly or weekly against staging with everything enabled, including the authorization scanners and, where the environment is yours to stress, the fuzzers. There is a third option worth knowing about. A scan on a clock does not need a pipeline at all, and a scheduled scan inside the security tool covers the recurring pass without a runner. Use the pipeline when you want the scan tied to a change and the schedule when you want it tied to a clock. ## In Routebase The whole scan lifecycle is available over the REST API, so the pipeline step is three calls. One `POST` queues a run from an existing profile and returns immediately with the run id, because the scan is a background job. A `GET` on the run polls until the status reaches completed, failed or cancelled. The same response carries the score, the open findings count and the scanner progress, so a pipeline can print something useful while it waits. A final `GET` reads the findings, either as JSON for the gate or as SARIF for upload. _Screenshot: A pipeline key needs Full Access, because queueing a run needs execute permission on security while reading runs and findings needs read access to the project._ The SARIF export is version 2.1.0 and is shaped for code scanning specifically. Findings are grouped into rules by guidance id, so there is one rule per issue class carrying the remediation text. Severity is expressed twice. The SARIF `level` is `error` for critical and high, `warning` for medium, `note` for low and `none` for info, and alongside it the numeric `security-severity` property carries the value hosts bucket on. The endpoint path is the result location, so findings land on the route rather than all on line one, and every result carries a `partialFingerprints` entry so the same finding is recognised across runs. Both result calls are project-wide and reflect current triage state, so a finding marked accepted risk does not come back as open and trip the gate. There is no server-side pass or fail verdict, which is deliberate, because the threshold is yours. The [Routebase CLI](https://docs.routebase.dev/cli-overview/) collapses queue, poll, gate and export into one command with a `--fail-on` flag if installing a tool on the runner is acceptable. A profile can also carry its own cron schedule with notifications on critical and optionally high findings, which covers the recurring pass without any pipeline at all. See [Security in CI/CD](https://docs.routebase.dev/security-in-cicd/) for the complete job, and [API Keys](https://docs.routebase.dev/api-keys/) for the key. ## Frequently asked questions ### How do you add API security testing to a CI/CD pipeline? Queue a scan against a deployed environment, wait for it to finish, then read the findings and decide whether to fail the build. Export the results in a format your code host understands so reviewers can see what broke the build rather than only that something did. Keep the pull request pass small and put the thorough pass on a schedule. ### What severity should fail a build? Start at critical only, then tighten once the existing backlog is triaged. A gate that is red on day one is a gate somebody disables by day three, and a disabled gate finds nothing at all. Tightening later is an easy change, while restoring trust in a permanently red build is not. ### What is SARIF and why does it matter for security scanning? SARIF is a standard JSON format for static analysis results that code hosts read natively, so findings appear next to the code instead of in a separate dashboard. It also carries a fingerprint per result, which is what lets a host recognise the same finding across runs rather than reporting it as new every time. ### Should a security scan run on every pull request? A small one should, because an authorization regression is cheapest to fix while the change is still in review. The full profile, including the authorization scanners and anything that generates load, belongs on a nightly or weekly schedule against an environment you own. Most teams end up running both. --- # What a Scanner Cannot Find — Routebase > Business logic abuse, multi-step sequences and the APIs you consume are beyond a scanner, and knowing that line is what gives a green report meaning. Canonical page: https://routebase.dev/guides/api-security/what-a-scanner-cannot-find/ Chapter 11 of 12 · API Security · Last reviewed 2026-09-13 by The Routebase Team. Every chapter so far has described something a machine can check. This one is about the part that is left over, and it is a larger part than a clean report suggests. ## The shape of the blind spot A scanner reasons about one request at a time. It can tell whether a response carried a field it should not have, whether an endpoint refused a caller it should have refused, and whether a header is missing. What it cannot do is know what your service is for. A refund endpoint that lets any authenticated user refund any order they are allowed to view is a serious flaw, and to a scanner it looks like an endpoint working correctly. Every request is authenticated, every response matches the contract and nothing in the exchange is malformed. _Figure: The line runs between what one request can prove and what only a sequence of legitimate requests reveals. Everything above it is mechanical and belongs on a schedule, because a machine will check it on every endpoint on every run without getting bored. Everything below it needs somebody who knows what the API is for._ ## Three categories that live below the line **Business logic abuse.** A sequence of legitimate calls produces an outcome nobody intended. A discount is applied twice because two endpoints each check it independently, or a workflow runs out of order because the state machine is implied rather than enforced. Another version changes a value between the step that prices it and the step that charges it. **Automated access to flows that assume a human.** This is **API6:2023 Unrestricted Access to Sensitive Business Flows**, and OWASP's own examples are commercial rather than technical. Buying out limited stock to resell it, reserving most of the seats on a flight and cancelling them to move the price, and farming a referral programme for credit. Each individual request in those examples is legitimate, and the volume and intent are the problem. OWASP's recommended defences are correspondingly non-technical, including device fingerprinting, human detection and pattern analysis of behaviour. **The APIs you consume.** **API10:2023 Unsafe Consumption of APIs** is about trusting a response from a third party more than you trust one from a user. Its references name [CWE-20](https://cwe.mitre.org/data/definitions/20.html) for improper input validation, [CWE-200](https://cwe.mitre.org/data/definitions/200.html) for information exposure and [CWE-319](https://cwe.mitre.org/data/definitions/319.html) for cleartext transmission. A scanner probing your API from outside never observes that exchange at all. OWASP's guidance is to validate and sanitise data from integrated APIs as you would any other input. It also asks you to keep those calls on a secure channel and to hold an allow list of destinations rather than following redirects. ## What covers the rest **Threat modelling on the flows that carry money or identity.** Walk one flow end to end and ask what an actor who wants the wrong outcome would try. Checkout, refunds, invitations, password reset, plan changes and anything with a quota or a credit. A morning per flow finds things no tool will. **Code review aimed at the checks rather than the logic.** For the categories in this guide, the useful review question is not whether the handler is correct. It is whether the ownership check is present, whether the writable fields are an allow list, and whether the response is a projection rather than a serialised model. **Penetration testing, once the cheap half is done.** A tester whose first two days go to missing headers and unbounded pagination is a tester spending your money on what a scanner does for free. Run the mechanical checks continuously so the human time starts where the machine stopped. **Monitoring for the shapes that only appear in aggregate.** Volume anomalies on a sensitive flow, one identity touching an implausible number of objects, and error-rate patterns that look like enumeration. These are the traces business logic abuse leaves, and they are visible in production rather than in a scan. ## In Routebase The product documentation says which category has no scanner rather than implying full coverage. **API10:2023 Unsafe Consumption of APIs** is listed as not covered, because it would require analysing the upstream and third-party APIs your service calls, and those are outside the scanner's view of your own surface. Nothing in the product claims otherwise. The coverage of **API6:2023** is deliberately partial and says so. `api6-business-flow` identifies state-changing endpoints whose path or tags mark them as a sensitive flow, matching tokens such as `checkout`, `purchase`, `payment`, `transfer`, `signup`, `invite`, `redeem` and `coupon`. It then sends a single `OPTIONS` request per matched endpoint rather than triggering the flow, and it checks the response headers for rate-limit signalling. A missing signal raises a Medium finding at low confidence, which is a prompt to look at a flow rather than a claim that it is abusable. That is an honest design for an unautomatable category, and it is worth reading the way it is meant. The scanner is telling you which flows deserve the threat-modelling morning, not that it has tested them. See the *Not covered* section of the [Scanner Reference](https://docs.routebase.dev/scanner-reference/). ## Frequently asked questions ### What can an API security scanner not detect? Anything that requires knowing what your business is for. A refund that any authenticated user may issue against any order they can see is a serious flaw and a perfectly valid sequence of requests. Multi-step abuse, price and quota manipulation between steps, and the security of the third-party APIs you call are all in the same blind spot. ### What is business logic abuse in an API? It is using an API exactly as designed to reach an outcome nobody designed. Every request is authenticated, authorised and schema-valid, and the combination produces something the business would refuse, such as a discount applied twice or a booking flow driven out of order. No individual request looks wrong, which is why request-level checks cannot see it. ### Why is API10 Unsafe Consumption of APIs hard to scan for? Because the weakness is in what your service does with a response from somewhere else, and a scanner that probes your API from the outside never sees that exchange. Detecting it would mean analysing the third-party integrations in your code and their transport and trust assumptions. That is code review and threat modelling work rather than a probe. ### Does a clean security scan mean an API is secure? It means the mechanical categories came back clean on the surface that was scanned, which is worth having and is not the same claim. The categories that need a model of your business are untouched by that result. Read a clean report as the cheap half being done rather than as the question being answered. --- # What to Look for in an API Security Testing Tool — Routebase > Eight criteria that decide whether a scanner is still being read in month three, written as questions to put to any tool including the one you already run. Canonical page: https://routebase.dev/guides/api-security/api-security-testing-tools/ Chapter 12 of 12 · API Security · Last reviewed 2026-09-27 by The Routebase Team. Tools in this category demo identically. They all produce a list with red items on it, and the differences only show up in the weeks after the trial, when somebody has to read run number twelve. These are the questions that predict that. They apply to any tool including the one you already run. ## Eight questions for a security scanner ### 1. Does it start from your specification Ask how the tool learns what your API contains. A crawler follows links, and an API has none, so a crawling tool sees whatever you manually pointed it at. A tool that reads your specification knows every path, method, parameter and body schema before it sends anything, which means coverage becomes a property of your contract rather than of a discovery heuristic. It also means probes fit the endpoint, and a probe that fits produces far fewer false positives than one that does not. ### 2. Can it hold more than one identity This is the question that decides whether the tool can test the top of the OWASP list at all. Three of the ten categories need two identities compared against each other, and a tool with one credential slot cannot express the comparison. Ask how identities are stored, which authentication schemes they support, whether secrets are encrypted at rest and never returned, and what the tool does when an authorization check is configured without enough identities. Skipping silently is the wrong answer, because a check that quietly does nothing is worse than one that is absent. ### 3. What does it do to the target A scan is traffic, so ask what the traffic looks like before you point it anywhere. Which probes write data, which generate load, what the concurrency and delay defaults are, and whether there is a wall-clock limit. Then ask which of the aggressive checks are off by default. A tool with fuzzing and rate-limit bursts on out of the box will eventually be blamed for an outage. A tool that cannot be paced at all cannot be pointed anywhere shared. ### 4. Is confidence separate from severity A single ranking collapses two different questions, as the [triage chapter](https://routebase.dev/guides/api-security/triaging-security-findings/) covers. Ask whether the tool tells you how sure it is, separately from how bad it would be. Then ask the sharper version, which is whether the tool ever reports a weaker finding at a lower grade rather than promoting it. A tool that grades every detection as high is telling you about its marketing rather than its evidence. ### 5. Can you reproduce a finding without the tool Every finding you act on has to be verified. Ask what the tool hands you for that. The good answer is a request you can run yourself, plus the raw evidence behind the decision. The poor answer is a category name and a description. Whoever has to fix it then reconstructs the probe from prose. This single property does more for adoption than anything else on this list, because it is the difference between a finding and an accusation. ### 6. What happens to a finding you closed Ask whether a resolving status needs a reason, and whether a later run reopens an item it sees again. A tool that lets you close things without a note produces a list nobody can audit six weeks later. A tool that keeps something closed after the fix was reverted produces a list that is wrong. Both failure modes end the same way, which is a report people stop reading. ### 7. Does it leave the tool Ask for the export format and check that your code host reads it natively. SARIF is the answer worth wanting. The details matter more than the checkbox. Ask whether severity is carried in the property your host buckets on, whether results land on the endpoint rather than on one line, and whether each result has a stable fingerprint. ### 8. Does it state its limits Ask which categories the tool does not cover and see whether you get a straight answer. Every scanner has a blind spot, since business logic is not automatable by anyone. A vendor who names the gap is telling you what the rest of your programme has to cover. A vendor who implies complete coverage is selling you a false negative. The [limits chapter](https://routebase.dev/guides/api-security/what-a-scanner-cannot-find/) is what a straight answer looks like. ## A scorecard for security scanners | Criterion | The question | Poor answer | |---|---|---| | Surface discovery | Does it read the specification | It crawls, or you list endpoints by hand | | Identities | Can it compare two callers | One credential slot | | Impact on the target | What does a run cost the system | No pacing, aggressive probes on by default | | Confidence | Is it separate from severity | Everything is high | | Reproduction | What do you get per finding | A description | | Triage | Are closures recorded and reopened | Close with no note, never reopened | | Export | Does your code host read it | A PDF | | Limits | Which categories are not covered | Complete coverage implied | ## Read the first fifty findings, then the second run Do not evaluate on a deliberately vulnerable sample application, because every tool looks competent against one. Point the tool at a staging deployment of your largest real API and read the first fifty findings rather than the summary. Count three things. How many you could reproduce from what the tool gave you, how many were genuinely wrong, and how long a run takes. Those three numbers are the tool's real cost, since a scanner that produces forty items nobody can verify is a net loss whatever it detects. Then check the second run. A tool that reports the same fifty findings again, with no memory of what you decided, will not survive contact with a team. ## In Routebase Run through the scorecard, Routebase answers in the way the chapters on [running a scan](https://routebase.dev/guides/api-security/running-an-api-security-scan/) and [triaging findings](https://routebase.dev/guides/api-security/triaging-security-findings/) describe in depth. The scanner reads the specification you already maintain, so coverage follows your contract rather than a crawl. Identities are personas with encrypted credentials that are never returned to the browser, and a scanner that needs two of them cannot be saved with fewer. Pacing is explicit, with concurrency, delay and a time budget on every profile, and the two load-generating features are off until you turn them on. Severity and confidence are separate fields, and the weaker authorization detector reports at a lower grade rather than being promoted to match the stronger one. Every finding carries a reproduction `curl` command and the raw evidence. Closing one requires a note, reopening happens automatically on the next scan that sees it, and the export is SARIF 2.1.0 with the numeric severity property, endpoint-level locations and per-result fingerprints. The category with no scanner is named as not covered in the documentation rather than implied away. See [Security Overview](https://docs.routebase.dev/security-overview/) for the workflow and the [Scanner Reference](https://docs.routebase.dev/scanner-reference/) for what each scanner checks, including the *Not covered* section. ## Frequently asked questions ### What should you look for in an API security testing tool? Ask whether it reads your specification, whether it can hold more than one identity, what it does to the target while it runs, and whether every finding comes with a way to reproduce it. Those four separate a scanner from a report generator. The feature lists tend to converge, and the answers to those questions do not. ### What is the difference between DAST and API security testing? DAST means dynamic application security testing, which is the general category of probing a running system rather than reading its source. A classic DAST tool was built for web applications and discovers its targets by crawling links, which finds very little of an API. A tool built for APIs starts from the specification instead, so coverage is a property of your contract rather than of the crawler. ### Do you need a scanner if you already have a penetration test? They answer different questions and the schedule is the reason. A penetration test is a deep look at one moment, and a scanner is a shallow look at every moment. Without the scanner, the twelve months between tests are unobserved, and without the test, everything that needs a model of your business stays unexamined. ### How should you evaluate an API security scanner? Point it at a staging deployment of your largest real API and read the first fifty findings rather than the summary. Count how many you can reproduce from what the tool gave you, how many are genuinely wrong, and how long the run took. That afternoon tells you more than any feature comparison, because it measures the work the tool creates as well as the work it saves. --- # API Versioning: A Complete Guide — Routebase > What an API version really promises, which versioning methods exist, when you must cut a new one, and when versioning is a cost with no return. Canonical page: https://routebase.dev/guides/api-versioning/ Guide overview · 13 chapters · Last reviewed 2026-10-29 by The Routebase Team. Every API version is a promise you make to somebody else's code, and that single fact explains why versioning feels heavier than it looks. Cutting a version takes an afternoon, while living with two of them for the next three years is the part nobody plans for. This guide covers the methods, the trade-offs between them, and the decision that comes before all of them. Every chapter stands on its own, so you can read the one that matches your situation and follow the links out from there. ## A version is a contract, not a deployment Teams often use the word version for two different things, and the confusion is expensive. One meaning is the build you shipped this afternoon, which changes constantly, carries no promise, and is known to nobody outside your team. The other meaning is the shape of the interface your consumers wrote code against, which changes rarely and is felt by people who do not work with you. Only the second one is an API version. When a team uses the same number for both, every deploy reads as a change of contract to the people watching your changelog, and they soon stop watching it. _Figure: A call passes from a consumer through the contract to the service, and the contract lists the fields it pins, one clause for each field the payload carries either side of it. The version names which of those contracts the call is made against, which is why it changes rarely while the build behind the service changes all day._ ## The question that comes before the method Most versioning articles start with the carrier, meaning whether the version belongs in the path or in a header. That question matters, and it is not the one that decides your workload. The decision that decides your workload is whether the change breaks anybody at all. A change that nobody can detect needs no version, no migration and no announcement. A change that breaks one caller needs all three, whatever carrier you picked. So the order is fixed. First you classify the change, then you look for an additive path, and only if there is none do you reach for a version. The chapter on [what counts as a breaking change](https://routebase.dev/guides/api-versioning/api-breaking-changes/) sets the classification up so a machine can apply it, because a rule two people can disagree about is not a rule. ## The map of methods Five carriers cover essentially every REST API in production, and they differ in routing, in caching and in how visible the version is to the person calling you. | Method | Looks like | Suits | |---|---|---| | [URL path](https://routebase.dev/guides/api-versioning/api-versioning-strategies/) | `/v1/orders` | Public APIs that want the version obvious in every log line and every support ticket | | [Header](https://routebase.dev/guides/api-versioning/api-versioning-strategies/) | `Api-Version: 2` | APIs whose resource identity should not change when the representation does | | [Query parameter](https://routebase.dev/guides/api-versioning/api-versioning-strategies/) | `?api-version=2` | Platforms where callers paste URLs and tooling has to work without custom headers | | [Media type](https://routebase.dev/guides/api-versioning/api-versioning-strategies/) | `Accept: application/vnd.api.v2+json` | Teams that version representations separately from resources | | [Date-based](https://routebase.dev/guides/api-versioning/semantic-versioning-for-apis/) | `2026-08-26` | Products with frequent small contract changes and long-lived customer pins | Two further layers get versioned alongside the API and are commonly confused with it. Your OpenAPI document has [its own version field](https://routebase.dev/guides/api-versioning/openapi-versioning/), and your documentation portal has versions that consumers switch between. Neither of them is the version your consumers call. ## What versioning costs The version number is free. Everything behind it is not. A second live version means a second contract to keep true, a second suite of tests and a second set of documentation pages. It also means a second mock for the frontend team, and a second set of monitors watching a service you were planning to forget. Support answers questions about both, and every new feature is either built twice or held back until the old version finally dies. That is the case for the chapter most versioning guides leave out, which is [when versioning does not matter](https://routebase.dev/guides/api-versioning/when-not-to-version-an-api/). It is also why the healthiest APIs cut versions rarely and evolve constantly. ## The short answer If you want one rule to carry away, this is it. Change your API additively for as long as you can, prove that it stayed additive rather than assuming it, and cut a version only when the change has no additive form. When you do cut one, give it a real end date and a migration path, because a version with no sunset is a version forever. The rest of the guide is that rule taken apart. | Chapter | Answers | |---|---| | [Breaking changes](https://routebase.dev/guides/api-versioning/api-breaking-changes/) | Which changes actually break a consumer, and which only feel dangerous | | [How often APIs break](https://routebase.dev/guides/api-versioning/how-often-do-apis-break/) | What 1,927 public specs compared with their 2023 copies say about change, breaking changes and version numbers | | [Versioning strategies](https://routebase.dev/guides/api-versioning/api-versioning-strategies/) | How the five carriers compare on routing, caching, tooling and visibility | | [Semantic versioning](https://routebase.dev/guides/api-versioning/semantic-versioning-for-apis/) | Why consumers only ever feel the major, and where date-based numbers fit | | [When you must version](https://routebase.dev/guides/api-versioning/when-to-version-an-api/) | The changes and the audiences that leave you no additive option | | [When it does not matter](https://routebase.dev/guides/api-versioning/when-not-to-version-an-api/) | Controlled consumers, pre-release APIs, and the real bill for parallel versions | | [Backward compatible change](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/) | Additive evolution, tolerant readers, and how to prove compatibility | | [Running several versions](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/) | Keeping docs, mocks, tests and monitors bound to the right version | | [Deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) | Phases, the `Deprecation` and `Sunset` headers, and migration that works | | [Changelogs and migration guides](https://routebase.dev/guides/api-versioning/api-changelogs-and-migration-guides/) | What a consumer needs to read at the moment they discover the change | | [OpenAPI versioning](https://routebase.dev/guides/api-versioning/openapi-versioning/) | Spec versions against shipped versions, and what derives from what | | [Beyond REST](https://routebase.dev/guides/api-versioning/versioning-graphql-grpc-and-events/) | Schema evolution in GraphQL, field numbers in Protobuf, event schemas | | [Choosing a strategy](https://routebase.dev/guides/api-versioning/choosing-an-api-versioning-strategy/) | One decision path from the change in front of you to the method | ## In Routebase Routebase treats a version as the frozen contract it is. A draft stays editable while you work, releasing it freezes an immutable snapshot, and a frozen contract cannot be edited afterwards, so nobody quietly changes what a consumer already integrated against. _Screenshot: The version switcher groups versions by status, locks the ones that have been released, and carries the compare and publish actions._ From there the rest of the workspace follows the version. Comparing two versions classifies every difference as breaking, safe or a deprecation, so the release conversation starts from a list instead of an argument. Each environment pins one version per specification, and promoting or rolling back moves the pin. The mock server routes by the strategy you configured, documentation portals expose a version switcher to your consumers, and deprecations run as dated plans with reminders and a sunset date. Start with the [Spec Versioning guide](https://docs.routebase.dev/versioning/) in the product documentation, or read on for the decision you are facing. The [API design feature page](https://routebase.dev/api-design/) has the short version of how specifications, branches and releases fit together. ## Frequently asked questions ### What is API versioning? API versioning is how you let a contract change without breaking the code that already depends on it. You keep serving the old behaviour under one identifier and the new behaviour under another, so consumers move when they are ready instead of when you deploy. The identifier can travel in the path, in a header, in a query parameter or in the media type, and the choice of carrier is a smaller decision than most teams expect. ### What is the difference between an API version and a release? A release is the build you shipped this afternoon, which changes constantly and promises nothing to anyone outside your team. An API version is the shape of the interface consumers wrote code against, which changes rarely and is felt by people who do not work with you. Using one number for both makes every deploy look like a change of contract. ### When should you version an API? Version when a change removes something a consumer relies on, changes the type of something, makes an optional input required, or changes what a value means without changing its shape. Version also when you cannot reach the people calling you, which is the situation on any public API. Everything else usually has an additive path that costs you nothing and costs your consumers nothing. ### Is API versioning always necessary? No. An internal API with a handful of known consumers, a pre-release API with no stability promise, and any change that can be made additively are all cases where a version number buys nothing. Every parallel version has to be operated, tested, documented, mocked and monitored for as long as it lives, so the cheapest version is the one you never cut. ## Chapters in this guide 1. [What Counts as a Breaking Change in an API](https://routebase.dev/guides/api-versioning/api-breaking-changes/index.md): The changes that break a live consumer, the ones that only feel dangerous, the asymmetry between request and response, and how to classify them automatically. 2. [How Often Do APIs Break?](https://routebase.dev/guides/api-versioning/how-often-do-apis-break/index.md): Half of the public API contracts we compared changed within three years, two thirds of those changes break a client, and nine in ten breaking changes kept the major version. 3. [API Versioning Strategies Compared](https://routebase.dev/guides/api-versioning/api-versioning-strategies/index.md): URL path, header, query parameter, media type and date-based versioning, with the routing, caching, tooling and visibility trade-offs of each. 4. [Semantic Versioning for APIs](https://routebase.dev/guides/api-versioning/semantic-versioning-for-apis/index.md): How SemVer maps onto an HTTP API, why consumers only ever feel the major, what an alias like v1 really is, and where date-based numbering fits instead. 5. [When You Must Version an API](https://routebase.dev/guides/api-versioning/when-to-version-an-api/index.md): The changes that have no additive path, the consumer situations that leave you no choice, and the semantic breaks that never show up in a diff. 6. [When API Versioning Does Not Matter](https://routebase.dev/guides/api-versioning/when-not-to-version-an-api/index.md): The situations where a version number buys nothing, what running parallel versions really costs, and the alternatives that solve the same problem for less. 7. [Backward Compatible API Changes](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/index.md): Additive evolution, the tolerant reader pattern, expand and contract, and how to prove an API stayed compatible instead of assuming it did. 8. [Running Multiple API Versions at Once](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/index.md): What it means for a version to be live in an environment, how routing decides who gets which one, and how docs, mocks and tests stay bound to it. 9. [API Deprecation and the Sunset Header](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/index.md): How to retire an endpoint or a version without ambushing anyone, using the Deprecation and Sunset headers, dated phases and a usable migration guide. 10. [API Changelogs and Migration Guides](https://routebase.dev/guides/api-versioning/api-changelogs-and-migration-guides/index.md): What belongs in a changelog entry, how release notes differ from it, and how to write a migration guide that reaches the consumer at the moment they need it. 11. [OpenAPI Versioning](https://routebase.dev/guides/api-versioning/openapi-versioning/index.md): The three different versions an OpenAPI document carries, how spec versions relate to the API consumers call, and where documentation versions fit. 12. [Versioning Beyond REST: GraphQL, gRPC and Events](https://routebase.dev/guides/api-versioning/versioning-graphql-grpc-and-events/index.md): Why GraphQL evolves instead of versioning, how Protobuf field numbers make compatibility mechanical, and what a schema registry does for event streams. 13. [Choosing an API Versioning Strategy](https://routebase.dev/guides/api-versioning/choosing-an-api-versioning-strategy/index.md): One decision path from the change in front of you to the method, with the criteria that actually separate the options and the policy each one needs. --- # What Counts as a Breaking Change in an API — Routebase > The changes that break a live consumer, the ones that only feel dangerous, the asymmetry between request and response, and how to classify them automatically. Canonical page: https://routebase.dev/guides/api-versioning/api-breaking-changes/ Chapter 1 of 13 · API Versioning · Last reviewed 2026-10-29 by The Routebase Team. Half of all versioning anxiety comes from not having a shared definition of the word breaking. One engineer calls a new optional field a breaking change, another ships a renamed response field on a Friday, and both are arguing from intuition. The definition worth using is narrow and testable. A change is breaking when a caller who was correct before the change is no longer correct after it, without that caller touching a line of code. ## The classification Structural breaking changes fall into a small, closed set, and every one of them has the same shape. Something a consumer relied on is gone, is different, or is now mandatory. | Change | Why it breaks | |---|---| | An endpoint is removed | Every call to it starts failing | | A path or a method changes | The old address answers nothing | | A parameter is removed | Callers still sending it may be rejected | | A parameter or field changes type | Values that were valid stop being valid | | An optional input becomes required | Callers that omit it start failing | | A new required parameter or body field appears | Every existing call is now incomplete | | A response field is removed | Consumers reading it get nothing | | A response field changes type | Consumers parsing it fail or coerce silently | | An enum value is removed | Callers sending it are rejected | The safe set is just as short. Adding an optional parameter, adding a response field, adding an enum value, relaxing a required field to optional, and editing descriptions or examples all leave existing callers correct. Deprecation belongs in neither column. Marking something deprecated changes no behaviour at all, and it is still worth counting separately, because it is the announcement that a future release will change behaviour. ## The asymmetry that explains the rules The two lists look arbitrary at first. Adding a required request field breaks consumers while adding a response field does not, and removing a request field is usually safe while removing a response field is not. One rule produces all four results. Whatever the other side has to give you may only get easier over time, and whatever the other side receives from you may only get richer. _Figure: A required field added to a request breaks existing callers, while the same field added to a response leaves them working, because obligations may only shrink and payloads may only grow._ That single sentence is worth teaching to a whole team, because it turns a memorised table into something people can derive at the moment they need it. ## The changes that only feel dangerous Three changes generate more debate than they deserve. **Adding an optional response field.** Safe for any consumer that ignores unknown properties, and unsafe for one that validates against a closed schema. Since you cannot audit every consumer, state the expectation in your own documentation. A consumer who then chooses strict validation has chosen it knowingly. **Adding an enum value.** Safe on the request side, because nothing existing becomes invalid. On the response side it depends on how consumers parse it, and a client whose language maps enums exhaustively will fall over on an unrecognised member. Publishing that new values may appear is what keeps this additive. **Reordering fields or array members.** JSON object members carry no order, so reordering a response object is not a change at all. Reordering an array is a real change of meaning whenever consumers rely on position, and it does not show up in any schema diff. ## The breaks a diff cannot see Structural rules catch most of the damage, and they are blind to an entire second class of change. A field called `status` that returned `active` and `cancelled` and now also returns `paused` has grown an enum value, which the diff will report. A field called `amount` that quietly switches from cents to a decimal string is caught too. But a field called `amount` that stays an integer and switches from cents to whole currency units looks identical in every diff, and it will produce hundredfold billing errors in production. Semantic changes of that kind are always breaking, and they are always invisible to tooling. The same goes for tightening validation on an input you previously accepted loosely, for changing the default value of an optional parameter, and for changing which errors an endpoint returns in a given situation. The practical answer is to treat those as declarations. Whoever makes the change says so, and the classification tool covers the structural half so the humans have attention left for this half. ## Why the rules have to be rules A classification that depends on judgement produces a different answer depending on who is asked and how close the release is. That is not a small problem, because the classification decides whether you cut a major version. Public APIs show how often that major version stays untouched in practice. In a comparison of 1,927 public OpenAPI specs with their copies from three years earlier, 161 contracts contained at least one breaking change, and only 18 of them had raised the major version. In 86 of them the version string had not changed at all. The [corpus study](https://routebase.dev/blog/public-api-specs-three-years-later/) documents the numbers together with its method. The chapter on [how often APIs break](https://routebase.dev/guides/api-versioning/how-often-do-apis-break/) walks through those numbers and what the word break means in them. Fixed rules give you three things. Two people comparing the same pair of contracts reach the same conclusion, and the check runs in a pipeline without anybody calling a meeting. The argument then moves from whether a change is breaking to whether you want to ship it anyway. The blog post on [versioning without breaking your consumers](https://routebase.dev/blog/api-versioning-without-breaking-consumers/) works through how that plays out in a release. Once the classification is automatic, the interesting question becomes what you do with the answer. A breaking change with an additive alternative is a design choice, which [backward compatible change](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/) covers. A breaking change with no alternative is a version, which is the subject of [when you must version](https://routebase.dev/guides/api-versioning/when-to-version-an-api/). Some breaks are not visible in a schema at all, such as retiring an error code a client branches on, and [designing API errors](https://routebase.dev/guides/api-design/designing-api-errors/) covers why that catalogue is part of the contract. ## In Routebase Comparing two versions of a specification classifies every difference against a fixed rule set, so the same pair of versions produces the same verdict every time. The summary counts breaking changes, improvements and deprecations, and the detail tabs break the result down by endpoint and by schema, down to the level of individual fields, parameters and responses. _Screenshot: Comparing two versions classifies every difference and counts the breaking ones before anything is released._ The same classification runs where it matters most. A merge request between a spec branch and its draft reports the breaking changes it would introduce. The release wizard warns you when the version you are about to promote breaks against whatever that environment runs today. The classification rules and the full breaking and non-breaking tables are documented in the [Spec Versioning guide](https://docs.routebase.dev/versioning/). ## Frequently asked questions ### What is a breaking change in an API? A breaking change is any change that can stop working code from working, without that code being edited. Removing an endpoint, renaming a field, changing a type, adding a required input and removing an enum value all qualify. The test is not whether the change is large, it is whether a caller who was correct yesterday is still correct today. ### Is adding a field to an API response a breaking change? Adding an optional field to a response is safe for any consumer that ignores what it does not read, which is what a tolerant reader does. It becomes breaking in practice when consumers validate responses against a closed schema that rejects unknown properties, or when a strongly typed client was generated with strict deserialization. That is why the additive rule is worth stating in your own documentation. ### Why is adding a required request field breaking but adding a response field not? The asymmetry follows from who has to supply what. Whatever the caller must provide may only ever get easier, because an existing call has to stay valid. Whatever the caller receives may only ever get richer, because an existing reader has to keep finding what it looked for. Reverse either one and somebody's working code stops working. ### How do you detect breaking changes automatically? Compare the two contract documents rather than the two codebases, and apply a fixed rule set to the differences. Structural changes such as removals, type changes and new required inputs are decidable from an OpenAPI diff alone. What a diff cannot see is a change of meaning behind an unchanged shape, so that class still needs a human to declare it. --- # How Often Do APIs Break? — Routebase > Half of the public API contracts we compared changed within three years, two thirds of those changes break a client, and nine in ten breaking changes kept the major version. Canonical page: https://routebase.dev/guides/api-versioning/how-often-do-apis-break/ Chapter 2 of 13 · API Versioning · Last reviewed 2026-10-29 by The Routebase Team. Public APIs change their contract far more often than their version numbers admit. About half of the public API contracts we could compare changed within three years, two thirds of those changes break a client, and nine in ten breaking changes arrived without a new major version. Those three numbers come from a study we published in September 2026. This chapter explains what each of them counts, what the word break means in them, and why the version number was no help. The full method and the open data are in [the corpus study](https://routebase.dev/blog/public-api-specs-three-years-later/) and in the public repository [routebase-dev/openapi-corpus-study](https://github.com/routebase-dev/openapi-corpus-study). ## The answer in three numbers The [apis.guru directory](https://github.com/APIs-guru/openapi-directory) lists public APIs and records, for 1,927 of them, the URL of the Swagger or OpenAPI file at the provider, together with a copy of that file from spring 2023. In September 2026 we fetched every one of those files again and compared it with the 2023 copy. The comparison used the same breaking-change rules Routebase applies when a team publishes a new version of its own spec. | Question | Answer | What it counts | |---|---:|---| | How many contracts changed within three years? | 48.9 percent | Of 493 comparable pairs, 241 changed in a way a client can observe | | How many of those changes break a client? | 66.8 percent | 161 of the 241 changed contracts contain at least one breaking change | | How many breaking changes came without a major version bump? | 88.8 percent | 143 of the 161 kept their major version | | How many came with no version change at all? | 53.4 percent | 86 of the 161 carry the same version string as in 2023 | A change counts when an endpoint, a parameter or a field was added or removed, or when a type changed. Edits to descriptions and examples do not count, because no client can observe them. The breaking subset follows the classification in [what counts as a breaking change](https://routebase.dev/guides/api-versioning/api-breaking-changes/), so a removed endpoint, a removed response field, a changed type and a new required input each qualify. The breaking changes themselves are ordinary. An endpoint disappeared in 45.3 percent of the contracts with a breaking change, and a response field was removed in 44.1 percent. On the consumer's side these are a missing route and a null value, and they appear on the day the provider deploys. Four providers with hundreds of specs each make up more than half of the directory, so we also computed every share with each provider weighted equally. That moves the share of changed contracts to 42.0 percent, the share with a breaking change to 70.8 percent and the share without a major bump to 87.7 percent. The headline survives the weighting, and it survives leaving those four providers out altogether. ## What break means in these numbers The question of how often APIs break has two readings, and the study measures only one of them. The first reading is an outage. The API stops answering, answers slowly or answers with server errors, and the problem ends when the provider restores service. Providers publish that number themselves as an availability target, and the arithmetic behind it is worth knowing. An availability of 99.9 percent still allows a little under nine hours of downtime a year, and 99.99 percent allows a little under one hour. We have not measured outages across public APIs, so this chapter gives no figure of its own for that reading. The provider's status page and its service level agreement are the sources for it, and the monitoring guide covers [uptime, latency and SLAs](https://routebase.dev/guides/api-monitoring/api-uptime-latency-and-slas/). The second reading is a contract change. The API keeps answering, often with a 200, while a field, a parameter or an endpoint that a client depended on is gone or has changed shape. Nothing recovers on its own, because the client stays broken until somebody changes its code. This is the reading the study measures, and it is the one that uptime monitoring cannot see, since a response with a missing field is still a successful response to a health check. [Contract drift](https://routebase.dev/guides/api-monitoring/api-contract-drift/) is the name for that gap between what the contract says and what the service does. A third reading sits between the two. Before a contract can change, the file that describes it has to still be there. Of the 1,927 spec URLs recorded in 2023, only 1,230 still served a file in 2026, which is 63.8 percent. Another 27.0 percent answered that the file is gone. A build step that fetches a provider's spec by URL to generate a client or run a contract test fails for more than one URL in three today. ## Why the version number does not warn you Semantic versioning promises that a breaking change raises the major version, and consumers build on that promise when they pin a major or let a dependency bot wait for one. In the corpus, that promise held for 18 of the 161 contracts with a breaking change. _Figure: The 161 public API contracts with at least one breaking change between 2023 and 2026, grouped by what their version number did in the same period. Only a major bump is the signal semantic versioning promises, and it covers 18 of them. More than half kept the exact same version string, and fifteen carry a lower number today than in 2023._ The rest moved in ways a consumer cannot act on. In 86 contracts the version string did not change at all, fifteen carry a lower version number today than in 2023, and eight use version strings that are not semantic versions. A client that reviews its dependencies only when the major changes would have met 143 of these 161 breaking changes without any warning from the version number. The directory's git history shows that this is not new. Between 2015 and 2023 its update job recorded 106,083 new revisions of existing spec files, and of the pairs we could compare, 26.7 percent changed the contract structurally within a published version. Of those changes, 30.8 percent broke a client. Providers change contracts inside versions they have already published, and they have done so for as long as the record goes back. The reason is mechanical rather than careless. A version number is typed by a person, while a contract changes whenever the code behind it changes. Nothing in a typical release process compares the new contract with the one consumers already rely on. The chapter on [semantic versioning for APIs](https://routebase.dev/guides/api-versioning/semantic-versioning-for-apis/) explains what the major should mean, and [backward compatible API changes](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/) shows how to prove that a change stayed additive instead of assuming it. ## What the numbers do not cover Three limits shape what the study can say, and they are worth carrying along with the numbers: - The corpus is public APIs that someone once listed in a directory, so the numbers say nothing about internal APIs, which have fewer consumers and fewer reasons to stay stable. - The 2023 side is the directory's copy of each file rather than the provider's original, so only changes a client can observe are counted, and the directory stopped refreshing in 2023. - A diff sees structure and not meaning. A field that keeps its type but switches from cents to whole units is breaking and invisible here, so the breaking share is a floor rather than a ceiling. ## In Routebase The study ran on the same breaking-change rules that Routebase applies when you publish a new version of a specification. Comparing two versions classifies every difference as breaking, safe or a deprecation. The release wizard warns you when the version you are about to promote breaks against what that environment runs today. A merge request between a spec branch and its draft reports the breaking changes it would introduce before anything merges. More than half of the breaking changes in the study arrived with an unchanged version string, and that is the case drift monitors cover. They compare the live API with the contract its environment is pinned to, field by field. A field that comes back with a different type, a required field that is missing or a value outside its enumeration becomes a drift event. The event carries a first-seen date and an observation count, even when every response came back with a 200. _Screenshot: A drifting endpoint names the field, the type the contract promised and the type the service actually returned, which is exactly the change a version number stays silent about._ Contract tests ask the same question before a release instead of after it. A test case linked to a designed endpoint validates every response against that endpoint's documented schema, so a removed field or a changed type fails the run in CI before a consumer sees it. The product guides for [Contract Drift](https://docs.routebase.dev/contract-drift/) and [Contract Testing](https://docs.routebase.dev/contract-testing/) cover the setup, and the [API monitoring](https://routebase.dev/api-monitoring/) page shows how drift events, alert policies and incidents fit together. ## Frequently asked questions ### How often do APIs break? In a comparison of 1,927 public OpenAPI specs with their copies from three years earlier, 48.9 percent of the contracts that could be compared had changed in a way a client can observe. Two thirds of those changes, 66.8 percent, contained at least one breaking change, and 88.8 percent of the breaking changes arrived without a new major version. The numbers come from the Routebase corpus study of September 2026, and they describe public APIs listed in the apis.guru directory. ### How often do APIs change? Within three years, 48.9 percent of the comparable public API contracts in the apis.guru directory changed structurally, meaning an endpoint, a parameter or a field was added or removed, or a type changed. Edits to descriptions and examples are not counted. Weighted so that every provider counts once, the share is 42.0 percent. ### Do breaking API changes come with a new major version? Rarely. Of the 161 public API contracts with a breaking change in the corpus study, 143 kept their major version, and 86 of them did not change their version string at all. A client that waits for a major version bump before it reviews a dependency would have been warned about 18 of those 161 breaking changes. ### What is the difference between an API breaking and an API being down? An outage means the API stops answering or answers with errors, and it ends when the provider restores service. A breaking change means the API keeps answering with a 200 while the shape or meaning of the contract has changed, so a client that was correct yesterday now fails or misreads data. Uptime monitoring sees the first kind and not the second, which is why the two questions need two different measurements. --- # API Versioning Strategies Compared — Routebase > URL path, header, query parameter, media type and date-based versioning, with the routing, caching, tooling and visibility trade-offs of each. Canonical page: https://routebase.dev/guides/api-versioning/api-versioning-strategies/ Chapter 3 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. The five strategies below all solve the same problem, which is telling the server which contract the caller expects. They differ in how the version travels, and that one difference decides how the request routes, how it caches, how visible the version is, and how much work a migration turns out to be. ## URL path versioning The version sits in the address, as in `/v2/orders/42`. It is the most common choice on public APIs and the easiest to explain. Routing is trivial, because a proxy or a router matches a prefix and needs to know nothing about the request. Caching works without configuration, since the version is already part of the URL and therefore part of the cache key. Every log line, browser address bar, bug report and support ticket carries the version, which shortens a surprising number of conversations. The cost is conceptual and it is real. One resource now has two addresses, which conflicts with the idea that a URL identifies a thing and not a representation of it. Clients that build links by string concatenation have to be updated in every place they do it, and a migration therefore touches more code than a header change would. ## Header versioning The version travels in a request header, such as `Api-Version: 2` or a vendor-specific name. The resource keeps one address for its whole life. This is the version of the argument that HTTP purists win. It also has a practical trap, because a shared cache that does not know about your header will happily serve one version's response to a caller who asked for the other. The fix is a `Vary` header naming your version header on every response, and it has to be there from the first day. Header versioning is quieter than the path in every log you own, so plan for that. A caller cannot try version 2 by editing a URL, which makes debugging over the phone harder, and it makes accidental version drift in a client less likely. ## Query parameter versioning The version is a query parameter, as in `/orders/42?api-version=2026-01-01`. It caches like the path, because the query string is part of the cache key, and it is the easiest of all to try by hand. The drawback is tidiness. Version parameters mix with filtering and pagination parameters in the same namespace, and it becomes easy for a caller to omit yours by accident. Any API using this strategy therefore needs an explicit answer for a request that carries no version at all. ## Media type versioning The caller negotiates the version through content negotiation, sending something like `Accept: application/vnd.example.v2+json`, and the server answers with a matching `Content-Type`. This is the most faithful to HTTP, since it treats a version as one representation of an unchanged resource. It is also the least well served by tooling. Browsers cannot ask for it without help, command line examples get longer, and a caller who sends a plain `Accept: application/json` needs a documented default. Teams that adopt it usually do so because they genuinely version representations separately, and not because they wanted a tidier URL. ## Date-based versioning Date-based versioning changes what the version is called instead of where it travels. Rather than counting majors, each release is named by its date, and consumers pin to the date they integrated against. Stripe uses date-based versions with release names such as `2026-08-26.dahlia`, carried in the `Stripe-Version` header, with an account-level default and a per-request override. Its documentation describes monthly releases as backward compatible and major releases as the ones that are not, and webhook endpoints carry their own version so event payloads stay stable while the caller upgrades. GitHub uses plain dates in the `X-GitHub-Api-Version` header, defaults requests without that header to `2022-11-28`, and answers a request naming a retired version with `410 Gone`. Both pages were retrieved on 13 September 2026. The appeal is that a date is honest about what a version is, which is the state of the contract on a given day. The cost is that consumers can end up pinned to dozens of distinct dates, so this strategy needs strong tooling and a deliberate retirement policy behind it. ## The comparison _Figure: The same call drawn five times, with the version selector highlighted in each. What separates the strategies is whether the selector rides in the address, as it does for a URL path and a query parameter, or alongside it as metadata, as it does for a header and a media type. An address is cached, logged and linkable, and metadata is none of those things, which is what the table below measures. Date-based numbering is a scheme rather than a carrier, so it rides on whichever of the four you already chose._ | | URL path | Header | Query | Media type | Date-based | |---|---|---|---|---|---| | Routing | Prefix match, trivial | Needs header inspection | Query parsing | Content negotiation | Follows its carrier | | Caching | Free, part of the key | Needs `Vary` | Free, part of the key | Needs `Vary: Accept` | Follows its carrier | | Visible in logs | Always | Only if logged | Always | Rarely | Follows its carrier | | Try by hand | Edit the URL | Needs a client | Edit the URL | Needs a client | Depends | | Tooling support | Universal | Good | Universal | Patchy | Good | | Migration cost | Every URL a client builds | One client setting | Every URL a client builds | One client setting | One client setting | | Fits | Public APIs, wide audiences | Internal and platform APIs | Platforms with URL sharing | Representation-heavy designs | Products with frequent contract changes | Azure API Management offers the first three of these as configurable schemes, calling them path, header and query string, with a version identifier that is any string you choose. Its documentation is at `learn.microsoft.com/azure/api-management/api-management-versions`, retrieved on 13 September 2026. That a managed gateway exposes exactly those three is a useful signal about which of them the wider ecosystem actually supports. ## What every strategy needs answered Whichever carrier you pick, three questions decide whether it works in practice, and none of them is about the carrier. **What happens when no version is sent.** Serving the latest is friendly and it silently upgrades every unversioned caller into the next breaking change. Serving a fixed default is predictable and it strands newcomers on old behaviour. Rejecting the request is strict and it is the only option that never surprises anybody. Public APIs usually pick a fixed default, and internal APIs can afford to require the version. **What happens when an unknown version is sent.** A typo should produce a clear error and never a silent fallback. Returning the nearest version is the one behaviour that guarantees a confusing bug report later. **Where the version applies.** A version per API is simple and forces the whole surface forward at once. A version per endpoint is flexible and multiplies the combinations you have to test. The middle path, which most teams end up at, is one version for the API with additive change inside it. ## In Routebase A specification carries its versioning strategy as configuration instead of convention. You choose URL path, header, query parameter or content negotiation, name the carrier, and set what happens when a consumer sends nothing or sends something unknown. _Screenshot: The strategy card sets the carrier and the default behaviour, and previews the resulting request as curl._ The setting is not decorative. A Routebase mock server routes requests by the strategy you configured, so your frontend team develops against the same version selection your production API will use. Strict mode rejects an unknown version identifier instead of guessing, and the documentation portal shows consumers which strategy the API uses next to its version switcher. The [Spec Versioning guide](https://docs.routebase.dev/versioning/) walks through each field, and [Mock Server](https://docs.routebase.dev/mock-server/) covers how version routing behaves against a mock. ## Frequently asked questions ### What are the main REST API versioning strategies? There are five in common use. URL path versioning puts the version in the address, and header versioning carries it in a request header. Query parameter versioning appends it to the URL, while media type versioning negotiates it through the Accept header. Date-based versioning replaces a counter with a release date. The first four decide where the version travels, and the fifth decides what the version is called. ### Is URL path or header versioning better? URL path versioning is visible in every log line, every browser address bar and every support ticket, and it caches without any extra configuration. Header versioning keeps one address for one resource, which is closer to how HTTP was designed. It needs a Vary header, because otherwise a cache can serve one version's response to a caller who asked for another. Most public APIs choose the path for its visibility. ### How does Stripe version its API? Stripe uses date-based versions with release names, such as 2026-08-26.dahlia, sent in the Stripe-Version header. An account has a default version set in the dashboard, requests may override it per call, and webhook endpoints carry their own version so event payloads stay stable. The documentation for this is at docs.stripe.com/api/versioning, retrieved on 13 September 2026. ### Does API versioning affect caching? Yes, and it is the difference that most often decides the choice. A version in the path or the query string is part of the cache key already, so two versions never collide. A version in a header is invisible to a cache unless the response carries a Vary header naming it. Without that header, a shared cache can serve a version 1 response to a caller who asked for version 2. --- # Semantic Versioning for APIs — Routebase > How SemVer maps onto an HTTP API, why consumers only ever feel the major, what an alias like v1 really is, and where date-based numbering fits instead. Canonical page: https://routebase.dev/guides/api-versioning/semantic-versioning-for-apis/ Chapter 4 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. Semantic versioning is the default answer to how a version should be numbered, and it was written for libraries. An HTTP API is not a library, so the mapping is close but not exact, and the differences are where teams get into trouble. ## What SemVer actually says The specification at `semver.org` is short. You increment the major version for incompatible API changes, the minor version when you add functionality in a backward compatible manner, and the patch version for backward compatible bug fixes. Version 1.0.0 defines the public API, and anything below it may change at any time. That last rule is more useful than it looks. A `0.x` API carries no stability promise at all, which is a legitimate and honest state for a product that has not found its shape yet. What is not legitimate is staying on `0.x` for three years while enterprise customers build on it. ## Consumers only ever feel the major Map the three digits onto the classification from [what counts as a breaking change](https://routebase.dev/guides/api-versioning/api-breaking-changes/) and something becomes obvious. | Digit | Contains | Can a consumer opt out | |---|---|---| | Major | Breaking changes | Yes, and they must be able to | | Minor | Additive, backward compatible | No, because there is nothing to opt out of | | Patch | Fixes with no contract change | No | If a minor release is genuinely backward compatible, then every caller that worked before still works. Offering `1.3` and `1.4` as separately selectable versions therefore creates a choice with no consequence, and a support matrix with no benefit. _Figure: Five releases on one timeline, and only the two majors reach the callers above it. The minors and patches land on the axis and stop there, because a caller that worked before a backward compatible release still works after it. That is the argument for exposing only the leading digit and keeping the rest for your release notes._ That is why almost every public API exposes only the major to its callers, whether as `/v2`, as `Api-Version: 2` or as a date range. The precise number keeps living in your release notes and in your support conversations, and the caller never has to care. ## An alias is not a version The label `v1` in a URL is usually an alias, meaning a stable name that points at whichever precise version is current. Today it resolves to `1.5.0`, next month it resolves to `1.6.0`, and no consumer changes anything. This is the mechanism that makes additive evolution work in public. Consumers integrate against a label with a compatibility promise, you keep shipping improvements behind it, and the exact number stays available for anybody who needs it. The promise attached to the label is the important half, so write it down. Something like new fields may appear and existing fields will not change is enough, and it is what tells a consumer how to write their parser. ## The trap called latest A `latest` selector looks helpful and behaves like a scheduled outage. Anybody pointing at `latest` is opted into your next breaking change on the day you ship it, without a decision and usually without noticing. Worse, they are the callers least likely to be watching your changelog, because pointing at `latest` is what people do when they do not want to think about versions. Serving the newest contract to callers who send no version is the same trap wearing different clothes. It is a reasonable default while an API is young, and it stops being reasonable the moment you have a consumer you cannot phone. ## Date-based numbering Some APIs replace the counter entirely and name each release by its date. Stripe and GitHub both do this, as covered in [versioning strategies](https://routebase.dev/guides/api-versioning/api-versioning-strategies/), and the reasoning is worth understanding even if you never adopt it. A date makes no claim about compatibility, which sounds like a weakness and is actually the point. There is no argument about whether a change deserves a major, because the release is simply the contract as it stood on that day. Consumers pin to the date they integrated on and upgrade deliberately. The bill arrives in the long tail. Customers stay pinned for years, so the number of live contracts grows steadily, and you need automated migration support plus a retirement policy that you actually enforce. Choose dates when your contract changes often and your customers upgrade rarely, and choose numbers when your contract changes rarely in deliberate steps. ## Keep the build number out of it One more distinction saves a great deal of confusion. The version your deployment pipeline stamps on a container is not the version your consumers select, even when both are numbers and both live in the same repository. Your service can ship forty times a week while the contract stays at `2`. When the two share a number, every deploy looks like a contract change from the outside, and the changelog turns into noise that nobody reads. Keep the contract version in the specification, keep the build version in the pipeline, and let the release notes join them where it helps. ## In Routebase Every specification version in Routebase carries a full `Major.Minor.Patch` number, and the create dialog offers the three bumps with the meaning attached to each. Comparing against the previous version suggests which digit the changes actually justify, so the number follows the classification instead of somebody's mood. _Screenshot: The three bumps carry their meaning in the dialog, so the number follows the classification of the change._ Aliases are a separate layer on top of that number, so `v1` can resolve to `1.5.0` while the precise version stays visible everywhere it matters. A published version can carry an alias and a sunset date, and both appear in a table below the versioning strategy once they are set. Only published and deprecated versions take either one, since neither means anything for a draft that is still moving. The [Spec Versioning guide](https://docs.routebase.dev/versioning/) covers the numbering dialog and the alias table in detail. ## Frequently asked questions ### Does semantic versioning work for REST APIs? It works as a numbering discipline and not as a routing scheme. Semantic versioning tells you which digit to increment, since semver.org defines MAJOR for incompatible changes, MINOR for backward compatible additions and PATCH for backward compatible fixes. What consumers actually select is almost always the major alone, because a caller has no reason to pin to a minor that only added optional fields. ### Why do API consumers only see the major version? Because minor and patch releases are defined as backward compatible, so there is nothing for a consumer to opt into. If v1.4.0 works for every caller that v1.3.0 worked for, then exposing both as selectable versions creates choices with no consequences and a support matrix with no benefit. The internal number stays precise while the public selector stays coarse. ### What is an API version alias? An alias is a stable label pointing at a precise version, so v1 might resolve to 1.5.0 today and 1.6.0 next month. Consumers integrate against the label and receive compatible improvements without changing anything. The precise number stays available for release notes, for support conversations and for anybody who needs to pin exactly. ### Should an API version be a number or a date? Use a number when your contract changes in occasional deliberate steps, since a major number communicates a migration. Use a date when the contract changes often in small compatible increments and customers stay pinned for years, which is the pattern behind Stripe and GitHub. A date says what the contract looked like on a day, and it removes the argument about whether something deserves a major. --- # When You Must Version an API — Routebase > The changes that have no additive path, the consumer situations that leave you no choice, and the semantic breaks that never show up in a diff. Canonical page: https://routebase.dev/guides/api-versioning/when-to-version-an-api/ Chapter 5 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. The interesting question is not which changes are breaking, since [that classification](https://routebase.dev/guides/api-versioning/api-breaking-changes/) is a closed list. The interesting question is which breaking changes leave you no way out except a new version. Two things decide it. What the change is, and who is on the other end. ## Changes with no additive path Most breaking changes have an additive alternative if you look for one, which is the subject of [backward compatible change](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/). A few genuinely do not. **A resource is being reshaped, not extended.** Splitting one endpoint into three, flattening a nested structure and moving from a single object to a collection are all the same kind of change. The old shape and the new one cannot coexist under one name. You can serve both shapes under different names for a while, and at some point that is just a version with extra steps. **A field's type has to change.** An identifier that outgrows a 32-bit integer, a decimal amount that has to become a string for precision, a timestamp that gains a time zone. Adding a parallel field is the additive route, and it works until you have five parallel fields and no consumer knows which is authoritative. **An input becomes mandatory.** Once an operation cannot be performed correctly without a piece of information, there is no compatible way to demand it. You can default it, and a wrong default is worse than a version. **The meaning of a value changes.** This is the one that produces real incidents, because the shape does not move. An `amount` in cents that becomes an `amount` in whole units passes every schema check and every contract test, while consumers compute totals that are wrong by a factor of a hundred. Semantic changes are always breaking and always invisible, so they have to be declared. **Authentication or authorization changes.** Adding auth to a previously open endpoint, replacing one scheme with another, or requiring a scope that existing tokens do not carry all break every current caller. None of them shows up in a response schema diff. ## Audiences that remove the choice The same change can be routine in one setting and unacceptable in another, and the difference is whether you can reach the people affected. _Figure: The callers of one API sorted by a single property, which is whether you can reach them before the change ships. An internal service and your own web app can be told, so a breaking change becomes a coordinated release. A partner SDK, a mobile app already installed and a caller you cannot name have no return path, and those are the ones that turn the same change into a version._ | Situation | Why a version becomes unavoidable | |---|---| | A public API with open signup | You do not know who is calling, so you cannot coordinate anything | | Partner integrations under contract | The contract may name the interface, so a change is a commercial matter | | Customers in regulated industries | Their release process is measured in quarters, and they cannot follow yours | | Mobile or embedded clients | Old versions live in the field for years, and some of them never update | | Anything with an SDK you did not write | A third-party client is generated against a contract and pinned to it | The pattern behind the table is reach. If you can list every caller, phone them, and confirm the change landed, a breaking change can be a coordinated release. If you cannot, the version is the coordination mechanism. Mobile is the case teams underestimate most. An application released two years ago is still installed on somebody's phone, it will never be updated, and it calls your API tomorrow morning. That single fact turns many otherwise minor changes into permanent commitments. ## Breaking on purpose, and doing it well Sometimes the honest answer is that the current contract is wrong and no amount of additive patching will fix it. Cutting a major version is then the correct decision, and the work is in how you run it. Three things separate a version people forgive from one they complain about for years. Announce it before it exists, so consumers hear about it from you and not from a failing build. Ship the old and the new side by side for long enough that a team can plan the migration into an ordinary sprint. Give the end date at the start, because [a deprecation with no sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) never actually ends. ## The change you should decline There is a fourth category worth naming, which is the breaking change that is not worth its cost. Renaming a field for consistency, tidying an inconsistent plural, correcting a spelling in a JSON key, and reordering a response for readability all break consumers and buy nobody anything. They feel like housekeeping and they are paid for by every team integrating with you. Collect them, and spend them together when a genuine major change forces a version anyway. ## In Routebase The classification decides the version rather than the other way round. When you open the release wizard, the first step compares the version you are about to release against the last published one and shows what the change actually is, so the version number follows evidence. _Screenshot: The release step names the trade-off before the click, including how many breaking changes the consumers of that environment would receive._ The warning is specific rather than general. If the version you are promoting carries breaking changes against what the target environment runs today, the wizard says how many and reminds you that consumers on that version may break. Freezing is permanent, so the wizard also spells out the chain it is about to execute before you confirm it. The [Spec Versioning guide](https://docs.routebase.dev/versioning/) covers the three steps of a release and the receipt that follows. ## Frequently asked questions ### When should you create a new API version? Create one when the change has no additive form and a consumer you cannot reach would be broken by it. Removing or renaming a field, changing a type, making an optional input required, changing what a value means, and replacing the authentication scheme all qualify. If you can reach every caller and confirm the change with them, a version is often avoidable even for a breaking change. ### Do internal APIs need versioning? Usually not in the formal sense, because you can find every caller and coordinate the change. What internal APIs do need is the same classification discipline, since knowing a change is breaking is what triggers the coordination. Versioning becomes necessary internally as soon as one team cannot ship in step with another, which happens earlier than most organisations expect. ### Is changing the meaning of a field a breaking change? Yes, and it is the most dangerous kind, because no diff and no schema validator will notice. An amount that switches from cents to whole units keeps the same type, the same name and the same position, so every automated check stays green while consumers silently compute the wrong number. Semantic changes have to be declared by the person making them. ### Does adding authentication to an endpoint require a new version? Yes, if the endpoint was previously reachable without it, because every existing caller starts receiving 401 responses. The same applies to changing the scheme, tightening required scopes, or shortening token lifetimes below what clients were built to handle. These changes never appear in a response schema diff, so they need to be classified by hand. --- # When API Versioning Does Not Matter — Routebase > The situations where a version number buys nothing, what running parallel versions really costs, and the alternatives that solve the same problem for less. Canonical page: https://routebase.dev/guides/api-versioning/when-not-to-version-an-api/ Chapter 6 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. Most writing about API versioning assumes that versioning is the goal and the only open question is which scheme to use. That assumption is wrong often enough to be worth a chapter, because a version number is a permanent liability and it should be taken on deliberately. ## Where a version buys nothing **Consumers you can reach.** If every caller is a team in your organisation, a breaking change is a coordination problem and not a contract problem. You change the interface, you change the callers, and both ship together. A version number here adds a support burden and prevents nothing. **An API that has not promised anything yet.** Before the first stability commitment, the honest state is that everything may change. Semantic versioning has a name for it, since anything below `1.0.0` carries no promise. Say so loudly, keep the audience small, and do not pretend to a stability you have not decided on. **Genuinely additive change.** Adding an optional parameter, a response field or an enum value leaves every existing caller working. Cutting a version for it splits your consumers across two contracts that behave identically, and now you maintain both. **Internal platform interfaces behind a single client.** A backend built for one application in the same repository has one consumer that ships with it. The contract is real, and the versioning ceremony around it is not. ## What parallel versions actually cost The version cut is cheap, and it is not the expense. The expense is everything that has to exist twice for as long as both versions live. _Figure: A second live version duplicates the tests, the documentation, the mocks and the monitors behind it, and every one of those copies has to stay true until the old version retires._ | Area | What a second live version adds | |---|---| | Runtime | Two code paths, or a translation layer, and both in every incident | | Tests | A second suite that has to keep passing against behaviour you no longer develop | | Documentation | A second set of pages, examples and changelogs that stay accurate | | Mocks | A second mock for client teams, matching the older contract | | Monitoring | A second set of checks, because an outage on the old version is still an outage | | Support | Every question starts with which version the caller is on | | Product | New features are built twice, or held back until the old version dies | None of these is dramatic on its own, and together they are why teams that version casually end up with four live majors and no appetite to remove any of them. The cost does not scale with the number of versions you cut, it scales with the number you keep, multiplied by the years you keep them. ## The alternatives worth trying first **Additive change with tolerant readers.** The default answer, covered in [backward compatible change](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/). Grow the payload, never reshape it, and document that consumers must ignore what they do not recognise. **Feature flags on the consumer.** When one integration needs new behaviour and the others do not, a per-consumer flag delivers it without a new contract. This works well for a known set of callers and badly for an open one, because a flag nobody can see is a hidden version. **Expand and contract.** Ship the new field alongside the old one, populate both, mark the old one deprecated, and remove it when usage reaches zero. It converts one breaking change into two compatible ones separated by time, which is the whole trick. **Consumer-driven contracts.** When each consumer states what it depends on, you can answer the question of who breaks before you decide anything. Quite often the answer turns out to be nobody, or one team you can message. ## What you still need without versions Not versioning is not the same as not being careful, and the discipline that replaces the version number is where the value sits. You still need the classification, because knowing that a change is breaking is what starts every other conversation. You still need a changelog, since an unversioned API that changes silently is worse than a versioned one. You still need a way to detect that a change escaped, which means checking real responses against the written contract rather than trusting that additive was actually additive. That last one is the load-bearing part. Additive evolution is a claim about what your service does, and a claim nobody verifies decays quietly. ## The downside Choosing not to version means accepting that some future change will be harder than it would have been. You will meet a case where a version would have been the clean answer, and you will be doing expand and contract across two quarters instead. That trade is usually correct, and it is a trade. Teams who never version and never plan for the day they must are the ones who eventually break their consumers without warning, because the option they refused to build was the one they needed. ## In Routebase A specification does not have to declare a versioning strategy at all. With none configured, the panel states plainly that consumers always receive the latest version and that the API operates without version-specific routing, which is the right setting for the situations above. _Screenshot: With no strategy configured, Routebase says plainly what that means for consumers instead of hiding it._ What replaces the version is verification. Contract tests validate live responses against the published contract, so a change that was supposed to be additive fails the run when it was not. Drift monitors keep doing the same thing against a deployed environment after the release, with the differences reported at field level. Choosing not to version is then a decision you can defend with evidence instead of a hope. The [Contract Testing guide](https://docs.routebase.dev/contract-testing/) covers the validation side, and [Contract Drift](https://docs.routebase.dev/contract-drift/) covers what continues after the release. ## Frequently asked questions ### Do you always need to version an API? No. Versioning pays for itself when you cannot reach the people calling you and a change would break them. If every consumer is a team you can talk to, if the API has not promised stability yet, or if the change is additive, a version number adds a support burden and prevents nothing. ### What does running multiple API versions cost? Each live version needs its own tests, its own documentation, its own mock for client teams and its own monitoring, and support answers questions about all of them. New features either get built in every live version or get held back until the old ones retire. The cost is not the branch, it is the years of parallel maintenance after it. ### What are the alternatives to API versioning? Additive change with tolerant readers covers most cases, since a consumer that ignores what it does not read is unaffected by growth. Feature flags let a specific consumer opt into new behaviour without a new contract. The expand and contract pattern ships both shapes for a period and removes the old one once usage reaches zero. Consumer-driven contracts tell you exactly who would break, which often turns a version into a phone call. ### Should internal APIs be versioned? Internal APIs need the classification discipline more than the version numbers. Knowing that a change is breaking is what triggers coordination with the teams that call you. Formal versioning becomes worth it once those teams can no longer deploy in step with you, which is a question about your release process rather than about your API. --- # Backward Compatible API Changes — Routebase > Additive evolution, the tolerant reader pattern, expand and contract, and how to prove an API stayed compatible instead of assuming it did. Canonical page: https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/ Chapter 7 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. Additive evolution is the version you never have to cut. It sounds like a constraint and it works more like a design discipline, because most contract changes have a compatible form if you look for one before you reach for a version number. ## The safe set Five changes are compatible under every reasonable client, and between them they cover a surprising amount of ordinary product work. - Add an optional request parameter, with a documented default - Add a field to a response - Add a value to an enum a consumer sends back to you, once you have said new values may appear - Relax a required field to optional - Add a whole new endpoint The pattern is that obligations may only shrink and payloads may only grow, which is the asymmetry from [what counts as a breaking change](https://routebase.dev/guides/api-versioning/api-breaking-changes/). Every safe change fits it, and every unsafe change violates it. ## Tolerant readers Additive evolution only works if clients tolerate growth, and clients only tolerate growth if somebody told them to. A tolerant reader takes the fields it needs and ignores everything else. It does not validate against a closed schema, it does not fail on an unfamiliar enum value, and it does not depend on the order of members in an object. Write that expectation into your documentation, because a consumer who chose strict validation without knowing your evolution policy made a reasonable decision with bad information. Two smaller rules make a real difference in practice. Say that unknown fields must be ignored, and say that new enum values may appear with a documented fallback for unrecognised ones. Both cost you a sentence each and remove entire categories of future breakage. ## Expand and contract The pattern behind almost every avoided version is the same three-step move. **Expand.** Add the new field, parameter or endpoint next to the old one, and populate both of them so that callers on either side receive correct data. **Migrate.** Mark the old one deprecated in the specification and in the documentation, tell consumers what to use instead, and watch usage fall. **Contract.** Remove the old one when nobody calls it any more. That removal is a breaking change on paper and nobody notices it, because the affected set is empty. _Figure: The old field and the new one on one timeline, with the migration window shaded between the two dates. Both are populated and correct for the whole of that window, which is what lets callers move at their own pace. The removal at the end is a breaking change on paper only, because by then nobody is reading the old field._ The step teams skip is the middle one, and skipping it is what turns expand and contract into permanent duplication. A deprecation without a date is a field you will still be populating in four years, which is covered in [deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/). ## Renaming without breaking Renaming is the most common request and the least necessary breaking change. Serve both names for a period. On responses, populate the old field and the new one with the same value, so a consumer can move whenever it suits them. On requests, accept either and prefer the new one when both arrive, and document that behaviour so nobody discovers it by experiment. Then deprecate the old name with a date, and remove it when the traffic is gone. The same applies to endpoints. A new path serving the new shape, the old path still answering, and a `Deprecation` header on the old one is the entire migration, spread over as long as your consumers need. ## Compatibility is a claim until you check it Everything above describes intent, and what actually ships is a different question. A serializer that starts omitting nulls, a library upgrade that changes date formatting and a field that quietly becomes required in the database all break consumers without anybody deciding to. That is why additive evolution needs verification and not just discipline. Two checks cover it, and they answer different questions. | Check | Question it answers | |---|---| | Contract diff between two versions | Did we intend a breaking change | | Contract validation against live responses | Did the running service produce one anyway | The first runs before merge and needs only the two documents. The second needs a real environment and real responses, because a document cannot tell you what a service does. [Contract testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) covers the mechanics of the second one in detail. ## When additive stops being compatible There is a point where compatibility becomes a costume. An endpoint with three parallel field names, two of them deprecated and one of them authoritative under conditions nobody remembers, is technically unbroken and practically unusable. The signal is when the answer to a consumer's question needs a paragraph. At that point the compatible path has become more expensive than the version would have been, and [cutting the version](https://routebase.dev/guides/api-versioning/when-to-version-an-api/) is the kinder decision. ## In Routebase Contract tests validate live responses against the published contract, so an additive claim gets checked instead of trusted. A field that changed type, a required property that went missing, or a shape nobody documented fails the run even when the status code is still 200. _Screenshot: Drift is reported field by field against the version the environment is supposed to be serving, with the request and response that produced it._ After the release the same validation continues as a monitor against a deployed environment, and the difference is reported at field level with the request and response that produced it. Where an endpoint was deliberately deprecated instead of removed, the deprecation travels with the specification, into the exported OpenAPI and onto the portal page a consumer reads. The [Contract Drift guide](https://docs.routebase.dev/contract-drift/) covers the monitoring side, and the [Deprecation guide](https://docs.routebase.dev/deprecation/) covers the middle step of expand and contract. ## Frequently asked questions ### What is a backward compatible API change? A change is backward compatible when every caller that worked before the change still works after it, with no edits on their side. In practice that means growing the payload rather than reshaping it, adding optional inputs rather than required ones, and never removing or retyping anything a consumer already reads. The list of safe changes is short and it covers most of the work an API does over its life. ### What is a tolerant reader? A tolerant reader is a client that takes only the fields it needs and ignores everything else, including fields it has never seen. It does not validate responses against a closed schema, it does not fail on an unrecognised enum value, and it does not depend on the order of object members. Tolerant readers are what makes additive evolution possible, which is why the expectation belongs in your documentation. ### What is the expand and contract pattern? Expand and contract turns one breaking change into two compatible ones separated by time. First you add the new field or endpoint alongside the old one and populate both. Then you mark the old one deprecated and watch its usage fall, and you remove it once nobody calls it. The cost is a period of duplication, and the benefit is that no consumer is broken at any point. ### How do you prove an API change was backward compatible? Compare the two contract documents with a fixed rule set to catch structural breakage, then validate real responses from the running service against the published contract. The first check tells you what you intended, and the second tells you what the service actually does. Without the second one, additive evolution is a claim nobody has verified. --- # Running Multiple API Versions at Once — Routebase > What it means for a version to be live in an environment, how routing decides who gets which one, and how docs, mocks and tests stay bound to it. Canonical page: https://routebase.dev/guides/api-versioning/running-multiple-api-versions/ Chapter 8 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. Cutting a version is a decision, and running two is an operating model. This chapter is about the second one, because that is where the cost from [when versioning does not matter](https://routebase.dev/guides/api-versioning/when-not-to-version-an-api/) actually lands. ## One deployment or two There are exactly two ways to serve two contracts, and the choice shapes everything after it. **One deployment handling both.** The service knows which version the caller asked for and behaves accordingly. Shared data stays consistent, operations stay simple, and the code fills with conditionals that nobody dares remove. This suits versions that differ in representation rather than in behaviour. **Separate deployments per version.** Each version is its own service, clean and independently deployable, and both still write to the same data. Every schema migration now has to satisfy two consumers, and every incident has two suspects. This suits versions that differ deeply, and it works best when the older one is frozen and only receiving security fixes. Most teams start with the first and are pushed towards the second by the third live version, which is a good argument for never having a third. ## Routing is a policy, not a config file Whichever [carrier](https://routebase.dev/guides/api-versioning/api-versioning-strategies/) you chose, the routing layer has to answer three questions consistently, and the answers belong in your documentation rather than in a proxy rule nobody reads. Which version a request with no version identifier receives, what happens when the identifier is unknown, and whether a caller can be pinned by account rather than per request. That third one is what large platforms use, since it lets a customer set their version once and stop thinking about it. ## Everything downstream needs the same pin The part that goes wrong is rarely the routing. It is that the documentation, the mock server, the test suite and the monitors all keep pointing at whatever is newest, while production keeps serving something older. _Figure: Production serves one version while the documentation, the mock server, the contract tests and the monitors all follow whichever is newest, so every row sits in the wrong column. Nothing in the system reports this, because each artefact is individually correct about a version that nobody is running. The pin has to be one column rather than two._ | Artefact | What it should be bound to | |---|---| | Documentation portal | The version each environment actually serves, with a switcher for consumers | | Mock server | A named version, so client teams build against a stable contract | | Contract tests | The version its target environment runs, not the newest draft | | Monitors | The published contract of the deployed version | | Client SDKs | The version they were generated from, stated in the package | Each row is the same mistake in a different costume. Something derived from the specification gets bound to the latest state of it, and then it silently changes meaning when somebody edits a draft. ## A pin is a claim, not a fact Saying that production runs version 2 is a statement about intent. Whether the service actually behaves like version 2 is a separate question, and the two drift apart quietly. Someone deploys a hotfix straight to production, a configuration change alters a response, a shared library changes how dates serialize. Nothing in the version pin notices any of it, because the pin records what should be true. The only way to close that gap is to check the running service against the contract the pin names. That is contract validation applied to a specific version rather than to the newest one, and it is what turns the deployment record into something you can rely on during an incident. Running that check continuously against a live environment is [contract drift monitoring](https://routebase.dev/guides/api-monitoring/api-contract-drift/). ## Rollback means moving the pointer When a release goes wrong, the temptation is to edit the version that just shipped. That is the one thing to avoid, because anybody who already integrated against it now has a third contract wearing the same number. Released contracts should be immutable, and rollback should move the pointer to the previous version. The failed version stays in the record as something that existed and was withdrawn, which is both honest and useful the next time somebody asks what happened. ## Retiring one is the whole point Two live versions is a transition. Two live versions with no retirement date is an architecture, and it is the expensive one. Every version you run should have an answer to the question of when it goes away, and that answer should exist before the version ships. [Deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) covers how to run that end deliberately. ## In Routebase Each environment pins one version per specification, so the question of what production runs has a recorded answer. Promoting a version moves the pin forward, rolling back moves it to the previous version, and the frozen contracts themselves never change. _Screenshot: The contract tab shows which version an environment claims to run, next to whether that claim has been verified against the live service._ The rest of the workspace follows the pin. Contract tests validate against the version the environment is pinned to, so a test run tells you about the contract that is actually deployed there. Mock rules are pinned to a published version and show a drift banner when the specification moves past them, with a **Sync from Spec** action when you want them to follow. Documentation portals expose a version switcher to consumers, and the mock server routes incoming requests by the strategy the specification declares. The [Environments guide](https://docs.routebase.dev/environments/) covers promotion, pins and rollback. ## Frequently asked questions ### How do you run two API versions at the same time? Either the service implements both behaviours behind one deployment, or a routing layer sends each version to its own deployment. Sharing one deployment keeps the data layer consistent and fills the code with conditionals. Separate deployments keep each version clean and multiply the operational work, and they need a plan for how both talk to one database. ### Which environment should run which API version? Production runs the version your consumers depend on, staging runs the version you are about to release, and development runs the draft. Pinning each environment to a named version is what makes that statement true rather than aspirational, since without a pin the answer is whatever was deployed last. ### How do you roll back an API version? Move the pointer rather than editing the contract. A released version should be immutable, so rolling back means pointing the environment at the previous version, not changing what the new one says. Anything that reopens a frozen contract for editing turns a rollback into a second breaking change for whoever already integrated. ### How do mocks and tests stay in sync with multiple API versions? Bind each one to a named version instead of to the latest state of the specification. A mock pinned to version 2 keeps serving version 2 behaviour while the design of version 3 continues, and a contract test bound to the version its environment runs validates against the right contract. Anything bound to latest silently changes meaning the moment someone edits a draft. --- # API Deprecation and the Sunset Header — Routebase > How to retire an endpoint or a version without ambushing anyone, using the Deprecation and Sunset headers, dated phases and a usable migration guide. Canonical page: https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/ Chapter 9 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. Deleting an endpoint takes a minute and somebody else pays for it. Deprecating one is the alternative, and it works only if it is a dated plan with a migration path rather than a note in a changelog. ## Announcement, grace, sunset, removal Every workable deprecation has the same four stages, whatever you call them internally. **Announcement.** The change becomes public with an end date attached. Nothing behaves differently yet, and consumers can plan. **Grace period.** The window in which migration is expected. Both the old and the new path work, and the old one is signalling that it is on the way out. **Sunset phase.** The last stretch before the date. This is where escalating signals belong, since anybody still calling at this point has not seen the earlier ones. **Removal.** The endpoint stops answering. That the date arrived and that you are ready are two different statements, and only one of them should come from a timer. _Figure: The two versions as lanes on one timeline, with the grace period shaded between the announcement and the sunset date. The old version keeps answering for the whole of that window while the new one is already live. The Deprecation header from RFC 9745 sits on the announcement and the Sunset header from RFC 8594 sits on the date it names, so a consumer's own monitoring can read both without anybody opening an email._ The number that matters most is the gap between the announcement and the sunset. Ninety days is a common floor for public APIs, and enterprise or regulated consumers routinely need six months, because their release process runs on quarters. Set the date once and never move it closer, since a shortened deprecation teaches consumers that your dates are negotiable. ## The headers, with their sources Two HTTP headers carry this in-band, so a consumer's own monitoring can find out without anybody reading an email. `Deprecation` is standardised in RFC 9745, published in March 2025 on the standards track. It carries a structured field date saying when the resource became, or will become, deprecated. `Sunset` comes from RFC 8594, published in May 2019 as informational, and it carries an HTTP date for when the resource is expected to become unresponsive. The two are designed to be used together, and RFC 9745 states that the sunset timestamp cannot be earlier than the deprecation timestamp. RFC 8594 also registers a `sunset` link relation, which is the right way to point at the page explaining the retirement. A response carrying both headers and a link to a migration guide tells a machine and a person everything they need. One header to leave alone is `Warning`. It was the older way to attach a human-readable note to a response, and RFC 9111 obsoletes it, stating that it is not widely generated or surfaced to users. If you send it, send it as an extra on top of the two headers above and never as the only signal. ## Escalation that respects the calendar The point of a phased retirement is that the signal grows while the consequence stays deferred. A workable escalation looks like this. | Stage | What the consumer experiences | |---|---| | Announcement | `Deprecation` and `Sunset` headers, changelog entry, portal banner | | Grace period | The same headers, plus scheduled reminders as the date approaches | | Sunset phase | Stronger signals, and in testing environments a preview of the removal | | After sunset | `410 Gone`, which says the resource existed and is intentionally gone | `410` rather than `404` is worth the extra thought. A `404` reads as a mistake in the caller's URL and sends a developer looking for a typo, while a `410` says the resource is deliberately gone and sends them looking for the migration guide. Practising the removal in a non-production environment before the date is the single most effective step in this list. A consumer who hits the removal in their own test run has time to react, while one who hits it in production does not. ## The migration guide is the deliverable Everything else is scaffolding around one artefact, which is the text a consumer reads at the moment they discover the problem. A useful migration guide names the replacement, shows the old call and the new call side by side, states what changed about the response, and describes anything that has no equivalent. That last part is the one people skip and the one that matters, because a consumer who cannot find the replacement for a field assumes the migration is impossible and escalates. Where there is no replacement, say so plainly and explain why the capability is going away. That is a harder message and a shorter conversation than letting them search. ## Tell the people who are still calling The final piece is knowing whether anyone is listening. Usage data for a deprecated endpoint turns the removal decision from a guess into an observation, and traffic that has been at zero for two weeks is the strongest signal you will get. Where you have identifiable consumers, a direct message beats a changelog. A team that receives an email naming their integration and the date it stops working will act, while the same information in a release note will not reach them. ## In Routebase A deprecation in Routebase is a dated plan with phases rather than a flag. The wizard asks for the sunset date, the successor endpoint, the migration guide and the sunset policy, and it validates the date against the minimum grace period your organisation set. _Screenshot: The wizard collects the sunset date, the successor and the migration guide before anything is announced._ Phases advance on their own as their dates come due, with one deliberate exception, since retirement happens automatically only if you asked for it. Consumers see a banner on the portal page with the remaining days, the rendered migration guide and a link to the successor, and your team gets reminders before the date. Against a Routebase mock server the sunset policy also changes behaviour, adding the deprecation warning, reducing the rate limit, and answering `410 Gone` during an optional soft-shutdown window so consumers meet the removal in testing first. Organisation-wide presets set the floor for the grace period and can require a migration guide, a successor or an approval. The [Deprecation guide](https://docs.routebase.dev/deprecation/) covers the phases and the policy in full, and the blog post on [versioning without breaking your consumers](https://routebase.dev/blog/api-versioning-without-breaking-consumers/) works through a deprecation end to end. ## Frequently asked questions ### What is API deprecation? Deprecation is the announcement that something still works today and will stop working on a stated date. It changes no behaviour by itself, which is exactly why it is useful, since it gives consumers a window to migrate while everything is still functioning. A deprecation without a date is not a deprecation, it is a note. ### What is the Sunset HTTP header? The Sunset header, defined in RFC 8594, carries an HTTP date saying when a resource is expected to become unresponsive. The same document registers a sunset link relation for pointing at a page that explains the retirement. It is informational rather than a standard, and it is widely enough implemented to be worth sending. ### What is the difference between the Deprecation and Sunset headers? Deprecation, standardised in RFC 9745, says when the resource became or will become deprecated. Sunset, from RFC 8594, says when it will stop responding. They answer different questions and are designed to be sent together, and RFC 9745 notes that the sunset timestamp cannot be earlier than the deprecation timestamp. ### How long should an API deprecation period be? Long enough for a consumer to fit the migration into an ordinary release cycle rather than an emergency. Ninety days is a common floor for a public API, and regulated or enterprise customers often need six months or more, because their release process is measured in quarters. What matters more than the number is that you announce the date at the start and do not move it inward. --- # API Changelogs and Migration Guides — Routebase > What belongs in a changelog entry, how release notes differ from it, and how to write a migration guide that reaches the consumer at the moment they need it. Canonical page: https://routebase.dev/guides/api-versioning/api-changelogs-and-migration-guides/ Chapter 10 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. A changelog is the interface to your interface. It is where a consumer finds out whether the release you just shipped is something they have to care about, and most of them are written as though nobody will ever read them under pressure. ## What a consumer is actually doing Picture the reader for a moment. They maintain an integration they have not touched in five months, they have just received an email saying a new version shipped, and they have about ninety seconds before they move on. They are answering one question, which is whether anything here affects them. Everything about the format follows from that. The classification comes first, the affected surface is named precisely, and the action is explicit. Prose that requires reading three paragraphs to find out that nothing changed for them is a failure even when every word is accurate. _Figure: The same release written twice, measured against the reader's attention rather than the release calendar. The entry that classifies first answers the only question they have well inside the window. The entry that opens with prose answers it too, in a sentence nobody reaches, which is why an accurate changelog can still fail._ ## The anatomy of an entry | Element | Why it is there | |---|---| | Date and version | Lets a reader skip everything before their last upgrade | | Classification | Breaking, added, changed or deprecated, scanned before anything else | | The exact surface | The endpoint, the field, the parameter, named as it appears in the contract | | What changed | Old behaviour and new behaviour, in that order | | What to do | Migrate, do nothing, or act before a date | A good entry can be read in one line and expanded when it matters. A bad one requires the reader to reconstruct which of your endpoints they use. ## Changelog, release notes, migration guide The three get conflated constantly, and each of them is written for a different reader with a different question. The **changelog** is exhaustive and dated. Every contract change appears, including the ones that affect nobody, because a consumer scanning for their own endpoint needs completeness more than they need brevity. The **release notes** are a narrative for one release. They say what the release is for, what is worth adopting, and what needs attention. They are allowed to be selective, and they are the wrong place to hide a breaking change. The **migration guide** exists per breaking change, not per release. It is the longest of the three, it is the one that gets read at the worst possible moment, and it is the one that decides whether your deprecation was a courtesy or a nuisance. All three live on the documentation site, so where they sit and how a reader reaches them is a structural question as much as an editorial one. The [API documentation guide](https://routebase.dev/guides/api-documentation/keeping-api-documentation-up-to-date/) covers the pages around the changelog. ## Generate what is mechanical Half of a changelog is derivable. Comparing two contract versions produces every added endpoint, every removed field, every type change and every new enum value, with the classification already attached. Generating that half has two benefits beyond the time saved. It never forgets an entry, which is the most common failure of a hand-written changelog, and it uses the same classification as your release gate, so the changelog and the pipeline cannot disagree. The other half cannot be generated. A change in what a value means, a tightened validation rule, a different error for the same situation, and a performance characteristic your consumers relied on are all invisible to a diff. Somebody has to write those, and the generated half is what leaves them the attention to do it. ## Reaching people who are not reading A changelog is a pull channel, and the consumers most likely to break are the ones least likely to pull. Three push channels close the gap. The `Deprecation` and `Sunset` headers described in [deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) reach a consumer's own monitoring without anybody reading anything. A direct message to identifiable consumers naming their integration reaches the team that has to act. An error response that names the change, at the moment something stops working, reaches the person debugging it. That last one is underrated. When a request fails because of a change you made, the error body is the highest-attention documentation surface you will ever have, so link the migration guide from it. ## Write the migration guide for a bad day Assume the reader is annoyed, in a hurry, and unfamiliar with the endpoint they are fixing. Four sections cover it. Name the replacement and link it. Show the old call and the new call complete and side by side, then list the response differences field by field. Finish with the part everybody omits, which is what has no equivalent and what to do instead. Where a capability is going away with no replacement, say that in the first paragraph. A consumer who searches for twenty minutes before concluding the same thing will arrive in your support queue in a much worse mood. ## In Routebase Changelog entries are generated from the difference between two versions, with the same classification the release wizard uses. You review them, edit them, and publish them as a page in the documentation portal, so the changelog your consumers read comes from the contract rather than from somebody's memory of the sprint. _Screenshot: Changelog entries are generated from the version comparison and then edited before they are published._ Release notes are part of the release itself, written in the wizard and visible to consumers in the documentation. A deprecation carries its own migration guide, which is rendered on the portal page of the affected endpoint together with the sunset date and a link to the successor. Where consumers of a specification are known, the owners of dependent services can be notified directly. The [Changelog guide](https://docs.routebase.dev/doc-changelog/) covers the generated pages, and the [Spec Versioning guide](https://docs.routebase.dev/versioning/) covers release notes. ## Frequently asked questions ### What should an API changelog contain? Every entry needs a date, a version, a classification of the change as breaking or additive, the affected endpoint or field, and an action for the reader. A changelog that lists what you did without saying what a consumer must do is a work log. The classification is the part consumers scan for, so it belongs at the front of the entry rather than in the prose. ### What is the difference between release notes and a changelog? A changelog is a complete, dated record of contract changes, written for a consumer checking whether anything affects them. Release notes are a narrative summary of one release, written for someone deciding whether to upgrade. The changelog has to be exhaustive and the release notes have to be readable, which is why one is usually generated and the other written. ### How do you write an API migration guide? Name the replacement, show the old call and the new call side by side, state what changed in the response, and be explicit about anything that has no equivalent. The missing-equivalent section is the one people skip and the one that generates support tickets, because a consumer who cannot find a replacement assumes the migration is impossible. ### Should an API changelog be generated or written by hand? Generate the structural half from the diff between two contract versions, since that half is mechanical and it is the half people forget. Write the semantic half by hand, because a change of meaning behind an unchanged shape is invisible to any generator. The two together are complete, and either one alone is not. --- # OpenAPI Versioning — Routebase > The three different versions an OpenAPI document carries, how spec versions relate to the API consumers call, and where documentation versions fit. Canonical page: https://routebase.dev/guides/api-versioning/openapi-versioning/ Chapter 11 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. An OpenAPI document carries several things called a version, and they mean different things. Getting them mixed up is the reason a team can have a tidy specification and still ship a surprise to their consumers. The document itself is covered in the [OpenAPI guide](https://routebase.dev/guides/openapi/). ## Three versions in one file **The specification version.** The `openapi` field at the root of the document names which version of the OpenAPI Specification the file is written against, such as `3.0.3` or `3.1.0`. It tells a parser how to read the file and says nothing about your API. **The document version.** The `info.version` field. The specification is explicit here, defining it as the version of the OpenAPI document and stating that it is distinct from the specification version and from the version of the API being described. **The version your consumers call.** The one in the path, the header or the query parameter, decided by your [versioning strategy](https://routebase.dev/guides/api-versioning/api-versioning-strategies/). Nothing in the document enforces a relationship between this and `info.version`. Most teams set `info.version` to their API version, and that is a sensible convention as long as everyone knows it is a convention. The document does not police it, and tooling that assumes it will mislead you eventually. _Figure: The three numbers side by side, with where each one lives, what moves it, and whether a consumer ever notices. The specification release and the document version are both bookkeeping about the file, so a caller feels neither of them. Only the third, the one carried in the URL or a header, is a promise somebody wrote code against._ ## The document is not the API The gap between the two is where drift lives. A specification says what the service should do, and the service does what it was built to do, and those two statements part company between deploys without anybody noticing. That makes the version of a document a claim about a service rather than a description of it. Publishing a document as version 2.1 does not make the running service behave like 2.1, which is why [contract validation](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) against the live service is what turns the claim into a fact. ## Immutability is the property that matters Whatever you use to store specifications, one behaviour decides whether versioning works, and it is whether a published version can still change. A draft has to be editable, since that is where the work happens. A published version must not be, because somebody has integrated against it. When a released document can still be edited, consumers integrated against version 2 at different times against different contracts. The number stops meaning anything. The corollary is that fixing a released version is not a thing you do. You release a new version, or you move whatever pointer decides which version an environment serves, as described in [running multiple versions](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/). ## One file per version, or one file for all A document describes one contract, and a major version is a different contract, so one document per major version is the arrangement that causes the fewest problems. The alternative of a single document covering every version needs conditionals that most generators handle badly, and it makes the diff between two versions unreadable. Splitting by minor version has the opposite problem, since you end up with near-identical files that drift apart in ways nobody intended. ## Branches for parallel work Version control on a specification serves a different purpose than versioning the API. Two people designing two features in the same draft will collide. The answer is the same one code uses, which is a branch per piece of work and a review before it merges. Reviewing a specification change is where breaking changes get caught cheaply, before anything is released and while the author still remembers why they made it. A merge is not a release. Keeping those two events distinct is what lets design continue while a frozen version keeps serving consumers. ## Documentation versions are a third thing Your documentation portal has versions too, and they are not the same as either of the above. A documentation version is what a reader switches between, and it usually corresponds to an API version while being published on its own schedule. Exactly one version is normally live, older ones stay readable, and a page can be corrected without the API changing at all. Keeping the two lifecycles separate is what lets you fix a typo in the docs for version 1 without pretending the contract moved. ## In Routebase Specifications support OpenAPI 3.0, 3.1 and 3.2, and every specification is versioned in the workspace itself. A draft stays editable, a released version is frozen into an immutable snapshot, and the designer refuses edits to a frozen version with a banner telling you to create a new one. _Screenshot: Documentation versions have their own lifecycle, with exactly one of them live for readers at a time._ Branches and merge requests cover the parallel-work problem. A merge request reports the breaking changes it would introduce before anybody approves it. Every frozen snapshot can be exported as YAML, JSON, Postman or Insomnia, so the contract leaves the workspace in the form the receiving team needs. The [Spec Versioning guide](https://docs.routebase.dev/versioning/) covers the lifecycle, [Branching](https://docs.routebase.dev/branching/) covers parallel work, and [Doc Versioning](https://docs.routebase.dev/doc-versioning/) covers the portal side. ## Frequently asked questions ### What does info.version mean in OpenAPI? The OpenAPI Specification defines info.version as the version of the OpenAPI document, and it states that this is distinct from the OpenAPI Specification version and from the version of the API being described. In practice most teams set it to the API version anyway, which works as long as everyone knows that the field does not enforce that meaning. ### What is the difference between the openapi field and info.version? The openapi field at the root of the document names the version of the OpenAPI Specification the document is written against, such as 3.1.0. The info.version field describes the document itself. One tells a parser how to read the file and the other tells a reader which revision of the description they are looking at. ### How do you version an OpenAPI specification? Keep the document under version control with the code or in a workspace that versions it for you, and freeze a snapshot whenever you release. The important property is immutability, since a published contract that can still be edited is not a contract. Drafts stay editable, releases do not. ### Should each API version have its own OpenAPI file? One document per major version is the common arrangement, because a document describes one contract and a major version is a different contract. Splitting by minor version produces near-identical files that drift apart in small ways, and merging every version into one document produces conditionals that no generator handles well. --- # Versioning Beyond REST: GraphQL, gRPC and Events — Routebase > Why GraphQL evolves instead of versioning, how Protobuf field numbers make compatibility mechanical, and what a schema registry does for event streams. Canonical page: https://routebase.dev/guides/api-versioning/versioning-graphql-grpc-and-events/ Chapter 12 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. The classification, the additive discipline and the deprecation mechanics in this guide apply beyond REST. The carriers do not, because GraphQL, gRPC and event streams each decided the versioning question in their own way, and the reasoning behind each answer is worth knowing. ## GraphQL evolves rather than versions A GraphQL client states exactly which fields it wants, and the response contains those fields and nothing else. That single design choice removes most of the reason to version, since adding a field to a type cannot affect a client that did not ask for it. The result is that most GraphQL APIs are versionless and grow continuously. The documentation on graphql.org describes this as favouring evolution over versioning, with a built-in deprecation mechanism for the cases where a change cannot be additive. Fields carry a `@deprecated` directive with a reason, tooling surfaces it to developers as they write queries, and the field is removed once usage has fallen far enough. What GraphQL gains in flexibility it pays for in observability. Because every client asks for a different subset, the only way to know whether a removal is safe is to record which client used which field. That measurement is not optional in a versionless API, since it is the thing standing in for a version number. The breaking changes that remain look familiar. Removing a field or a type, making an optional argument required, changing a field's type, and removing an enum value all break clients exactly as they would over REST. ## Protobuf and gRPC make compatibility mechanical Protobuf takes the opposite approach and encodes compatibility into the format itself. Fields are identified on the wire by number rather than by name, which produces a small set of rules that are unusually easy to check. The Protobuf documentation states that a field number cannot be changed once a message type is in use, because the number is what identifies the field on the wire. Removing a field is safe, and the removed number must be reserved so that nobody reuses it later. Renaming is safe for the binary encoding and unsafe for the text and JSON encodings, where the name is serialized. Some type changes are compatible, since `int32`, `uint32`, `int64`, `uint64` and `bool` are interchangeable on the wire, and most other type changes are not. Because the rules are mechanical, tooling can enforce them at build time, which is why gRPC services often evolve for years without a version number. Where an interface really has to change, the convention is a new package name such as `v2`, which is a version in everything but the transport. ## Event schemas are the hardest case An event is a message you already sent, and that is what makes streams different. A request and its response are over in milliseconds, while an event sits in a topic or an archive and may be read next year by a consumer that does not exist yet. Most event platforms handle this with a schema registry that enforces a compatibility mode on every new schema version. The mode is the interesting decision. | Mode | Means | Fits when | |---|---|---| | Backward | New consumers can read old events | Consumers upgrade before producers | | Forward | Old consumers can read new events | Producers upgrade before consumers | | Full | Both directions hold | You cannot control the order | Choosing full compatibility restricts you to genuinely additive change with defaults on every new field, which is exactly the discipline from [backward compatible change](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/) enforced by a machine. Webhooks deserve a mention of their own, because they are a contract you push to somebody else's endpoint and they are easy to forget. Versioning a subscription rather than a request is the usual answer, so a receiver keeps getting the shape it registered for. Stripe pins an API version on each webhook endpoint for this reason, as its versioning documentation describes. ## What carries across Strip away the transports and the same three ideas survive. Additive change is always the cheap path, whatever the technology. Deprecation with a date and a replacement is always better than removal, and always requires knowing who is still calling. Compatibility is a property of the running system rather than of the schema, so somebody has to check it. _Figure: One call drawn for each of the three, with the contract in a different place every time. GraphQL has nothing standing between the parties because it evolves in place and deprecates single fields. gRPC keeps the contract and numbers its clauses, which is what makes its compatibility checks mechanical. An event has no reply at all, so the contract travels inside the payload and the producer never learns who read it._ The rest is a question of which layer enforces the rules for you. Protobuf enforces the most, GraphQL enforces the least and gives you the most room, and REST sits between them and leaves the decision to you. ## In Routebase Routebase versions OpenAPI specifications, which covers REST and any HTTP API you can describe in OpenAPI. GraphQL schemas, Protobuf definitions and event schemas are not part of that. The parts of this guide that are about method rather than format still apply to how you work. Classify the change before you decide anything, look for the additive path first, and give every retirement a date and a replacement. Where your HTTP surface is described in OpenAPI, the [Spec Versioning guide](https://docs.routebase.dev/versioning/) covers how that plays out in the product. ## Frequently asked questions ### How do you version a GraphQL API? Most GraphQL APIs are not versioned at all. Because a client asks for the exact fields it wants, adding a field affects nobody, so the schema grows continuously and fields that are going away are marked with the deprecated directive. The GraphQL documentation describes this as favouring evolution over versioning, with deprecation as the built-in mechanism when a breaking change is unavoidable. ### How does Protobuf handle backward compatibility? Compatibility in Protobuf is decided by field numbers rather than names, because the number identifies the field on the wire. The documentation states that a field number cannot be changed once a message type is in use, that removing a field is safe, and that the removed number must be reserved so nobody reuses it. Some type changes are compatible and most are not. ### How do you version event schemas? Event streams usually version through a schema registry that enforces a compatibility mode, so a producer cannot publish a schema that would break existing consumers. Backward compatibility lets new consumers read old events, forward compatibility lets old consumers read new events, and the mode you pick depends on whether producers or consumers upgrade first. Events are harder than requests, because a stored event has to stay readable for as long as you keep it. ### Do webhooks need versioning? Yes, and they are easy to forget, since a webhook payload is a contract you push to somebody else's endpoint. The usual approach is to version a subscription rather than a request, so an existing receiver keeps getting the payload shape it registered for while new receivers get the current one. Stripe pins the API version on each webhook endpoint for exactly this reason. --- # Choosing an API Versioning Strategy — Routebase > One decision path from the change in front of you to the method, with the criteria that actually separate the options and the policy each one needs. Canonical page: https://routebase.dev/guides/api-versioning/choosing-an-api-versioning-strategy/ Chapter 13 of 13 · API Versioning · Last reviewed 2026-09-13 by The Routebase Team. Everything in this guide comes down to a handful of decisions taken in the right order. This chapter puts them in that order, so a change in front of you turns into an action without re-reading the rest. ## The decision path **One. Classify the change.** Use the closed list in [what counts as a breaking change](https://routebase.dev/guides/api-versioning/api-breaking-changes/). If nothing on it applies, and no value quietly changed meaning, then the change is additive and you can ship it. Verify against the live service afterwards that it really was additive. **Two. Look for the additive form.** Most breaking changes have one, and [backward compatible change](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/) covers the moves in detail. A parallel field, a new endpoint next to the old one, and an optional parameter with a safe default all avoid a version between them. **Three. Ask who is affected.** If you can list every caller and reach them, then coordinate the change with them and skip the version entirely. If you cannot, or the callers are mobile clients, partners under contract or customers on quarterly releases, the version becomes your coordination mechanism. **Four. Pick the carrier, once.** The choice in the table below is made once for the whole API and rarely revisited, because changing it later is itself a migration for every consumer. **Five. Set the end date at the start.** A version with no retirement plan is a permanent obligation, so decide when it ends while you are still deciding to create it. The chapter on [deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) covers how to run that ending deliberately. ## Picking the carrier | If | Then | Because | |---|---|---| | The API is public with open signup | URL path | Visible in every log and ticket, caches with no configuration | | Consumers are internal teams and services | Header | One address per resource, and you control the clients | | Callers paste and share URLs | URL path or query | The version survives being copied into a browser | | The contract changes often and customers pin for years | Date-based in a header | No argument about what deserves a major | | You genuinely version representations, not resources | Media type | Content negotiation is what it was designed for | | You are on a managed gateway | Whatever it supports natively | Fighting the platform costs more than the tidier option is worth | If two rows apply and disagree, take the one about your audience, because visibility to people you cannot contact beats elegance that only you will appreciate. ## The policies that matter more than the carrier A strategy is not finished when the carrier is chosen, and these three answers are what consumers actually need. **No version supplied.** Serving the latest silently upgrades every unversioned caller into your next breaking change, which is why most public APIs serve a fixed default instead. Rejecting the request outright never surprises anybody, and that suits internal APIs best. **An unknown version supplied.** Fail with a clear error naming the versions that exist, because falling back to the nearest one produces the worst bug report you will receive all year. **Support window.** State how long a version keeps working once a newer one ships. A published window is what lets a consumer plan, and its absence guarantees that every deprecation you announce arrives as a surprise. ## What good looks like Six months after the decision, a healthy setup has a few recognisable properties that have nothing to do with the carrier you picked. Breaking changes are detected before merge instead of being reported by a consumer, and most releases turn out to be additive and need no version at all. Every live version has a retirement date that somebody has agreed to. Documentation, mocks and tests are bound to the version each environment actually serves, and the changelog says what a reader must do instead of what you did. ## Where to go next If you are choosing a scheme, read [versioning strategies](https://routebase.dev/guides/api-versioning/api-versioning-strategies/) for the mechanics of each one. If you are deciding whether to version at all, read [when it does not matter](https://routebase.dev/guides/api-versioning/when-not-to-version-an-api/) for the bill you would be signing. If you already run several versions, [running multiple versions](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/) covers keeping them straight, and [deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) covers ending one. ## In Routebase The decision path above maps onto the workspace in the order you would take it. Comparing two versions classifies the change, and the release wizard shows what a promotion would do to consumers before you confirm it. The versioning strategy card sets the carrier and the default behaviour, while a deprecation plan carries the end date from the first announcement through to the sunset. What ties them together is that the contract is one object rather than several copies. Documentation, mocks, tests and monitors derive from the published version, so a decision taken in the designer reaches every surface that consumers touch. The [Spec Versioning guide](https://docs.routebase.dev/versioning/) is the place to start, and the [API design feature page](https://routebase.dev/api-design/) shows how specifications, branches and releases fit together. ## Frequently asked questions ### Which API versioning strategy should I use? For a public API with an open audience, URL path versioning is the usual answer, because the version is visible in every log line and it caches without configuration. For internal and platform APIs, header versioning keeps one address per resource at the cost of needing a Vary header. For a product whose contract changes often while customers stay pinned for years, date-based versions carried in a header fit better than a counter. ### How do you decide whether to version at all? Classify the change first. If it is additive, ship it and verify that it really was additive. If it is breaking and every consumer is someone you can reach, coordinate the change instead of versioning it. Only a breaking change affecting consumers you cannot reach genuinely needs a new version. ### Can you change an API versioning strategy later? You can, and it costs your consumers a migration, so it belongs in the same category as a breaking change. Running both carriers for a transition period is the least disruptive route, since the server can accept a version from either place while clients move. Picking a strategy before the first external consumer arrives is much cheaper than changing it afterwards. ### What policies does an API versioning strategy need alongside it? Three, and they matter more than the carrier. Decide what happens when no version is sent, decide what happens when an unknown version is sent, and decide how long a version is supported once a newer one exists. Publishing those three answers is what turns a versioning scheme into something a consumer can plan around. --- # API Monitoring: A Complete Guide — Routebase > What API monitoring covers, how uptime, latency and correctness differ, where it ends and testing or observability begin, and how to run it on a contract. Canonical page: https://routebase.dev/guides/api-monitoring/ Guide overview · 9 chapters · Last reviewed 2026-09-14 by The Routebase Team. An API that answers is not the same as an API that is right. Most monitoring setups only measure the first of those, which is why the outage everyone remembers is the one where every dashboard stayed green. This guide covers what to watch on a live API, which kind of check answers which question, and how to alert on the results without training your team to ignore the channel. It then covers the part that status codes cannot reach, which is whether the response still matches the contract you published. ## Three questions, one request Every scheduled call to your API can answer three different questions, and each one needs something different to be judged against. _Figure: A single scheduled request can answer three questions, but only if something is there to judge the answer against, and the third question needs the contract rather than the status code._ **Is it up?** The status code answers this one on its own, which is why uptime is the cheapest thing to monitor and the first thing every tool offers. **How fast is it?** A clock answers this one, and the answer is only useful as a distribution over time rather than as a single number. **Is it right?** Nothing in the response answers this by itself, because a wrong body and a correct body are both served with a `200`. Judging it needs a description of what the response was supposed to look like, which is what an OpenAPI contract is. The third question is the expensive one to skip. Downtime is loud and somebody notices within minutes, while a renamed field is silent and gets noticed by a consumer's parser three weeks later. ## Where monitoring stops Monitoring is one of four things that get called monitoring, and the differences decide what you should expect each one to catch. | It is not | Because | |---|---| | Testing | Tests run before a release against a build you control, so they can write data and block a merge. Monitors run after it, read-only, against the environment customers use. | | Observability | Traces, logs and metrics describe the service from the inside. A monitor has no privileged access and sees exactly what a consumer sees. | | A status page | A status page is a statement you publish. Monitoring is the measurement you make, and the second one should drive the first rather than the reverse. | | Incident management | An incident is what you open once monitoring has decided something is wrong. The rules that make that decision are the interesting part. | Contract testing is the closest neighbour of all, because it asks the same question as contract monitoring. The difference is the side of the release it stands on, which [contract testing versus integration testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/) works through in full. ## The loop that closes Monitoring gets much better when the thing being monitored and the thing describing it are the same document. Your contract lists the endpoints, so the monitors can be generated from it rather than typed in. Each endpoint carries its response schema, so every check can validate the body it already fetched. The environment records which version it is meant to be serving, so the check knows which promise to hold the response against. When you publish a new version, the baseline moves with it. That loop is what turns monitoring from an uptime dashboard into a continuous check that production still does what you documented. It also means the monitoring setup is only as good as the contract behind it, so a specification full of untyped objects validates almost nothing. ## The short answer If you take one rule from this guide, take this one. Alert on sustained conditions rather than single events, and validate the body rather than the status code. The rest of the guide is that rule taken apart. | Chapter | Answers | |---|---| | [Types of checks](https://routebase.dev/guides/api-monitoring/types-of-api-monitoring-checks/) | Health, synthetic, contract and SLA checks, and what each one misses | | [Uptime, latency and SLAs](https://routebase.dev/guides/api-monitoring/api-uptime-latency-and-slas/) | p95 against the average, error budgets, and the arithmetic behind 99.9 | | [Alerting without the noise](https://routebase.dev/guides/api-monitoring/api-alerting-and-alert-fatigue/) | Thresholds, windows, cooldowns, and which alerts earn a phone call | | [Incidents and maintenance](https://routebase.dev/guides/api-monitoring/incidents-and-maintenance-windows/) | When a failure becomes an incident, and how planned work stays quiet | | [Contract drift](https://routebase.dev/guides/api-monitoring/api-contract-drift/) | Monitoring correctness, and why a `200` proves nothing about it | | [Design-first monitoring](https://routebase.dev/guides/api-monitoring/design-first-api-monitoring/) | Monitors that exist before the service and wait instead of paging | | [Authentication for monitors](https://routebase.dev/guides/api-monitoring/authentication-for-api-monitors/) | Real credentials on a schedule, and why an expired token is not an outage | | [Data freshness](https://routebase.dev/guides/api-monitoring/api-data-freshness-monitoring/) | The field that keeps its shape and stops changing its value | | [What to look for in a tool](https://routebase.dev/guides/api-monitoring/api-monitoring-tools/) | Nine criteria, written as questions rather than as a vendor list | ## In Routebase Monitoring in Routebase is a project-level area with a health dashboard, the monitors themselves, incidents, contract drift and the alert policies that connect them. _Screenshot: The dashboard answers the three questions in one screen, with the uptime bars sorted so the monitors in trouble sort to the top rather than to wherever the alphabet puts them._ A monitor is a scheduled HTTP check against a URL you type or an endpoint from your specification, and every run is recorded as a check with its own timing breakdown. Checks feed uptime and latency figures, alert rules evaluate them, and incidents open when failures persist. Because a monitor can be linked to a documented endpoint, the same check also validates the response body against the version the environment is pinned to. The product page for [API monitoring](https://routebase.dev/api-monitoring/) walks the whole surface from the generated monitor to the alert. Start with the [Monitoring overview](https://docs.routebase.dev/monitoring-overview/) in the product documentation, or read on. The [testing guide](https://routebase.dev/guides/api-testing/) covers the half of this that runs before the release. ## Frequently asked questions ### What is API monitoring? API monitoring is the practice of calling a live API on a schedule and recording what came back, so problems are found by you rather than reported by a customer. Each run produces a status code, a response time and a body, and from a history of those you get uptime, latency trends and a record you can point at afterwards. The important part is that monitoring runs against the environment your consumers actually use, which is the only one that can tell you the truth. ### What is the difference between API monitoring and API testing? They ask the same question at different moments. Tests run before a release against a build you control, so they can create data, run destructive cases and block a merge. Monitors run after the release against production, so they are read-only, scheduled and judged on how quickly they notice. A team that has one and not the other is either shipping blind or running blind. ### Is API monitoring the same as observability? No, because they look from opposite sides. Observability tools such as Datadog, Dynatrace or Splunk instrument the service from the inside and report traces, logs and metrics about its own behaviour. A monitor stands outside with no privileged access and asks what a consumer would ask, which is why it catches a broken gateway, an expired certificate or a response that no longer matches the contract. ### What should you monitor on an API? Three things, in this order. Whether it answers at all, how long it takes to answer, and whether the answer still matches what the contract promises. The third one is the one most setups skip, and it is also the one that fails silently. A drifting endpoint returns a perfectly healthy 200 while a consumer downstream breaks on a field that changed shape. ## Chapters in this guide 1. [Types of API Monitoring Checks](https://routebase.dev/guides/api-monitoring/types-of-api-monitoring-checks/index.md): What a health check proves, what a synthetic call adds, what contract validation catches that neither does, and how to set intervals and timeouts. 2. [API Uptime, Latency and SLAs](https://routebase.dev/guides/api-monitoring/api-uptime-latency-and-slas/index.md): Why the average response time hides the problem, what each additional nine actually costs in minutes, and how to keep an uptime figure honest enough to publish. 3. [API Alerting Without the Noise](https://routebase.dev/guides/api-monitoring/api-alerting-and-alert-fatigue/index.md): How to turn check results into alerts people still read, using sustained conditions, windows, cooldowns and a routing rule that keeps the paging set small. 4. [API Incidents and Maintenance Windows](https://routebase.dev/guides/api-monitoring/incidents-and-maintenance-windows/index.md): When failed checks should become an incident, what acknowledging means, and how to schedule planned work without teaching anyone to mute the channel. 5. [API Contract Drift Monitoring](https://routebase.dev/guides/api-monitoring/api-contract-drift/index.md): Why a 200 proves nothing about the body behind it, which contract a live response should be validated against, and how a silent deviation gets an owner. 6. [Design-First API Monitoring: Monitors That Wait](https://routebase.dev/guides/api-monitoring/design-first-api-monitoring/index.md): What changes when the contract exists before the service, why an unshipped endpoint must not report zero uptime, and what coverage tells you. 7. [Authentication and Secrets for API Monitors](https://routebase.dev/guides/api-monitoring/authentication-for-api-monitors/index.md): Why an unauthenticated check watches the wrong surface, how to give a monitor an identity that expires gracefully, and why expiry is not an outage. 8. [API Data Freshness Monitoring](https://routebase.dev/guides/api-monitoring/api-data-freshness-monitoring/index.md): A field that keeps its shape but stops changing its value passes every validation, which is why staleness needs its own check and its own judgement. 9. [What to Look For in an API Monitoring Tool](https://routebase.dev/guides/api-monitoring/api-monitoring-tools/index.md): Nine questions about what a monitoring tool judges a response against, how it authenticates, when it alerts and what it leaves out of its numbers. --- # Types of API Monitoring Checks — Routebase > What a health check proves, what a synthetic call adds, what contract validation catches that neither does, and how to set intervals and timeouts. Canonical page: https://routebase.dev/guides/api-monitoring/types-of-api-monitoring-checks/ Chapter 1 of 9 · API Monitoring · Last reviewed 2026-09-27 by The Routebase Team. Everything that calls a live API on a schedule gets called monitoring, and the differences between those calls decide what you will find out. This chapter separates them by the question each one answers. ## Four kinds of check | Check | Answers | Misses | |---|---|---| | Health endpoint | Is the process running | Almost everything, when the handler touches no dependency | | Synthetic call | Does a real endpoint work end to end, with real credentials | Anything about the shape of the answer | | Contract validation | Does the body still match what the contract promises | A field that keeps its shape and stops changing value | | SLA measurement | What number do we report at the end of the month | Nothing, because it is a measurement rather than a detector | The four are layers rather than alternatives. Each one rides on the request the one above already made, so adding the next layer usually costs configuration rather than traffic. ## Health checks, and the trap in them A health endpoint is the cheapest check to set up, and the easiest one to make meaningless. The trap is depth. A handler that returns `{"status":"ok"}` without touching anything proves that the web server is accepting connections, which is true of a service whose database credentials expired an hour ago. Every dependency the check skips is a dependency it cannot report on. A deeper health endpoint touches the database, the queue and the upstream providers before answering, so a failure means something. That makes it slower and gives it a second job, because a deep check under a one-minute schedule is a load test of your dependencies that runs forever. Two rules keep it useful. Separate liveness from readiness, so the orchestrator gets the cheap answer and your monitoring gets the honest one. Then give the deep check a longer interval than the shallow one, because you do not need a full dependency sweep every thirty seconds. ## Synthetic checks against real endpoints A synthetic check is a scripted request to an endpoint your consumers actually use, sent on a schedule with the credentials a consumer would carry. Its advantage over passive telemetry is coverage of the quiet paths. An export endpoint that three customers call on Mondays is invisible in traffic dashboards, and a synthetic check notices when it breaks on a Wednesday. Three design decisions make the difference between a useful set of them and an expensive one. **Pick endpoints that mean something.** Check the ones that touch the database, the queue and the upstream provider, because those are the ones that break. A list endpoint that reads from cache is not representative of your API. **Keep them read-only.** A monitor that creates data creates data every minute, forever. Where a write path has to be covered, give it a dedicated account and a cleanup path, and run it far less often than a read. **Spend the interval budget deliberately.** Every check is a real request, so the total cost is the number of monitors multiplied by their frequency. Concentrate the fast intervals where the minutes matter. ## Contract validation on the same response The response body is already in hand once the synthetic check has run, so validating it against the contract costs almost nothing beyond the decision to do it. This is the layer that catches the failures a status code cannot express. A field that went missing, a type that changed from a string to a number and an enum that grew a value the contract never listed are all served with a `200`. All three break a consumer. [Contract drift](https://routebase.dev/guides/api-monitoring/api-contract-drift/) covers the mechanics and what to do with what it finds. One decision has to be made here rather than later, which is what the response gets compared against. Validating against the newest draft of your specification reports drift every time somebody edits a schema. Validating against the version this environment is supposed to serve reports it only when production and its promise disagree. ## Intervals and timeouts Two numbers decide both the cost and the sensitivity of your setup, and both are usually left on the default. The **interval** decides how quickly you can possibly know. An outage cannot be detected sooner than the next scheduled check, and an alert rule that waits for three consecutive failures multiplies that. At a five-minute interval, a rule like that takes a quarter of an hour to fire, which is fine for a reporting API and much too slow for a payment path. | Endpoint | Reasonable interval | Reason | |---|---|---| | Login, checkout, payment | 30 seconds to 1 minute | Minutes of silence are already expensive | | Core read paths | 1 to 5 minutes | The bulk of consumer traffic | | Long tail and internal tools | 15 to 30 minutes | Nobody is waiting on the news | | Deep dependency sweep | 15 minutes or more | It costs real work to answer | The **timeout** decides what counts as a failure rather than a slow success. Set it above your worst legitimate response time and below the point where a caller would have given up. A timeout of sixty seconds on an endpoint that answers in eighty milliseconds cannot tell the difference between slow and dead. ## What none of them catch Three failure modes survive every check in this chapter, and it is worth knowing them before you trust a green dashboard. A value that keeps its shape and stops changing is invisible to schema validation, which [data freshness](https://routebase.dev/guides/api-monitoring/api-data-freshness-monitoring/) covers. A response that is correct for the monitor's account and wrong for somebody else's needs more than one identity to detect. And a check that runs from one place tells you nothing about a consumer on the other side of a broken peering link. ## In Routebase A monitor is a scheduled HTTP check against one target, which is either a URL you type or an endpoint from your specification. You choose the method from the seven HTTP verbs, the status code that counts as healthy, an interval from the presets between 30 seconds and an hour, and a timeout of up to 120 seconds. _Screenshot: Every check keeps its own timing breakdown across DNS, connect, TLS, first byte and download, so a slow check can be blamed on the network or on the server rather than on either by guess._ Linking a monitor to an environment applies that environment's variables and authentication to every check, so a target written as `{{baseUrl}}/carriers` resolves and the request carries real credentials. **Generate from Spec** provisions monitors for a whole specification through a four-step wizard, and it is idempotent, so re-running it after adding endpoints fills only the gaps. You can also create one straight from the API designer by right-clicking an endpoint. Schema validation is a per-monitor setting with three modes, defaulting to **Warn**. See [Monitors](https://docs.routebase.dev/monitors/) for the full configuration and [Schema Drift](https://docs.routebase.dev/schema-drift/) for what validation compares. ## Frequently asked questions ### What is an API health check? A health check is a request to an endpoint whose only job is to report that the service is running. A shallow one returns a fixed response from a handler with no dependencies, so it proves the process is alive and nothing else. A deep one touches the database, the queue and the upstream providers before answering, which makes it far more useful and far more likely to be slow. ### What is synthetic API monitoring? Synthetic monitoring sends scripted requests to a live API on a schedule and records the result, rather than waiting for real traffic to reveal a problem. Its advantage over passive telemetry is coverage, because an endpoint nobody has called since Tuesday still gets checked every few minutes. Its cost is that every check is real traffic against real infrastructure. ### How often should an API monitor run? Match the interval to how fast you need to know and what the check costs. One minute is reasonable for the handful of endpoints that carry the product, while five or fifteen minutes is plenty for the long tail. A one-minute interval across two hundred endpoints is a load pattern rather than a monitoring strategy, so treat the interval as a budget you are spending. ### Should API monitors write data? Prefer read-only checks, because a monitor that creates an order creates one every minute forever. Where a write path genuinely has to be covered, give it a dedicated account, a cleanup path and a lower frequency, and accept that you are running a scheduled test rather than a monitor. The alternative is a production database slowly filling with synthetic rows nobody claims. --- # API Uptime, Latency and SLAs — Routebase > Why the average response time hides the problem, what each additional nine actually costs in minutes, and how to keep an uptime figure honest enough to publish. Canonical page: https://routebase.dev/guides/api-monitoring/api-uptime-latency-and-slas/ Chapter 2 of 9 · API Monitoring · Last reviewed 2026-09-27 by The Routebase Team. Two numbers get published about every API, and both are routinely reported in a way that hides the problem they exist to expose. This chapter covers how to read them and what the targets actually cost. ## The average is the wrong number An average response time answers a question nobody asked, which is how long a typical request took when nothing was wrong. Consider an endpoint where 95 out of 100 calls return in 80 milliseconds and the remaining five take six seconds. The average lands around 375 milliseconds, which looks acceptable and describes not a single real request. One user in twenty is waiting six seconds, and the number you are reporting says nothing about them. Percentiles fix that by describing the tail instead of the middle. | Statistic | What it tells you | When to use it | |---|---|---| | Average | The bulk, pulled around by outliers | Comparing two periods of the same endpoint | | p50, the median | The typical request, ignoring the tail | A sanity check next to the p95 | | p95 | The experience of the unluckiest one in twenty | The default target for a public API | | p99 | Where the systemic problems hide | High-traffic endpoints, where one in a hundred is a lot of people | | Max | One request, possibly a network blip | Debugging, never reporting | A useful habit is to publish a p95 target and to watch the p50 next to it. When the two drift apart, the slow path is a subset of requests rather than a general slowdown, and that subset is usually something you can name. ## Where you measure changes the number A response time measured inside your own process excludes DNS, the TLS handshake, the connection and every hop between you and the caller. A monitor standing outside includes all of it, which is why its number is larger and more honest. The useful version separates those phases rather than reporting one figure. Say a check slows from 90 to 400 milliseconds. Knowing whether the extra 310 went into the handshake or into the time to first byte is the difference between calling the network team and reading your own query log. ## Uptime, and what counts as down Uptime is the share of checks that succeeded over a window, and every part of that sentence is a decision. **What counts as a failure.** A timeout and a `503` clearly do. A `429` from your own rate limiter probably does not, because the service is behaving as designed. A `401` caused by an expired monitoring credential definitely does not, because the service is fine and your check is broken. **Which window.** A 24-hour window reacts fast and forgets fast, while a 30-day window is what a customer will quote at you. Report both, because the first one is for you and the second one is for them. **What gets excluded.** Checks that could not run at all must not count as failures. A monitor whose endpoint has never been deployed, or whose target URL still contains an unresolved path parameter, has measured nothing. Recording those as downtime produces a figure that is wrong in the direction that makes you look worse than you are. ## What a nine actually costs The gap between two uptime targets is easier to argue about than to picture, so here it is in minutes. A month is taken as 30 days, which is 43,200 minutes. _Figure: Each additional nine cuts the allowance by a factor of ten, so the step from 99.9 to 99.99 percent leaves less monthly downtime than a careful deployment takes._ | Target | Per 30-day month | Per year | |---|---|---| | 99% | 7 hours 12 minutes | 3 days 15 hours | | 99.5% | 3 hours 36 minutes | 1 day 20 hours | | 99.9% | 43 minutes 12 seconds | 8 hours 46 minutes | | 99.95% | 21 minutes 36 seconds | 4 hours 23 minutes | | 99.99% | 4 minutes 19 seconds | 52 minutes 34 seconds | Two things follow from the table. Above 99.9 percent, planned maintenance has to stop being downtime, which means rolling deployments rather than windows. And at 99.99 percent the detection time itself becomes the budget, because a five-minute check interval already exceeds the monthly allowance. ## Error budgets, and why they are useful The inverse of an uptime target is a budget you are allowed to spend. At 99.9 percent you have 43 minutes a month, and the question stops being whether you had an outage and becomes how much of the month you have left. The budget is useful mostly as a decision rule. A team that has spent 5 percent of it by the tenth can ship the risky change, while a team that has spent 90 percent should be stabilising instead. It turns reliability from an argument about blame into arithmetic anyone can check. ## SLI, SLO and SLA Three terms that get used interchangeably, and keeping them apart is what stops you promising something you cannot measure. The **indicator** is what you measure, such as the share of successful checks over 30 days. The **objective** is your internal target for that indicator. The **agreement** is the promise made to a customer, usually with a remedy attached. The order matters, because the agreement should be the loosest of the three. If you promise 99.9 percent and hold yourself to 99.9 percent, the first bad month is a contractual event. If you promise 99.5 and target 99.9, you have margin, and the margin is the point. ## In Routebase Every monitor keeps uptime over 24 hours, 7 days and 30 days, plus its average response time and its p95. The monitors list gives you those figures in a grid or in a sortable table, next to a 24-hour sparkline. That sparkline leaves a gap for hours where no check ran rather than drawing a straight line through them. _Screenshot: The table sorts by status first, so a monitor in trouble is at the top with the reason next to it rather than somewhere in an alphabetical list._ Each check records its own timing breakdown across DNS, connect, TLS, first byte and download, so a slowdown can be placed in the network or in the service. The health dashboard shows 30-day uptime as one bar per monitor, coloured green from 99.5 percent and yellow from 95 percent, sorted so the failing ones come first. Two states are excluded from every health figure on purpose, which are a monitor waiting for its endpoint to be deployed and one waiting for a path parameter value. Neither has measured anything, so neither is allowed to move the number. See [Monitors](https://docs.routebase.dev/monitors/) and the [Monitoring overview](https://docs.routebase.dev/monitoring-overview/). ## Frequently asked questions ### What is a good API response time? There is no universal number, because a search endpoint and a payment confirmation are judged by different people against different expectations. What matters is that you state the target as a percentile rather than as an average, and that you measure it where your consumers stand rather than inside your own process. A p95 of 300 milliseconds is a claim somebody can check, while an average of 300 milliseconds is a number that survives one request in twenty taking four seconds. ### Why does a monitor report slower response times than the server logs? A time measured inside your own process leaves out DNS, the TLS handshake, the connection and every hop between you and the caller. A monitor outside includes all of them, so its number is larger and closer to what callers experience. Splitting the check into those phases shows whether a slowdown sits in the network or in your own handler. ### How much downtime does 99.9 percent uptime allow? Over a 30-day month, 99.9 percent allows 43 minutes and 12 seconds of downtime, and over a year it allows 8 hours and 46 minutes. The step to 99.99 percent cuts the monthly allowance to 4 minutes and 19 seconds, which is less than most deployments take. That is why each additional nine is an architecture decision rather than a target you can simply adopt. ### What is the difference between an SLA, an SLO and an SLI? An SLI is the indicator you measure, such as the share of successful checks over 30 days. An SLO is the target you hold yourself to for that indicator, and it should be stricter than what you promise. An SLA is the contractual promise to a customer, usually with a remedy such as a service credit attached, which is why the number in it should have margin over the SLO. --- # API Alerting Without the Noise — Routebase > How to turn check results into alerts people still read, using sustained conditions, windows, cooldowns and a routing rule that keeps the paging set small. Canonical page: https://routebase.dev/guides/api-monitoring/api-alerting-and-alert-fatigue/ Chapter 3 of 9 · API Monitoring · Last reviewed 2026-09-27 by The Routebase Team. An alerting setup has one failure mode that matters more than all the others combined, and it is that people stop reading it. Everything in this chapter is in service of that one problem. ## Alert on conditions, not on events A single failed check is weak evidence. Networks drop packets, load balancers recycle connections, and a deploy rolls one instance at a time. _Figure: A rule that fires on the first failure reacts to a blip that recovers on its own, while a rule that waits for three consecutive failures stays quiet through it and still catches the outage two checks later._ The cost of waiting is small and the cost of not waiting is large. Waiting two extra checks delays the real alert by two intervals, while firing on every blip teaches the team that the channel is usually wrong. The first cost is measured in minutes, and the second one is permanent. ## The four conditions worth having Most useful alerting reduces to four rule shapes, and each one keys on a different failure. | Rule | Fires on | Tune it with | |---|---|---| | Consecutive failures | A run of failed checks | The count, against your interval | | Latency threshold | Average response time over a window exceeding a limit | The limit and the window length | | Error rate | The share of failing checks in a window crossing a percentage | The percentage and the window | | Contract deviation | A response that no longer matches the contract | The minimum severity | The latency and error-rate rules exist because of a failure the consecutive rule misses entirely. An endpoint that fails one check in three never accumulates three in a row, and is unmistakably broken. A window-based rule catches that pattern, so it is worth having both. The one number to think hardest about is the window length. A window of five checks at a one-minute interval reacts in five minutes and is jumpy, while twenty checks at the same interval is calm and slow. Pick the reaction time first, then divide by the interval. ## Cooldowns A rule without a cooldown notifies on every evaluation for as long as the condition holds. A two-hour outage under a five-minute interval then produces twenty-four messages that all say the same thing. Set the cooldown to roughly how long it takes somebody to pick the alert up and respond. Thirty minutes is a sensible default, and anything under five minutes is repetition rather than information. The recovery notification is the one that should always come through, because "it is back" is the message people are actually waiting for. ## Route by consequence, not by severity label Most alerting setups have one channel and a severity field nobody trusts. A better model asks what should happen when this fires. | It should | Send it to | Example | |---|---|---| | Wake somebody up | A phone | Checkout returns 500 for three checks running | | Be seen within the hour | A chat channel people watch | p95 on a core read path doubled | | Be picked up today | A chat channel or a ticket | An endpoint started returning an undocumented field | | Be reviewed weekly | A digest or a dashboard | Coverage dropped because six endpoints shipped without monitors | Keeping the top row small is the entire discipline. Every alert promoted into it dilutes the ones already there, so the honest test for a new one is whether you would accept being woken up by it twice in a month. ## Three alerts that should not page Three common conditions look like outages and are not, and each one has a fix that is cheaper than a night shift. **An expired monitoring credential.** The service is fine and your check cannot authenticate. Treat an authentication failure as its own category, because sending it as downtime turns a token rotation into an incident. [Authentication for monitors](https://routebase.dev/guides/api-monitoring/authentication-for-api-monitors/) covers how to keep them from expiring at all. **Planned work.** A deployment window that pages the person running the deployment teaches everyone to mute the channel, and the mute outlives the deployment. Suppress during maintenance instead, which [incidents and maintenance windows](https://routebase.dev/guides/api-monitoring/incidents-and-maintenance-windows/) covers. **A monitor for a service that does not exist yet.** In design-first work, monitors are often created before the endpoints ship. A monitor whose target has never answered should wait rather than report an outage, which [design-first monitoring](https://routebase.dev/guides/api-monitoring/design-first-api-monitoring/) covers. ## Rules belong to groups, not to monitors Configuring alerts on each monitor individually works until you have forty of them, at which point nobody knows what is configured where and a new monitor silently arrives with nothing. Defining a set of rules once and assigning it to a whole environment or a whole specification scales better and answers the auditing question. The detail worth knowing about any such system is how overlapping assignments resolve. The usual rule is that the most specific assignment wins outright rather than merging with the broader one. A narrow policy carrying only a drift rule can therefore remove downtime alerting from everything it covers, silently. ## In Routebase Alert policies are reusable sets of rules, assigned to an environment, a specification or a single monitor, with the most specific assignment winning. A policy holds at most one rule per type, and the four types are downtime, latency threshold, error rate and schema drift. _Screenshot: Each rule carries its own condition and its own cooldown, so the rule that pages on downtime can react faster than the one that reports a slow week._ The defaults are three consecutive failures for downtime, 2000 milliseconds over five checks for latency, 50 percent over ten checks for error rate, and error severity for schema drift. Cooldowns default to 30 minutes and run from 5 to 120. A more specific policy replaces the broader one rather than merging with it. The policy Routebase creates for a drift watch therefore brings a downtime rule along, so that the specification does not lose its downtime alerting. Alerts reach the in-app notification centre, email per category, and Slack or Microsoft Teams as first-class targets with their own categories for contract drift and for incidents and recovery. See [Alert Policies](https://docs.routebase.dev/alert-policies/) and [Messaging](https://docs.routebase.dev/messaging/). ## Frequently asked questions ### How do you avoid alert fatigue? Alert on sustained conditions rather than on single events, so a rule fires after several consecutive failures instead of on the first blip. Give every rule a cooldown so a two-hour outage produces one notification rather than twenty-four, and suppress alerts during planned work. Then keep the set of alerts that reach a phone small enough that each one is worth the interruption. ### How many consecutive failures should trigger an alert? Three is the common default and it is a reasonable starting point, because a single failed check is often a network hiccup rather than an outage. The number interacts with your check interval, since three failures at a five-minute interval means a quarter of an hour before anyone hears. On a payment path, shorten the interval rather than dropping to a single failure. ### What is a cooldown in monitoring alerts? A cooldown is the minimum time between repeat notifications for the same rule. Without one, a sustained outage sends a notification on every failed check, which is how a channel gets muted during exactly the incident it existed for. Thirty minutes is a common default, and the right value is roughly how long it takes somebody to act on the first message. ### Should contract drift page someone at night? Usually not, because a drifting endpoint is still answering and nothing is down for anyone yet. Drift belongs in a channel that gets read during working hours, with an owner assigned the same day. The exception is a field that a paying integration depends on, and that decision belongs to whoever knows the consumers rather than to a default setting. --- # API Incidents and Maintenance Windows — Routebase > When failed checks should become an incident, what acknowledging means, and how to schedule planned work without teaching anyone to mute the channel. Canonical page: https://routebase.dev/guides/api-monitoring/incidents-and-maintenance-windows/ Chapter 4 of 9 · API Monitoring · Last reviewed 2026-09-13 by The Routebase Team. An alert tells you something is happening. An incident is what you open when it keeps happening, and it exists so that the second person to look at the problem does not start from nothing. ## What an incident adds An alert has no memory. It fires, it lands somewhere, and the next one looks exactly the same whether it is the first or the fortieth. An incident carries the four things a message cannot. It has a **start time** that does not move and a **state** that says whether anybody has picked it up. It also has a **duration** that keeps counting while the problem is open, and a **timeline** of what happened in what order. That last one is the artefact you want the next morning, when somebody asks how long the outage really lasted. ## When one opens The threshold that opens an incident is the point where a transient cause stops being the likely explanation. For most APIs that is three consecutive failed checks, and two factors move it. The **check interval** multiplies the threshold into real time. Three failures at a five-minute interval means an incident opens fifteen minutes after the service stopped answering, so a path where that is too slow needs a shorter interval rather than a lower threshold. **What else is running** should suppress it entirely. A monitor inside an active maintenance window and a monitor that is disabled both have good reasons not to open anything. ## Three states, and what they promise The lifecycle is short on purpose, because a workflow with seven states is a workflow people route around. | State | Means | Does not mean | |---|---|---| | Open | Nobody has taken it on yet | Nobody has noticed | | Acknowledged | A specific person is working on it | The problem is smaller than it looked | | Resolved | The underlying cause is cleared | The alert stopped firing | The distinction between acknowledged and resolved is the one that decays first in practice. If people acknowledge to stop the noise, the state stops meaning anything, and the fix is in the alert rules rather than in the workflow. A channel that is quiet enough to read is a channel where acknowledging costs nothing to do honestly. ## Maintenance windows Planned work produces failures that are expected, and a monitoring setup that pages anyway has one predictable outcome. The channel gets muted during the deployment, and somebody forgets to unmute it. A maintenance window suppresses the consequence rather than the measurement. Checks keep running, results keep being recorded, and failures inside the window simply do not open incidents. The difference matters the morning after, because a deployment that broke something leaves a visible trail instead of a gap. Three properties decide whether windows get used at all. **Scope.** A full-stack deployment takes an environment down, not one endpoint, so scheduling has to work at the level of an environment or a specification rather than monitor by monitor. **Recurrence.** Weekly deployments and monthly patch nights are the common case, and anything that has to be scheduled by hand every week eventually is not. **Honesty about the numbers.** Decide once whether suppressed failures count against uptime, and say so wherever the figure is published. Excluding planned windows from an SLA is normal and defensible, while quietly excluding them from an internal dashboard is how a team stops believing its own graphs. ## In Routebase An incident opens once a monitor crosses the project's incident threshold, which defaults to three consecutive failed checks and is configurable from 1 to 100. Incidents move through open, acknowledged and resolved, and each one carries the environment, the specification, the monitor, the cause, how many checks were affected and which alert policy triggered it. _Screenshot: An expanded incident carries the cause, the number of affected checks, the policy that opened it and the event timeline, so the handover to whoever picks it up next is already written._ Maintenance windows are scheduled against a monitor, a specification or an environment. A window is either a one-off period or a recurring template such as a weekly Tuesday deployment slot, with a custom cron expression for anything else. While a window is active, failed checks do not open incidents, the affected monitors are marked in the tree, and the dashboard lists what is currently suppressed with its end time. Checks keep running throughout. See [Incidents](https://docs.routebase.dev/incidents/) and [Maintenance Windows](https://docs.routebase.dev/maintenance-windows/). ## Frequently asked questions ### What is the difference between an alert and an incident? An alert is a message that fires when a rule matches, and it has no memory. An incident is a record with a start time, a state, an owner and a timeline, which is what you need when the same problem lasts three hours and four people work on it. Alerts are how you find out, and incidents are how you keep track. ### When should a failed check open an incident? Once enough consecutive checks have failed that a transient cause is unlikely, which for most APIs is three. The threshold interacts with your check interval, so three failures at five minutes means an incident opens a quarter of an hour after the service went down. Lower the interval rather than the threshold when that is too slow. ### What does acknowledging an incident mean? It means a specific person has seen it and is working on it, which is a different statement from the problem being over. Treating acknowledge as a way to silence a noisy alert destroys the only signal that separates an unhandled incident from a handled one. If people use it that way, the alerting is too noisy rather than the workflow being wrong. ### Do maintenance windows stop monitoring? They should suppress the consequences rather than the measurement. Checks keep running so you still have the history afterwards, and failures during the window simply do not open incidents or page anyone. That way a deployment that broke something is visible in the timeline the moment the window ends, instead of being a gap in the record. --- # API Contract Drift Monitoring — Routebase > Why a 200 proves nothing about the body behind it, which contract a live response should be validated against, and how a silent deviation gets an owner. Canonical page: https://routebase.dev/guides/api-monitoring/api-contract-drift/ Chapter 5 of 9 · API Monitoring · Last reviewed 2026-09-27 by The Routebase Team. Uptime monitoring asks whether your API answered. It has no opinion at all about what the answer contained, which is why a response can be wrong in a way that breaks every consumer while every dashboard stays green. ## The silent failure A deploy renames `tracking_number` to `trackingNumber`. The endpoint still returns `200`, in the same time it always did, with a body that is still valid JSON. Uptime is unaffected. Latency is unaffected. Every consumer that reads that field starts getting `undefined`, and the ones that validate strictly start throwing. The failure is total and completely invisible to a check that only reads the status line. _Figure: Drift is a span of time rather than an event, and every uptime check stays green from the moment it opens until a consumer breaks._ That span is the thing worth measuring. It opens at a deploy, and it closes either when somebody updates the contract or when somebody updates the service, and the interesting number is how long it took anyone to find out. The reasons these gaps open in the first place are the subject of [why OpenAPI specs drift](https://routebase.dev/blog/why-openapi-specs-drift/). How often such gaps open is measurable in public APIs. In September 2026 we fetched 1,927 public OpenAPI specs from their original URLs and compared each with its copy from 2023. Of the contracts that could still be compared, 48.9 percent had changed in a way a client can observe. Two thirds of those changes included at least one breaking change, and 88.8 percent of the breaking changes came without a new major version. The method and the open data are in [the corpus study](https://routebase.dev/blog/public-api-specs-three-years-later/). ## What counts as a deviation Not every mismatch deserves the same reaction, and treating them alike produces either noise or blindness. | Deviation | Severity | Why | |---|---|---| | A required field is missing | Breaking | Every consumer that reads it fails | | A field changed type | Breaking | Deserialisation fails, often loudly and far downstream | | An enum returned a value the contract does not list | Breaking for strict consumers | Anything switching on the value falls through | | A format no longer matches | Depends | A date that stopped being ISO 8601 breaks parsers, while a looser pattern usually does not | | An undocumented field appeared | Informational | Most consumers ignore it, and the strict ones do not | A workable default is to record everything and alert on the breaking classes only. The informational ones still accumulate in the record, so the answer to "how long has that field been arriving" exists when somebody finally asks. ## Which contract you are checking against This is the decision that determines whether the whole exercise works, and there are two defensible answers and one wrong one. | Baseline | When it is right | |---|---| | The version this environment is pinned to serve | Almost always, because it is what the environment promised | | The latest published version | When nothing is pinned, as a fallback | | The newest draft | Never, because production is not supposed to serve your work in progress | The failure mode worth watching for is a pin that has fallen behind. Production now serves 2.1 while the pin still says 2.0, so the monitor validates against the old contract and drift against the newer one stays invisible. A monitoring setup that cannot tell you which contract it is comparing against is not really comparing anything, so every drift record should name its baseline rather than assuming one. ## Warn or strict Once you detect drift, you have to decide what it does to the check that found it, and the two options encode genuinely different positions. **Warn** records the deviation and leaves the check successful. The reasoning is that the endpoint answered exactly as it was supposed to on the wire, so failing it would push a correctness problem into an availability number that customers read. **Strict** fails the check on breaking drift. The reasoning is that a response nobody can parse is not a successful response, whatever the status line says. Warn is the better default, and strict is the right answer for an endpoint whose consumers would call a shape change an outage. The thing to avoid is picking strict everywhere and then explaining an uptime figure that mixes two different kinds of failure. ## Drift is not an incident A drift finding and an outage want different handling, and collapsing them into one workflow damages both. An outage has a clear end, so its record wants a duration and a resolution. Drift has a start and an owner, and it may legitimately stay open for a week while the team decides whether the contract or the service is the thing that is wrong. Two properties make that record trustworthy. **The first-seen date never moves.** Somebody closing and reopening an item should not reset how long it has been going on. **The observation count is recorded rather than scored.** A deviation seen on sixty-nine checks across two days is a deploy, while one seen once is a blip, and the raw count says that better than a confidence percentage nobody can audit. ## In Routebase Every monitor check that gets a response validates that response against the contract its environment is pinned to, falling back to the latest published version where nothing is pinned. A deviation that keeps appearing becomes a drift event with a first-seen date, an observation count and a lifecycle you acknowledge and close, and it resolves itself when a later check matches the contract again. _Screenshot: The response that produced this record came back with a 200 in 38 milliseconds, which is exactly why no uptime check anywhere reported a problem._ The detail names the field path, the change type, what the contract expected and what actually arrived, and a field the response did not carry at all reads as not present rather than as null. The failing request and response are kept with it, and credentials never reach that record, because secret variables are not substituted into the stored copy in the first place rather than being filtered out afterwards. **Watch this API for drift** sets all of it up for a whole specification in one environment from a single dialog. Disabling it later turns validation off while leaving the monitors running as uptime checks. See [Contract Drift](https://docs.routebase.dev/contract-drift/) and [Schema Drift](https://docs.routebase.dev/schema-drift/), and the product page for [API monitoring](https://routebase.dev/api-monitoring/) for how drift events, alert policies and incidents fit together. The same question asked before a release instead of after it is [contract testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/). ## Frequently asked questions ### What is API contract drift? Contract drift is the gap between what your specification promises and what your service actually returns. It opens the moment a deploy changes a response without the contract being updated, and it stays open until somebody notices. Nothing is down while it lasts, every status code is a 200, and the first sign is usually a consumer whose parser broke. ### How do you detect contract drift in production? Validate the body of every monitoring check against the contract the environment is supposed to be serving, rather than only checking the status code. Because the response was already fetched for the uptime check, the validation costs configuration rather than traffic. A deviation that keeps appearing then becomes a record with a first-seen date and an observation count, which is what turns a silent mismatch into something with an owner. ### Should contract drift fail the check? By default it should not, because the endpoint answered correctly on the wire and counting that against uptime hollows out a number you publish to customers. Recording the drift and alerting on it is enough for most teams. Strict mode, where breaking drift fails the check outright, is the right choice when a contract violation genuinely is an outage for the consumers of that endpoint. ### Which version should a monitor validate against? The version the environment is supposed to be serving, which means the version it is pinned to, falling back to the latest published version where nothing is pinned. Validating against the newest draft reports drift every time somebody edits a schema, which is noise rather than signal. The failure mode to watch for is a pin that fell behind production, because the monitor then keeps checking a contract nobody is serving any more. --- # Design-First API Monitoring: Monitors That Wait — Routebase > What changes when the contract exists before the service, why an unshipped endpoint must not report zero uptime, and what coverage tells you. Canonical page: https://routebase.dev/guides/api-monitoring/design-first-api-monitoring/ Chapter 6 of 9 · API Monitoring · Last reviewed 2026-09-13 by The Routebase Team. In a design-first workflow the contract exists before the implementation does. That changes what monitoring can be, because the list of things worth watching is already written down before there is anything to watch. ## Monitors can exist before the service If the specification lists twenty endpoints, twenty monitors can be provisioned from it in one step, long before the service answers any of them. That is useful for two reasons. It removes the step everybody forgets, which is going back to add monitoring after the launch, when the launch is over and attention has moved on. And it makes the gap visible in the other direction, because a monitor waiting for an endpoint is a visible reminder that the endpoint has not shipped. None of it works if those monitors are red in the meantime. ## Why waiting is a state and not a failure A monitor whose endpoint has never been deployed has not measured anything. Reporting that as downtime is wrong in three separate ways. It **corrupts the uptime figure**, because a service that does not exist yet cannot have a 0 percent availability record that later gets averaged into a real one. It **fires alerts nobody can act on**, and repeated alerts nobody can act on are how a team learns to dismiss the channel. And it **hides the real signal**, because the day that endpoint ships and genuinely breaks, its monitor was already red. Two waiting conditions are worth separating, because they are fixed by different people. | Waiting on | Cause | Who resolves it | |---|---|---| | Deployment | The endpoint exists in the contract and the environment does not serve it yet | Whoever ships the service | | A parameter value | The target URL still contains an unresolved placeholder such as `{id}` | Whoever configured the monitor | Both should be visible, neither should alert, and neither should touch the uptime number. The second one deserves a warning somewhere in the interface, because a monitor that has silently never run is worse than one that runs and fails. ## Coverage, and what it does not say Coverage is the share of endpoints in a specification that have a monitor. It exists to answer one question, which is whether anything shipped without anyone thinking about it. It is a completeness measure and not a quality one, so read it with two caveats. An endpoint with a monitor that only checks the status code counts as fully covered while validating nothing about the response. And a monitor pointed at the same URL by hand usually does not count at all, because nothing links it back to the endpoint in the contract it is supposed to be watching. The useful second number sits next to it. Coverage asks how many endpoints have a monitor, while the share of those monitors that can actually validate a response asks how many of them are checking anything beyond availability. ## What should happen when you publish Publishing a version is the moment monitoring most often falls behind, because the specification grows and the monitors do not. Two behaviours keep them in step, and a team should pick one on purpose. Either new endpoints get a monitor created automatically in the target environment, which keeps coverage at 100 percent and occasionally produces a monitor nobody wanted. Or the gap is reported and somebody decides, which keeps the set deliberate and depends on the report being read. The second thing that should move at publish is the baseline. If the environment now serves 2.1, validation should compare against 2.1, and a pin left behind on 2.0 makes the whole drift setup quietly useless. [Running multiple API versions](https://routebase.dev/guides/api-versioning/running-multiple-api-versions/) covers how those pins behave when several versions are live at once. ## In Routebase Monitors are generated from a specification through a four-step wizard that picks the specification and environment, selects the endpoints, sets defaults for the batch and reports what it created. It is idempotent, so endpoints that already have a monitor are marked and skipped rather than duplicated. _Screenshot: The wizard reads the endpoints from the contract, marks the ones that already have a monitor as skipped, and asks for a value for every path parameter it cannot fill by itself._ A monitor whose endpoint has never answered reports as waiting for deployment, raises no alert, opens no incident and is excluded from every health figure, and it activates itself the moment the endpoint responds. The [API-first development](https://routebase.dev/api-first-development/) page shows the same waiting stance across the mock, the tests and the monitors. A monitor with an unresolved path parameter reports as waiting for parameters and runs no checks at all, so nothing is written to its history. The dashboard carries a coverage card per specification with a shortcut that fills the gaps, and a project setting decides whether publishing a version creates monitors for new endpoints or just reports them. See [Coverage](https://docs.routebase.dev/coverage/) and [Environments](https://docs.routebase.dev/environments/). ## Frequently asked questions ### Can you set up monitoring before an API is deployed? Yes, and design-first teams should, because the contract already lists every endpoint that is going to exist. The condition is that a monitor for an endpoint nobody has shipped yet must report that it is waiting rather than reporting an outage. A monitor that is red for three weeks before launch is a monitor everybody has learned to ignore by launch day. ### What is monitoring coverage? Coverage is the share of a specification's endpoints that have a monitor attached to them, which answers the question of whether anything shipped without being watched. It is a completeness measure rather than a quality measure, so an endpoint with a monitor that only checks the status code counts as covered while validating nothing about the body. ### What happens to monitoring when you publish a new API version? Two things should happen. New endpoints in that version need monitors, either created automatically or reported to you as a gap. And the contract that existing monitors validate against should follow the version the environment is now serving, so that validation keeps testing the current promise rather than an old one. ### Should every endpoint have a monitor? Every endpoint should be accounted for, which is not the same as every endpoint being checked every minute. Cover the paths that carry the product at a short interval and the long tail at a long one. Then make a deliberate decision about the rest, rather than leaving it to whoever was setting monitors up that afternoon. What you want is no endpoint that nobody has thought about. --- # Authentication and Secrets for API Monitors — Routebase > Why an unauthenticated check watches the wrong surface, how to give a monitor an identity that expires gracefully, and why expiry is not an outage. Canonical page: https://routebase.dev/guides/api-monitoring/authentication-for-api-monitors/ Chapter 7 of 9 · API Monitoring · Last reviewed 2026-09-13 by The Routebase Team. Most endpoints worth monitoring are behind authentication, and the shortcut of monitoring them without a credential produces a check that reliably confirms the wrong thing. ## An unauthenticated check watches the gatekeeper A request with no credential against a protected endpoint gets a `401`, and it gets it from the authentication layer before the handler ever runs. Configure the monitor to expect a `401` and you have a green check that will stay green while the database is down. The rule is simple. Send the request a consumer would send, with a credential a consumer would carry, and expect the response a consumer would get. Anything less is monitoring a surface that sits in front of the thing you care about. The catalogue of methods you might have to reproduce is the subject of the [API authentication guide](https://routebase.dev/guides/api-authentication/). ## Expiry is the dominant failure mode Credentials on a schedule fail differently from credentials in an application, because nobody is watching when they go. | Credential | How it fails | What to do about it | |---|---|---| | Static API key | Rotated by somebody who did not know about the monitor | Put the monitoring identity on the rotation checklist | | Bearer token pasted in by hand | Expires quietly, often after an hour | Do not do this, use a flow that refreshes | | OAuth client credentials | The client secret expires, usually after a year | Diary the expiry, and alert on the auth failure category | | Signed request | Clock skew or a rotated signing key | Monitor the signing key's lifetime, not just the endpoint | The pattern to aim for is a credential the monitor can obtain for itself, because anything typed in by a person has an expiry date that only that person knows. ## Give the monitor its own identity A monitoring account should be separate from any human or any production integration, for three reasons that all show up later. **Scope.** The monitor needs the narrowest permission that still reaches the code path you want to watch, which is usually read access to a handful of resources. A monitoring account with write permissions is a scheduled job with write permissions. **Attribution.** When the audit log shows a request every minute, you want to see that it came from the monitor rather than from a service account that four other things also use. **Blast radius.** Rotating or revoking the monitoring credential should never require touching anything a customer depends on. One more consideration is quota. Monitoring traffic should usually be counted like any other traffic, because an identity that cannot be rate limited cannot tell you that your rate limiting broke. What it should not do is share a quota with a real consumer, since that produces `429` responses that look like an API fault and are an accounting artefact. ## Secrets belong in variables, not in monitors A credential typed straight into a monitor's header field or target URL spreads. It gets copied into check history, into the request stored alongside a drift record, into an export, and into the screenshot somebody pastes into a ticket. Storing it as a secret variable on the environment keeps it in one place, lets it be rotated once, and means the stored copy of a request can keep the placeholder rather than the value. That last property is what makes a check history safe to share, and it only works if the values marked as secret actually are marked as secret. ## An auth failure is not an outage A `401` from an expired credential and a `503` from a broken service are both failed checks, and treating them as the same event is how token rotation becomes a night-time incident. Separating them costs very little. The monitor already knows whether the credential could be resolved and what status came back. An authentication failure can therefore carry its own label, go to a different channel and stay out of the alert that pages somebody. The signal is genuinely different, because one of them says your service is broken and the other says your monitoring is. ## In Routebase Linking a monitor to an environment applies that environment's variables and authentication to every check, so a target written as `{{baseUrl}}/shipments` resolves and the request is signed with the environment's configured scheme. Basic, Bearer, API key, OAuth2 and JWT are all applied automatically, and a static header you set on the monitor itself takes precedence over the one the environment would have sent. _Screenshot: Secrets are stored once on the environment and are never printed back, so the monitor references a name while the value stays where it was put._ Failed checks record a structured reason, and an authentication failure gets its own badge instead of looking like an outage. That covers both cases, whether the environment's auth could not be resolved at all or the target answered `401` or `403`. In the request stored with a drift record, values from secret variables are never substituted in the first place. Header names that can carry a credential have their values withheld as well, and a key passed in the query string is stored as redacted. See [Monitors](https://docs.routebase.dev/monitors/) for the environment link and [Variables](https://docs.routebase.dev/variables/) for how secrets are stored. ## Frequently asked questions ### Should API monitors use authentication? Yes, because an unauthenticated request to a protected endpoint tests your authentication layer rather than the endpoint behind it. A 401 arriving reliably every minute proves that the gatekeeper works and says nothing about whether the handler, the database or the upstream provider are healthy. Use a real credential with the narrowest scope that still reaches the code you want to watch. ### How do you store credentials for a monitor? Keep them as secret variables belonging to the environment rather than typing them into the monitor itself, so the value is stored once, is never printed back and can be rotated in one place. A credential pasted into a header field or a target URL ends up copied into check history, diffs and screenshots, and it is very hard to get back out of all of them. ### Why does my monitor suddenly return 401? Almost always because the credential expired or was rotated, which is the single most common cause of a monitor failing while the service is fine. Treat that as its own failure category rather than as downtime, because otherwise a routine token rotation turns into a night-time incident. The fix is a credential that refreshes itself, or a rotation process that includes the monitoring identity. ### Should monitoring traffic be exempt from rate limits? Usually it should be counted like any other traffic, because a monitor that cannot be rate limited also cannot tell you that your rate limiting is broken. What you should avoid is a monitoring identity that shares a quota with a real consumer, since a busy afternoon then produces 429s that look like an API problem and are a bookkeeping problem. --- # API Data Freshness Monitoring — Routebase > A field that keeps its shape but stops changing its value passes every validation, which is why staleness needs its own check and its own judgement. Canonical page: https://routebase.dev/guides/api-monitoring/api-data-freshness-monitoring/ Chapter 8 of 9 · API Monitoring · Last reviewed 2026-09-27 by The Routebase Team. Contract validation catches a field that changes shape. It has nothing to say about a field that keeps its shape perfectly and stops changing its value, which is a real outage for whoever depends on the number. ## Four failures that pass every check Each of these returns a `200`, in the usual time, with a body that validates against the contract without a single deviation. A `lastUpdatedAt` that has read the same timestamp since Tuesday, because the job that refreshes it died. A price feed still serving the numbers from before the upstream provider stopped answering. A counter that stopped counting while its shape stayed an integer. A cached aggregate that got pinned by a deploy and now serves last month's figures to everybody. The common shape is that the response is structurally perfect and semantically dead. No amount of schema strictness reaches any of it, because the schema describes what the field looks like and never what it should say. ## Why a staleness threshold is the wrong instrument The obvious fix is a rule that fires when a value has not changed for some period, and it does not survive contact with a real response body. Most of a response is supposed to stand still. A currency code, a plan name, a warehouse identifier and a configuration flag are all constants by design, and a threshold has no way to distinguish them from a feed that died. Setting one produces a stream of alerts about fields that are working exactly as intended, which is the fastest known way to get an alerting channel muted. What is left is genuinely a judgement call, and the person holding the context is the only one who can make it. The useful design therefore reports the observation plainly, which is that this path has now returned the same value for forty-seven checks, and leaves the verdict where the knowledge is. ## Pick a handful of fields Freshness watching pays off precisely because it is narrow. Three questions select the fields worth the effort. **Is standing still the failure mode?** A timestamp that should advance, a counter that should climb and a feed value that should move all qualify. A status enum that sits on `active` for months does not. **Does something upstream feed it?** Values that arrive from another system are the ones that go stale silently, because their failure happens outside anything you are watching. **Would anybody notice within a day?** A field that a nightly report reads is a candidate, while one that a dashboard displays live has a human watching it already. Two or three paths per monitor is usually the right number. A monitor with twenty watched paths produces a wall of unchanged values that nobody scans, and that is functionally the same as watching none. ## What else a monitor cannot judge Freshness is one case of a wider limit, and it is worth being explicit about where automated checking stops. | Failure | Detectable from the response alone | |---|---| | A field disappeared | Yes, the contract says it should be there | | A type changed | Yes, the contract says what it should be | | A value stopped changing | Yes, across checks, though the meaning needs a person | | A list came back empty | Sometimes, if empty is never correct for that request | | A number is plausible and wrong | No, because nothing says what the right number was | The last row is where monitoring hands over to testing. A test can set up known data and assert a known answer, which is exactly the thing a production monitor cannot do without writing to your live system. [Functional API tests](https://routebase.dev/guides/api-testing/functional-api-tests/) covers how to pick those assertions. ## In Routebase The **Field freshness** card on a monitor's detail page watches specific JSONPaths across checks. You enter one path per line, up to twenty per monitor, and each one then reports what the checks have actually seen rather than a verdict. _Screenshot: Each path reports what was observed, so an unchanged value is stated neutrally and only a path that resolved to nothing is raised as a warning._ There is deliberately no staleness threshold and no alert, because a value unchanged for two hundred checks may be a frozen feed or a perfectly correct constant and only you know which. The one state shown as a warning is a path that did not resolve at all, since that means the watch is measuring nothing. Two details keep the numbers honest. Freshness is read from the full response body rather than from the truncated sample kept for triage, so a field past the cut does not read as missing forever. It is also recorded whenever the server answered as expected, including on a strict monitor whose check was failed by drift. A drifting endpoint therefore keeps its freshness history exactly while somebody is looking at it. See [Monitors](https://docs.routebase.dev/monitors/). ## Frequently asked questions ### What is API data freshness monitoring? Freshness monitoring watches the value of specific fields across successive checks and reports how long each one has been standing still. It exists because schema validation only judges shape, so a timestamp frozen since Tuesday and a price feed whose upstream job died both pass validation while being completely broken. The unit of measurement is change over time rather than correctness of a single response. ### Why not just alert when a value has not changed for an hour? Because a value that has not moved is not evidence of anything on its own. A currency code, a plan name and a configuration flag are all supposed to sit still, and a threshold cannot tell them apart from a dead feed. Only somebody who knows the field can say which one it is, so the honest design reports the observation and leaves the verdict to a person. ### Which fields are worth watching for freshness? The handful where standing still is itself the failure, which usually means timestamps that should advance, counters that should climb, and values that come from an upstream feed. Watching every field is wasted effort, because most of a response is supposed to be stable and a wall of unchanged values is indistinguishable from no information at all. ### Can a monitor detect wrong data? It can detect several classes of wrong without knowing your domain, including a value that stopped changing, a field that disappeared from the response, and a shape that no longer matches the contract. What it cannot detect is a number that is plausible and incorrect, because nothing in the response says what the right answer was. That gap is what makes a handful of well-chosen assertions worth more than a hundred generic ones. --- # What to Look For in an API Monitoring Tool — Routebase > Nine questions about what a monitoring tool judges a response against, how it authenticates, when it alerts and what it leaves out of its numbers. Canonical page: https://routebase.dev/guides/api-monitoring/api-monitoring-tools/ Chapter 9 of 9 · API Monitoring · Last reviewed 2026-09-27 by The Routebase Team. Every monitoring tool can tell you that an endpoint answered. The ones worth keeping can also say whether the answer was right, reach an endpoint that needs a credential and stay quiet during planned work. The questions below separate the two. ## Nine questions for a monitoring tool ### 1. What can it judge a response against Ask whether the tool can compare a response body to a description of what that body should be, and then ask the sharper question, which is where that description comes from. A tool that can only assert on a status code answers one of the three questions worth asking. A tool where you hand-write assertions per endpoint answers more, and it becomes a second copy of your contract that somebody has to maintain. A tool that reads the contract you already publish is the only arrangement where adding an endpoint does not add maintenance. ### 2. Can it authenticate the way your API does Most endpoints worth watching are behind a credential, and a tool that cannot carry one will quietly be pointed at an unprotected health endpoint instead. Ask which schemes are supported natively, and then ask the question people forget, which is what happens when the credential expires. A tool that can obtain a token for itself keeps working, while one that holds a pasted string will fail on a Sunday. ### 3. How does it decide that something is worth telling you This is where a tool either respects your attention or trains you to ignore it. Ask whether rules can fire on sustained conditions rather than single events, whether windows exist for latency and error rate, and whether every rule has a cooldown. A tool that notifies on each failed check will produce a hundred messages during a two-hour outage, and the hundredth one will arrive in a muted channel. ### 4. Where do the alerts go Ask which destinations exist without you building them, since a notification that lands only inside the tool is a notification nobody sees. Then ask what the message contains. An alert that names the route, the condition and the concrete change is one somebody can triage from their phone. An alert saying only that a check failed sends them to a browser to find out anything at all. ### 5. Can planned work be made quiet Ask whether maintenance can be scheduled against a whole environment rather than monitor by monitor, and whether it can recur. Then ask what happens to the checks during a window. The behaviour you want is that checks keep running and only the consequences are suppressed, because a gap in the history is exactly what you will want to look at the next morning. ### 6. Does it tell you what is not monitored Every tool reports on the checks you configured. The more useful question is what it says about the endpoints you did not. Ask whether coverage is measured against your contract, and whether publishing a new version surfaces the endpoints that arrived without a monitor. Without that, the setup degrades quietly with every release, and the first sign is an outage on a path nobody was watching. ### 7. What gets excluded from the numbers This one is rarely on a feature page and it decides whether the figures are usable. Ask what happens to a monitor for an endpoint that has not been deployed yet, and whether suppressed maintenance failures count against uptime. A tool that reports 0 percent availability for a service that does not exist yet produces a dashboard people learn to read around, and a dashboard people read around is not a dashboard. ### 8. What does it keep, and for how long Ask three things about history. How long individual check results are kept, whether uptime figures survive that sweep, and whether a finding outlives the check that produced it. The answer matters when somebody asks in March how long a problem had been running. A tool that swept the evidence in February can only tell you that it is happening now. ### 9. What exactly is metered Two questions catch most of the surprises, and both are about the meter rather than the headline price. Ask what is counted, since checks, monitors, endpoints, seats and alert destinations are all used as meters and they reward very different behaviour. A per-check meter turns your interval into a billing decision, which is a bad way to decide how fast you find out about an outage. Then ask what happens when you cross the line, because a plan that stops checking is a different risk from one that sends an invoice. ## A scorecard for monitoring tools | Criterion | Question | Weight it if | |---|---|---| | Response judgement | Can it validate the body against your contract | Your responses change shape more than rarely | | Authentication | Native schemes, and what happens at expiry | Anything worth watching is protected | | Alert logic | Sustained conditions, windows, cooldowns | You have more than a handful of monitors | | Destinations | Chat and email without glue, with usable content | The people on call are not in the tool all day | | Maintenance | Scheduled by environment, recurring, checks keep running | You deploy on a schedule | | Coverage | Measured against the contract, reported at publish | Your API is still growing | | Exclusions | Undeployed endpoints and maintenance kept out of the figures | You publish an availability number | | Retention | Checks, uptime history and findings, separately | Anybody asks how long | | Pricing shape | What is metered, and what happens at the limit | Your endpoint count will grow | ## Check one authenticated endpoint, then break the contract A monitor is only as good as the failure it notices, so the evaluation should produce one on purpose. **Point it at one real authenticated endpoint.** Not a public sample API. Use one that needs a credential, takes a parameter and returns a body you care about, and get a check running end to end. **Then break the contract on purpose.** Change a field name in the response, or remove a required field, and watch what the tool does. Whether it notices, what it says, and where the message arrives is the single behaviour that decides how much you will trust it in six months. While you are there, rotate the credential and confirm that the resulting failure does not look identical to an outage. ## In Routebase Monitoring in Routebase is built on the first criterion. Monitors are generated from the specification you already maintain, and every check validates the response against the version the environment is pinned to. Coverage is measured against that same contract rather than against a list somebody keeps. The rest sits in the same workspace. Environments supply the variables and the authentication, so checks carry real credentials and secrets stay where they were stored. Alert policies cover downtime, latency, error rate and contract drift with windows and cooldowns, assigned per environment, per specification or per monitor, and they reach the notification centre, email, Slack and Microsoft Teams. Maintenance windows suppress incidents while the checks keep running, and monitors for endpoints that have not shipped wait instead of reporting an outage. The [testing guide](https://routebase.dev/guides/api-testing/) covers the half of this that runs before a release, and the [pillar](https://routebase.dev/guides/api-monitoring/) has the short version of how the pieces fit together. ## Frequently asked questions ### What should you look for in an API monitoring tool? Ask what it can judge a response against, how it decides that something is worth an alert, and what it excludes from the numbers it reports. Then ask what it tells you about the endpoints you have not monitored at all. Those four decide whether people still trust the dashboard after a year, while the features that demo well tend to matter only on the first afternoon. ### Do I need a dedicated API monitoring tool if I have an APM? They answer different questions, because an APM instruments your service from the inside and reports what it did, while a monitor stands outside and asks what a consumer would ask. The outside view is what catches an expired certificate, a misconfigured gateway or a response that no longer matches the contract, none of which look wrong from inside the process. Most teams end up with both, and the mistake is assuming the first one covers the second. ### How do you evaluate an API monitoring tool properly? Point it at one real authenticated endpoint rather than at a public sample, then change the response so it no longer matches your contract and see what the tool does. Whether it notices at all, what it says, and where the notification lands tell you more than any feature comparison. Then rotate the credential and check that the resulting failure does not look identical to an outage. ### Is uptime monitoring enough for an API? It covers one of the three questions worth asking, which leaves latency partly covered and correctness not covered at all. An API can be up, fast and returning a body that breaks every consumer, and uptime monitoring reports that state as perfect health. Whether the missing coverage matters depends on how often your responses change shape, which for most teams is more often than they expect. --- # API Governance: A Complete Guide — Routebase > What API governance is when it is not a committee. Style guides, automated checks, reusable components, quality scores and a rollout teams accept. Canonical page: https://routebase.dev/guides/api-governance/ Guide overview · 10 chapters · Last reviewed 2026-09-13 by The Routebase Team. Somebody decided two years ago that your errors return a problem details body. The question governance answers is whether that decision still holds on the API a different team ships next quarter. Most organisations answer it with a document, a review meeting, or both. This guide is about why those two are the weakest half of the answer, and what the other half looks like. ## Governance is three parts, and a committee is none of them The word carries a lot of baggage, so it helps to say what the work actually consists of. _Figure: Three mechanisms, ordered by what they cost and what they catch. Writing a convention down costs one afternoon and prevents nothing on its own. A shared component makes a whole class of violation impossible for anything that references it. An automated check catches the rest, and only where it runs in front of the person making the decision._ A decision has to exist somewhere other than in the heads of the people who made it. That is the part everybody builds, because it is cheap, and it is also the part that does nothing by itself. Then something has to apply the decision without anyone remembering it. Sometimes that is a check, and more often it should be a reusable building block, since a shape you reference cannot be violated. Finally somebody has to be able to see where the standard does not hold yet. Without that you cannot tell the difference between an organisation that is compliant and one that has never looked. ## The two ways it fails Governance failures are not subtle, and they come in two shapes that look like opposites. The first is the review board. Every new API goes through a group of experienced people, the queue grows, and teams start scheduling around it. Within a year the board approves almost everything it sees, because rejecting work that is already built is expensive and unpopular. The reviews cost real time and change almost nothing. The second is the standards document. It is thorough, it is correct, and it sits in a wiki. Nobody reads it at the moment a decision is being made, which is the only moment it could have helped. Two quarters later it describes an API that no longer exists, so people stop trusting it, and a standard nobody trusts is worse than none. Both failures end in the same place. The APIs diverge while everyone believes there is a standard. ## Rules are the cheap half Writing rules is genuinely easy, because the OpenAPI specification suggests most of them and your last argument about plurals supplies the rest. The expensive question is what happens when one fires. A finding that changes nobody's behaviour is not governance, it is a line number in a report. Deciding which rules stop a release, which leave a note, and which you will never enforce is where the actual work sits. The [style guide post](https://routebase.dev/blog/what-belongs-in-an-api-style-guide/) is the short argument for that, and [severity and enforcement](https://routebase.dev/guides/api-governance/api-rule-severity-and-enforcement/) is the long one. ## Consistency is cheaper to build than to inspect The most underused lever in governance is not a rule at all. If every API references one error schema, no rule has to check that ten teams wrote compatible error bodies, because there is one body. The same applies to pagination envelopes, authentication schemes and the headers that carry rate limit state. Inspection scales with the number of copies, and reuse removes the copies. That is why [reuse beats inspection](https://routebase.dev/guides/api-governance/reuse-beats-inspection/) sits early in this guide rather than at the end. ## The rollout is the part people skip Switch a complete style guide on over APIs that already exist and the first run returns a large number. What happens in the hour after that number appears decides whether governance survives in your organisation. Turning everything into a blocker stops work immediately and teaches people to route around the tool. Leaving everything advisory forever means the count only grows, because nothing ever has to be fixed. There is an order that works, and it is the subject of [rolling governance out](https://routebase.dev/guides/api-governance/rolling-out-api-governance/). ## The short answer Write the decisions down, make as many of them as possible impossible to violate, check the rest where the work happens, and turn on blocking last and for very few rules. The rest of the guide is that sentence taken apart. | Chapter | Answers | |---|---| | [What belongs in an API style guide](https://routebase.dev/guides/api-governance/api-style-guide/) | The subjects a guide has to cover, and how a rule stays applicable to an API you already shipped | | [From a document to a check](https://routebase.dev/guides/api-governance/machine-checkable-api-rules/) | What a checker can see, what it never will, and what a review is for once it has the rest | | [Severity and enforcement](https://routebase.dev/guides/api-governance/api-rule-severity-and-enforcement/) | Three severities as three promises, and where a block is fair | | [Rules of your own](https://routebase.dev/guides/api-governance/custom-api-rules/) | When a house rule earns a check, and how to write one that does not cry wolf | | [Reuse beats inspection](https://routebase.dev/guides/api-governance/reuse-beats-inspection/) | Shared components as governance, and the distribution problem underneath them | | [Consistent headers across every API](https://routebase.dev/guides/api-governance/consistent-api-headers/) | The place consistency dies first, and why a policy beats a rule there | | [Measuring API quality](https://routebase.dev/guides/api-governance/measuring-api-quality/) | What a weighted score is made of, and what happens when a team is measured by it | | [Rolling governance out](https://routebase.dev/guides/api-governance/rolling-out-api-governance/) | Measure, then warn, then block, and who grants an exception | | [Governing change](https://routebase.dev/guides/api-governance/governing-api-change/) | The rules and alerts that apply after the first release | | [Choosing a governance tool](https://routebase.dev/guides/api-governance/api-governance-tools/) | The criteria that separate a linter from a governance workflow | Three neighbouring subjects live elsewhere. The decisions themselves are covered in the [API design guide](https://routebase.dev/guides/api-design/), and the mechanics of running a linter over a document are covered in [validating and linting OpenAPI](https://routebase.dev/guides/openapi/validating-and-linting-openapi/). What to do when a decision has to change is covered in [API versioning](https://routebase.dev/guides/api-versioning/). ## In Routebase Governance in Routebase is a set of organisation-level settings rather than a separate product, so the standard lives next to the specifications it applies to. _Screenshot: The shared standard is one table, and each row is a decision somebody made once for the whole organisation instead of once per pull request._ Three surfaces carry the three mechanisms. The style guide holds the rules and their severities, and the shared library holds the schemas and responses that make a shape reusable across projects. Header policies apply a set of response headers wherever the status codes match. All three cascade from the organisation to the project, and the quality score aggregates what is left over into a number per specification. Start with the [Style Guide](https://docs.routebase.dev/style-guide/) guide in the product documentation, or read on. The [API governance](https://routebase.dev/api-governance/) page has the short version of the three surfaces and the rollout, and the [API design feature page](https://routebase.dev/api-design/) shows how governance fits into the rest of the lifecycle. ## Frequently asked questions ### What is API governance? API governance is how an organisation makes the same design decisions apply to every API it ships. It has three working parts rather than one. The decisions are written down somewhere people can argue with them, a machine checks the ones that can be checked, and somebody can see where the standard does not hold yet. A review board is one way to arrange the first part and it does nothing about the other two. ### Why does API governance fail? It fails in two opposite ways. A review board becomes a queue that teams learn to route around, so it slows delivery without improving consistency. A written standard with no check decays quietly instead, because nobody reads it at the moment a decision is made. Both failures produce the same result, which is a set of APIs that drift apart while everyone believes they agreed. ### What should an API governance framework include? Four things carry almost all of the value. A style guide records the decisions, automated checks enforce the machine-checkable ones where the work happens, shared components make the agreed shape the easiest one to build, and a measurement shows which APIs need attention. A rollout plan is the fifth, and skipping it is the most common way the other four get switched off. ### Do you need an API governance team? You need someone who owns the standard, and that is a smaller job than a team. The work is deciding what goes in the guide, choosing what blocks a release, and handling exceptions when a rule meets an API it cannot fit. Everything mechanical belongs to a tool, because a person reviewing naming conventions by hand is the slowest and least reliable way to catch them. ## Chapters in this guide 1. [What Belongs in an API Style Guide](https://routebase.dev/guides/api-governance/api-style-guide/index.md): The subjects a style guide has to cover, the difference between a decision and a preference, and how to write rules that apply to an API you already shipped. 2. [Machine-Checkable API Rules](https://routebase.dev/guides/api-governance/machine-checkable-api-rules/index.md): What an automated check can see in an API description, what it will never see, and what a design review is for once the machine has taken the mechanical half. 3. [API Rule Severity and Enforcement](https://routebase.dev/guides/api-governance/api-rule-severity-and-enforcement/index.md): Error, warning and info as three different promises to the people who hit them, where a block is fair, and why an escape hatch keeps a guide switched on. 4. [Custom API Linting Rules](https://routebase.dev/guides/api-governance/custom-api-rules/index.md): When a house convention earns an automated check, what a condition-based rule can express, and how to write one that does not fire on half your endpoints. 5. [Reuse Over Inspection in API Governance](https://routebase.dev/guides/api-governance/reuse-beats-inspection/index.md): Why a shared definition removes a class of violation instead of reporting it, what belongs in an organisation-wide library, and how to roll out a change. 6. [Consistent Headers Across Every API](https://routebase.dev/guides/api-governance/consistent-api-headers/index.md): Headers are where consistency decays first. The four families worth standardising, why a policy beats a rule here, and what a policy cannot do. 7. [Measuring API Quality](https://routebase.dev/guides/api-governance/measuring-api-quality/index.md): What a weighted quality score is made of, why coverage is not quality, what the number cannot see, and what happens to it the moment a team is measured by it. 8. [Rolling Governance Out Without Stopping the Team](https://routebase.dev/guides/api-governance/rolling-out-api-governance/index.md): Measure, then warn, then block. Why the reverse order gets governance switched off, how existing APIs differ from new ones, and who grants exceptions. 9. [Governing API Changes Between Versions](https://routebase.dev/guides/api-governance/governing-api-change/index.md): Governance does not end at the first release. Which rules can check a change, what only a comparison between versions can tell you, and the alerts worth having. 10. [What to Look for in an API Governance Tool](https://routebase.dev/guides/api-governance/api-governance-tools/index.md): Eight questions about where governance checks run, how exceptions are recorded and whether a standard cascades, tested on your least consistent API. --- # What Belongs in an API Style Guide — Routebase > The subjects a style guide has to cover, the difference between a decision and a preference, and how to write rules that apply to an API you already shipped. Canonical page: https://routebase.dev/guides/api-governance/api-style-guide/ Chapter 1 of 10 · API Governance · Last reviewed 2026-09-28 by The Routebase Team. A style guide is not a list of rules. It is a list of decisions, and the rules are how you write them down so that a machine can help. That distinction decides what goes in. A decision has a reason and a cost, so it survives its first disagreement. A preference has neither, and it becomes the rule everybody learns to ignore. ## A rule is a decision with a reason attached The test for every entry is short. Somebody should be able to say what goes wrong when it is violated. For a duplicate operation identifier the answer is concrete, because generated clients either fail to compile or silently lose a method. For unique paths the answer is that the second declaration is unreachable. For a missing error response the answer is that every consumer has to discover the failure shape by causing it. When the honest answer is that this is how we have always done it, the rule will lose its first real argument anyway. In the meantime it costs you credibility for the rules that matter, which is a bad trade for a naming preference. ## The subjects a guide has to cover Seven areas account for nearly every decision two teams would otherwise make differently. **Naming.** Path segments, path and query parameters, schema names, property names, enum values and operation identifiers. The value is not tidiness, it is that a reader who has seen three of your endpoints can predict the fourth. **Resources and URL structure.** Whether collections are plural, how deep nesting goes, and what happens to actions that are not create, read, update or delete. The [resource chapter](https://routebase.dev/guides/api-design/resources-and-urls/) of the design guide covers the decisions themselves. **Errors.** One body shape for every failure across every API, with a machine-readable code that clients can branch on. This is the single highest-value entry in most guides, because it is the one every consumer touches. **Collections.** Paging, filtering and sorting, expressed the same way everywhere. Three pagination styles in one organisation means every consumer writes the loop three times. **Headers and metadata.** Correlation identifiers, rate limit state, caching validators and deprecation signals. Headers are covered in their own chapter, because they are the part that decays first. **Security.** Which schemes are permitted, where credentials may travel, and what an endpoint without a security requirement means. A rule that keeps API keys out of query strings pays for itself the first time somebody reads a server log. **Documentation completeness.** What has to be present before an endpoint counts as documented, which is usually a summary, a description, a declared success response and at least one error. ## Must, should and may Not every decision deserves the same force, and a guide that does not say so leaves the question to whoever runs the tool. A **must** is something you would revert a release for. There are fewer of these than people expect, and they cluster around things that break downstream rather than things that look untidy. A **should** is the house default. Departing from it is allowed and should be visible, which is exactly what a warning is for. A **may** is a recommendation you are still socialising, or one that genuinely depends on the API. Writing it down is still worth it, because the next team gets the benefit of the thinking without the obligation. Three entries from a fictional orders API show both ideas together, since each one carries its force and its answer to the test from the start of this chapter. | Entry | Force | What goes wrong when it is violated | |---|---|---| | Operation identifiers are unique across the document | must | Generated clients fail to compile or silently lose a method | | Every operation declares at least one error response | should | Every consumer discovers the failure shape by causing it | | Filter parameters on collections use one naming form | may | Each list needs its own filter call, and two older APIs cannot follow the form yet | Mapping those three onto the severities of a tool is a separate decision, and it is the subject of [the next chapter but one](https://routebase.dev/guides/api-governance/api-rule-severity-and-enforcement/). ## Rules that fit the APIs you already have The guide is worthless if applying it to your existing estate is impossible, and this is where most first drafts break. Write the rule as a shape with a parameter wherever you can. A rule that checks that path segments follow one convention applies to an API built on camelCase just as well as to one built on kebab-case, and you set the convention once. A rule that hard-codes kebab-case gives a team with three years of `/orderItems` a choice between renaming forty paths and turning the check off, and they will turn the check off. Where a rule genuinely cannot fit a particular API, scope the exception rather than weakening the standard. One project that departs from one rule is a documented decision, while a standard lowered for everybody because of one legacy service is a loss you never get back. ## What belongs somewhere else Three kinds of entry look like style guide material and are not. Anything a person has to judge belongs in a design review, because a rule that needs human interpretation either never fires or fires on everything. Anything the specification already rejects belongs to validation, since re-checking syntax adds findings without adding information. Anything that encodes one person's taste belongs in a conversation, and it will not survive contact with a second opinion. The [style guide post](https://routebase.dev/blog/what-belongs-in-an-api-style-guide/) works through the same boundary from the opposite direction, starting from the noise a bloated guide produces. ## In Routebase The built-in rules are grouped into the five categories of naming, completeness, best practices, security and structure, which is close enough to the subject list above to use as a starting outline. Each rule carries a target, a default severity and, where the convention is genuinely a choice, a dropdown that sets what the rule checks. The URL path rule is the one that matters most in practice, because it accepts kebab-case, camelCase, PascalCase or lowercase, so an existing API keeps the check instead of losing it. Severity is set for the organisation and can be overridden per project, and the project view marks where each value came from. Rules whose name says must are not automatically errors, since the wording and the severity are set independently. Configuring the guide needs the governance permission held by admins and owners, and it is a Pro plan feature. The [Style Guide](https://docs.routebase.dev/style-guide/) guide lists every rule with its default. ## Frequently asked questions ### What is an API style guide? An API style guide is the written set of design decisions that every API in an organisation follows. It covers naming, URL structure, error format, collection handling, headers, security and documentation completeness. It differs from the OpenAPI specification in that the specification says what a legal document looks like, while the style guide says what your organisation has decided to put in one. ### What should an API style guide contain? Seven subjects cover almost everything that matters. Those are naming conventions, resource and URL structure, the error format, how collections are paged and filtered, which headers every response carries, how authentication is declared, and what counts as a documented endpoint. Anything outside those is usually either a preference nobody can justify or a judgement that belongs in a review. ### How do you write an API style guide for an existing API? Write rules that describe the shape you want rather than the one convention you happen to prefer. A rule that checks a configurable naming convention applies to an API that uses camelCase paths, while a rule that hard-codes kebab-case forces a choice between renaming everything and switching the rule off. Where a rule genuinely cannot fit an existing API, scope the exception to that project instead of weakening the standard everywhere. ### How long should an API style guide be? Long enough to cover the subjects where two teams would otherwise decide differently, and no longer. Every rule costs attention on every run, so a rule nobody can justify makes the ones that matter harder to see. The useful test for each entry is whether somebody can name what goes wrong when it is violated. --- # Machine-Checkable API Rules — Routebase > What an automated check can see in an API description, what it will never see, and what a design review is for once the machine has taken the mechanical half. Canonical page: https://routebase.dev/guides/api-governance/machine-checkable-api-rules/ Chapter 2 of 10 · API Governance · Last reviewed 2026-09-27 by The Routebase Team. A convention that nothing checks is a description of the past. It was true when somebody wrote it, and it drifts from that day forward at the speed your team ships. This chapter is about which half of a style guide a machine can carry, and what the other half is then free to do. ## What a check can see A checker reads one document and answers questions about it. Four kinds of question cover almost everything worth automating. **Presence.** Does this operation have a summary, does this parameter have a description, does this endpoint declare an error response. These are the rules that decide whether generated documentation is readable. **Form.** Does this name match the convention, does this server URL use HTTPS, does this path contain a query string. Pattern matching is cheap and it catches the drift that accumulates one endpoint at a time. **Uniqueness.** Do two operations share an identifier, do two paths resolve to the same route, does an enum repeat a value. These produce real defects downstream rather than untidiness. **Agreement.** Does the path template match the declared parameters, does every reference resolve, does the example validate against the schema it illustrates. This is the most valuable group, because a document that disagrees with itself misleads every reader and every generator. ## What a check will never see The boundary is sharper than it looks, and it is worth naming so that nobody expects the tool to hold the line alone. A checker cannot tell you whether the resource model fits the domain. It will happily approve an API where a single `POST /process` hides four different operations, because the document is perfectly well formed. It cannot tell you whether a name means anything. `GET /items/{id}` passes every naming rule ever written, and so does a field called `data2`. It cannot tell you whether a description is true. A summary that was accurate two releases ago satisfies the presence rule forever. It cannot tell you whether this endpoint should exist. Duplication across two teams is invisible to a tool that reads one document at a time. ## The rules in the middle Between the two groups sits a band of rules that are right most of the time, and those are the ones that decide whether people trust the output. A rule that flags schema properties whose names look like passwords or card numbers is a heuristic. It will occasionally be wrong, and it is worth keeping, because the case it catches is expensive. A rule that requires pagination parameters on every operation returning a collection is also a heuristic, and it will fire on the endpoint that legitimately returns a fixed set of nine currencies. Judge these by what a false positive costs. If somebody can dismiss it in five seconds, it belongs at a low severity and it earns its place. If it requires an argument every time, it will train people to stop reading the output, which costs you the rules that were never wrong. ## Turning a sentence into a condition A written convention becomes checkable by splitting it into three parts, and the sentence usually resists the first attempt. Take the house rule that every operation must be owned by a team. The check needs a target, which is the operation, a field, which is the description or an extension, and a condition, which is that the field matches a pattern naming a known team. If none of the three can be filled in, the rule is not checkable as written, and the useful move is to change the convention rather than to give up. Filled in for a fictional shop with three teams, the house rule splits like this. | Part | Filled in | |---|---| | Target | Every operation in the document | | Field | The `x-owner` extension on the operation | | Condition | The value is one of `team-orders`, `team-payments` or `team-catalog` | An operation carrying `x-owner: team-orders` passes, and one carrying `x-owner: orders` fails, which is exactly the drift the written sentence could never catch on its own. Sometimes that change is an improvement on its own. A rule that cannot be expressed usually turns out to be two rules, or one rule and an opinion. [Rules of your own](https://routebase.dev/guides/api-governance/custom-api-rules/) covers what a condition can carry and where that stops. ## Where the check has to run The same rule produces a different result depending on where it fires. A check that runs while somebody is editing is a correction, because the person who made the decision is still in the file and the fix costs seconds. A check that runs in a nightly report is a list, and lists accumulate. By the time anyone reads it, the author has moved on and each entry has become an archaeology task. The practical arrangement is two points rather than one. Rules run continuously while the description is being written, and they run again when a version is released, which is where the small set of blocking rules belongs. [Validating and linting OpenAPI](https://routebase.dev/guides/openapi/validating-and-linting-openapi/) covers the mechanics of running the rules themselves. ## What a review is for afterwards Automating the mechanical half is what makes a design review worth attending. A review that spends forty minutes on plural nouns and missing descriptions is doing a tool's job slowly. Once those never reach the meeting, the same forty minutes can go to the questions nothing else will ask. Does this resource model match how the business talks about the thing. Is this endpoint a duplicate of one another team already ships. What happens to a caller when this fails, and can they tell the difference between the three ways it can. That is the split worth aiming for. The machine takes everything that has a right answer, and the people take everything that does not. ## In Routebase The built-in rules cover the four question types above, and they run against the specification you are editing rather than against a file you remember to lint. Violations appear in an issues panel at the bottom of the designer, grouped by rule, with per-severity counts that double as filters. Many carry a one-click fix, and a single button applies every available fix at once, which is what makes the first pass over an imported API survivable. A summary badge sits in the header, the endpoint and schema tree carries badges whose tooltips list the violations, and the publish dialog lists whatever is left. Custom rules cover the house conventions that have no built-in equivalent, within the limits the next chapter describes. The [Style Guide](https://docs.routebase.dev/style-guide/) guide covers the rules and where each violation surfaces. ## Frequently asked questions ### Which API design rules can be checked automatically? Anything a machine can decide from the document alone. That covers presence, such as whether an operation has a description, and form, such as whether a name matches a pattern. It also covers uniqueness, such as two operations sharing an identifier, and agreement between two parts of the same document, such as a path template and its declared parameters. ### What can an API linter not check? Everything that requires knowing what the API is for. A linter cannot tell you whether the resource model matches the domain, whether a name means what it says, whether a description is true, or whether an endpoint should exist at all. Those questions are why design reviews still happen, and they are the only questions a review should be spending time on. ### What is an API design review for? For the decisions a machine cannot make. Once the mechanical checks run automatically, a review has time for the resource model and for naming that is technically valid and still misleading. It also has room for the error cases nobody thought about, and for whether this endpoint duplicates one that already exists. A review that spends its time on naming conventions is doing work a tool does better. ### Why do API style guides stop being followed? Because nothing checks them at the moment a decision is made. A document is read once during onboarding and then competes with a deadline, so it loses. After two quarters it describes an API that no longer exists, and people stop trusting it, which makes it worse than having nothing written down. --- # API Rule Severity and Enforcement — Routebase > Error, warning and info as three different promises to the people who hit them, where a block is fair, and why an escape hatch keeps a guide switched on. Canonical page: https://routebase.dev/guides/api-governance/api-rule-severity-and-enforcement/ Chapter 3 of 10 · API Governance · Last reviewed 2026-09-27 by The Routebase Team. A severity looks like a property of a rule. It is actually a sentence about what happens to a person, and that is the only way to choose it correctly. ## Three severities are three promises Before assigning any of them, it is worth saying out loud what each one commits you to. _Figure: Each severity is a promise about somebody's next ten minutes. Info costs a glance and never interrupts. Warning asks for a fix while the author is already in the file. Error stops the release, which means somebody stops what they were doing, so it has to be worth an interruption every single time it fires._ **Info** means the guide has an opinion and will not insist. It is the right level for a rule you are still socialising and for one that depends on the API. **Warning** means fix it while you are here. Most naming and completeness rules belong at this level for their entire life, and that is a stable state rather than a failure. **Error** means this does not ship. Somebody stops, and the rule has to be worth that interruption on every occasion it fires, including the inconvenient ones. The fourth option is off, and switching a rule off after looking at it is a legitimate outcome. An enabled rule everybody has learned to scroll past costs the same attention on every run and buys nothing, while teaching the team that findings are background texture. ## The name of a rule is not its severity Rules tend to be written in the imperative, so a list of them reads like a list of requirements. A rule called `Operations must have a description` is a warning in most organisations, and there is nothing inconsistent about that. The wording describes the convention, and the severity describes your enforcement appetite. Reading a rules table as a list of things that will stop a release is a common way to overestimate what a guide is doing. Say this explicitly when you introduce a guide to a team, because the alternative is people assuming the worst and asking for the whole thing to be turned off. ## Where the block lands decides whether it is fair A blocking rule is tolerable when the person who hits it can fix it right there. It is resented when they cannot. Blocking on every save is the worst arrangement, since it interrupts the work at the exact moment the document is legitimately incomplete. Half-written is a normal state for a specification, and a tool that refuses to accept it teaches people to draft somewhere else. Blocking at the release is the arrangement that holds. The work is finished, the author is the person who can fix it, and the cost of the rule is paid once rather than continuously. It is also the last moment where a fix is cheaper than a migration. ## An escape hatch is what keeps the guide on Every guide meets an API it cannot fit. What happens next decides whether the guide survives that meeting. A guide with no exception mechanism does not produce compliant APIs, it produces teams that stop running the guide. An exception that is scoped and written down does the opposite, because the rest of the standard still applies to that project and everybody can see what was agreed. The rule of thumb is that an exception should name a project rather than lower a default, carry a reason, and be something a person could review later. An organisation that cannot name its exceptions does not know what its standard is. ## The two numbers that say the guide is failing You can tell whether a guide is working from the shape of its output rather than from its contents. If the violation count only grows, nothing is ever being fixed, which means every rule is advisory in practice and the guide is a report. If almost every rule is an error, people are either blocked constantly or bypassing the check, and both end with the guide switched off. A healthy guide has a small blocking set that fires rarely, a larger advisory set that trends downward, and a handful of rules somebody deliberately turned off. ## In Routebase Severity is set per rule, and the rules and the blocking are separate switches. _Screenshot: Enforcement is its own switch, so the rules can run and report for as long as you need before anything stops a publish._ Every rule sits at error, warning, info or off, and a rule you changed from its default carries an override badge with a one-click reset. Enforcement on publish is off until somebody turns it on, so switching the guide on does not by itself stop a release. With enforcement on, error-level violations block a publish and the dialog says how many have to be fixed. Warnings never block, and they can be published after a confirmation, which keeps the difference between the two severities visible at the moment it matters. Exceptions are scoped by project. The organisation sets the standard, and a project can override the severity of any rule for its own specifications. The project view adds a source column reading custom, org or default, with a reset back to the inherited value. The [Style Guide](https://docs.routebase.dev/style-guide/) guide covers the severities, the override badge and the publish gate, and [rolling governance out](https://routebase.dev/guides/api-governance/rolling-out-api-governance/) covers the order to turn them on in. The [API governance](https://routebase.dev/api-governance/) page shows the same cascade from the organization to a project in one view. ## Frequently asked questions ### Should API style guide rules block a release? A few of them should, and the test is what happens downstream when the rule is violated. A duplicate operation identifier produces generated clients that do not compile, so blocking is proportionate. A missing tag description costs a reader a moment, so blocking is not. Most guides end up with a handful of blocking rules and are stronger for it. ### What is the difference between an error and a warning in an API linter? They are promises about what happens to the person who hits them. An error says this does not ship, so somebody has to stop and fix it now. A warning says fix this while you are here, so it gets reported and never interrupts. Using error for things you do not actually intend to block is what teaches people to ignore the output. ### How do you handle a rule that a legacy API cannot satisfy? Scope the exception rather than change the standard. Override the rule for the one project that cannot meet it and leave the organisation default where it is, so the remaining rules still apply to that project and the standard still applies everywhere else. An exception with a reason attached is governance working, and a lowered standard is governance losing. ### Where should API governance rules be enforced? Continuously while somebody edits, and as a gate when a version is released. Editing is where a violation is cheapest to fix, because the author is still in the file. The release is the last point where blocking is fair, since the work is finished and the fix is visible. Blocking every save teaches people to work around the tool instead. --- # Custom API Linting Rules — Routebase > When a house convention earns an automated check, what a condition-based rule can express, and how to write one that does not fire on half your endpoints. Canonical page: https://routebase.dev/guides/api-governance/custom-api-rules/ Chapter 4 of 10 · API Governance · Last reviewed 2026-09-27 by The Routebase Team. Every organisation has conventions no tool ships with. The question is which of them are worth turning into a check, because the answer is not all of them. ## Three tests before you write one A house convention earns an automated check when three things hold at once. It has to recur. A convention that comes up twice a year is cheaper to catch in a review than to maintain as a rule, and the rule will be stale by the time it next fires. Somebody has to be able to name the cost. If nobody can say what goes wrong when the convention is ignored, the rule is a preference and it will lose its first argument. A machine has to be able to decide it. The convention needs a target, a field and a condition, as the [previous chapter](https://routebase.dev/guides/api-governance/machine-checkable-api-rules/) describes, and a convention that resists that split needs rewriting rather than automating. ## What a condition can carry Condition-based rules are deliberately small, and knowing the shape of the box is what stops you from fighting it. A rule points at one target, which is an operation, a schema or the specification itself. It picks one field on that target, such as a path, a summary, an operation identifier or a contact address. It then applies one condition, which is typically that the field exists, contains something, equals something or matches a pattern. That covers more than it sounds like. Internal header prefixes, operation identifier naming, mandatory summaries, a contact address that has to be a team alias rather than a person, and path patterns your platform requires are all one field and one condition. ## What it cannot carry The limits below belong to condition-based rules rather than to linting in general, and they are worth knowing before you design a convention around them. A condition-based rule looks at one field, so a rule that compares two fields against each other is out of reach. A condition does not count, so a rule about how many parameters an operation may have has nowhere to go. A condition sees one target, so a rule that checks an operation against a schema somewhere else in the document cannot be written this way. When a convention needs one of those, you have two honest options. Restate it as something narrower that a condition can see, or accept that it belongs in a design review. Writing an approximation that fires on the wrong things is the option that costs you the most, because it damages the credibility of every other rule. ## Writing one that does not cry wolf Most bad custom rules are bad in the same three ways, and all three are avoidable in the first draft. **Pick the narrowest target.** A rule on the specification fires once, and a rule on every operation fires everywhere. If the convention really concerns operations, keep it there rather than approximating it at the document level. **Anchor the pattern.** An unanchored expression matches a substring, so a rule meant to require a `team-` prefix will happily accept `customer-team-orders`. Anchoring both ends turns a rule that quietly passes into one that means what it says. Running the same three field values against three versions of the pattern shows where each one lets something through. | Pattern | `team-orders` | `customer-team-orders` | `team-` | |---|---|---|---| | `team-` | match | match | match | | `^team-` | match | no match | match | | `^team-[a-z]+$` | match | no match | no match | Only the pattern anchored at both ends rejects the prefix buried inside another name and the bare prefix with nothing after it. **Start it advisory.** Run the rule at an informational severity for a week and read the output before deciding anything. A rule that fires on a third of your endpoints is usually describing a convention you believed you had rather than one you actually have. ## The rule you should not write There is one category worth naming, because it is tempting and it never works. Rules that encode a judgement produce findings nobody can act on. A pattern that tries to detect a vague summary will flag good ones and miss bad ones, because the thing being judged is meaning rather than form. The same applies to any rule whose violation prompts an argument about intent rather than a fix. Those conventions are real, and they belong in the review that the mechanical rules just freed up. ## In Routebase Custom rules are declarative rather than scripted, which is what keeps them readable by the next person. _Screenshot: A rule is a target, a field and a condition, with the category and severity it carries into the rules table alongside the built-in ones._ A rule targets an endpoint, a schema or the specification, and the available fields depend on which of the three you pick. Endpoints expose the path, summary, description, operation identifier and method, schemas expose the name and description, and the specification exposes its name, version, description, server URL, contact address and licence identifier. The condition is regex, contains, equals or exists, and patterns are validated before the rule is saved. You choose the category and the severity yourself, so a custom rule sits in the same table as the built-in ones with a custom badge. It can be enabled, edited, disabled or deleted from the same page. Anything outside a single field and a single condition is not expressible, which is the trade this design makes on purpose. The [Style Guide](https://docs.routebase.dev/style-guide/) guide lists the fields available on each target. ## Frequently asked questions ### When should you write a custom API lint rule? When the convention recurs, somebody can name what goes wrong without it, and a machine can decide it from the document. All three have to hold. A convention that comes up once a year is cheaper to catch in review, and one nobody can justify will lose its first argument whether or not a tool enforces it. ### What can a condition-based API rule check? One field on one target, against one condition. That covers a great deal in practice, including path patterns, required summaries, operation identifier prefixes and specification metadata such as a contact address. It does not cover anything that needs two fields compared against each other, anything that counts, or anything that looks at a different part of the document. ### How do you stop a lint rule from producing false positives? Narrow it before you tighten it. Pick the most specific target the rule can sit on, and anchor the pattern at both ends so it cannot match a substring by accident. Start it at an advisory severity as well, so the first week of output is data rather than an obstacle. A rule that fires on a third of your endpoints is usually describing a convention you do not actually have. --- # Reuse Over Inspection in API Governance — Routebase > Why a shared definition removes a class of violation instead of reporting it, what belongs in an organisation-wide library, and how to roll out a change. Canonical page: https://routebase.dev/guides/api-governance/reuse-beats-inspection/ Chapter 5 of 10 · API Governance · Last reviewed 2026-09-27 by The Routebase Team. A rule that checks ten copies of the same shape is work created by the copies. Removing them removes the rule, and the category of mistake it was there to catch. ## A shared definition removes the violation, not the report This is the difference worth internalising. A check tells you that three teams wrote incompatible error bodies, and a shared component means there was only ever one error body to write. Nobody can be inconsistent about a shape they reference. The inconsistency requires a copy, and the copy is the thing a library takes away. That is why reuse is the cheapest governance mechanism available, and why it is usually the one an organisation reaches for last. Two APIs from a fictional shop show the change, first with an error body each and then with a reference to one shared definition. ```yaml # Before: two error bodies, and a rule to notice that they differ # orders.yaml components: schemas: Error: type: object properties: message: { type: string } # payments.yaml components: schemas: PaymentError: type: object properties: error_code: { type: string } detail: { type: string } # After: both files reference one definition, pinned to the version they linked # orders.yaml and payments.yaml components: responses: NotFound: description: The requested resource does not exist. content: application/json: schema: $ref: "https://schemas.example.com/shared/v1/error.yaml" ``` The effect compounds in the places consumers touch most. Every client that talks to your APIs writes error handling once instead of per service, and that is visible to them long before any style guide is. ## What belongs in a library across teams The line runs between the shapes every API has and the shapes that belong to one domain. Four things are almost always worth sharing. The error body is the first, since every API has one and no API benefits from its own. The pagination envelope is the second, because the alternative is consumers writing the loop once per service. Authentication schemes are the third, and the small value types such as money, addresses, identifiers and timestamps are the fourth. Domain objects are the counter-example. A shared `Customer` schema sounds like consistency and behaves like coupling, because two services that had no reason to move together now do. If a team has to negotiate a release with another team to add a field, the library has become a distributed monolith with a friendly name. The [components chapter](https://routebase.dev/guides/openapi/openapi-components-and-reuse/) of the OpenAPI guide covers where the same line sits inside a single document, and [consistency across an API](https://routebase.dev/guides/api-design/consistency-across-an-api/) covers when to extract at all. ## The distribution problem Sharing a definition across twelve services creates a question that sharing inside one document never raises, which is what happens when it changes. A library that pushes a change to every consumer at once is a deployment nobody scheduled. The first time it breaks a service, the team that owns that service starts copying definitions instead of linking them, and the library quietly stops being used. The arrangement that survives is the opposite. Each consumer records the version it linked and moves when it chooses, so a change to the library is an offer rather than an event. The cost is that several versions coexist for a while, and that cost is small next to a library nobody is willing to depend on. ## Adopting a library into APIs that already exist Starting a library on an empty page produces definitions that match nothing you have. The cheaper route is to promote what already works. Find the error schema in the API your team knows best, lift that one into the library, and link it back. The definition is then proven rather than theoretical, and the first consumer is already using it. Finding the duplicates is the other half. Teams rarely copy a schema by name, they write their own version of the same idea, so a `PostalAddress` and an `Address` and a `ShippingAddress` describe one thing. Grouping schemas by structure rather than by name is what surfaces those, and each group is a candidate with a ready-made consumer list. ## Where reuse ends A library cannot carry the decisions that are not shapes. It will not make anybody name a resource well, choose the right status code, or decide that an operation should not exist. It covers the parts of consistency that can be factored out, and the rest stays with the rules and the review. A library plus a check is the working pair, and neither one on its own gets you there. ## In Routebase The shared library holds organisation-wide schemas and responses, and linking one into a specification copies it in while keeping the connection. _Screenshot: A change to a shared component raises its version on save, and every specification that linked it stays on the version it linked until somebody accepts the update._ Every shared component carries a version, and the editor shows the pending bump while you type. Specifications keep the version they linked, so a library change never rewrites a consuming specification behind somebody's back. When a newer version exists the component shows an update indicator with both version numbers, and accepting the update is a single action on that specification. Components can go the other way as well, so a schema or response that proved itself in one specification can be promoted into the library rather than rewritten. A project-level overview groups the structurally identical schemas across every specification in the project, which is how you find the three teams that each wrote their own address type. One of them can then be promoted into the library. Linked components carry a badge showing whether they came from the organisation or the project library, and unlinking keeps the content and drops only the connection. Linking follows ordinary specification write access, while creating and changing library components needs the governance permission. The shared library is available on every plan. The [Shared Library](https://docs.routebase.dev/shared-library/) guide covers versioning, promotion and the update flow. ## Frequently asked questions ### How do you keep API schemas consistent across teams? Share the definition rather than check the copies. When every API references one error schema, no rule has to compare ten error bodies, because there is one body. Inspection scales with the number of copies while reuse removes them, which is why a shared library usually buys more consistency than the rules people write to compensate for not having one. ### What should go in a shared API component library? The shapes every API has and none of them should be inventing. That is the error body, the pagination envelope, the authentication schemes, and the small value types such as money, addresses and timestamps that appear everywhere. Domain objects belong to the team that owns them, and putting one in a shared library couples two services that had no reason to be coupled. ### How do you update a shared schema without breaking consumers? Pin each consumer to the version it linked and let it move on its own schedule. A library that pushes changes to everybody at once is a deployment nobody scheduled, and the second time it breaks a service, teams stop linking anything. Versions coexisting for a while is the price of a library people are willing to depend on. --- # Consistent Headers Across Every API — Routebase > Headers are where consistency decays first. The four families worth standardising, why a policy beats a rule here, and what a policy cannot do. Canonical page: https://routebase.dev/guides/api-governance/consistent-api-headers/ Chapter 6 of 10 · API Governance · Last reviewed 2026-09-13 by The Routebase Team. Naming conventions get argued about in reviews. Headers get forgotten, because they sit one level below the thing anybody is looking at. That makes them the most reliable early indicator of whether your consistency is a mechanism or an intention. ## Why headers decay first A response header is attached per response, and a medium API has a few hundred responses. Nobody adds a correlation header to all of them by hand correctly. The first twenty get it, the next batch gets it under a different name, and the ones added during a release week get nothing. None of that is visible in a design review, because reviews look at operations and bodies rather than at the header list of the third error response. The result is an API where tracing works on some calls, and a consumer who cannot tell which. ## The four families worth standardising Most header conventions reduce to four groups, and everything else is local to one API. **Correlation.** One identifier that travels with a request across every service it touches. This is the header your on-call engineer needs at three in the morning, and it is worth more than the other three combined. **Rate limit state.** How much budget a caller has left and when it resets. Carrying it only on the rejection is the common mistake, because a client that learns its position only when refused cannot slow down before that. Note that the widely used `X-RateLimit-*` spelling is a convention rather than a published standard, so pick one spelling and apply it everywhere. The [rate limit chapter](https://routebase.dev/guides/api-design/api-rate-limiting/) of the design guide covers what the values should mean. **Caching and concurrency.** Validators such as `ETag` and `Last-Modified`, along with the cache directives that say whether a response may be stored. These are defined in RFC 9110 and RFC 9111, so the decision is where to apply them rather than what to call them. **Deprecation signals.** Whatever you use to tell a caller that this version is going away, applied consistently rather than mentioned in a changelog. [Deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) covers the process behind the signal. ## A policy beats a rule here For most conventions a check is the right mechanism. Headers are the case where it is not. A rule reports that this response is missing the correlation header. Somebody then adds it to that response, and to the next one, and to the three hundred after that, and the count goes back up the following week. The rule is correct and the work it creates is endless. A policy inverts that. You declare that every response in a status class carries this set of headers, and the responses get them. The consistency is a consequence of the declaration rather than a task somebody works through, and new endpoints inherit it without anyone remembering. This is the same argument as the previous chapter. Where you can make a class of violation impossible, do that instead of detecting it. ## Scope, priority and exceptions A policy needs three things to survive contact with a real estate of APIs. It needs a **scope** narrow enough to be true. Applying rate limit headers to every response in the document is wrong, because they belong on the responses the limit governs. Status classes are the natural unit, so a policy for successful responses and a policy for rejections say different things. It needs a **precedence** when two policies overlap, since they will. An explicit order is better than a surprise, and the surprise is what teaches people to distrust the mechanism. It needs **exceptions with reasons**. One response that legitimately should not carry an inherited header is normal, and an exception recorded on that response is a documented decision. Turning the policy off for the whole specification because of one response is how you lose the other three hundred. ## What a policy in a contract does not do This is worth saying plainly, because the word enforcement invites the wrong expectation. A header policy describes what your API documents. It makes every matching response in the specification carry the header, which means your reference documentation, your generated clients and your mocks all agree about it. It does not reach into the running service and make it send the header. Closing that gap is a different mechanism, which is checking a live environment against the contract and reporting where they differ. [Contract drift](https://routebase.dev/guides/api-monitoring/api-contract-drift/) covers it, and a header your specification promises and your service omits is exactly the kind of thing it finds. ## In Routebase Header policies are built from header components, and both cascade from the organisation down. _Screenshot: Policies are defined once for the organisation and inherited by every project and specification, and the drag handle sets which one wins where two overlap._ A header component is a reusable definition of one header, carrying its name, type, required flag and description. A set of common headers covering correlation, rate limits, caching and retries can be added in one step. A policy bundles components and applies them to every response whose status code matches its scopes, which are the individual codes or whole classes. Policies exist at the organisation, the project and the specification, and the most specific level wins. They are priority ordered by dragging, and a policy can be disabled while you stage it. An impact analysis shows how many endpoints and responses a policy touches, along with any overlap with another policy, before you save it. A single response can exclude an inherited header with a reason recorded on the exclusion, and the policy stays intact everywhere else. Managing organisation-level policies needs the governance permission, while an exclusion needs ordinary specification write access. The [Header Policies](https://docs.routebase.dev/header-policies/) guide covers scopes, priority and exclusions. ## Frequently asked questions ### Which HTTP headers should every API response carry? Four families cover almost all of it. A correlation identifier lets one request be traced across services, and rate limit state tells a client where it stands. The other two are caching and concurrency validators such as ETag, and deprecation signals on anything that is going away. Beyond those, a header belongs to one API rather than to a standard. ### How do you keep response headers consistent across APIs? Apply them rather than check them. A rule reports that one response is missing the correlation header, and somebody then has to add it by hand to that response and every other one like it. A policy that attaches a set of headers to every response in a status class does the work instead, so the consistency is a consequence rather than a chore. ### Should every response include rate limit headers? Every response the limit actually applies to, which is usually every authenticated one rather than only the rejections. A client that learns its remaining budget only when it is refused cannot slow down in advance, so the headers are worth carrying on success as well. The 429 response then adds retry guidance on top. --- # Measuring API Quality — Routebase > What a weighted quality score is made of, why coverage is not quality, what the number cannot see, and what happens to it the moment a team is measured by it. Canonical page: https://routebase.dev/guides/api-governance/measuring-api-quality/ Chapter 7 of 10 · API Governance · Last reviewed 2026-09-13 by The Routebase Team. A quality score is useful for one job and harmful for another, and the two are close enough that organisations regularly do the second by accident. ## What a weighted score is made of Every score of this kind is a handful of countable things, weighted and added up. _Figure: Five dimensions with their default weights, and the question each one actually answers. Four of the five are counts over the description itself, which is what makes the number cheap to produce and narrow in what it can mean._ **Rule compliance** is the share of applicable style guide rules the specification passes. It is the most direct of the five, and it inherits whatever your guide happens to contain. **Documentation coverage** counts what a reader needs on each endpoint, which is normally a summary, a description, a declared response with a schema and an example. **Security posture** counts declared security requirements, whether schemas carry validation constraints, and whether anything looks like a field that should not be in an API at all. **Consistency** compares the document against itself. Whether path segments follow one convention, whether error responses share a shape, and whether property naming is uniform. **Architecture health** sits outside the document and describes how the service relates to its neighbours, so it is the one dimension that needs analysis beyond the specification. ## Coverage is not quality The largest gap between what a score says and what people hear sits in the word coverage. Coverage says a description exists. It cannot say the description explains anything, and the two are only weakly related. A team pushed on coverage will produce a summary for `GET /orders/{id}` that reads "Gets an order by id", which moves the number and helps nobody. That does not make it worthless. A missing description is a certain defect, so a coverage number is a genuine floor. Read it as the absence of one known problem rather than the presence of quality. ## What the number cannot see Four things sit outside any score computed from a description, and they happen to be the four that decide whether an API is good. Whether the resource model fits the domain. A document can be immaculate and still model the business wrongly, and the score has no opinion. Whether consumers succeed. The time from reading your documentation to a working first call is the number that actually reflects quality, and it is measured against your API rather than against your specification. Whether the API should exist. Two teams shipping overlapping APIs both score well. Whether it is stable. A specification that changes shape every sprint can hold a perfect score throughout, while the consumers absorb every change. ## What happens when you manage by it This is the failure the rest of the chapter exists to prevent. A measure that becomes a target stops being a measure, because effort moves to the number rather than to the thing it was counting. The mechanism is not abstract, and it shows up in the same three ways every time. Descriptions get padded, since the check is presence and presence is cheap. Rules get switched off, because a rule nobody passes is easier to disable than to fix and the score improves either way. Work gets reordered so that the countable parts go first, which means the design questions nobody can count go last. The honest arrangement is to use the score as a filter rather than a grade. It tells you which specification to open, and the conversation after you open it is about what you found there. Compare a specification against its own history rather than against another team's number, because two APIs at different ages and different levels of ambition are not comparable by construction. ## The measurements worth adding If you want numbers that resist the problem above, take them from outside the document. Time to first successful call is the strongest one, and it moves when the getting started page genuinely improves. Support questions per API tell you where the documentation failed, and each repeat question is a specific defect. Failed searches in your documentation portal are a ranked list of things readers expected and did not find. [Measuring API documentation](https://routebase.dev/guides/api-documentation/measuring-api-documentation/) covers those in detail. None of them are as convenient as a single percentage, which is exactly why they are harder to game. ## In Routebase Each specification gets a quality score aggregated from five weighted dimensions, and the weights are yours to set. Style guide compliance carries a quarter by default, documentation, security and consistency carry a fifth each, and architecture health carries the rest. The settings page requires the five to total one hundred and refuses to save otherwise, which keeps the weighting an explicit decision rather than a drift. Architecture health scores full marks until an architecture analysis has run for the project, so it never costs points by default. Two thresholds turn the score into an alert rather than a dashboard. A minimum quality score and a minimum documentation coverage each come with a live preview, counting how many specifications would fall below the value you are typing. That preview is the fastest way to see whether a threshold is ambitious or unreachable. Alerts on breaking changes and on drafts left untouched beyond a configurable window round it out. The score is deliberately a pointer. It reports which specification is furthest from the standard you set, and the [Style Guide](https://docs.routebase.dev/style-guide/) guide covers the dimensions, the weights and the thresholds behind it. ## Frequently asked questions ### How do you measure API quality? By combining a few things a machine can count and then treating the result as a pointer rather than a verdict. Rule compliance, documentation coverage, security posture and internal consistency are all countable, so a weighted score over them is a reasonable way to find the specification that needs attention. Whether the API is any good is a different question that no count answers. ### What are good API quality metrics? The countable ones are rule compliance and the share of endpoints carrying a summary, a description and a declared response. Add to those the share declaring a security requirement, and how uniform naming and error shapes are across the document. The ones that matter more are harder to get, such as how long a new consumer takes to make a successful first call and how many support questions an API produces. ### Should teams be measured by an API quality score? No, and the reason is mechanical rather than cultural. As soon as the number is a target it stops describing quality and starts describing effort spent on the number, so descriptions get padded and inconvenient rules get switched off. Use it to decide where to look, and use the things it points at as the actual conversation. ### What is API documentation coverage? The share of endpoints that carry the things a reader needs, which is normally a summary, a description, a declared response with a schema and an example. It is worth measuring because a missing description is a certain defect. It is a floor rather than a target, since it says nothing about whether the descriptions are any good. --- # Rolling Governance Out Without Stopping the Team — Routebase > Measure, then warn, then block. Why the reverse order gets governance switched off, how existing APIs differ from new ones, and who grants exceptions. Canonical page: https://routebase.dev/guides/api-governance/rolling-out-api-governance/ Chapter 8 of 10 · API Governance · Last reviewed 2026-09-13 by The Routebase Team. Switch a complete style guide on over APIs that already exist and the first run returns a number nobody wants to see. That number is not a problem. What you do in the following hour is. ## Measure first, and tell nobody The first run is research, and treating it as a status report is the fastest way to lose the room. Run the rules over the APIs you already ship, with everything advisory and nothing blocking, and read the output yourself. You will find three groups. There will be violations you genuinely want fixed, violations worth noting and never chasing, and rules that turned out not to describe how your organisation actually builds APIs. _Figure: The same guide, three arrangements, and only one of them survives contact with a team. Measuring costs nobody anything and tells you what your estate looks like. Warning creates a backlog somebody can work. Blocking at the end applies to the handful of rules the first two steps proved were worth it._ Sorting that list once takes a couple of hours, and it produces a guide calibrated against your APIs instead of against a template. The third group is the valuable one, because a rule you switch off deliberately costs nothing while a rule you leave on trains everybody to ignore findings. ## Then warn, and work the backlog The second step is where governance becomes visible, and the tone of that introduction matters more than the contents. Turn the guide on as advisory findings, and say plainly that nothing is blocking. Give the teams the list for their own APIs rather than a league table, because the first is a task and the second is a judgement. Expect the count to fall quickly at first, since a large share of the initial number is usually two or three rules firing everywhere. Watch the trend rather than the level. A count going down means the arrangement is working, and a count that only grows means everything is advisory in practice and the guide has become a report. ## Then block, and only for a handful The last step is the one people want to do first, and it works only because the other two came before it. Promote a rule to blocking when you would revert a release for it. That usually means rules whose violation breaks something downstream, such as duplicate operation identifiers or two paths that resolve to the same route, plus the few security rules where shipping is worse than stopping. [Severity and enforcement](https://routebase.dev/guides/api-governance/api-rule-severity-and-enforcement/) covers how to choose them. Announce the promotion before it takes effect, and make sure the violations of that rule are already at zero. A blocking rule introduced onto a non-empty backlog stops work on its first day, which is the precise outcome the whole sequence was designed to avoid. ## New APIs and existing APIs are different populations Applying one enforcement level to both is the most common way a sensible guide becomes unpopular. A new API can satisfy a naming rule at no cost, because nothing has been published yet. An API with three years of consumers may need a breaking change to satisfy the same rule, which is a disproportionate price for tidiness. Treating both identically punishes the API that is actually carrying load. The mechanism for this is a cascade rather than two guides. The organisation holds one standard, and a project departs from it where it has to, visibly and with the rest of the guide still applying. Two separate standards drift apart within a year, while one standard with recorded exceptions stays one standard. ## Who grants an exception and how long it lasts An exception is governance working, provided somebody can find it later. Keep the authority with whoever owns the standard, so exceptions stay comparable. Require a reason that names what applying the rule would cost, since a reason nobody can evaluate is a preference with paperwork. Review them on some cadence, because the legacy service that could not be renamed in March may be retired by October. The test of a healthy scheme is that you can list your exceptions. An organisation that cannot does not have a standard, it has a default that some teams follow. ## The order nobody should use For completeness, the sequence that fails. Enable every rule at error severity on the day the guide is announced. Within a week, one of two things has happened. Either work has stopped, and the guide is switched off under pressure and never comes back. Or teams have found the route around the check, and the guide is now a formality that costs everybody time and changes nothing. Both outcomes are difficult to reverse, because the second attempt has to overcome the memory of the first. ## In Routebase The three steps map onto three settings, and none of them requires a migration. The guide runs continuously once it is enabled, so the measuring step is the default state. Enforcement on publish is a separate switch that stays off until you turn it on, which is what makes step one and step two the same configuration with different expectations. Severity is set at the organisation and overridden per project, and the project view shows a source column reading custom, org or default with a one-click reset. An exception is therefore visible rather than folded into the numbers. A rule changed from its shipped default carries an override badge for the same reason. The alerts cover the part a rules table cannot. Thresholds for quality score and documentation coverage come with a live preview of how many specifications fall below them. Alerts fire on breaking changes, and on drafts left untouched beyond a window that defaults to a month. Configuring any of this needs the governance permission held by admins and owners. The [Style Guide](https://docs.routebase.dev/style-guide/) and [API Design Settings](https://docs.routebase.dev/api-design-settings/) guides cover the settings themselves. ## Frequently asked questions ### How do you introduce API governance to a team? In three steps and in this order. Run the rules and tell nobody, so you learn what your estate actually looks like. Then turn them on as advisory findings and work the backlog down with the teams. Only then promote the small number of rules you would genuinely revert a release for, which is usually a handful rather than a category. ### What do you do about the violations an existing API already has? Treat them as an agenda rather than a debt. Sort the first run into things you want fixed, things you want noted and things you now know to switch off, which takes a couple of hours and calibrates the guide against reality. New APIs then start from the calibrated standard, and the existing ones work through their list at a pace somebody agreed to. ### Should new and existing APIs follow the same API standards? The same standard with different enforcement. A new API can meet a rule at no cost, while an existing one may need a breaking change to do the same thing. Blocking both identically punishes the API that is already carrying consumers. A per-project override lets one service depart from one rule while the standard stays where it is for everybody else. ### Who approves exceptions to API design standards? Whoever owns the standard, and the important part is that the decision is recorded rather than negotiated in a pull request. An exception should name the project and the rule, carry a reason somebody can evaluate later, and leave the rest of the guide applying to that project. An exception nobody can find is indistinguishable from the rule being ignored. --- # Governing API Changes Between Versions — Routebase > Governance does not end at the first release. Which rules can check a change, what only a comparison between versions can tell you, and the alerts worth having. Canonical page: https://routebase.dev/guides/api-governance/governing-api-change/ Chapter 9 of 10 · API Governance · Last reviewed 2026-09-27 by The Routebase Team. Everything so far governs a specification being written. Most of the risk in an API estate is in the specifications that already shipped and are still changing. ## What a rule can check about a change A rule reads one document, which limits what it can say about change. Within that limit there is still useful ground. It can check that a deprecated version carries a sunset date, which is the single most useful change-related rule there is. It can check that a published version has a readable alias, so consumers can say `v2` rather than quote a build number. It can check that the specification declares a versioning strategy at all, which is the thing teams skip and then improvise under pressure. Those are all questions about the current document, so a style guide handles them. They are also the paperwork rather than the risk. ## What only a comparison can tell you Whether a change breaks anybody depends on what the previous version promised, and no amount of reading the new document reveals that. Removing a field is a breaking change if something consumed it. Narrowing an enum breaks the caller sending the value you dropped. Making an optional request field required breaks everybody who omitted it. Each of those is invisible to a rule and obvious to a comparison, which is why the two mechanisms are complementary rather than alternatives. A comparison between two versions of a fictional orders API shows all three cases, and the second version on its own is a perfectly valid document. | Change from v1 to v2 | Where it sits | Who it breaks | |---|---|---| | `Order.trackingUrl` is removed | Response body | Every client that reads the field | | `deliveryMethod` loses the value `pickup` | Request body | Every client that still sends `pickup` | | `CreateOrderRequest.phone` becomes required | Request body | Every client that omitted it | Run the comparison at the same gate as the rules, so a release produces one answer about both. [API breaking changes](https://routebase.dev/guides/api-versioning/api-breaking-changes/) covers the classification itself, and [backward compatible changes](https://routebase.dev/guides/api-versioning/backward-compatible-api-changes/) covers what you can ship without any of this. ## Alerts are the governance of things nobody is looking at A check runs when somebody does something. Alerts cover the state that develops when nobody does anything, and that is a different class of problem. Three examples show what such a signal looks like. A spike of breaking changes in a single version usually means something was rewritten rather than evolved, and it is worth a conversation before release rather than after. A draft that has sat untouched for a month is either abandoned or blocked, and both are worth knowing. Changes that have been sitting unpublished for weeks mean the specification and what consumers can see have quietly diverged. None of these are violations. They are signals that a process stopped, which is exactly what a rules table cannot see. ## Deprecation is a governed process, not a label Marking a version deprecated is the easiest part and the least useful on its own. A deprecation that consumers should act on needs three things. It needs a date, because without one nothing follows from the label and people reasonably ignore it. It needs a successor, so the first question a consumer asks has an answer in the same place. It needs a migration path, even a short one, because the alternative is every consumer working out the same diff independently. The date is also what makes the process measurable. You can see whether traffic is moving off the old version in time, and a migration that has not started six weeks before the sunset is a decision you still have room to make. [Deprecation and sunset](https://routebase.dev/guides/api-versioning/api-deprecation-and-sunset/) covers the full sequence. ## In Routebase The change-related rules sit in the same guide as the rest, and the comparison and the alerts sit next to them. _Screenshot: A deprecation collects its sunset date, its successor and its migration guide before anything is announced, so the label always arrives with the answer to the next question._ A built-in rule flags a deprecated version without a sunset date, and further rules cover aliases on published versions and a configured versioning strategy. Version comparison reports what changed between two versions and marks the breaking entries, and the release flow surfaces them before a version is frozen. On the alerting side, breaking changes can raise an alert, and drafts left untouched beyond a configurable window raise one as well. Both sit on the governance settings page alongside the quality thresholds, so the process signals and the quality signals arrive through the same channel. The [Versioning](https://docs.routebase.dev/versioning/) guide covers deprecation, sunset dates and the release flow. ## Frequently asked questions ### How do you govern breaking changes to an API? With a comparison rather than a rule, because a breaking change is a relationship between two versions and a rule reads one document. Compare the candidate version against the one consumers are on, classify what changed, and require a decision on anything that removes or narrows something. The rules then cover the paperwork around it, such as whether a deprecated version carries a sunset date. ### Can a linter detect breaking API changes? Not on its own. A linter answers questions about the document in front of it, and whether a change breaks anybody depends entirely on what the previous version promised. A version comparison is the mechanism for that, and it is worth wiring into the same gate that runs your rules so both answers arrive together. ### What should happen when an API version is deprecated? The version should carry a sunset date, name its successor and say how to migrate before the announcement goes out. A deprecation without a date is a label, since nothing follows from it and consumers reasonably ignore it. The date is also what lets you tell the difference between a migration that is progressing and one that has stalled. --- # What to Look for in an API Governance Tool — Routebase > Eight questions about where governance checks run, how exceptions are recorded and whether a standard cascades, tested on your least consistent API. Canonical page: https://routebase.dev/guides/api-governance/api-governance-tools/ Chapter 10 of 10 · API Governance · Last reviewed 2026-09-27 by The Routebase Team. Governance tools are easy to compare on the wrong things. What decides the outcome is whether the checks still run, and are still read, after the first report over a messy API has been sorted into fix, note and switch off. The questions below are about that stage. ## Eight questions for a governance tool ### 1. Where do the checks run A finding that appears where the decision is being made is a correction. The same finding in a report is a task for somebody in two weeks. Ask whether violations appear while a description is being edited, whether they can be fixed from where they appear, and whether the same rules run again at the release. Anything that only runs on a schedule will be read for a month and ignored afterwards. ### 2. Can you express your own conventions Every organisation has conventions no tool ships with, and this is where tools differ most. Ask what a rule of your own can target, what it can match, and whether it is declarative or a script. A declarative rule is readable by the next person, while a scripted one is a small program somebody has to maintain. Both are legitimate. The failure case is a tool where the shipped rules are all you get. ### 3. Is enforcement optional per rule A tool where everything blocks and a tool where nothing blocks fail in opposite directions and at the same speed. Ask whether severity is yours to set, whether blocking is a separate switch from the rules themselves, and whether a warning can still be published after a confirmation. If enforcement is all or nothing, your rollout has no middle step. That step is what makes the whole thing survivable. ### 4. How is an exception recorded Every standard meets an API it cannot fit, so the handling of that case is a core feature rather than an edge case. Ask whether an exception can be scoped to one project or one response rather than switching a rule off everywhere. Ask whether the exception shows its origin, so somebody reading the settings can tell an inherited value from a local decision. A tool with no escape hatch produces teams that stop running it. ### 5. Does the standard cascade One standard with local departures stays one standard, while two standards drift apart within a year. Ask whether an organisation-level default exists, whether a project can override it, and whether the override is visible as an override. The same question applies to shared components and to header policies, since a cascade that covers rules but nothing else leaves the copies where they were. ### 6. Can it remove violations instead of reporting them This is the criterion most comparisons leave out. It is also the one with the largest effect. Ask whether the tool can hold a definition once and have several APIs reference it, and whether it can apply a set of response headers rather than checking that somebody added them. Inspection scales with the number of copies, so a tool that can only inspect will generate work forever. ### 7. What does it measure, and against what A number is useful for choosing where to look, provided you can see what it is made of. Ask whether the weighting is visible and adjustable, whether you can see a specification's own history rather than only its current value, and whether thresholds produce an alert rather than a leaderboard. A score you cannot decompose is a grade. A grade invites exactly the behaviour the [measurement chapter](https://routebase.dev/guides/api-governance/measuring-api-quality/) warns about. ### 8. What can you take with you Governance configuration is a real asset once it has been calibrated against your APIs. Ask how the rules and their severities can be read out, whether by export or through an API, and what happens to your custom rules if you move. The answer will not usually decide between two tools. It does tell you how much of the calibration work you would be repeating. | Criterion | The question | The answer that should worry you | |---|---|---| | Where checks run | Do violations appear while editing | A scheduled report | | Own conventions | What can a rule target and match | A fixed rule set with no extension | | Enforcement | Is blocking optional per rule | All or nothing | | Exceptions | Can one project depart from one rule | Switch it off for everybody | | Cascade | Is there an org default with visible overrides | One flat configuration | | Removing violations | Can a definition be shared rather than checked | Inspection only | | Measurement | Is the weighting visible and adjustable | One opaque number | | Portability | How do the rules come back out | No way to read the configuration | ## Run it on your least consistent API Do not evaluate on a tidy API, because the first run over a tidy API tells you nothing you did not know. Load the least consistent real API you have and read the whole first run. Sort it into what you want fixed, what you want noted and what you would switch off. That is the same calibration exercise the [rollout chapter](https://routebase.dev/guides/api-governance/rolling-out-api-governance/) describes, and you have to do it anyway. Then take one convention your organisation genuinely has and try to express it as a rule. Then take the API that legitimately cannot satisfy one of your rules and record the exception. Those three exercises take an afternoon and they cover the three things that decide whether the tool is still running next year. ## In Routebase Asked of Routebase, the eight questions get the answers below, and the earlier governance chapters describe each of them in full. Rules run continuously against the specification you are editing and again in the publish dialog, with an issues panel that offers a fix for many findings. Severity is set per rule at the organisation and overridable per project, with a source column that shows where the current value came from. Blocking on publish is a separate switch that starts off. Custom rules extend the set with a target, a field and a condition. The shared library and header policies remove classes of violation rather than reporting them, and both cascade from the organisation down. The quality score exposes its weights and requires them to total one hundred, and its thresholds raise alerts rather than rankings. Two limits are worth knowing before you plan around them. The configuration lives in the organisation rather than as a file in your repository, so rules are read and written through the settings pages or the API rather than reviewed as a pull request. There is also no import or export of rule sets from other linters, so a ruleset you maintain elsewhere is expressed again rather than loaded. The [Style Guide](https://docs.routebase.dev/style-guide/), [Shared Library](https://docs.routebase.dev/shared-library/) and [Header Policies](https://docs.routebase.dev/header-policies/) guides cover the three surfaces in the product documentation. The [comparison with Stoplight](https://routebase.dev/stoplight-alternative/) covers where this sits when linting is one stage of the lifecycle rather than the product. The [API governance](https://routebase.dev/api-governance/) page is the short version of these answers, with the plan each surface sits on. ## Frequently asked questions ### What should you look for in an API governance tool? Ask where the checks run, whether you can express your own conventions, whether enforcement is optional per rule, and how an exception is recorded. Those four decide whether a team keeps the tool switched on. Rule counts and dashboards demo well and tell you almost nothing about the year after the trial. ### Do you need a dedicated API governance tool? Not for one team and one API, where a linter in the pipeline covers it. The case starts when several teams ship APIs that consumers see as one product. You then need a standard set in one place, exceptions that are visible, and a view of where the standard does not hold yet. Those are coordination problems rather than linting problems. ### How do you evaluate an API governance tool? Load your least tidy real API rather than a sample, and read the first run. Then take one convention your organisation actually has and try to express it as a rule. Then take an API that legitimately cannot meet one rule and see how the tool records the exception. The three answers together tell you more than any feature comparison. --- # Your Mock Server Is Too Nice — Routebase > A mock that always answers instantly with 200 teaches your frontend the network is free and reliable. Neither is true. What a mock must do before you build on it. Canonical page: https://routebase.dev/blog/your-mock-server-is-too-nice/ Published: 2026-10-26 · The Routebase Team · Mock Server, API Design, Testing Everyone learns to drive on an empty lot. Flat asphalt, a few cones, nobody else for two hundred metres. It is the right place to start, because you find the biting point without anyone behind you. But nothing on that lot teaches you what to do when a van pulls out, or when the rain starts halfway through a manoeuvre, or when the car behind you is already too close. The lot is not wrong. It is just *too nice*, and the first real junction is not a continuation of it. It is a different game. Most mock servers are that empty lot. Which is fine on day one and expensive on integration day. ## What a friendly mock quietly teaches Start a frontend against a mock that answers in three milliseconds, always with `200`, always with the same tidy object, and you will build a genuinely good application, for a world that does not exist. You will not build a loading state, because nothing was ever slow enough to need one. You will not build an error state, because nothing ever failed. You will not find out what your list view does with zero results, or with four hundred, because the mock returns three every time. You will not discover that two components fetch the same resource on mount, because at three milliseconds nobody notices six requests. And you will not handle `429` at all, because the thought does not arise. None of this is carelessness. You cannot write a handler for a condition you have never seen. The mock decided which conditions you would see, and it chose the pleasant ones. Then the real backend arrives. Every one of those missing states shows up in the same week, usually the week before launch. Each of them is a small change to a component that has since been reused in six places. ## Three things a mock has to be able to do The useful question about a mock is not "does it respond?" It is "does it behave?", and behaviour comes down to three properties that have nothing to do with the shape of the response body. **It has to be slow sometimes.** A fixed delay is better than none, but a *range* is what surfaces the real bugs. Those are the request that finishes after the one that started later, the spinner that flickers because it appears for forty milliseconds, and the component that unmounts before its response arrives. In Routebase a rule carries a delay and, optionally, an upper bound to randomise against, so latency varies the way it varies in production. **It has to fail.** Not once, on demand, while you are watching, because that only proves the error path renders. It has to fail *occasionally*, at a probability you set, so that failure lands while you are working on something else and you find out what your retry logic does to a half-filled form. A mock rule can return `500`, `502`, `503` or `504`, and it can do worse, because it can hold the connection open until it times out, or reset it outright. Those last two are the ones that find the bugs, because a clean `500` is a response and a dead socket is not. **It has to say no.** Rate limits are the condition frontends handle worst, because they are invisible in development and unavoidable in production. A mock that enforces a request ceiling over a window turns `429` from a thing you read about into a thing your UI has already survived. Add a fourth if the API has any notion of sequence, which is state. A mock that accepts a `POST` and then still answers the following `GET` as if nothing happened is fine for rendering a page and useless for building a flow. Statefulness is what makes "create it, then list it" testable before the backend exists. _Figure: The same eight requests against a friendly mock and against production. On the left every response is fast and green, so no loading state and no error path was ever needed. On the right the same calls vary in latency and two of them fail, and those two are the states the frontend never got round to building._ ## Where the response body comes from matters more Behaviour makes a mock realistic. The body is what makes it *true*, and this is where hand-written mocks quietly go wrong. A mock maintained by hand in the frontend repository is a second opinion about the API. It starts as a faithful copy of the contract and then drifts, because it is edited by whoever needs a field today, in a repository the backend team does not read. By the time it disagrees with the API, nothing announces the disagreement, and the tests still pass, because they are testing against the same fiction. A mock derived from the contract cannot drift while it is derived. In Routebase the response body for a draft endpoint is projected from the current draft schema at request time, so when you change the schema, the next request through the mock reflects it. There is no regenerate button in that path because there is nothing to regenerate. That property has an exact boundary, and it is worth stating plainly rather than selling around. The moment you edit the response body by hand, the rule stops following the schema. It is now yours, and a later schema change will not touch it. That is deliberate, because an override that silently disappears on the next edit upstream is worse than no override. Regenerating the body hands ownership back and the rule follows again. And once a spec version is published, the mock pinned to it is frozen on purpose, because a published version that shifts underneath a consumer is not a version. What you get from that point is not silent synchronisation but *detection*. The rule is compared against the newer contract and flagged, and pulling it forward is a step you take. So the honest summary is that the mock is derived while it can be, frozen when it should be, and never quietly disagreeing with the contract without saying so. ## What this buys the team The point of all of this is not fidelity for its own sake. It is that "integration" stops being an event. When the mock is slow, fails, rate-limits and remembers, the frontend that was built against it has already met the conditions the real backend will present. Integration day becomes a change of base URL and a short list of genuine surprises, rather than a fortnight of discovering states nobody designed. And the backend team gets something too, which is easy to miss. Every question the frontend would have asked in a meeting got asked against the contract instead, early, while changing the answer was still cheap. That includes what this returns when the list is empty, and what happens on a duplicate submit. If you want the mechanics of that setup, from how rules come off the spec and what matching looks like to where fixtures fit, our [API mocking](https://routebase.dev/api-mocking/) page covers it. ## Back to the empty lot Nobody argues that learner drivers should start in city traffic. The lot earns its place, because you need somewhere to make the first mistakes cheaply. What makes the lot useful is that you leave it. What makes leaving it survivable is that the last few sessions were not empty, with a bit of traffic, a bit of rain, and someone impatient behind you. A mock server works the same way. It should be the easy place to start, and it should stop being easy well before the day it stops being a mock. --- # How We Got Our Docs to 100 on the Agent-Friendly Docs Scorecard — Routebase > We took routebase.dev from 87 to 100 on the open Agent-Friendly Docs Scorecard in one day. What failed, the four fixes, and the CDN header detail that nearly broke it. Canonical page: https://routebase.dev/blog/agent-friendly-docs-scorecard/ Published: 2026-10-06 · The Routebase Team · AI Agents, Documentation, llms.txt When an agent fetches a page of your documentation, it gets the same HTML your browser gets. In a sample of 20 pages from routebase.dev, the median page weighs 148 KB as HTML and only 8 KB as Markdown. More than nine tenths of what an agent downloads is therefore markup, scripts and navigation. Some agents cut the page off and others summarise it first, and in both cases the answer your user gets rests on less than you published. The [Agent-Friendly Docs Spec](https://agentdocsspec.com/spec/web/) turns that problem into something you can measure. It is an open specification under CC BY 4.0, and its companion tool [afdocs](https://afdocs.dev) runs 28 checks in seven categories against any documentation site. We ran it against routebase.dev on October 5 and scored 87 out of 100. By the end of the same day the score was 100, and this post walks through what we changed. ## What the scorecard measures The checks follow the path an agent takes through a site. They ask whether the agent can find an index of your pages, whether each page exists as Markdown, and whether that Markdown fits into a context window and matches what a human sees. Further checks cover redirects, error codes and caching, and whether bot protection blocks the agent before it reads anything. You can run the same check yourself with one command, and it needs nothing but a URL. ```bash npx afdocs check https://docs.example.com --format scorecard ``` ## Where we started Our `llms.txt` was already in good shape, so the index checks passed. The 87 came from five findings, and each of them pointed at the way the site was built rather than at what the pages said: - A request with `Accept: text/markdown` still received HTML. - Eight of 49 sampled pages differed between their Markdown and HTML versions, mostly because product mockups and calls to action existed only in the HTML. - On guide chapters the content began after the navigation and a chapter list, so across the sample it started at a median of 30 percent of the page. - No page told an agent that an `llms.txt` existed. - The Markdown versions carried 467 links like `/pricing/` that only resolve when you already know the host. ## Fix 1: a Markdown version of every page Most pages of the site already had a Markdown twin at `/.md`. We added a build step that places a copy at `//index.md` next to every `index.html`, and it converts the few pages without a twin from their main element. As a result, every page now exists in both forms under the same path. Parity was the harder half. Live product mockups, pricing widgets and call-to-action blocks mean something to a person and nothing to an agent, so we marked them with `data-markdown-ignore`, which afdocs leaves out of its comparison. We also added the page headline to every Markdown version and rewrote all root-relative links as absolute ones. A link then keeps working after the Markdown has been copied into a prompt or a file somewhere else. ## Fix 2: content negotiation at the edge A `.md` URL helps only an agent that knows to ask for it. Content negotiation lets every agent use the URL it already has, because the request states which format it wants and the server answers in that format. Our sites sit behind a CDN, so the decision happens there in a single edge rule. When the path ends in a slash and the `Accept` header contains `text/markdown`, the rule rewrites the request to the `index.md` in the same folder. _Figure: One URL, two answers. A browser asks for HTML and receives the full page. An agent that sends Accept: text/markdown to the same URL receives the Markdown version at about a twentieth of the size, and both responses carry Vary: Accept so that no cache mixes them up._ The effect is easy to check from a terminal, since the same URL answers with a different content type depending on the header. ```bash curl -sI https://routebase.dev/pricing/ | grep -i content-type # content-type: text/html curl -sI -H "Accept: text/markdown" https://routebase.dev/pricing/ | grep -i content-type # content-type: text/markdown; charset=utf-8 ``` Two details decide whether this stays correct once caches are involved. Every page response has to carry `Vary: Accept`, so that no cache along the way hands the HTML to an agent or the Markdown to a browser. In addition, our negotiated responses bypass the edge cache entirely, which keeps the cached HTML and the Markdown from ever sharing a cache entry. The header itself held the one surprise of the day. Our CDN can modify a response header with either Append or Overwrite, and Append sounds like the safe choice when the origin already sends a `Vary`. Its documentation says, however, that Append joins the two values by plain string concatenation and adds no delimiter, and that is easy to read past. On our docs host the origin already sent `Vary: Origin`, so appending `Accept` produced `Vary: OriginAccept`, which no cache can interpret. We caught it in the probe after the rollout, and the fix was Overwrite with the complete value `Origin, Accept`. ## Fix 3: tell the agent where to look An agent that lands on a single page has no reason to look for `llms.txt` unless something tells it to. Every HTML page now starts with one short sentence for agents, which is hidden visually and from screen readers. Every Markdown version opens with the same sentence right under its headline, and it says that each page can be read as Markdown and where the full index lives. ## Fix 4: content first in the document Agents and most HTML-to-Markdown converters read a page from the top, so anything that comes before the content costs context. On our guide chapters the chapter list stood in the markup before the article. We moved it behind the article and kept its position on screen with CSS grid order. The teasers inside the navigation menus now render only once the page runs in a browser, so they never appear in the server-rendered HTML that an agent fetches. In our own measurement the content on guide chapters now begins at 14 percent of the page instead of 35. Across its sample, the scorecard now reports a median start of one percent. ## The result Two runs on October 5 and another on October 6 each returned 100 out of 100, which is grade A+. The scorecard draws a sample of 50 pages per run, so a single run can land on pages the others missed, and that is why we don't rely on one run alone. Our documentation portal at docs.routebase.dev went through the same kind of changes and scored 100 on its latest run as well. None of the fixes rewrote what our pages say. Every change sat in the build, the markup or the edge configuration, which also means that every page we add from now on inherits it without extra work. ## In Routebase Routebase publishes your [API documentation](https://routebase.dev/api-documentation/) as a portal that is generated from your spec, and every portal comes with this behaviour by default. Each content page exists as Markdown and answers `Accept: text/markdown` on its normal URL. Each one opens with the `llms.txt` directive and uses absolute links in its Markdown, so an agent can follow them wherever the text ends up. You can also measure any of your portals without leaving Routebase. The **Agent Readiness** card in the portal settings runs the same scorecard against the published portal and shows the score, the grade and every check that didn't pass. Checks that Routebase already handles are marked as such, and the others come with a hint on what to change. When a portal has no meta description, for example, the card takes you straight to that field. An agent working over the Routebase MCP server can start the check and read the result under the same permissions as your team. Existing portals pick the changes up with their next build. The ideas behind them, from `llms.txt` to Markdown versions of generated reference pages, are explained in the guide chapter [API documentation for AI agents](https://routebase.dev/guides/api-documentation/api-documentation-for-ai-agents/). --- # Three Years Later: What Happened to 1,927 Public API Specs — Routebase > We fetched 1,927 public OpenAPI specs again and compared each with its 2023 copy. About half had changed, and nine in ten breaking changes had no new major. Canonical page: https://routebase.dev/blog/public-api-specs-three-years-later/ Published: 2026-09-24 · The Routebase Team · OpenAPI, Versioning, Breaking Changes If you integrated a public API in 2023, you probably read its OpenAPI spec, generated a client from it, and trusted the version number to tell you when the contract changed. The contract most likely did change since then, and the version number most likely kept quiet about it. We know this because we measured it. The apis.guru directory stores 1,927 public API specs that point back to a Swagger or OpenAPI file at the provider. In September 2026 we fetched each of those files again and compared it with the copy the directory had kept since 2023. Where a contract had changed in a way that breaks a client, the major version stayed the same nine times out of ten. ## What we measured The [APIs.guru OpenAPI directory](https://github.com/APIs-guru/openapi-directory) is an open collection of public API descriptions, and it holds more than 2,500 APIs from 676 providers. Its update job last refreshed a spec in April 2023, so the directory is a record of how those APIs described themselves in spring 2023. For every API whose source was a Swagger 2.0 or OpenAPI 3.x file, the directory also records the URL that file came from. We fetched those 1,927 URLs once on September 14, 2026, and parsed both the old and the new document. We then compared each pair with the same breaking-change rules that Routebase applies when a team publishes a new version of its own spec. Three limits shape what the numbers can say: - The 2023 side is the directory's copy, which differs from the provider's file in format and in small corrections, so we only count changes a client can observe. - A spec that pulls definitions from other files can't be compared reliably from one file, so those pairs are set aside. - The numbers describe public APIs that someone once listed in a directory, not internal APIs. ## A third of the spec URLs are gone Before a contract can drift, the file that describes it has to still be there. Of the 1,927 URLs, 1,230 answered with a 200 in 2026, which is 63.8 percent. Another 521, or 27.0 percent, answered with a 404 or a 410, and 122 didn't answer at all. _Figure: Where the 1,927 spec URLs recorded in 2023 led in September 2026. Fewer than two in three still serve a file, and more than a quarter answer that the file is gone. The last row collects server errors, unresolved redirects and a few rare status codes._ This is a finding about spec URLs and not about the APIs behind them, because a provider can move its description without retiring anything. For a consumer the effect is the same, though. When a build step fetches a provider's spec by URL to generate a client or run a contract test, more than one in three of those steps would fail today. ## Half of the surviving contracts changed Of the 1,230 URLs that still answered, 838 returned a document we could parse and pair with its 2023 copy. The 493 pairs that stand on their own, without definitions pulled from other files, carry the numbers in this section. Within three years, 48.9 percent of those contracts changed in a way a client can observe. An endpoint, a parameter or a field was added or removed, or a type changed, while edits to descriptions and examples don't count. Two thirds of the changed contracts, 66.8 percent, contain at least one breaking change. The breaking changes are not exotic. An endpoint disappeared in 45.3 percent of the affected specs, and a response field was removed in 44.1 percent. These are exactly the changes that turn into a missing route or a null value in someone else's code on the day the provider deploys. | Breaking change | Share of specs with a breaking change | |---|---:| | Endpoint removed | 45.3% | | Response field removed | 44.1% | | Parameter removed | 36.6% | | Response type changed | 36.0% | | Required field added to the request body | 17.4% | | Endpoint path changed | 15.5% | ## Nine in ten breaking changes arrive without a major bump Semantic versioning makes a simple promise, which is that a breaking change raises the major version. Among the 161 specs with a breaking change, 143 kept their major version, which is 88.8 percent. In 86 of them, or 53.4 percent, the version string didn't change at all. _Figure: The 161 contracts with at least one breaking change, grouped by what their version number did between 2023 and 2026. Only the major bump is the signal semantic versioning promises, and it covers 18 of them. More than half kept the exact same version string, and fifteen carry a lower number today than they did in 2023._ Some of the rest moved in directions semantic versioning has no word for. Fifteen specs carry a lower version number today than in 2023, and eight use version strings that aren't semantic versions at all. The consequence is practical. A client that pins a major version, or a dependency bot that waits for one, would have been warned about 18 of these 161 breaking changes. It would have met the other 143 without any warning from the version number. ## It was always like this The directory's git history lets us look further back than one comparison. Between 2015 and 2023, its update job committed 106,083 new revisions of existing spec files, and we compared each of them with the revision before it. Of the pairs we could compare, 26.7 percent changed the contract structurally, and 30.8 percent of those changes broke a client. The directory stores every declared version in a folder of its own, so a new version is a new file, and nearly all of these pairs share one version number. That follows from how the directory is organised and is not a finding in itself. The finding is what providers change inside a version they have already published, which is more than one structural change in four, with almost one in three of those breaking a client. ## Weighting doesn't move the headline Four providers with hundreds of specs each hold more than half of the directory, so a share across the whole corpus risks describing those four and nobody else. We therefore computed every number with each provider weighted equally, and again without those four providers at all. | Share of re-fetched contracts | Raw | Each provider weighted equally | Without the four largest providers | |---|---:|---:|---:| | Contract changed | 48.9% | 42.0% | 50.3% | | Of those, with a breaking change | 66.8% | 70.8% | 66.7% | | Breaking changes without a major bump | 88.8% | 87.7% | 88.8% | In every column, between 42 and 50 percent of the contracts changed, and about two thirds of those changes broke something. Close to nine in ten of those breaks kept the major version, whichever way you count. ## What a spec looks like before it drifts The 2023 snapshot also shows the state these contracts were in before they changed. Only 47.6 percent of the 2,481 specs define a 4xx error response on even one endpoint, so for most of them the error format is something a consumer finds out at runtime. More than a quarter, 27.8 percent, attach no security requirement to any endpoint, and 20.5 percent define no security scheme at all. Even the version numbers start on shaky ground, because only 31.8 percent of them follow the x.y.z shape that semantic versioning expects. We also ran the neutral core of our own built-in style guide rules, which leaves casing and other house style aside. By that measure, 98.1 percent of the specs have at least one finding, and the median spec has 13. These are Routebase's rules and therefore a convention rather than a standard. ## How to catch this in your own APIs The providers in this study aren't careless. A contract changes because the code behind it changes, and nothing in a typical release process compares the new contract with the one consumers already rely on. That comparison is cheap once it runs automatically, and it belongs in two places, at the moment a new version is published and while the API is running. When you publish a new version in Routebase, it compares the spec with the previous version using the same breaking-change rules this study used, and it suggests the version bump those changes call for. A branch that removes a field or adds a required parameter is flagged as breaking on its merge request, and you can require an Admin or Owner to approve it before it merges. The rules and what counts as breaking are explained in [API breaking changes](https://routebase.dev/guides/api-versioning/api-breaking-changes/). For the changes that ship without a new spec version at all, drift monitors compare the live API with the published spec field by field. Contract tests run from the same spec as well. When the spec says a product carries a `currency` field and the live API doesn't return one, the test goes red in CI before a consumer sees the gap. The production side is covered in [contract drift monitoring](https://routebase.dev/guides/api-monitoring/api-contract-drift/), and agents that work on the spec over MCP pass through the same checks. ## Method - **Corpus.** [APIs-guru/openapi-directory](https://github.com/APIs-guru/openapi-directory) at commit `f04b8d0bcd39c52e1cf3ad7a5fe744709832ae49`, with the directory's `list.json` read on September 14, 2026. Contributed definitions are CC0, and definitions taken from public sources are listed under fair use. - **Re-fetch.** Every origin URL whose source format is Swagger 2.0 or OpenAPI 3.x, fetched once on September 14, 2026, with a 20-second timeout and no retries. - **Engine.** The parser, style guide rules and breaking-change detection of the Routebase product, run from a console harness without a database. - **Comparison.** Path placeholders are compared by position and local references are inlined before the diff, because a renamed placeholder or a moved schema is invisible on the wire. Pairs that reference other documents are left out. - **Weighting.** Every share is reported raw and with each provider weighted equally. - **Review.** Ten breaking-change verdicts drawn at random were read by hand against both documents, and the comparison rules above come from that review. - **Data.** Tables, pseudonymised raw data and the aggregation script are in [routebase-dev/openapi-corpus-study](https://github.com/routebase-dev/openapi-corpus-study). Data and tables are CC BY 4.0, and the script is MIT. --- # Where Should Your OpenAPI Spec Live? — Routebase > Repo or hosted is the wrong question. What decides whether your API has one contract or several is which copy the others derive from, and who runs that step. Canonical page: https://routebase.dev/blog/where-should-your-openapi-spec-live/ Published: 2026-09-15 · The Routebase Team · OpenAPI, API Design, Documentation Every corporate lobby has the same wall, with four identical clocks in a row, one per office. It works because each clock is labelled with a different city. Now imagine the same four clocks, all labelled with the same city, showing four different times. Nobody standing in front of that wall asks which clock is broken. They ask which one is *right*. There is no way to tell from looking, because all four are running, all four look official, and each one was correct on the day somebody set it. That is the state of the API contract at most companies, and it is not fixed by deciding where the spec file goes. ## The argument everyone has instead Ask where an OpenAPI spec should live and you get a storage answer. It belongs in the repo, next to the code, in version control, like every other artefact. Or it belongs in a tool, where people who do not have a Git client can reach it. Teams argue this for an afternoon, pick the repo, and consider the matter settled. Then someone counts, and the spec turns out to live in four places. There is the YAML in the repo and the docs portal that was generated from it in March. There is the Confluence page a solutions engineer maintains by hand, and the PDF a partner was emailed at integration time and has been building against ever since. All four are real. All four are being read. None of them is labelled with the version it came from. The storage question was answered. The contract still has four values. ## What the repo is genuinely good at It is worth being precise about this, because the case for keeping the spec in Git is strong and mostly correct. The spec becomes a build artefact. It moves with the branch, so a feature that changes the API changes the contract in the same commit, and the two cannot be merged apart from each other. Review happens where review already happens, in a pull request with the same reviewers, the same threads and the same approval rules the team already agreed on. It does not happen in a second tool with a second set of permissions nobody audits. CI can gate on it, so it can lint the document, diff it against the previous version, and fail the build on a breaking change before it reaches anyone. `git blame` on a schema line answers "who changed this and why" better than any audit log, because it lands you in the commit, the pull request and the discussion in one step. And there is no lock-in worth the name. It is a text file in a directory. If the tooling around it disappoints you, you keep the file. Anyone who tells you this is a bad setup is selling something. It is a good setup. It just does not answer the question the four clocks are asking. ## The moment a copy is born Watch where a spec-in-the-repo actually breaks, and it is never at the repo. It is at the first reader who cannot get to it. A support engineer needs to know whether `status` can still return `pending`. A partner integrating next month wants the current contract. A QA lead is writing a regression plan, product is scoping the next quarter, and a customer's developer, who will never have access to your repository under any circumstances, is building against your API today. Increasingly the reader is not a person at all but an agent that reads the contract and calls the endpoint without asking anyone first. Every one of them gets served the same way. Somebody exports the file, or pastes it into a wiki, or attaches it to an email, or publishes a portal and does not publish it again. That is the moment the copy is born, and from that second on it is a *statement about the past* that looks exactly like a statement about the present. The copies are not the failure. Copies are how a contract reaches the people who need it. The failure is that none of them carries the one piece of information that would make it safe to read, namely which version of the source it came from. _Figure: Four surfaces derived from the same spec, none of them stamped with the version it came from, so the question 'which one is current?' has no answer you can look up. Stamping them does not stop two of them from falling behind. It just means you can see which two._ ## The question worth arguing about Replace "where should the spec live" with three questions that actually have consequences. **Can someone without repository access read the current contract without being sent it?** If the honest answer is "they ask us and we export it", you do not have one contract. You have one contract and an unbounded number of snapshots in other people's inboxes, with no way to recall them. **When the spec changes, is there a named step that brings the derived surfaces forward, or does somebody have to remember?** A portal, a mock, a test suite and a generated client are all downstream of the same document. "We regenerate when we think of it" is not a process. It is a person, and that person will be on holiday during your next breaking change. **Can you tell, by looking at a copy, which version it came from?** This is the cheapest of the three and the one most often skipped. An unstamped copy cannot be triaged. A stamped one can be, in seconds, by someone who was not involved. Notice that none of these is a hosting question. A disciplined Git-first setup answers all three. The spec in the repo is the source, CI regenerates the portal and the clients on every merge and publishes them, and each artefact carries the commit it was built from. That works. It is a pipeline you build and then maintain, and the maintenance is the part teams underestimate, because it is invisible right up until the day it silently stops running. The hosted answer moves the same responsibility into a tool, where the source sits somewhere non-developers can reach without asking, and publishing is an act with a record. That works too, and it also has a cost, because it is one more system, with credentials, and a place where the spec can be edited outside your review process if you let it. Both need discipline. They just need it in different places, and the useful comparison is which kind of discipline your team actually sustains, not which architecture reads better in a blog post. ## How we treat it, and what we deliberately do not do Routebase keeps the spec in a system rather than a file, so the second and third questions have structural answers. But it is worth being exact about what that does and does not mean, because this is the area where API tooling routinely overpromises. A version is `draft`, `review`, `published` or `deprecated`. While it is a draft, it moves. Once it is published, it is frozen on purpose, because a version that changes underneath a reader is not a version. The whole point of stamping a copy is defeated if the thing it points at is a moving target. What we do **not** claim is that everything downstream stays in sync by itself. It does not. When a published spec moves on, a mock or a test suite pinned to the older version stays where it is, and the honest description of what the product gives you is *detection*. It compares what the surface was built from against the current contract and shows you the gap, and pulling it forward is a step someone takes. The clocks still drift. You can see which ones. And the repo stays in the picture rather than being replaced. The spec exports as YAML, JSON, Postman or Insomnia, which is the file you would have had, when you want it. Documentation is genuinely docs-as-code in both directions. The CLI pulls a version down to Markdown files and pushes edits back, and it exits with a conflict code rather than overwriting when a page moved remotely in the meantime. And after a deploy, CI can pin the version an environment is running with a single command. That is how the environment stops being folklore and starts being a fact you can assert in a test. If you are working out how the pieces fit together, from design and review to mock, test, and publish, we lay out that shape in more detail on our [API design](https://routebase.dev/api-design/) page. ## The wall of clocks The reason the lobby wall works is not that the clocks are accurate. Clocks drift, because that is what clocks do. It works because each one is labelled, so a wrong clock is a visibly wrong clock rather than a plausible one. Your spec does not need to live in any particular place. It needs one location that everybody agrees is the source, and a way for people without repository access to read it without being sent a copy. It also needs a stamp on everything derived from it saying where it came from. Get those three right and the storage argument answers itself, in either direction, which is the honest conclusion. Get them wrong and it does not matter how good your YAML is. There will be four clocks on the wall, all of them running, and the next person who needs the right time will pick one. --- # Why API Style Guides Fail With Too Many Rules — Routebase > Most style guides fail with too many rules, not too few. The work is deciding which rules stop a build, which leave a note, and which you will never enforce. Canonical page: https://routebase.dev/blog/what-belongs-in-an-api-style-guide/ Published: 2026-09-01 · The Routebase Team · API Design, Governance, OpenAPI Someone adds a rule that paths must be kebab-case. It is a good rule. Two days later the build is red on an API that has shipped `/orderItems` for three years, and the only change that would make it green renames forty-one paths and breaks every consumer at once. Both sides of that argument are right, which is exactly what makes it a bad fight to have in a pull request. The rule is correct. The cost of applying it to this API is also correct. What is missing is the thing a style guide is supposed to provide, which is a decision, made once and written down, about which of those two facts wins here. Most guides never make that decision. They collect rules instead, because collecting is easy and deciding is not. ## Rules are the cheap part Routebase ships built-in rules across five categories, which are naming, completeness, best practice, security, and structure. Writing that list was the least interesting work in the whole feature. Any team can produce fifty rules in an afternoon, because the OpenAPI specification alone suggests most of them, and the rest are one argument about plurals away. What the list cannot tell you is what should happen when a rule fires. And that is the entire question, because a finding that does not change anyone's behaviour is not governance. It is noise with a line number. ## Three kinds of finding, wearing the same badge Run any linter over a real spec and the output arrives as one flat list. It is not one kind of thing. **Something is broken.** A `$ref` points at a component that does not exist. A path declares `{orderId}` and no parameter defines it. An example does not validate against the schema it illustrates. These are not opinions. The document is wrong, tooling downstream will fail on it, and nobody will defend it in review. **Something is inconsistent.** Half the paths are kebab-case and half are camelCase. Two operations share an `operationId`. The document works. It is merely irregular, and the irregularity costs the next reader a moment each time. **Something is a preference.** Whether every operation carries a `license` block, whether tags need descriptions, whether error responses are enumerated per-operation or once at the top. Reasonable teams differ, and the API is perfectly usable either way. Only the first kind has an obvious answer. A dangling `$ref` should stop a build. A missing license block should not, and if your guide treats them the same, you have not built a standard. You have built a wall of red. ## The severity is where the thinking goes Every rule in Routebase sits at one of four levels, `Off`, `Info`, `Warning`, or `Error`. Choosing among them is the real work. The useful question is not "is this rule good?" but "what do I want to happen at three in the afternoon when this fires on someone else's pull request?" - **`Error`** means stop. Reserve it for the broken class, plus the handful of security rules where the cost of shipping is genuinely worse than the cost of blocking, such as an API key accepted in a query parameter or a server URL still on plain HTTP. - **`Warning`** means fix it when you are here anyway. Most naming and completeness rules belong here for their whole life, and that is not a failure state. - **`Info`** means the guide has an opinion and is not going to insist. Useful for rules you are still socialising. - **`Off`** means you looked at it and decided no. That last one deserves defending, because switching a rule off feels like losing. It is the opposite. An enabled rule that everyone has learned to scroll past is worse than a disabled one, because it costs the same attention on every run and buys nothing. It also teaches the team that findings are background texture. A guide of fifteen rules that people act on beats one of several dozen that people mute. _Figure: A dashboard where every lamp is lit tells you nothing, because the one warning that matters arrives in the same colour as eleven you have already learned to ignore. Turning the other eleven off is what makes the twelfth mean something._ ## Where a rule lives matters as much as what it says The kebab-case fight at the top has a real answer, and it is not "give up" or "rename forty-one paths". In Routebase, severity is set per rule at the organisation level and can be overridden per project, with a reset that drops the project back to inheriting. So the house standard stays `Warning` for every new API your team designs, and the one legacy service that will never be renamed sets that single rule to `Off` in its own project. Nobody argues in a pull request, because the argument already happened once, in the place where it belonged. Treat the override as the feature it is, not as a loophole. A guide with no escape hatch does not produce compliant APIs. It produces teams that stop running the guide. The escape hatch is why every other rule still applies to that legacy service. ## What does not belong in a style guide Three things, reliably. **Anything without a machine-checkable condition.** "Endpoints should be intuitive" is good advice and a bad rule. If a person has to judge it, it belongs in a review, a design document, or a conversation, and not in a linter that will either never fire or fire on everything. **Anything nobody can justify.** For each rule, someone should be able to say what goes wrong when it is violated. If the honest answer is "that is how we have always done it", the rule will not survive its first real disagreement anyway. In the meantime it will cost you credibility for the rules that matter. **Anything that duplicates the specification.** OpenAPI already rejects a malformed document. A style guide that re-litigates syntax adds findings without adding information. Where a rule *is* checkable but specific to your house, such as an internal header that must appear on every operation or a naming prefix your platform requires, custom rules are declarative rather than scripted. They consist of a target, a condition type, the field it applies to, and the value to compare against. That constraint is deliberate. A rule you can read at a glance is a rule the next person can change without archaeology. ## Start with the spec you already have The worst time to write a style guide is on an empty page, because everything seems reasonable in the abstract and you will enable all of it. Run a draft guide against an API you already shipped instead. The output is your actual agenda, because every finding is either something you genuinely want fixed, something you want noted, or something you now know to switch off. Sorting that list once is a couple of hours, and it produces a guide calibrated against reality rather than against a blog post, including this one. That sorting is also where a style guide stops being a document and becomes part of the workflow. It is worth checking where the guide runs in your toolchain. A linter that only exists on someone's laptop enforces nothing. One that runs in the same place your specs are designed, reviewed and published gets to catch things before the pull request rather than after. If you are weighing that up, [our comparison with Stoplight](https://routebase.dev/stoplight-alternative/) lays out where the style guide sits when linting is one stage of the lifecycle rather than the whole product. None of this makes the kebab-case argument disappear. It just makes it happen once, in the open, at organisation level, instead of every time somebody opens a pull request against the wrong service. That is all a style guide really buys you, and it is worth a great deal more than the rule count on the front of it. If you are working out where the guide sits in the rest of the picture, our [API governance guide](https://routebase.dev/guides/api-governance/) covers the same ground at length, from what belongs in the guide through to rolling it out without stopping the team. The product side, from the severity table to the shared library and the switch that turns enforcement on, is on the [API governance](https://routebase.dev/api-governance/) page. --- # API Descriptions That Pass the Linter and Fail the Agent — Routebase > A linter flags a missing description, not a useless one, and the useless one is what an agent chokes on. What to write, what to leave out, and how to test it. Canonical page: https://routebase.dev/blog/api-descriptions-llms-can-use/ Published: 2026-08-25 · The Routebase Team · AI Agents, OpenAPI, API Design Here is a description that passes every completeness check we know how to write: ```yaml /deployments: post: summary: Create deployment description: Creates a new deployment. ``` Nothing is missing. There is a `summary`, there is a `description`, both are non-empty strings. Run it through a style guide and it comes back clean. Now read it as the only thing you know about this endpoint. What is a deployment here? Can you create one for any environment, or does something have to exist first? Does it return the finished thing, or start something that finishes later? You cannot answer any of that, and neither can an agent, which is why it will call this endpoint with a plausible guess and report success it has no evidence for. We have written this wrong at least as often as anyone. This is the checklist we now use. ## What a linter can see, and where it stops Routebase ships six built-in rules that look at descriptions, because operations, summaries, schemas, responses, parameters, and tags each have one. Every one of them is the same check underneath, asking whether this field is empty or whitespace, and they are graded accordingly. A missing operation description is a warning. A missing parameter description is an information notice. That is the correct design, and it is worth being precise about why. Presence is machine-checkable, while usefulness is not. No rule can decide whether *"Creates a new deployment."* tells a reader something they did not already know, because answering that requires knowing what the reader already knew. So linting gives you the floor, which is that every description exists. Everything above the floor is a writing problem, and it stays a writing problem no matter how many rules you add. The trap is that a clean lint report reads like a finished job. ## The four questions A description is doing its job when a reader who has only the contract, with no tribal knowledge, no colleague to ask, and no staging environment to poke, can answer these: 1. **What does this do,** in terms of the domain rather than the mechanics? 2. **When do I use this one** instead of its neighbours? 3. **What has to be true first**, such as required state, prior calls, or ordering? 4. **What comes back, and what do I do next** with it? Question 2 is the one that gets skipped, and it is the one agents fail on. A human choosing between `POST /deployments` and `POST /config-snapshots` reads both, forms a theory, and tries one. An agent is doing the same thing with far less context and no way to notice that its theory was wrong until something downstream breaks. Applied to the example: ```yaml /deployments: post: summary: Deploy a config snapshot to an environment description: > Starts a deployment of an existing config snapshot to one environment. Create the snapshot first with POST /config-snapshots — this endpoint does not capture the current configuration, it only ships a snapshot that already exists. Returns 202 with a deployment id. The deployment is not finished when this returns; poll GET /deployments/{id} until status is "succeeded" or "failed". ``` Longer, yes. Long enough to answer all four questions, and no longer, because the prose is four sentences. ## The most common failure is a description that restates the name `POST /deployments` → *"Creates a new deployment."* The method said "creates", the path said "deployments", and the description spent a line saying both again. It costs the reader a line and returns nothing. We hold our own tooling to this. The rule set behind Routebase's description suggestions says, in as many words, not to repeat the HTTP method or the path. It also says to describe what the endpoint does rather than how it works internally. Those two instructions kill most bad descriptions on their own. The reason a restated name is worse than an empty field is that it looks handled. An empty description is visibly a gap, and someone eventually fills it. *"Creates a new deployment."* closes the ticket. ## Descriptions below the operation level Operation descriptions get the attention. The ones that actually decide whether a call is correct usually sit further down. **Enums.** An enum tells a model which values are legal and nothing about what they mean. Take `status: ["pending", "active", "suspended", "closed"]`. Is a suspended account billable? Can a closed one reopen? If the difference matters to the caller, it belongs in the description, per value. **Parameters that look obvious.** Every API has `limit`, `since`, and `filter`, and no two agree. What is the maximum for `limit`, and what happens if you exceed it, a clamp or a 400? Is `since` inclusive? Answer it once in the parameter description and stop answering it in support threads. **Fields whose name is a lie by omission.** Is `email` required, or is it the address the invitation goes to? Is `amount: 1250` $12.50 in cents or $1,250.00 in whole units? The schema says `integer`, and both readings are type-correct. The description is the only place the unit can live. _Figure: The same type-correct field, charged twice. With the description slot empty, nothing says what 1250 counts, so the agent reads dollars and moves a hundred times the intended money, while schema and linter stay green in both rows. One sentence in that slot is the difference between $1,250.00 and $12.50, because for the unit, the description is the entire contract._ We learned this from the other side of the table. Routebase's own MCP server exposes a large tool surface, and one convention has earned its keep more than any other. Where a parameter takes a fixed set of actions, the description enumerates every legal value, because that description is the only place an agent ever sees them. The parameter is typed as a string, and the error thrown on an invalid value repeats the same list. Anything left out of that sentence does not exist as far as the model is concerned. That generalises past our own tools. The description is not commentary on the contract. For everything the type system cannot express, such as units, bounds, inclusivity, and meaning, it *is* the contract. ## What to leave out - **Internal implementation.** Which service handles it, which queue it lands in, which table it writes. It is noise to a caller and a liability the day it changes. - **Interface instructions.** "Click Save to confirm." There is no Save button in a `POST`. - **Restating the schema.** The schema already says `string`, `required`, `maxLength: 200`. Do not paraphrase it, and say what a valid value *means*. - **Marketing.** "Our powerful deployment engine." No consumer, human or otherwise, has ever made a better call because of a sentence like this. ## How to tell whether it worked The honest test is cheap. Hand the endpoint to an agent with no context beyond the contract and ask it to perform a real task. Watch which endpoint it picks, which parameters it fills, and where it invents a value. Every guess it makes is a sentence you did not write. This is uncomfortable in the specific way good tests are uncomfortable, because it finds the gaps you had stopped seeing, since you have known the answers for two years. Then do the work, which is mostly not thinking. Reading several hundred descriptions, finding the ones that restate their own name, and writing the units into the fields that lack them is transformation work. It is what an agent connected to the [Routebase MCP server](https://routebase.dev/mcp-server/) is for. It proposes the rewrite, you accept or reject it, and what lands in the spec is a diff you approved rather than a paragraph you typed. The descriptions your agents will read can be drafted by one, as long as a person still signs off. None of this is new advice. Descriptions have always been the part of a spec that decides whether anyone can use it without asking you first. What changed is that the reader who cannot ask you is now most of your traffic, and [the way you design the rest of the API](https://routebase.dev/blog/designing-agent-ready-apis/) has to hold up under the same reader. The OpenAPI guide covers the same ground inside the document, in [descriptions an agent can use](https://routebase.dev/guides/openapi/openapi-descriptions-for-agents/), and the documentation guide covers the pages around it, from [writing the reference](https://routebase.dev/guides/api-documentation/how-to-write-api-documentation/) to [what an agent can read from a published portal](https://routebase.dev/guides/api-documentation/api-documentation-for-ai-agents/). The product side of all four questions, and of the errors and the portal around them, is on the [agent-ready APIs](https://routebase.dev/agent-ready-apis/) page. --- # Migrating from Postman to an OpenAPI-First Workflow — Routebase > The Postman migration everyone postpones is mostly mechanical, and that is agent work. How an AI over MCP imports collections and rebuilds your assertions. Canonical page: https://routebase.dev/blog/migrating-from-postman-to-openapi-first/ Published: 2026-08-14 · The Routebase Team · OpenAPI, Postman, Migration Almost nobody migrates off Postman because Postman is bad at being Postman. Teams migrate because of something that happened without anyone deciding it. The collection became the documentation. Then it became the contract. And a collection was never designed to be either. The difference is easy to state and easy to miss. A collection is a record of *calls that worked*, meaning this URL, these headers, this body, and whatever came back that one time. A spec is a statement about *what the API promises*, meaning these fields always exist, this one is optional, this enum has exactly four values, and this endpoint can fail this way. One is a transcript. The other is a contract. Most teams know this. They postpone the move anyway, and always for the same reason, which is that somebody estimates it in weeks. Six hundred requests, years of accumulated test scripts, and environments nobody fully understands add up to a quarter of work with no feature at the end of it. That estimate was correct until recently. It isn't anymore, and the reason is worth being precise about. ## Why this is agent work Look closely at what a migration actually consists of, and there are no hard decisions in it. There is a large amount of **transformation**. This Postman field becomes that OpenAPI field, this `pm.test` line becomes that assertion row, and this `{{authToken}}` becomes that environment variable. Every step is well-defined, every step is verifiable, and there are thousands of them. That is the exact shape of work that is miserable for a person and trivial for a machine. What made it a quarter-long project was never difficulty. It was volume. _Figure: Broken down, a migration is several hundred transformations of half a dozen kinds, each one mechanical and verifiable, plus a handful of calls that genuinely need judgement. Those are which enums are really enums, what the saved examples never showed, and which scripts stay code. The quarter-long estimate came from the first number. The second is the part that stays with you._ The reason an agent can now do it end to end is that every one of those steps is a **tool call**, not a click. Routebase ships an [MCP server](https://routebase.dev/mcp-server/) on every plan with tools covering the same operations your team performs in the UI, under the same role-based permissions. Connect Claude, Cursor, or your agent of choice, point it at your collection export, and the migration becomes something it can actually perform. It imports the spec, corrects the schemas, rebuilds the suites, runs them, reads the failures, and fixes them. Here is what that looks like, step by step, and where you still matter. ## Step 1: Import, with a dry run first Hand the agent your collection export and it can preview the result before anything is written. A validation call in import mode returns exactly what the real import would create, namely the endpoint, schema and folder counts, plus every warning, and it writes nothing. The collection is recognized as a Postman file automatically, so nobody has to tell it what format it's looking at. The structural mapping is more faithful than people expect: - **Folders become tags.** A request inside a `Customers` folder comes out tagged `Customers`. Nested folders collapse to the innermost name, so a request in `API / v2 / Customers` gets one tag, `Customers`. - **Request names become summaries.** Whatever you called it in the sidebar is now the human-readable name of the operation. - **`:id` segments become path parameters.** `{{baseUrl}}/customers/:customerId` becomes `/customers/{customerId}` with a declared, required path parameter. - **Query params and headers become parameters**, minus the ones the client generates anyway (`Content-Type`, `Host`, `User-Agent` and friends), which would be noise in a spec. - **Saved responses become response schemas**, inferred from the example body. - **Auth becomes a security scheme**, at collection level and per request. So this request: ```json { "name": "Get customer", "request": { "method": "GET", "url": { "raw": "{{baseUrl}}/customers/:customerId?include=invoices", "path": ["customers", ":customerId"], "query": [{ "key": "include", "value": "invoices" }], "variable": [{ "key": "customerId", "value": "c-1024" }] }, "header": [{ "key": "X-Tenant-Id", "value": "acme" }] }, "response": [{ "name": "200 OK", "code": 200, "body": "…" }] } ``` The saved `200 OK` body is an ordinary customer record: ```json { "id": "9f2c1d4e-5b6a-4c3d-8e7f-0a1b2c3d4e5f", "email": "ada@example.com", "createdAt": "2026-03-04T09:12:00Z", "plan": "pro", "seats": 12 } ``` comes out as this operation: ```yaml /customers/{customerId}: get: summary: Get customer tags: [Customers] parameters: - name: customerId in: path required: true schema: { type: string } - name: include in: query required: true schema: { type: string } - name: X-Tenant-Id in: header required: false schema: { type: string } responses: "200": description: 200 OK content: application/json: schema: type: object required: [id, email, createdAt, plan, seats] properties: id: { type: string, format: uuid } email: { type: string, format: email } createdAt: { type: string, format: date-time } plan: { type: string } seats: { type: integer } ``` Look closely at `include`. In Postman it was an enabled row in the query table, which is all a query row can be, so it arrived as `required: true`. If `include` is really an optional filter, that line is wrong. That is the point of the whole exercise. The import produces a structurally valid spec, and then somebody has to supply the intent that was never written down. The warnings tell you where. Pre-request and test scripts, collection variables beyond the base URL, duplicate requests merged into one operation, and duplicate parameters dropped are each flagged, with the request they came from. Traditionally that list is the reason migrations stall, because it is a few hundred lines of "you'll want to look at this." For an agent it's the opposite, a work queue that is already itemized and already located. ## Step 2: Closing the inference gap Inferred schemas are better than nothing and worse than they look. The example above is a fair result. The types are real, the `uuid`, `email` and `date-time` formats were recognized from the values, and `seats` came through as an integer rather than a string. But every line of it was derived from **one recorded response**, which produces three predictable errors. **Everything present became required.** `plan` and `seats` happened to have values in that body, so both are now required. If a trial account returns no `seats`, the spec is wrong in the direction that breaks generated clients. **Everything absent doesn't exist.** Optional fields the example didn't include aren't marked optional. They're missing entirely. Consumers will discover them in production and depend on them anyway. **Nothing knows its own range.** `plan: "pro"` is `type: string`. It is almost certainly an enum with three or four members, and that enum is one of the most valuable things you can write down. _Figure: Every failure has the same cause, because a single saved example is the entire evidence base and only a narrow window onto the contract. Everything inside the window hardens on its way into the schema, so present values become required and a string that is really an enum stays a string. Everything outside it simply doesn't exist. The fields the example never carried aren't marked optional, they are missing entirely, with nothing to flag the gap._ Here the agent has an advantage no single import pass has, because it can read your *entire* collection at once. Four saved responses for the same endpoint, scattered across four duplicate requests, are four observations of the same schema. A field that's present in three of them and absent in the fourth is demonstrably optional. The same sweep surfaces the enum members, the nullable fields, and the formats that only one example happened to show. It then corrects the spec directly, with parameters updated, schemas rewritten, and responses added. Then there's the half of the contract that collections rarely record at all, the failures. Most saved responses are the happy path, because that's what you were debugging when you hit **Save**. So a freshly imported spec often documents every success and no errors, while `401`, `404`, `409` and `422` are exactly the responses consumers write code against. An agent that has read your handlers or your error middleware can draft those too, ideally in a [consistent error format](https://routebase.dev/blog/consistent-error-handling-rfc-9457/), and you review the result rather than typing it. ## Step 3: Every script has a destination This is the part everyone braces for, and the fear is misplaced. Yes, your `pm.test("status is 200", …)` JavaScript does not survive the import, because assertions were never part of the OpenAPI contract. But "doesn't import" is not the same as "has nowhere to go." Sort your scripts by what they actually do, and each group has a specific home. **Checks become assertions.** The overwhelming majority of `pm.test` bodies verify something about a response. That translates into a row of data with a type, an operator, a target, and an expected value, across six assertion types and ten operators. `pm.response.to.have.status(200)` becomes a `status` / `equals` / `200` assertion. `pm.expect(json.plan).to.eql("pro")` becomes a `jsonPath` assertion on `$.plan`. This is the single best case for handing work to a machine, because the target is structured data. Instead of writing logic you'd have to audit line by line, the agent is filling in fields you can read in a diff. **Token stashing becomes response extraction.** The classic `pm.environment.set("token", json.access_token)` at the end of a login request becomes an extraction rule that captures `$.access_token` from the response into a runtime variable that later steps reference as `{{token}}`. That rule is declarative, inspectable, and no longer invisible in a script tab. **Chained requests become scenarios.** The sequence you encoded by ordering requests in a folder and passing variables between them becomes an explicit multi-step scenario, with the extraction rules wiring one step's output to the next step's input. **Environments become environments.** Every `{{apiVersion}}`, `{{tenantId}}`, `{{authToken}}` the importer warned about is a value with a proper place in environment variables and auth schemes, with secrets marked as secrets instead of sitting in a collection file that gets shared. **And genuinely computational logic stays code.** Signing a request, computing an HMAC, or deriving a nonce is real work a script should do, and it belongs in a reusable pre-request or post-response snippet. Note the word *reusable*, because the same signing logic copy-pasted into forty Postman requests becomes one snippet referenced forty times. The migration is where that duplication gets collapsed. So the honest count isn't "your scripts are lost." It's that most of them stop being scripts, a few stay scripts and get deduplicated, and an agent can place every one of them. ## Step 4: The loop that makes this trustworthy Everything above would still be a leap of faith if the output were only generated. It isn't, because the agent can check its own work, and this is the part that separates a migration you can trust from a pile of plausible YAML. The same MCP connection that creates a test suite can **run** it. So the loop closes: 1. Import the collection, correct the schemas, rebuild the suites. 2. Lint the spec against your style rules, and fix what the linter reports. 3. Run the suites against a real environment. 4. Read the failures, because a failure here is *information*, not a setback. Each one is either a test the agent got wrong, or a place where your collection was already lying about your API. 5. Fix and repeat until it's green. That fourth step is the one worth sitting with. A failing assertion after migration usually isn't a migration bug. It's a contract violation that has been in your API for months, invisible because the collection recorded what the API *did* rather than what it *promised*. The migration finds them because, for the first time, something is comparing the two. None of this runs unsupervised in a way you can't see. The agent works through the same permission system as your team, where creating specs needs `specs:write` and touching tests needs `tests:write`. What an agent may do is what its role allows, and every change is a diff you can review before it ships. ## Step 5: One artifact instead of several Once the spec is honest, the payoff isn't "we have a spec now." It's that mocks, docs, and tests stop being separate objects kept aligned by hand. In the collection world, a [mock server](https://routebase.dev/api-mocking/), a docs page, and a monitor each encode their own copy of the contract, and each drifts on its own schedule. Derive all of them from one spec and there is nothing left to synchronize, not because the sync got better, but because there is only one document to change. That is also the most practical defence against [contract drift](https://routebase.dev/blog/why-openapi-specs-drift/), because the drift you never have is the drift between artifacts that don't exist separately. ## What stays in Postman Probably a scratchpad, and that's fine. Poking at a third-party endpoint, reproducing a bug with a hand-edited header, or trying something once is what a request client is good at, and none of this removes the need. The distinction worth keeping is which artifact is allowed to be the source of truth. A scratchpad nobody treats as documentation is a useful tool. A scratchpad that quietly became the contract is how you got here. ## Start with one folder You do not have to commit to the whole collection to find out whether this works. Export one folder with a dozen requests you know well, connect an agent to your workspace, and let it run the loop of import, correct, rebuild, and run. You'll have a governed spec, working test suites, and a mock server for that folder in an afternoon, and a precise sense of what the remaining folders will cost. The reason to do it now rather than next quarter is simply that the estimate changed. The migration was always mechanical. What's new is that mechanical work no longer has to be done by the person who understands the API. Their job is to review it, which is the only part that ever needed them. The [migration page](https://routebase.dev/migrate-from-postman/) has the mapping and the FAQ in one place. [Import your collection](https://routebase.dev/postman-alternative/) and see what the first pass gives you. Even the warning list is a useful read. --- # Why Your OpenAPI Spec Drifts (and How to Catch It) — Routebase > Every API contract decays once nothing enforces it. The four ways specs drift, why code generation does not save you, and how to make the spec true again. Canonical page: https://routebase.dev/blog/why-openapi-specs-drift/ Published: 2026-07-24 · The Routebase Team · OpenAPI, Contract Testing, API Design Every team with an OpenAPI spec believes the same comforting story, which is that the spec describes the API. And on the day it was written, it did. But specs and implementations are maintained by different forces, one by discipline and the other by deadlines, and the moment nothing *enforces* their agreement, they start to diverge. That divergence has a name, contract drift. It's rarely dramatic. Nobody deletes an endpoint from the spec while it keeps serving traffic. Instead, a field quietly becomes nullable. An enum grows a value. An error response changes shape. Each change is small, defensible, and invisible, until a consumer built against the spec meets the API that actually exists. ## The four ways specs drift Drift isn't one failure mode. In practice it's four, and they have different causes and different fixes. _Figure: Three of the four modes are production walking away from a spec that never moves, namely the hotfix nobody backported, the field shipped undocumented, and the behavior the generator can't see. The fourth is different in kind, because the multi-consumer fork splits the spec itself into copies, so the contract frays at both ends at once._ **1. The hotfix that never made it back.** Production is down, someone patches the handler, the incident closes, and the spec still describes the old behavior. This is the most common source of drift and the most forgivable, because under pressure, the spec is nobody's priority. The problem is that "we'll update it later" has no owner and no deadline. **2. The undocumented addition.** A new field ships because a frontend needed it. It works, everyone moves on, and the spec never hears about it. Additive changes feel safe, because no consumer breaks *today*, but every undocumented field is behavior consumers will discover, depend on, and treat as contract. Now you have an API surface you never designed and can't safely change. **3. The generator gap.** "We generate the spec from code, so it can't drift." It can, because it just drifts differently. Generated specs faithfully describe your DTOs and routes, but the contract is more than shapes. It includes validation rules living in handler logic, error responses produced by middleware, fields serialized conditionally, and side effects nobody annotated. The generated spec is precise about what the framework knows and silent about everything else, and the silence reads as documentation. **4. The multi-consumer fork.** The mobile team works from the spec in the repo. The partner integration got a YAML export from March. The [mock server](https://routebase.dev/api-mocking/) the frontend develops against was configured by hand in April. There is no single drifted spec. There are several versions of the truth, and every consumer is right according to one of them. ## Why you don't notice until it hurts Drift has a perverse property, because it's cheapest to fix when it's invisible and most visible when it's expensive. A stale description costs nothing until a new team member builds against it or a client SDK gets regenerated from it. Increasingly, the reader is [an AI agent that reads it as ground truth](https://routebase.dev/blog/designing-agent-ready-apis/) and calls your API exactly as documented. Agents have made drift more expensive overnight. A human integrator notices when reality disagrees with the docs and works around it, while an agent trusts the contract completely and fails in ways nobody debugs for hours. The instinctive answer is process, meaning "update the spec with every change" as a review checklist item. It fails for the same reason all unenforced process fails, because it depends on the person under the most time pressure remembering the step with the least visible payoff. Checklists don't catch drift. Machines do. ## Catching drift mechanically The teams that keep specs honest all converge on the same principle, which is that **the contract must be checked against reality by something that never gets tired.** There are three layers, in increasing order of confidence. _Figure: Drift can't be prevented, so the only variable is who discovers it. Without checks, the same divergence lives on unnoticed until a consumer hits it in production, while with the contract checked mechanically, it is caught minutes after it appears. The orange stretch, meaning the time a drift spends undetected, is where the cost accumulates._ **Diff every change.** Treat the spec like code, so every modification produces a diff, and breaking changes such as removed fields, narrowed types, and new required parameters are flagged before they merge, not after a consumer reports them. This catches drift *within* the spec's own history. **Validate responses against the schema.** Contract tests take each documented endpoint, call the real implementation, and check the response against the declared schema. Undocumented fields, surprise nullables, and changed error shapes surface as failing checks instead of consumer bug reports. This is where the generator gap and the hotfix gap actually get caught, and it's why we built schema drift checks and contract monitoring into [Routebase](https://routebase.dev/api-testing/). The same spec that renders your docs is continuously checked against live responses, and violations show up as findings, not folklore. The mechanics, and where a contract test stops and an integration test starts, are in [Contract Testing vs. Integration Testing](https://routebase.dev/guides/api-testing/contract-testing-vs-integration-testing/), and the production half of it is [contract drift monitoring](https://routebase.dev/guides/api-monitoring/api-contract-drift/). **Make the spec the artifact everything derives from.** Mocks, docs, SDKs, and tests generated from one spec can't fork from each other. The OpenAPI guide walks through [what actually comes out of one document](https://routebase.dev/guides/openapi/what-you-derive-from-openapi/), and this is the [design-first argument](https://routebase.dev/blog/design-first-vs-code-first/) in its most practical form, not as an aesthetic preference, but as the only structure in which "update the spec" and "change the API" are the same act. ## The test that settles it Here's a diagnostic you can run this week. Take your spec, generate a client from it, and run that client against production. Every failure is drift you already have, and you just hadn't paid for it yet. A spec that's checked against reality is a contract. A spec that isn't is a rumor with a version number. The difference isn't how carefully it was written. It's whether anything breaks when it stops being true. --- # Consistent Error Handling with RFC 9457 Problem Details — Routebase > Why every API needs exactly one error shape, how RFC 9457 Problem Details provides it, and the conventions that make it stick across every endpoint. Canonical page: https://routebase.dev/blog/consistent-error-handling-rfc-9457/ Published: 2026-07-08 · The Routebase Team · API Design, Error Handling, REST Ask consumers of any mature API where the integration pain lives, and the answer is rarely the happy path. It's the errors, because one endpoint returns `{"error": "invalid input"}`, the next returns `{"message": "..."}` with a `code` field, and a third lets the framework's default HTML error page leak through. Every consumer ends up writing and maintaining a small parser for each variant. This is a solved problem. [RFC 9457 Problem Details](https://www.rfc-editor.org/rfc/rfc9457) defines a standard shape for HTTP error responses, and it's small enough to adopt in an afternoon. The hard part, as with [most API design](https://routebase.dev/blog/api-design-principles/), isn't the format. It's applying it everywhere. This post covers both. ## The shape: five fields and a media type A Problem Details response is a JSON object served with the media type `application/problem+json`. Five members are defined: ```http HTTP/1.1 403 Forbidden Content-Type: application/problem+json { "type": "https://api.example.com/errors/plan-limit-reached", "title": "Plan limit reached", "status": 403, "detail": "Your Team plan allows 10 projects; this org has 10.", "instance": "/orgs/acme/projects" } ``` - **`type`** is a URI that identifies the *kind* of error. This is the field consumers branch on. If omitted, it defaults to `about:blank`, which means "the status code is all the semantics you get." - **`title`** is a short human-readable summary of the type. Same `type`, same `title`, every time. - **`status`** is the HTTP status code, duplicated into the body so the error object stays meaningful when it's logged, queued, or wrapped. - **`detail`** is a human-readable explanation of *this occurrence*. This is the field that varies per response. - **`instance`** is a URI reference identifying the specific occurrence, typically the request path or a trace lookup URL. All five are optional in the RFC. In practice, treat `type`, `title`, `status`, and `detail` as required in your API, because an error without a `type` forces consumers back to string-matching prose, which is the exact failure mode the format exists to prevent. ## `type` is a contract, not a link The `type` URI does not need to resolve to anything, and consumers must treat it as an opaque, stable identifier. But making it resolve to your error documentation is a cheap gift to every developer who hits it in a log at 2am. Two rules keep `type` trustworthy: - **Stable forever.** Renaming an error type is a breaking change, exactly like renaming a response field. Consumers write `if (problem.type.endsWith("/plan-limit-reached"))`, and that string is now part of your [contract](https://routebase.dev/api-testing/). - **One type per distinguishable failure.** If a consumer would plausibly *handle* two failures differently, say retry one and surface the other, they need different `type`s. If not, one type with a clearer `detail` beats an inflated error catalog. Keep a registry of your error types next to your spec, and treat additions the way you treat new endpoints, meaning reviewed, documented, and deliberate. _Figure: Consumers branch on the type URI, which makes every type a load-bearing string, so three types mean three handlers and three working edges. Rename one, say plan-limit-reached to plan-limit, and its edge snaps, because the consumer's branch still matches the old string. Renaming an error type breaks consumers exactly like renaming a response field._ ## Extensions: where your domain fits Problem Details objects are open, so any additional member is an "extension." This is where the format earns its keep, because it gives structured, per-error data a defined home instead of a prose sentence. The canonical example is validation: ```json { "type": "https://api.example.com/errors/validation", "title": "Validation failed", "status": 422, "detail": "2 fields failed validation.", "errors": [ { "field": "email", "message": "must be a valid email address" }, { "field": "plan", "message": "must be one of: free, team, business" } ] } ``` A consumer maps `errors[]` straight onto form fields, with no regex over `detail` and no guessing. The same pattern carries any machine-actionable context, such as a `retryAfter` on rate limits, a `requiredScope` on authorization failures, or a `conflictingResource` on `409`s. The rule of thumb is that if a consumer could *act* on a piece of information, it belongs in a named extension member, not in the prose. Extensions are also your evolution path, because adding a member is additive and safe, so the error schema can grow without [breaking consumers](https://routebase.dev/blog/api-versioning-without-breaking-consumers/). ## One shape means one code path The value of Problem Details is multiplicative, because it pays off only if every error, on every endpoint, uses it. One endpoint that returns `{"error": "..."}` and consumers are back to writing per-endpoint parsers, now with one more variant than before. _Figure: The cost that matters is the marginal one. Without an agreed shape, every endpoint a consumer integrates adds another parser to write and maintain, and the next endpoint you ship adds one more. With one Problem Details shape across the API, the consumer writes a single parser and branches on `type`, and the next endpoint costs nothing at all._ That consistency is not a discipline problem. It's an architecture decision. Errors should be produced in exactly one place, whether an exception mapper, middleware, or error handler at the edge of your stack, and never hand-assembled inside endpoint code. Most frameworks have this built in (ASP.NET Core's `ProblemDetails` support, Spring's `ProblemDetail`, libraries for Express and Go). The checklist: - Every non-2xx response body is a Problem Details object, including `404`s from unmatched routes, `405`s, and auth failures that fire before your handlers run. - The `Content-Type` is `application/problem+json`, so consumers and middleboxes can recognize an error body without sniffing it. - The body's `status` always matches the response's status line. - Unhandled exceptions map to a generic `500` problem, so they must not bypass the mapper and leak a framework error page. The framework defaults get you to "handled exceptions look right." The last two bullets are where audits usually find the gaps. ## What stays out of the error body Errors are a favorite reconnaissance surface, and `detail` is where well-meaning debugging information goes to become an information leak. Keep out of every error response: - **Stack traces and exception class names**, because they document your stack for attackers and nobody else. - **Internal identifiers**, such as database keys, hostnames, and queue names. If support needs a correlation handle, that's what `instance` is for, as an opaque trace ID consumers can quote back to you. - **Existence hints**, such as a `403` that says "you can't access project X" on a resource the caller shouldn't know exists should be a `404`. Decide the policy per resource, then encode it in the error mapper, not in each handler's judgment. The test for `detail` is simple, because it should help the caller fix *their* request, not understand *your* implementation. ## Agents raise the stakes Everything above predates AI, but AI collapsed the tolerance for ignoring it. A human meeting an unstructured error reads your docs. An [AI agent](https://routebase.dev/blog/designing-agent-ready-apis/) does whatever the error body suggests, and an error body that suggests nothing produces retry loops, hallucinated explanations, or an agent that silently routes around your API. A Problem Details response with a stable `type` and an actionable `detail` is, for an agent, a recovery instruction. `"Forbidden"` is a dead end. ## Make it part of the contract An error format that lives in a wiki page is a suggestion, while one that lives in the spec is a contract. Define your problem object once as a shared schema, reference it from every non-2xx response in your OpenAPI spec, and document each `type` where the endpoints are documented. Then the format is visible in review, testable against real responses, and impossible to drift from silently, which is the [design-first workflow](https://routebase.dev/blog/design-first-vs-code-first/) applied to the least-designed surface most APIs have. That's the workflow [Routebase](https://routebase.dev/api-design/) is built around, errors included. --- # API Design Principles: A Practical Guide — Routebase > Six design decisions that make or break an API, from resource modeling, naming, and idempotency to pagination, error formats, and versioning, with examples. Canonical page: https://routebase.dev/blog/api-design-principles/ Published: 2026-07-07 · The Routebase Team · API Design, REST, Guide Most APIs don't fail because of technology choices. They fail because of a hundred small design decisions made inconsistently, under deadline pressure, by different people who never agreed on the rules. The result is an API that works but fights its consumers, with three different pagination styles, error responses that change shape between endpoints, and a `PUT` that isn't safe to retry. This guide covers the six decisions that matter most. None of them are new, and that's the point. Good API design is mostly about picking a convention and applying it everywhere. ## 1. Model resources, not procedures The single most common design mistake is exposing your implementation instead of your domain. An endpoint like `POST /runSyncJob?mode=full` tells consumers how your system works internally, and it breaks the moment that internal changes. Model the things your consumers talk about, and let HTTP verbs carry the action: ```http POST /projects/42/sync-jobs # start a sync GET /projects/42/sync-jobs/7 # check its status DELETE /projects/42/sync-jobs/7 # cancel it ``` The test is whether a consumer could guess the endpoint for a new operation without reading your docs. If creating a project is `POST /projects`, then creating an environment had better be `POST /environments` (or `POST /projects/{id}/environments`), and not `POST /createEnv`. Nesting deserves restraint. One level (`/projects/{id}/environments`) expresses ownership, while three levels deep, URLs become brittle and clients end up hardcoding IDs they shouldn't know. When a resource has its own identity, give it a top-level collection and link to the parent by ID. ## 2. Be boringly consistent with names Every naming argument has more than one defensible answer, whether plural vs. singular collections, camelCase vs. snake_case fields, or `createdAt` vs. `created_at`. What's not defensible is mixing them. Pick once, write it down, enforce it: - **Collections are plural nouns**, such as `/projects`, `/api-specs`, `/test-runs`. - **Fields use one case, everywhere.** If your JSON is camelCase, your query parameters should be too. - **The same concept keeps the same name across endpoints.** If it's `status` on one resource, it isn't `state` on the next. - **Timestamps are ISO 8601 in UTC,** suffixed consistently as `createdAt`, `updatedAt`, `deletedAt`. This sounds trivial. It's not, because naming drift is the earliest and most visible form of [contract drift](https://routebase.dev/api-testing/). It's also the one your consumers notice first, usually in a code review, asking why your SDK has both `userId` and `user_id`. _Figure: The test for principles one and two is whether a consumer who has seen three endpoints can reach a fourth without opening the docs. Where one convention was applied throughout, the first guess lands. Where the API grew one reasonable decision at a time, with a verb in the path here, a singular there, and a case change somewhere else, every guess is a 404. There is no pattern to generalise from, and the consumer ends up in the docs for a call they should have been able to write blind._ ## 3. Make retries safe with idempotency Networks fail mid-request. When they do, clients retry, and if your API isn't designed for that, retries create duplicate orders, double charges, and support tickets. The HTTP verbs already define the contract, because `GET`, `PUT`, and `DELETE` are idempotent by definition, so repeating them must produce the same result. The hard case is `POST`. For creates that must not double-execute, accept an idempotency key: ```http POST /orders Idempotency-Key: 8e03978e-40d5-43e8-bc93-6894a57f9324 Content-Type: application/json { "projectId": "42", "plan": "team" } ``` The server stores the key with the first response and replays that response for any retry carrying the same key. Consumers can then retry fearlessly, which means their timeout handling gets simpler, which means fewer bugs that look like *your* API's fault. _Figure: The client's behavior is identical on both rows and outside your control. The first response is lost in transit, so it retries twice. Without a key, the server sees three separate intents and creates three orders. With the Idempotency-Key from the request above, it recognises the same request each time, so three attempts make one order._ ## 4. Paginate from day one Every collection endpoint will eventually return more data than anyone wants in one response. Retrofitting pagination is a breaking change, while shipping it on day one is a few lines of design. Cursor-based pagination is the safer default, because offsets skip or duplicate rows when the underlying data changes between pages: ```json { "data": [ ... ], "pagination": { "nextCursor": "eyJpZCI6MTAyNH0", "hasMore": true } } ``` Whatever you choose, choose it once. A response envelope that's identical across every list endpoint means consumers write their pagination loop one time and reuse it everywhere. ## 5. Return errors machines can read Error handling is API design's most neglected surface. A `400` with `"something went wrong"` forces every consumer to parse prose. Use a structured, uniform error shape, and [RFC 9457 Problem Details](https://www.rfc-editor.org/rfc/rfc9457) is the standard worth adopting: ```json { "type": "https://api.example.com/errors/validation", "title": "Validation failed", "status": 400, "detail": "The 'email' field is not a valid address.", "errors": [ { "field": "email", "message": "must be a valid email address" } ] } ``` Two rules make error design pay off, namely the same error shape on every endpoint, and error `type`s that are stable identifiers consumers can branch on and never strings they have to fuzzy-match. The full treatment, covering extension members, type registries, and what must stay out of error bodies, is in [Consistent Error Handling with RFC 9457 Problem Details](https://routebase.dev/blog/consistent-error-handling-rfc-9457/). ## 6. Version deliberately, break rarely Versioning is where design meets governance. The mechanics (URL prefix, header, media type) matter less than the policy. Know what counts as a breaking change, additive-change your way around most of them, and when a break is unavoidable, give consumers a version boundary and a deprecation window. That's a topic with enough depth for its own post, so see [Versioning APIs Without Breaking Your Consumers](https://routebase.dev/blog/api-versioning-without-breaking-consumers/). ## Principles need enforcement Everything above fits on one page, and that's exactly the problem, because knowing the principles was never the hard part. The hard part is holding a hundred endpoints to them, across teams, releases, and reviewer moods. That's an argument for putting the API contract, meaning the spec, at the center of the workflow instead of leaving design decisions buried in code. When the spec is the source of truth, conventions become lintable, drift becomes detectable, and review happens where design happens. That workflow shift is what [design-first development](https://routebase.dev/blog/design-first-vs-code-first/) is about, and building it is what we do at [Routebase](https://routebase.dev/api-design/). Each of the six decisions above has more to it than one section can carry, from what nesting costs a caller to what an idempotency key actually promises. The [complete API design guide](https://routebase.dev/guides/api-design/) takes them one at a time, with the trade-offs and the RFC behind each one. --- # Designing Agent-Ready APIs — Routebase > AI agents are becoming API consumers. What that changes about API design, from descriptions as prompts and actionable errors to MCP as the new surface. Canonical page: https://routebase.dev/blog/designing-agent-ready-apis/ Published: 2026-07-06 · The Routebase Team · AI Agents, MCP, API Design A new kind of consumer is calling your API. It is not a developer reading your docs over coffee, but an AI agent deciding in milliseconds, from your machine-readable contract alone, whether and how to call you. Most teams still design their APIs with only human consumers in mind, and they ship APIs that agents will misuse, avoid, or hallucinate around. The good news is that designing for agents is mostly a sharper version of designing for humans. The same qualities that make an API pleasant for developers make it *usable at all* for agents. But a few things change in emphasis. ## Your spec is now a prompt When an agent integrates with your API, whether through an [MCP server](https://routebase.dev/mcp-server/), a tool-use schema, or generated client code, your OpenAPI descriptions become part of its prompt. Every `summary` and `description` field is text a model reads to decide what your endpoint does and when to call it. That changes the bar for what counts as a good description: ```yaml # Not agent-ready — describes the mechanics, not the purpose /deployments: post: summary: Create deployment description: Creates a new deployment. # Agent-ready — says what it does, when to use it, and what happens next /deployments: post: summary: Deploy a gateway configuration to an environment description: > Deploys the current gateway config snapshot to the given environment. Returns 202 with a deployment ID; poll GET /deployments/{id} until status is "succeeded" or "failed". Requires an active config snapshot — create one via POST /config-snapshots first. ``` The second version tells an agent the *protocol*, meaning what to call first, what to poll, and when it's done. A human would have inferred that from context. An agent either reads it in the description or guesses. _Figure: Two agents read the same endpoint and walk toward the same goal. The one whose description only names the mechanics makes its call, gets a 202, and reports success while the deployment is still running. The gap between where it stops and 'deployed' is everything it was never told. The one whose description spells out the protocol chains three calls, snapshot first, polling last, and actually arrives._ ## Errors are instructions now A human hits a `403`, sighs, and checks their API key. An agent hits a `403` and does whatever the error body suggests, or, if the body is `"Forbidden"`, it retries in a loop, gives up, or invents an explanation for its user. Structured errors stop being a nicety and become the agent's recovery path. Every error should answer two questions, namely what went wrong, and what would fix it. ```json { "type": "https://api.example.com/errors/missing-scope", "title": "API key lacks required scope", "status": 403, "detail": "This key has scope 'specs:read' but 'specs:write' is required. Ask an org admin to grant the scope, or use a different key.", "requiredScope": "specs:write" } ``` An agent can read that, report precisely what's missing, and often resolve it. `"Forbidden"` gives it nothing to work with, and unhelpful failure modes in agent workflows don't produce support tickets. They produce agents that silently route around your API. (That error shape is [RFC 9457 Problem Details](https://routebase.dev/blog/consistent-error-handling-rfc-9457/), which is worth adopting across your API, agents or not.) _Figure: The same 403 twice. With nothing but 'Forbidden' in the body, the agent has nothing to act on, so it retries into the same wall three times and gives up. The Problem Details body names the missing scope, specs:write, so the agent asks for exactly that, retries once the scope is granted, and resolves the call._ ## Determinism beats cleverness Agents plan multi-step workflows, where they create, then configure, then verify. Every piece of hidden state or non-obvious ordering in your API is a step where that plan derails. The design consequences are familiar, just non-negotiable now: - **Idempotent operations**, because agents retry more aggressively than any human, and a duplicate-creating `POST` turns one intent into three resources. - **Explicit state machines**, so if a resource moves `draft → review → published`, put the allowed transitions in the spec and reject invalid ones with an error naming the legal next states. - **Predictable identifiers**, because an agent that creates a resource must get its ID back in the response, immediately and in the same shape every time. - **No side effects that aren't named**, so if `POST /publish` also sends emails, say so in the description. An agent can't intuit consequences it wasn't told about. ## MCP is the integration surface Tool-use protocols, with the Model Context Protocol chief among them, are how agents actually consume APIs today. Instead of generating HTTP calls from docs, the agent gets typed, described, permission-scoped tools. But an MCP server is only as good as the API design underneath it. Vague descriptions become vague tools, and inconsistent errors become tools agents learn to distrust. Agent-readiness isn't something you bolt on at the protocol layer, because it has to exist in the contract first. (This is why [every Routebase workspace ships an MCP server](https://routebase.dev/mcp-server/) generated from the spec. The descriptions, schemas, and permissions agents see are the ones your team already designed.) ## Where to start You don't need an AI strategy to make your API agent-ready. You need the fundamentals, held to a higher standard: 1. Audit your spec's `description` fields as if they were prompts, because they are. 2. Make every error response answer "what would fix this?" 3. Make retries safe and state transitions explicit. 4. Then expose it through MCP, and watch what an agent actually does with it. None of it has to be hand-work. The first three steps are transformation work, meaning reading every description, tightening the vague ones, and adding the error responses nobody wrote down. That is exactly what an agent connected to the [Routebase MCP server](https://routebase.dev/mcp-server/) can do across your whole spec. It uses the same tools your team uses in the UI, under the same permissions, and it produces diffs you review instead of edits you type. The spec your agents will read gets drafted by one. That last step is the honest test. Hand your API to an agent and it will find every ambiguity, every undocumented dependency, every misleading description, faster and more ruthlessly than any design review. The APIs that survive that test are simply well-designed APIs. The [principles haven't changed](https://routebase.dev/blog/api-design-principles/), but the tolerance for ignoring them has. The product side of each of these, from the description editor to the MCP server, is on the [agent-ready APIs](https://routebase.dev/agent-ready-apis/) page. --- # Design-First vs. Code-First API Development — Routebase > Two workflows for building APIs, and why the order you write the contract in changes everything downstream, from parallel work and review quality to drift. Canonical page: https://routebase.dev/blog/design-first-vs-code-first/ Published: 2026-07-03 · The Routebase Team · API Design, Workflow, OpenAPI Every API has a contract. The only question is when it gets written, whether before the implementation, as a deliberate design act, or after, as an export of whatever the code happens to do. That single ordering decision shapes how your team reviews changes, how fast your frontend can move, and how much you trust your own documentation. ## The two workflows **Code-first** means you write the implementation, with controllers, handlers, and annotations, and generate the OpenAPI spec from it. The spec is a build artifact. This is the default in most frameworks because it requires no process change, so you add a route and get docs for free. **Design-first** means you write the spec before the implementation. The contract gets reviewed and agreed on as its own artifact, and then backend and consumers build against it in parallel. Code-first's appeal is real, with one source file, no spec to keep in sync, and tooling included. For a solo service with one consumer, it's often enough. The costs show up when more people depend on the contract than write the implementation. ## What ordering changes ### Review happens at the right altitude In a code-first workflow, API design review happens inside implementation review, so a new endpoint arrives as 400 lines of handler logic, validation, and tests, with the contract implicit in the diff. Reviewers respond to the code ("this method is long") because the design ("should this be two resources?") is invisible. Design-first makes the contract the diff: ```yaml # The entire review surface for a new endpoint /projects/{projectId}/environments: post: summary: Create an environment in a project requestBody: content: application/json: schema: $ref: "#/components/schemas/CreateEnvironmentRequest" responses: "201": description: Environment created "409": description: An environment with this name already exists ``` Twenty lines. A reviewer can see the naming, the status codes, the resource shape, and object *before* anyone has invested a week implementing the wrong design. Breaking changes stop being archaeology and start being visible in review. ### Consumers stop waiting With a code-first flow, the contract exists when the backend is done, so frontend, mobile, and partner teams start integrating at the end. With an agreed spec, they start on day one, against [a mock server generated from the contract](https://routebase.dev/api-mocking/): - Backend implements the spec. - Frontend builds against mocks that honor the same spec. - Both meet at integration with no surprises, because neither invented anything. This is the most measurable win of design-first, because the spec turns a sequential dependency into parallel work. _Figure: The backend does the same amount of work in both plans. What changes is when everyone else can start. Code-first hands the contract over at the end, so frontend, mobile and partner teams queue behind it, while an agreed spec lets all four run at once. The bars carry no durations on purpose, because the claim is about ordering, not about a measured speed-up._ ### The spec becomes enforceable A generated spec can't disagree with the code, which sounds like a feature until you realize it means the spec can't *catch* anything either. Whatever the code does is, by definition, the contract. Rename a field in a refactor and the spec silently renames it too, and your consumers find out in production. A designed spec is an independent statement of intent. That makes two things possible, namely [contract testing](https://routebase.dev/api-testing/) (does the implementation actually match?) and governance (does the design follow our conventions?). Linting a generated spec is just critiquing the past, while linting a designed spec prevents the mistake. ## The strongest objections **"The spec and code will drift apart."** They will, if the spec lives in a wiki and nothing checks it. Drift isn't a property of design-first. It's a property of unenforced contracts. Contract tests in CI turn drift from a slow rot into a failing build. **"Writing YAML by hand is miserable."** Agreed, and nobody should. The answer is [purpose-built design tooling](https://routebase.dev/api-design/) with schema reuse, validation, and diffing, because the spec is the artifact, not the editing experience. **"It's slower to start."** The first endpoint ships later, and the tenth ships faster. Design-first front-loads an hour of thinking to save the days that integration surprises and breaking-change incidents cost later. For a two-endpoint internal tool, that trade may not pay, but for anything with multiple consumers or a public surface, it pays quickly. ## Picking for your team Code-first fits when one team owns both sides of the API, consumers are few, and the contract is low-stakes. Design-first earns its process cost as soon as the contract is load-bearing, whether that means multiple consumer teams, external users, or [AI agents](https://routebase.dev/blog/designing-agent-ready-apis/) that read your spec as their only source of truth. The direction of travel is one-way, though. Teams that adopt design-first rarely go back, because once the contract is where design, review, mocking, and testing all happen, generating it from code feels like publishing your blueprint after the building is up. Whichever order you work in, the decisions themselves stay the same, and the [API design guide](https://routebase.dev/guides/api-design/) walks through them one at a time. The workflow itself, from the reviewed contract to the teams that build against it at once, is on the [API-first development](https://routebase.dev/api-first-development/) page. --- # Versioning APIs Without Breaking Your Consumers — Routebase > What actually counts as a breaking change, why additive evolution beats version bumps, and how to run a deprecation your consumers will forgive. Canonical page: https://routebase.dev/blog/api-versioning-without-breaking-consumers/ Published: 2026-07-01 · The Routebase Team · API Design, Versioning, Breaking Changes Nobody versions an API for fun. Versioning is what you do when you need to change a contract that other people's code depends on, and every strategy is just a different way of distributing the pain between you and your consumers. The goal isn't a clever version scheme. It's breaking people as rarely, as visibly, and as considerately as possible. ## Know what actually breaks Half of all versioning anxiety comes from not having a shared definition of "breaking." Additive changes are safe **if your consumers follow the must-ignore rule** (tolerate unknown fields, which is worth stating explicitly in your docs): - Adding a new endpoint - Adding an **optional** request field or parameter - Adding a response field - Adding a new enum value *where consumers were told to expect additions* Breaking changes are everything that invalidates a working consumer: - Removing or renaming a field, endpoint, or parameter - Making an optional field required - Changing a field's type or format (`"42"` → `42`) - Narrowing validation (max length 500 → 100) - Changing error shapes or status codes consumers branch on - Changing defaults or semantics, so the same request gets different behavior The subtle ones do the damage. Nobody renames a field by accident, but tightening validation "because no legitimate value is that long" breaks the consumer who had one. If a change would make any currently-valid request or any currently-parsed response invalid, it's breaking, no matter how reasonable it feels. _Figure: Each change starts on the side intuition files it and ends on the side the test puts it, and three of the six cross over. Narrowing a validation rule and changing a default feel like housekeeping and break working consumers, while a new enum value feels risky and is safe as long as consumers were told to expect additions. Only one question decides it, which is whether anything that worked yesterday stops working._ ## Evolve additively first The cheapest version bump is the one you avoid. Most redesigns can ship as additive evolution, where you add the new field alongside the old, dual-write both, migrate consumers, and only then deprecate the original. ```yaml # Instead of renaming owner_email (breaking): properties: owner_email: type: string deprecated: true description: "Deprecated: use `owner.email` instead. Removed after 2026-12-01." owner: type: object properties: email: { type: string } name: { type: string } ``` This is more work for you, with two fields, a sync rule, and a removal ticket. That's the correct direction for the trade-off, because one team does extra work so that N consumer teams don't have to do a forced migration. An API version is a promise, and additive evolution is how you keep it while still moving. ## When you must break: make the boundary explicit Some changes can't be additive, such as a security fix in the auth model or a resource model that's fundamentally wrong. Then you need a version boundary, and the mechanics matter less than people argue about online: - **URL versioning** (`/v2/projects`) is visible in every log line, trivially routable, and impossible to send by accident. It is the pragmatic default. - **Header versioning** (`Api-Version: 2026-07-01`) keeps URLs stable and supports date-based pinning, at the cost of being invisible in casual use. Two rules matter more than the mechanism. **Version the whole API surface, not individual endpoints**, because a consumer on "v2" should never have to remember which five endpoints have a v2. And **v1 keeps working the day v2 ships**, because a version boundary is a migration path, not a cutover. ## Run deprecations like you mean them A deprecation is a project with a timeline, not a doc footnote. The sequence that keeps consumers on your side: 1. **Announce with a date** in the changelog, in the spec annotation (`deprecated: true`), and in machine-readable response headers: ```http HTTP/1.1 200 OK Deprecation: @1780272000 Sunset: Tue, 01 Dec 2026 00:00:00 GMT Link: ; rel="deprecation" ``` The `Deprecation` value is the moment the deprecation took effect, here 1 June 2026, written as a structured field date because RFC 9745 defines it that way. The `Sunset` date must not be earlier than it. 2. **Give a real window**, commonly 6–12 months for public APIs. What matters is that it reflects your consumers' release cadence and that you honor it. 3. **Watch actual usage**, because traffic on deprecated surfaces tells you who hasn't migrated. Silence in your metrics is the only acceptable green light for removal. 4. **Remove loudly**, because a clear `410 Gone` with a pointer to the migration guide beats a mysterious `404`. _Figure: A deprecation run in one picture. The Deprecation header starts the migration, traffic on the old surface drains, and it is still above zero when the announced Sunset date passes. The date starts the clock, while the flat zero afterwards is what actually clears the removal, and the removal itself is a loud 410 Gone, not a mysterious 404._ ## Catch breaks before consumers do The uncomfortable truth about breaking changes is that most of them ship unintentionally. A refactor renames a DTO property, a framework upgrade changes serialization, or a well-meaning cleanup deletes a "clearly unused" field, and no human notices, because humans don't diff contracts. Machines should. If your API has a spec as its source of truth, every change can be diffed against the previous version and classified as additive or breaking before it merges. [Contract testing](https://routebase.dev/api-testing/) closes the loop from the other side, verifying the implementation still honors what the spec promises. Versioning policy sets the rules. Enforcement is what makes consumers trust them, and trust, not the number in your URL, is what API versioning is actually about. For the full treatment of every method, when a version is unavoidable and when it buys you nothing, see the [API versioning guide](https://routebase.dev/guides/api-versioning/). For the broader design context, start with the [API design principles guide](https://routebase.dev/blog/api-design-principles/). --- [Routebase](https://routebase.dev/) — [Sign up](https://app.routebase.dev/): Every account starts with a 14-day Pro trial — no credit card required.