Sage · API Governance Rules

Sage API Rules

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

10 Rules error 1 warn 4 info 5
View Rules File View on GitHub

Rule Categories

sage

Rules

warn
sage-operation-summary-title-case
All operation summaries must use Title Case
$.paths[*][*].summary
error
sage-oauth2-security-required
All endpoints must use OAuth2 authentication
$.paths[*][*]
warn
sage-operation-ids-camel-case
Operation IDs must use camelCase
$.paths[*][*].operationId
warn
sage-tags-required
All operations must have at least one tag
$.paths[*][*]
info
sage-resource-paths-snake-case
Sage API resource paths use snake_case
$.paths
info
sage-list-pagination-items-per-page
List endpoints should support items_per_page parameter
$.paths[*][get]
info
sage-response-list-format
List responses should use $items array format
$.components.schemas[*List]*
info
sage-rate-limit-documented
API documentation should reference rate limiting
$.info.description
warn
sage-oauth-authorization-code-flow
OAuth2 security scheme must use authorizationCode flow
$.components.securitySchemes[*].flows
info
sage-response-delete-204
DELETE operations should return 204 No Content
$.paths[*][delete].responses

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  sage-operation-summary-title-case:
    description: All operation summaries must use Title Case
    message: "Operation summary '{{value}}' must use Title Case"
    given: "$.paths[*][*].summary"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^([A-Z][a-z]*)( [A-Z][a-z0-9]*)*$"

  sage-oauth2-security-required:
    description: All endpoints must use OAuth2 authentication
    message: "Endpoint must declare OAuth2 security"
    given: "$.paths[*][*]"
    severity: error
    then:
      field: security
      function: defined

  sage-operation-ids-camel-case:
    description: Operation IDs must use camelCase
    message: "Operation ID '{{value}}' must use camelCase"
    given: "$.paths[*][*].operationId"
    severity: warn
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-zA-Z0-9]*$"

  sage-tags-required:
    description: All operations must have at least one tag
    message: "Operation must have at least one tag"
    given: "$.paths[*][*]"
    severity: warn
    then:
      field: tags
      function: truthy

  sage-resource-paths-snake-case:
    description: Sage API resource paths use snake_case
    message: "Sage API resource paths use snake_case (e.g., sales_invoices)"
    given: "$.paths"
    severity: info
    then:
      function: pattern
      functionOptions:
        match: "^\\/[a-z_/{}]+$"

  sage-list-pagination-items-per-page:
    description: List endpoints should support items_per_page parameter
    message: "List endpoints should define items_per_page query parameter"
    given: "$.paths[*][get]"
    severity: info
    then:
      function: defined

  sage-response-list-format:
    description: List responses should use $items array format
    message: "List response schemas should have $items array"
    given: "$.components.schemas[*List]*"
    severity: info
    then:
      field: properties
      function: defined

  sage-rate-limit-documented:
    description: API documentation should reference rate limiting
    message: "API info description should mention rate limits"
    given: "$.info.description"
    severity: info
    then:
      function: pattern
      functionOptions:
        match: "(?i)(rate.limit|429)"

  sage-oauth-authorization-code-flow:
    description: OAuth2 security scheme must use authorizationCode flow
    message: "OAuth2 must use authorizationCode flow for Sage APIs"
    given: "$.components.securitySchemes[*].flows"
    severity: warn
    then:
      field: authorizationCode
      function: defined

  sage-response-delete-204:
    description: DELETE operations should return 204 No Content
    message: "DELETE operations should return 204 status code"
    given: "$.paths[*][delete].responses"
    severity: info
    then:
      field: "204"
      function: defined

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/sage-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.