Treblle · API Governance Rules

Treblle API Rules

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

7 Rules error 2 warn 5
View Rules File View on GitHub

Rule Categories

treblle

Rules

error
treblle-operation-id-required
All Treblle API operations should have an operationId for consistent SDK generation and documentation.
$.paths[*][get,post,put,patch,delete]
warn
treblle-api-key-auth
Treblle API uses API key authentication via the Treblle-Api-Key header. All operations should declare security requirements.
$.paths[*][*]
warn
treblle-response-200-defined
All Treblle API GET operations should define a 200 response.
$.paths[*].get.responses
warn
treblle-response-401-defined
All Treblle API operations requiring authentication should document the 401 Unauthorized response.
$.paths[*][get,post,put,patch,delete].responses
warn
treblle-tags-required
All operations should be tagged for catalog navigation.
$.paths[*][*].tags
warn
treblle-description-required
All operations should have a clear description.
$.paths[*][*]
error
treblle-summary-required
All operations should have a summary for quick identification.
$.paths[*][*]

Spectral Ruleset

Raw ↑
extends: spectral:oas
rules:
  treblle-operation-id-required:
    description: >-
      All Treblle API operations should have an operationId for consistent
      SDK generation and documentation.
    message: "Operation should have an operationId"
    severity: error
    given: "$.paths[*][get,post,put,patch,delete]"
    then:
      field: operationId
      function: truthy

  treblle-api-key-auth:
    description: >-
      Treblle API uses API key authentication via the Treblle-Api-Key header.
      All operations should declare security requirements.
    message: "Operation should declare security requirements"
    severity: warn
    given: "$.paths[*][*]"
    then:
      function: schema
      functionOptions:
        schema:
          oneOf:
            - required: ["security"]
            - not:
                required: ["security"]

  treblle-response-200-defined:
    description: All Treblle API GET operations should define a 200 response.
    message: "GET operation should define a 200 response"
    severity: warn
    given: "$.paths[*].get.responses"
    then:
      function: schema
      functionOptions:
        schema:
          required: ["200"]

  treblle-response-401-defined:
    description: >-
      All Treblle API operations requiring authentication should document
      the 401 Unauthorized response.
    message: "Operation should define a 401 Unauthorized response"
    severity: warn
    given: "$.paths[*][get,post,put,patch,delete].responses"
    then:
      function: schema
      functionOptions:
        schema:
          required: ["401"]

  treblle-tags-required:
    description: All operations should be tagged for catalog navigation.
    message: "Operation should have at least one tag"
    severity: warn
    given: "$.paths[*][*].tags"
    then:
      function: length
      functionOptions:
        min: 1

  treblle-description-required:
    description: All operations should have a clear description.
    message: "Operation should have a description"
    severity: warn
    given: "$.paths[*][*]"
    then:
      field: description
      function: truthy

  treblle-summary-required:
    description: All operations should have a summary for quick identification.
    message: "Operation should have a summary"
    severity: error
    given: "$.paths[*][*]"
    then:
      field: summary
      function: truthy

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