HTTP · API Governance Rules

HTTP API Rules

Spectral linting rules defining API design standards and conventions for HTTP.

0 Rules
View Rules File View on GitHub

Spectral Ruleset

http-rules.yml Raw ↑
x-aid: http:http-rules
x-name: HTTP Rules
description: >-
  Foundational rules and guidelines for designing, consuming, and
  operating systems that exchange messages over the HTTP protocol.
x-type: Rules
x-tags:
  - HTTP
  - Networking
  - Protocol
  - Standards
  - Web
rules:
  - name: Use Standard Methods Correctly
    description: >-
      GET is safe and idempotent, POST creates, PUT replaces, PATCH
      partially updates, and DELETE removes. Do not change resource
      state inside GET requests.
  - name: Return Meaningful Status Codes
    description: >-
      Use 2xx for success, 3xx for redirection, 4xx for client errors,
      and 5xx for server errors. Avoid returning 200 with an error
      payload as the canonical signal of failure.
  - name: Prefer HTTPS
    description: >-
      Serve all production traffic over TLS. Redirect plain HTTP to
      HTTPS and set HSTS where appropriate.
  - name: Honor Caching Semantics
    description: >-
      Use Cache-Control, ETag, and Last-Modified headers correctly.
      Do not mark mutable responses as cacheable.
  - name: Negotiate Content Types
    description: >-
      Use the Accept and Content-Type headers to negotiate
      representations. Default to application/json for API payloads
      unless a more specific media type applies.
  - name: Use Problem Details For Errors
    description: >-
      Return RFC 9457 (formerly RFC 7807) application/problem+json
      bodies for error responses so clients can parse a consistent
      structure.
  - name: Idempotency For Retries
    description: >-
      Implement idempotency keys for non idempotent methods like POST
      so clients can safely retry on network failures.
  - name: Apply Rate Limiting Headers
    description: >-
      Communicate rate limit state with X-RateLimit-* or RateLimit-*
      headers so clients can back off gracefully.
  - name: Validate Input Strictly
    description: >-
      Validate request bodies, headers, and query parameters at the
      boundary. Reject malformed input with 400 Bad Request and a
      problem details body.
  - name: Stable URI Design
    description: >-
      Treat URIs as long lived identifiers. Avoid breaking changes to
      paths and use redirects when paths must move.
x-maintainers:
  - FN: Kin Lane
    email: kin@apievangelist.com

Work with this as data

Every ruleset here is available over the APIs.io API and to AI agents over MCP.

MCP server

One button, every client — Claude, Cursor, VS Code and the rest.

https://apis.io/mcp

Tools for spectral rules

4 MCP tools reach this
  • find_rulesBrowse and filter every ruleset in the catalog.
  • apis_io_searchSTART HERE — APIs, providers and tags for one query, each with its total.
  • resolveTurn a domain, URL or GitHub org into the provider it belongs to.
  • find_cohortsEvery scored population of providers in the catalog.
All 92 tools →

Call it yourself

curl for this page
This ruleset
curl "https://apis.io/api/v1/rules/http-rules"
All spectral rules
curl "https://apis.io/api/v1/rules?limit=25"

Discovery needs no key. Ratings and market analysis are Pro.

Get an API key

Free tier, no form to fill in. Signing in shares your email address with us — we store it to create your key and to recognise you if you sign in with another provider. See our Privacy Policy and Terms.

A second provider on the same verified email joins the account you already have.