Losant · API Governance Rules

Losant API Rules

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

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

Rule Categories

losant

Rules

error
losant-id-pattern
Losant resource IDs MUST match the 24-hex-char MongoDB ObjectId pattern.
$.paths.*..parameters[?(@.name && @.name =~ /Id$/)].schema
warn
losant-application-scope
Application-scoped paths MUST include {applicationId} path parameter.
$.paths[?(@property =~ /^\/applications\//)]
warn
losant-title-case-summary
OpenAPI operation summaries SHOULD use Title Case.
$.paths.*.*.summary
error
losant-bearer-auth-required
All Losant Platform operations MUST require BearerAuth.
$.paths.*.*.security[*]
warn
losant-error-schema
Error responses SHOULD reference the shared error schema.
$.paths.*.*.responses[?(@property =~ /^4/ || @property =~ /^5/)].content.application/json.schema

Spectral Ruleset

Raw ↑
extends:
- - spectral:oas
  - recommended
rules:
  losant-id-pattern:
    description: Losant resource IDs MUST match the 24-hex-char MongoDB ObjectId pattern.
    severity: error
    given: $.paths.*..parameters[?(@.name && @.name =~ /Id$/)].schema
    then:
      field: pattern
      function: pattern
      functionOptions:
        match: ^\^\[A-Fa-f\\d\]\{24\}\$$
  losant-application-scope:
    description: Application-scoped paths MUST include {applicationId} path parameter.
    severity: warn
    given: $.paths[?(@property =~ /^\/applications\//)]
    then:
      function: truthy
  losant-title-case-summary:
    description: OpenAPI operation summaries SHOULD use Title Case.
    severity: warn
    given: $.paths.*.*.summary
    then:
      function: pattern
      functionOptions:
        match: ^([A-Z][\w\-/]*)( [A-Z][\w\-/]*| [a-z]{1,3}| [A-Z]+)*$
  losant-bearer-auth-required:
    description: All Losant Platform operations MUST require BearerAuth.
    severity: error
    given: $.paths.*.*.security[*]
    then:
      field: BearerAuth
      function: truthy
  losant-error-schema:
    description: Error responses SHOULD reference the shared error schema.
    severity: warn
    given: $.paths.*.*.responses[?(@property =~ /^4/ || @property =~ /^5/)].content.application/json.schema
    then:
      field: $ref
      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/losant-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.