Thoughtly · API Governance Rules

Thoughtly API Rules

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

6 Rules error 1 warn 4
View Rules File View on GitHub

Rule Categories

thoughtly

Rules

error
thoughtly-server-url
All Thoughtly API specs must declare the canonical production server.
$.servers[*].url
warn
thoughtly-require-api-token-security
Every operation must require the ApiKeyAuth (x-api-token) security scheme except public webhook trigger endpoints.
$.paths.*[?(@.operationId)]
warn
thoughtly-summary-title-case
Operation summaries should use Title Case (the API Evangelist convention).
$.paths.*[?(@.summary)].summary
hint
thoughtly-generic-response-schema
2xx JSON responses should reference the GenericResponse schema.
$.paths.*.*.responses.200.content.application/json.schema
warn
thoughtly-tag-known
Operations should be tagged with one of the documented tag categories.
$.paths.*.*.tags[*]
warn
thoughtly-operation-id
Every operation must declare a camelCase operationId.
$.paths.*[?(@.summary)]

Spectral Ruleset

Raw ↑
extends:
  - spectral:oas
documentationUrl: https://docs.thoughtly.com/developers
rules:
  thoughtly-server-url:
    description: All Thoughtly API specs must declare the canonical production server.
    message: Servers must include https://api.thoughtly.com
    severity: error
    given: $.servers[*].url
    then:
      function: pattern
      functionOptions:
        match: '^https://api\.thoughtly\.com'

  thoughtly-require-api-token-security:
    description: Every operation must require the ApiKeyAuth (x-api-token) security scheme except public webhook trigger endpoints.
    message: Operation must require ApiKeyAuth security.
    severity: warn
    given: $.paths.*[?(@.operationId)]
    then:
      field: security
      function: truthy

  thoughtly-summary-title-case:
    description: Operation summaries should use Title Case (the API Evangelist convention).
    severity: warn
    given: $.paths.*[?(@.summary)].summary
    then:
      function: pattern
      functionOptions:
        match: '^[A-Z][A-Za-z0-9]*(\s+[A-Z][A-Za-z0-9]*)*$'

  thoughtly-generic-response-schema:
    description: 2xx JSON responses should reference the GenericResponse schema.
    severity: hint
    given: $.paths.*.*.responses.200.content.application/json.schema
    then:
      function: schema
      functionOptions:
        schema:
          type: object
          properties:
            $ref:
              type: string
              pattern: '#/components/schemas/GenericResponse'

  thoughtly-tag-known:
    description: Operations should be tagged with one of the documented tag categories.
    severity: warn
    given: $.paths.*.*.tags[*]
    then:
      function: enumeration
      functionOptions:
        values:
          - agent
          - contact
          - user
          - webhooks

  thoughtly-operation-id:
    description: Every operation must declare a camelCase operationId.
    severity: warn
    given: $.paths.*[?(@.summary)]
    then:
      field: operationId
      function: pattern
      functionOptions:
        match: '^[a-z][A-Za-z0-9]*$'

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