WHOOP · API Governance Rules

WHOOP API Rules

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

6 Rules error 2 warn 3 info 1
View Rules File View on GitHub

Rule Categories

whoop

Rules

error
whoop-server-host
The single canonical WHOOP API server is https://api.prod.whoop.com/developer.
$.servers[*]
error
whoop-version-prefix
WHOOP paths must be under /v1/ (legacy mapping) or /v2/ (current).
$.paths[*]~
warn
whoop-snake-case-properties
WHOOP JSON property names use snake_case.
$.components.schemas[*].properties[*]~
warn
whoop-title-case-summaries
Operation summaries should use Title Case.
$.paths[*][get,post,put,patch,delete].summary
warn
whoop-oauth-scopes
Member-data OAuth scopes must follow the read: pattern.
$.components.securitySchemes.OAuth.flows.authorizationCode.scopes
info
whoop-uuid-id-format
v2 resource IDs (sleep, workout) must use the uuid format.
$.components.schemas[Sleep,WorkoutV2].properties.id

Spectral Ruleset

Raw ↑
extends:
  - "spectral:oas"
formats:
  - oas3
rules:
  whoop-server-host:
    description: The single canonical WHOOP API server is https://api.prod.whoop.com/developer.
    message: "Server URL must be https://api.prod.whoop.com/developer."
    severity: error
    given: $.servers[*]
    then:
      field: url
      function: pattern
      functionOptions:
        match: "^https://api\\.prod\\.whoop\\.com/developer$"

  whoop-version-prefix:
    description: WHOOP paths must be under /v1/ (legacy mapping) or /v2/ (current).
    message: "Path must begin with /v1/ or /v2/."
    severity: error
    given: $.paths[*]~
    then:
      function: pattern
      functionOptions:
        match: "^/v[12]/"

  whoop-snake-case-properties:
    description: WHOOP JSON property names use snake_case.
    message: "Schema property '{{property}}' must use snake_case."
    severity: warn
    given: $.components.schemas[*].properties[*]~
    then:
      function: pattern
      functionOptions:
        match: "^[a-z][a-z0-9_]*$"

  whoop-title-case-summaries:
    description: Operation summaries should use Title Case.
    message: "Summary should use Title Case: '{{value}}'."
    severity: warn
    given: $.paths[*][get,post,put,patch,delete].summary
    then:
      function: pattern
      functionOptions:
        match: "^[A-Z0-9]"

  whoop-oauth-scopes:
    description: Member-data OAuth scopes must follow the read:<resource> pattern.
    message: "Scope name '{{property}}' must match read:<resource>."
    severity: warn
    given: $.components.securitySchemes.OAuth.flows.authorizationCode.scopes
    then:
      field: "@key"
      function: pattern
      functionOptions:
        match: "^read:[a-z_]+$"

  whoop-uuid-id-format:
    description: v2 resource IDs (sleep, workout) must use the uuid format.
    message: "id field should declare format: uuid."
    severity: info
    given: $.components.schemas[Sleep,WorkoutV2].properties.id
    then:
      field: format
      function: enumeration
      functionOptions:
        values: ["uuid"]

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/whoop-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 email required.

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