openapi: 3.1.0
info:
  title: Watership Check API
  version: 0.1.0
  summary: Check prose against the Watership style guide, UX writing guide, and slop guard, and look up the rules behind each finding.
  description: |
    The Watership Check API runs the Watership automated checks on a piece of text and responds with findings by rule id. It also serves the rules, the terminology list, and the voices that the checks come from.

    **Design preview.** This API is a design, not a running service. There is no hosted endpoint and no way to get a production key yet. Every example in these docs runs against a local mock server built from this file. To start it, run `npm run mock` in the repository.

    The API wraps parts of Watership that already exist: the JavaScript check engine (the same mechanical checks as the Watership Vale package) and the Watership MCP server, whose limits it keeps.
  contact:
    name: Watership
    url: https://watership.ca/
  license:
    name: CC BY 4.0
    identifier: CC-BY-4.0
servers:
  - url: http://127.0.0.1:4010
    description: Local mock server (Prism). Start it with `npm run mock`.
  - url: https://api.watership.ca
    description: Planned hosted service. Not live, so requests to it fail.
security:
  - apiKey: []
tags:
  - name: Checks
    description: Run the automated checks on text and get findings by rule id.
  - name: Rules
    description: The rules in the style guide, the UX writing guide, and the slop guard, each with a stable id, a tier, and a check type.
  - name: Terms
    description: The terminology list, with the preferred word, the words it replaces, and the rule that enforces it.
  - name: Voices
    description: The stock Watership voices and where each sits on the six tone scales.
paths:
  /v1/checks:
    post:
      operationId: createCheck
      tags: [Checks]
      summary: Check text
      description: |
        Runs the Watership automated checks on one piece of text and responds with every finding, sorted by position. Each finding names the rule ids it enforces, so you can look up the rule, show its guidance, or decide what to block.

        The checks cover mechanical rules only: word lists, characters, capitalization, and number formats. Judgment rules need a reader. A check is stateless: the text isn’t stored, and the same text against the same release always gets the same findings.

        Text can be up to 100,000 characters. One response holds at most 500 findings. When there are more, `truncated` is `true`.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CheckRequest'
            examples:
              draft:
                $ref: '#/components/examples/DraftCheckRequest'
              errorsOnly:
                summary: Report errors only
                value:
                  text: The next maintenance window is 11/04/2026.
                  format: text
                  min_level: error
      responses:
        '200':
          description: The check ran. The findings may be empty.
          headers:
            Watership-Release:
              $ref: '#/components/headers/Watership-Release'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/CheckResult'
              examples:
                draft:
                  $ref: '#/components/examples/DraftCheckResult'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '413':
          $ref: '#/components/responses/PayloadTooLarge'
        '415':
          $ref: '#/components/responses/UnsupportedMediaType'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
        '503':
          $ref: '#/components/responses/CheckTimeout'
  /v1/rules:
    get:
      operationId: listRules
      tags: [Rules]
      summary: List rules
      description: |
        Lists the rules in the style guide, the UX writing guide, and the slop guard, in guide order. Filter by guide, tier, check type, or whether the automated checks cover the rule. Use `q` to search ids, names, and rule text.
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - name: guide
          in: query
          description: Only rules from this guide.
          schema:
            $ref: '#/components/schemas/Guide'
        - name: tier
          in: query
          description: Only rules of this tier.
          schema:
            $ref: '#/components/schemas/Tier'
        - name: check
          in: query
          description: Only rules of this check type.
          schema:
            $ref: '#/components/schemas/CheckType'
        - name: automated
          in: query
          description: '`true` for only the rules the automated checks cover, `false` for only the rules they don’t.'
          schema:
            type: boolean
        - name: q
          in: query
          description: Words to look for in rule ids, names, and text. Every word must match.
          schema:
            type: string
            minLength: 1
            maxLength: 200
          example: semicolon
      responses:
        '200':
          description: One page of rules.
          headers:
            Watership-Release:
              $ref: '#/components/headers/Watership-Release'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleList'
              examples:
                neverTier:
                  summary: Never-tier rules the checks cover
                  value:
                    data:
                      - id: num-no-slash-dates
                        name: No slash dates
                        guide: style-guide
                        section: numbers-dates-and-units
                        tier: never
                        check: mechanical
                        automated: true
                        link: https://watership.ca/style-guide/numbers-dates-and-units/#num-no-slash-dates
                      - id: link-descriptive-text
                        name: Descriptive link text
                        guide: style-guide
                        section: links-and-cross-references
                        tier: never
                        check: mechanical
                        automated: true
                        link: https://watership.ca/style-guide/links-and-cross-references/#link-descriptive-text
                    has_more: true
                    next_cursor: cnVsZTpsaW5rLWRlc2NyaXB0aXZlLXRleHQ
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
  /v1/rules/{rule_id}:
    get:
      operationId: getRule
      tags: [Rules]
      summary: Get a rule
      description: |
        Responds with one rule in full: its tier, its check type, the guidance in Markdown, and its examples. Every finding from `POST /v1/checks` carries rule ids you can pass here.
      parameters:
        - $ref: '#/components/parameters/RuleId'
      responses:
        '200':
          description: The rule.
          headers:
            Watership-Release:
              $ref: '#/components/headers/Watership-Release'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/RuleDetail'
              examples:
                termPlease:
                  summary: A style guide rule
                  value:
                    id: term-please
                    name: Please in instructions
                    guide: style-guide
                    section: terminology
                    tier: avoid
                    check: mechanical
                    automated: true
                    link: https://watership.ca/style-guide/terminology/#term-please
                    body: '**Don’t write “please” in documentation or interface text.** An instruction is not a favor, and the word slows every step. The one exception is a request the reader makes for the company’s benefit rather than their own, such as reporting a bug or filling in a survey.'
                    examples:
                      - instead: Please select Save to keep your changes.
                        write: Select Save to keep your changes.
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
  /v1/terms:
    get:
      operationId: listTerms
      tags: [Terms]
      summary: List terms
      description: |
        Lists the entries in the terminology list, in alphabetical order. Each entry gives the preferred word, the words it replaces with their status, and the rule that enforces it.
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
        - name: status
          in: query
          description: Only entries whose headword has this status.
          schema:
            $ref: '#/components/schemas/TermStatus'
        - name: q
          in: query
          description: Words to look for in the headword, its alternatives, and its usage notes.
          schema:
            type: string
            minLength: 1
            maxLength: 200
          example: login
      responses:
        '200':
          description: One page of terms.
          headers:
            Watership-Release:
              $ref: '#/components/headers/Watership-Release'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TermList'
              examples:
                firstPage:
                  summary: The first page
                  value:
                    data:
                      - id: sign-in
                        term: sign in
                        status: preferred
                        definition: To start a session in a product by proving who you are, such as with a password or a one-time code.
                        usage:
                          - Write “sign in,” not “log in,” “login,” or “log on.” Use two words as a verb (“sign in to your account”), and hyphenate only as a modifier, as in “the sign-in page.”
                        examples:
                          - instead: Login to Acme Cloud, then logout when you’re done.
                            write: Sign in to Acme Cloud, then sign out when you’re done.
                        alternatives:
                          - term: log in
                            status: prohibited
                          - term: log-in
                            status: prohibited
                          - term: login
                            status: prohibited
                          - term: log on
                            status: prohibited
                          - term: logon
                            status: prohibited
                        rule:
                          id: term-sign-in
                          tier: avoid
                          check: mechanical
                        related:
                          - sign-out
                    has_more: true
                    next_cursor: dGVybTpzaWduLWlu
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
  /v1/terms/{term_id}:
    get:
      operationId: getTerm
      tags: [Terms]
      summary: Get a term
      description: Responds with one entry from the terminology list.
      parameters:
        - name: term_id
          in: path
          required: true
          description: The entry’s id, the headword in lowercase with hyphens.
          schema:
            type: string
            pattern: '^[a-z0-9-]+$'
            maxLength: 200
          example: sign-in
      responses:
        '200':
          description: The term.
          headers:
            Watership-Release:
              $ref: '#/components/headers/Watership-Release'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Term'
              examples:
                signIn:
                  $ref: '#/components/examples/TermSignIn'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
  /v1/voices:
    get:
      operationId: listVoices
      tags: [Voices]
      summary: List voices
      description: Lists the stock voices, each with its personality and its resting position on the six tone scales.
      parameters:
        - $ref: '#/components/parameters/Limit'
        - $ref: '#/components/parameters/Cursor'
      responses:
        '200':
          description: One page of voices.
          headers:
            Watership-Release:
              $ref: '#/components/headers/Watership-Release'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/VoiceList'
              examples:
                all:
                  summary: The first two stock voices
                  value:
                    data:
                      - id: plainspoken
                        name: Plainspoken
                        tagline: Direct, clear, helpful.
                        default_for:
                          - concept
                          - task
                          - tutorial
                          - reference
                          - interface guide
                          - troubleshooting
                          - migration guide
                          - comparison
                        personality:
                          - trait: Direct
                            not: blunt
                          - trait: Clear
                            not: simplistic
                          - trait: Helpful
                            not: hovering
                        scales:
                          register:
                            rest: 50
                            error: 50
                            position: the center
                          levity:
                            rest: 32
                            error: 24
                            position: toward sober
                          deference:
                            rest: 52
                            error: 60
                            position: the center
                          energy:
                            rest: 40
                            error: 28
                            position: toward calm
                          confidence:
                            rest: 56
                            error: 56
                            position: toward assertive
                          detail:
                            rest: 50
                            error: 50
                            position: the center
                      - id: authoritative
                        name: Authoritative
                        tagline: Precise, assured, formal.
                        default_for:
                          - release notes
                          - policy page
                          - security advisory
                          - technical whitepaper
                          - backgrounder
                          - benchmark report
                          - press release
                          - media kit
                          - internal update or email
                        personality:
                          - trait: Precise
                            not: pedantic
                          - trait: Assured
                            not: arrogant
                          - trait: Formal
                            not: stiff
                        scales:
                          register:
                            rest: 68
                            error: 68
                            position: toward formal
                          levity:
                            rest: 26
                            error: 24
                            position: well toward sober
                          deference:
                            rest: 58
                            error: 64
                            position: toward deferential
                          energy:
                            rest: 32
                            error: 26
                            position: toward calm
                          confidence:
                            rest: 62
                            error: 58
                            position: toward assertive
                          detail:
                            rest: 56
                            error: 52
                            position: toward thorough
                    has_more: true
                    next_cursor: dm9pY2U6YXV0aG9yaXRhdGl2ZQ
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
  /v1/voices/{voice_id}:
    get:
      operationId: getVoice
      tags: [Voices]
      summary: Get a voice
      description: Responds with one stock voice.
      parameters:
        - name: voice_id
          in: path
          required: true
          description: 'The voice’s id: plainspoken, authoritative, warm, thoughtful, energetic, or steady.'
          schema:
            type: string
            pattern: '^[a-z0-9-]+$'
            maxLength: 200
          example: plainspoken
      responses:
        '200':
          description: The voice.
          headers:
            Watership-Release:
              $ref: '#/components/headers/Watership-Release'
            RateLimit-Limit:
              $ref: '#/components/headers/RateLimit-Limit'
            RateLimit-Remaining:
              $ref: '#/components/headers/RateLimit-Remaining'
            RateLimit-Reset:
              $ref: '#/components/headers/RateLimit-Reset'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Voice'
              examples:
                plainspoken:
                  $ref: '#/components/examples/VoicePlainspoken'
        '400':
          $ref: '#/components/responses/InvalidRequest'
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          $ref: '#/components/responses/NotFound'
        '429':
          $ref: '#/components/responses/RateLimited'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  securitySchemes:
    apiKey:
      type: http
      scheme: bearer
      bearerFormat: API key
      description: |
        Send your API key as a bearer token: `Authorization: Bearer <key>`. Test keys start with `wsk_test_`. The mock server accepts any key, but it rejects a request with no `Authorization` header.
  parameters:
    Limit:
      name: limit
      in: query
      description: The most items to return in one page.
      schema:
        type: integer
        minimum: 1
        maximum: 100
        default: 25
    Cursor:
      name: cursor
      in: query
      description: The `next_cursor` from the previous page. Leave it out for the first page.
      schema:
        type: string
        maxLength: 200
    RuleId:
      name: rule_id
      in: path
      required: true
      description: A rule id, such as one from a finding’s `rule_ids`.
      schema:
        $ref: '#/components/schemas/RuleId'
      example: term-please
  headers:
    Watership-Release:
      description: The release of the Watership checks that answered, which is the version of the Watership Vale package they come from, such as `0.2.0`. The same text checked against the same release always gets the same findings.
      schema:
        type: string
      example: '0.3.3'
    RateLimit-Limit:
      description: Requests allowed per window for this API key.
      schema:
        type: integer
      example: 120
    RateLimit-Remaining:
      description: Requests left in the current window.
      schema:
        type: integer
      example: 119
    RateLimit-Remaining-Exhausted:
      description: Requests left in the current window. On a 429 response, none are left.
      schema:
        type: integer
      example: 0
    RateLimit-Reset:
      description: Seconds until the current window ends and the count resets.
      schema:
        type: integer
      example: 42
    Retry-After:
      description: Seconds to wait before you send another request.
      schema:
        type: integer
      example: 42
    WWW-Authenticate:
      description: The authentication scheme the API expects.
      schema:
        type: string
      example: Bearer realm="watership"
  schemas:
    Level:
      type: string
      description: 'How serious a finding is. It usually follows the rule’s tier: `error` for never, `warning` for avoid, `suggestion` for prefer. A few checks report below their tier.'
      enum: [suggestion, warning, error]
    Tier:
      type: string
      description: 'How strongly a rule applies. `never` blocks publication. `avoid` means edit on one sighting, or keep it with a stated reason. `prefer` is a suggestion.'
      enum: [never, avoid, prefer]
    CheckType:
      type: string
      description: '`mechanical` if a pattern can catch it, `judgment` if a reader has to decide.'
      enum: [mechanical, judgment]
    Guide:
      type: string
      description: The guide a rule belongs to.
      enum: [style-guide, ux-writing, slop-guard]
    Group:
      type: string
      description: The check group a finding belongs to. You can turn groups on and off with `groups` in a check request.
      enum: [voice, spelling, caps, punctuation, numbers, interface, links, inclusive, terms, structure, slop, company]
    RuleId:
      type: string
      description: A stable rule id. The prefix names the section, such as `punct-` for punctuation or `floor-` for the slop guard.
      pattern: '^[a-z0-9-]+$'
      maxLength: 200
      examples: [term-please]
    CheckRequest:
      type: object
      additionalProperties: false
      required: [text]
      properties:
        text:
          type: string
          description: The text to check. Up to 100,000 characters.
          minLength: 1
          maxLength: 100000
        format:
          type: string
          description: '`markdown` skips code and reads headings, lists, and tables. `text` treats everything as prose.'
          enum: [markdown, text]
          default: markdown
        min_level:
          $ref: '#/components/schemas/MinLevel'
        groups:
          type: array
          description: Run only the checks in these groups. Leave it out to run every group.
          minItems: 1
          uniqueItems: true
          items:
            $ref: '#/components/schemas/Group'
        mode:
          type: string
          description: '`precise` leaves out matches that are almost always false alarms, such as a banned word inside a quotation or a product name. `vale` reports exactly what the Watership Vale package reports.'
          enum: [precise, vale]
          default: precise
    MinLevel:
      type: string
      description: The lowest level to report.
      enum: [suggestion, warning, error]
      default: suggestion
    CheckResult:
      type: object
      required: [release, engine_version, counts, findings, truncated]
      properties:
        release:
          type: string
          description: The release of the checks that ran, which is the version of the Watership Vale package they come from. It matches the `Watership-Release` header.
        engine_version:
          type: string
          description: The version of the check engine that ran.
        counts:
          type: object
          description: How many findings there are at each level, counted before truncation.
          required: [error, warning, suggestion]
          properties:
            error:
              type: integer
              minimum: 0
            warning:
              type: integer
              minimum: 0
            suggestion:
              type: integer
              minimum: 0
        findings:
          type: array
          description: The findings, sorted by position in the text. At most 500.
          maxItems: 500
          items:
            $ref: '#/components/schemas/Finding'
        truncated:
          type: boolean
          description: '`true` when there were more than 500 findings and only the first 500 are listed.'
    Finding:
      type: object
      description: One place in the text where a check matched.
      required: [check, style, rule_ids, tier, level, group, message, match, span, link]
      properties:
        check:
          type: string
          description: The name of the check that matched, as in the Vale package.
        style:
          type: string
          description: '`Watership` for the stock checks, `Company` for a company’s claims checks.'
          enum: [Watership, Company]
        rule_ids:
          type: array
          description: The rules this check enforces. One check can enforce rules in two guides. Empty for a company claims check, which has no stock rule (Watership ships no claims lists, so these appear only when an organization adds its own).
          items:
            $ref: '#/components/schemas/RuleId'
        tier:
          description: The strictest tier among `rule_ids`, or `null` when there are none.
          oneOf:
            - $ref: '#/components/schemas/Tier'
            - type: 'null'
        level:
          $ref: '#/components/schemas/Level'
        group:
          $ref: '#/components/schemas/Group'
        message:
          type: string
          description: What to change, in one sentence.
        match:
          type: string
          description: The text that matched.
        span:
          $ref: '#/components/schemas/Span'
        replacement:
          type: string
          description: The suggested replacement, when the check has one. The API never applies it.
        link:
          type: string
          format: uri
          description: The rule’s page in the published guide.
    Span:
      type: object
      description: Where the match is in the text you sent.
      required: [index, length, line, column]
      properties:
        index:
          type: integer
          minimum: 0
          description: Offset of the first character, in UTF-16 code units, as JavaScript counts string positions.
        length:
          type: integer
          minimum: 0
          description: Length of the match, in UTF-16 code units.
        line:
          type: integer
          minimum: 1
          description: Line number, starting at 1.
        column:
          type: integer
          minimum: 1
          description: Column, starting at 1, counted in Unicode code points.
    Rule:
      type: object
      required: [id, name, guide, section, tier, check, automated, link]
      properties:
        id:
          $ref: '#/components/schemas/RuleId'
        name:
          type: string
          description: The rule’s name in the guide.
        guide:
          $ref: '#/components/schemas/Guide'
        section:
          type: string
          description: The id of the guide section the rule is in.
        tier:
          $ref: '#/components/schemas/Tier'
        check:
          $ref: '#/components/schemas/CheckType'
        automated:
          type: boolean
          description: '`true` if `POST /v1/checks` can report this rule.'
        link:
          type: string
          format: uri
          description: The rule’s page in the published guide.
    RuleDetail:
      allOf:
        - $ref: '#/components/schemas/Rule'
        - type: object
          required: [body, examples]
          properties:
            body:
              type: string
              description: The rule’s guidance, in Markdown.
            examples:
              type: array
              description: Pairs of text to avoid and text to write instead.
              items:
                $ref: '#/components/schemas/Example'
    Example:
      type: object
      required: [instead, write]
      properties:
        instead:
          type: string
          description: Text that breaks the rule.
        write:
          type: string
          description: The same text, fixed.
    RuleList:
      type: object
      required: [data, has_more, next_cursor]
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Rule'
        has_more:
          type: boolean
          description: '`true` if there is another page.'
        next_cursor:
          description: Pass this as `cursor` to get the next page. `null` on the last page.
          type: [string, 'null']
    TermStatus:
      type: string
      description: '`preferred` is the word to use. `restricted` is fine in a stated sense. `prohibited` is never right. `obsolete` was once in the list and no longer is.'
      enum: [preferred, restricted, prohibited, obsolete]
    Term:
      type: object
      required: [id, term, status, definition, usage, examples, alternatives, rule, related]
      properties:
        id:
          type: string
          description: The entry’s id.
        term:
          type: string
          description: The headword.
        status:
          $ref: '#/components/schemas/TermStatus'
        definition:
          description: What the term means, for Watership’s own terms. `null` for everyday words.
          type: [string, 'null']
        usage:
          type: array
          description: How to use the word, one note per item.
          items:
            type: string
        examples:
          type: array
          items:
            $ref: '#/components/schemas/Example'
        alternatives:
          type: array
          description: Words this entry replaces or competes with.
          items:
            type: object
            required: [term, status]
            properties:
              term:
                type: string
              status:
                $ref: '#/components/schemas/TermStatus'
              usage:
                type: string
                description: When this alternative is fine, if ever.
        rule:
          description: The rule that enforces this entry, or `null` when none does.
          oneOf:
            - type: object
              required: [id, tier, check]
              properties:
                id:
                  $ref: '#/components/schemas/RuleId'
                tier:
                  $ref: '#/components/schemas/Tier'
                check:
                  $ref: '#/components/schemas/CheckType'
            - type: 'null'
        related:
          type: array
          description: Ids of related entries.
          items:
            type: string
    TermList:
      type: object
      required: [data, has_more, next_cursor]
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Term'
        has_more:
          type: boolean
          description: '`true` if there is another page.'
        next_cursor:
          description: Pass this as `cursor` to get the next page. `null` on the last page.
          type: [string, 'null']
    ScalePosition:
      type: object
      description: Where a voice sits on one tone scale, from 0 to 100.
      required: [rest, error, position]
      properties:
        rest:
          type: integer
          minimum: 0
          maximum: 100
          description: The everyday position.
        error:
          type: integer
          minimum: 0
          maximum: 100
          description: The position in an error or other bad news.
        position:
          type: string
          description: The everyday position in words.
    Voice:
      type: object
      required: [id, name, tagline, default_for, personality, scales]
      properties:
        id:
          type: string
          description: The voice’s id.
        name:
          type: string
        tagline:
          type: string
        default_for:
          type: array
          description: The content types this voice suits, for an organization that uses the six voices. The Watership voice is the default for every type, and the six are optional alternatives. The tone scales decide which types each voice suits, and a type that none of the six suits (such as interface text) isn’t listed under any voice.
          items:
            type: string
        personality:
          type: array
          description: Three traits, each with the failure it must not slide into.
          items:
            type: object
            required: [trait, not]
            properties:
              trait:
                type: string
              not:
                type: string
        scales:
          type: object
          description: The voice’s position on each of the six tone scales.
          required: [register, levity, deference, energy, confidence, detail]
          properties:
            register:
              $ref: '#/components/schemas/ScalePosition'
            levity:
              $ref: '#/components/schemas/ScalePosition'
            deference:
              $ref: '#/components/schemas/ScalePosition'
            energy:
              $ref: '#/components/schemas/ScalePosition'
            confidence:
              $ref: '#/components/schemas/ScalePosition'
            detail:
              $ref: '#/components/schemas/ScalePosition'
    VoiceList:
      type: object
      required: [data, has_more, next_cursor]
      properties:
        data:
          type: array
          items:
            $ref: '#/components/schemas/Voice'
        has_more:
          type: boolean
          description: '`true` if there is another page.'
        next_cursor:
          description: Pass this as `cursor` to get the next page. `null` on the last page.
          type: [string, 'null']
    Problem:
      type: object
      description: An error, as an RFC 9457 problem details object.
      required: [type, title, status, detail]
      properties:
        type:
          type: string
          format: uri
          description: A URI that identifies the kind of problem. Branch on this, not on `title` or `detail`.
        title:
          type: string
          description: A short summary of the kind of problem. The same for every problem of one type.
        status:
          type: integer
          description: The HTTP status code.
        detail:
          type: string
          description: What went wrong with this request, in a sentence a person can act on.
        instance:
          type: string
          description: An id for this occurrence. Quote it when you report a problem.
        errors:
          type: array
          description: For `invalid-request` and `text-too-long`, one item per field that failed.
          items:
            type: object
            required: [pointer, detail]
            properties:
              pointer:
                type: string
                description: A JSON Pointer (RFC 6901) to the field in the request body, or the query parameter name prefixed with `#/query/`.
              detail:
                type: string
                description: What’s wrong with that field.
        limit:
          type: integer
          description: For `text-too-long` and `payload-too-large`, the limit that was exceeded.
  responses:
    InvalidRequest:
      description: The request is malformed or a field fails validation. The `type` tells you which.
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            invalidRequest:
              summary: A field fails validation
              value:
                type: https://watership.ca/api/problems/invalid-request
                title: The request is not valid
                status: 400
                detail: One field isn't valid. Each item in "errors" names the field and what's wrong with it.
                instance: req_8Hq2tW4mZ1
                errors:
                  - pointer: /min_level
                    detail: Must be one of suggestion, warning, error.
            textTooLong:
              summary: The text is over 100,000 characters
              value:
                type: https://watership.ca/api/problems/text-too-long
                title: The text is too long
                status: 400
                detail: '"text" is 131,072 characters; the limit is 100,000. Split the text and check each part.'
                instance: req_3Kd9pX7vB2
                limit: 100000
                errors:
                  - pointer: /text
                    detail: Longer than 100,000 characters.
    Unauthorized:
      description: The `Authorization` header is missing, or the key isn’t valid.
      headers:
        WWW-Authenticate:
          $ref: '#/components/headers/WWW-Authenticate'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            missingKey:
              summary: No API key
              value:
                type: https://watership.ca/api/problems/unauthorized
                title: Authentication failed
                status: 401
                detail: Send your API key in the Authorization header as "Bearer <key>".
                instance: req_5Lr1cN8eQ4
    NotFound:
      description: Nothing has that id.
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            unknownRule:
              summary: An unknown rule id
              value:
                type: https://watership.ca/api/problems/not-found
                title: Not found
                status: 404
                detail: No rule has the id "punct-em-dashes". Did you mean "punct-em-dash"?
                instance: req_7Pw4hS2kD6
    PayloadTooLarge:
      description: The request body is over 1 MiB (1,048,576 bytes).
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            bodyTooLarge:
              summary: The body is over 1 MiB
              value:
                type: https://watership.ca/api/problems/payload-too-large
                title: The request body is too large
                status: 413
                detail: The request body is over 1,048,576 bytes.
                instance: req_2Mv6jR9tF1
                limit: 1048576
    UnsupportedMediaType:
      description: The request body isn’t JSON.
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            notJson:
              summary: Wrong content type
              value:
                type: https://watership.ca/api/problems/unsupported-media-type
                title: Unsupported media type
                status: 415
                detail: Send the body as JSON with "Content-Type application/json".
                instance: req_9Ty3bL5wH8
    RateLimited:
      description: This API key has sent more than 120 requests in the current minute.
      headers:
        Retry-After:
          $ref: '#/components/headers/Retry-After'
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining-Exhausted'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            rateLimited:
              summary: Over the rate limit
              value:
                type: https://watership.ca/api/problems/rate-limited
                title: Too many requests
                status: 429
                detail: This key has sent 120 requests this minute. Try again in 42 seconds.
                instance: req_4Gn8vK1sM3
    InternalError:
      description: Something failed on the server. Retry with backoff.
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            internal:
              summary: A server fault
              value:
                type: https://watership.ca/api/problems/internal
                title: Internal error
                status: 500
                detail: The request failed on our side. Try again; if it keeps failing, report the instance id.
                instance: req_6Fs2xQ7nC9
    CheckTimeout:
      description: The check took longer than 5 seconds and was stopped. Retrying the same text won’t help.
      headers:
        RateLimit-Limit:
          $ref: '#/components/headers/RateLimit-Limit'
        RateLimit-Remaining:
          $ref: '#/components/headers/RateLimit-Remaining'
        RateLimit-Reset:
          $ref: '#/components/headers/RateLimit-Reset'
      content:
        application/problem+json:
          schema:
            $ref: '#/components/schemas/Problem'
          examples:
            timeout:
              summary: The check ran out of time
              value:
                type: https://watership.ca/api/problems/check-timeout
                title: The check took too long
                status: 503
                detail: The check took longer than 5 seconds and was stopped. Split the text and check each part.
                instance: req_1Bh5zW3yJ7
  examples:
    DraftCheckRequest:
      summary: Check a Markdown draft
      value:
        text: |
          # Getting Started With Exports

          It's important to note that you can easily utilize the export tool. It allows you to download a seamless copy of your data. Please click Export to begin.

          Exports finish within a day; it is rare for one to fail. The next maintenance window is 11/04/2026.
        format: markdown
        min_level: suggestion
    DraftCheckResult:
      summary: Findings for the draft
      value:
        release: 0.3.3
        engine_version: 1.0.0
        counts:
          error: 1
          warning: 8
          suggestion: 2
        truncated: false
        findings:
          - check: HeadingCase
            style: Watership
            rule_ids:
              - cap-sentence-case-headings
            tier: avoid
            level: warning
            group: caps
            message: 'Use sentence case for headings: “Getting Started With” looks like title case.'
            match: Getting Started With
            span:
              index: 2
              length: 20
              line: 1
              column: 3
            link: https://watership.ca/style-guide/capitalization/#cap-sentence-case-headings
          - check: ImportanceFlags
            style: Watership
            rule_ids:
              - floor-importance-flagging
            tier: avoid
            level: warning
            group: slop
            message: Cut “It's important to note”; if it matters, say it.
            match: It's important to note
            span:
              index: 32
              length: 22
              line: 3
              column: 1
            link: https://watership.ca/slop-guard/#floor-importance-flagging
          - check: Minimizers
            style: Watership
            rule_ids:
              - incl-no-simply
            tier: avoid
            level: warning
            group: inclusive
            message: Delete “easily”; the instruction reads the same without it.
            match: easily
            span:
              index: 68
              length: 6
              line: 3
              column: 37
            link: https://watership.ca/style-guide/inclusive-and-accessible-language/#incl-no-simply
          - check: Use
            style: Watership
            rule_ids:
              - term-use
              - floor-banned-words
            tier: avoid
            level: warning
            group: terms
            message: Use “use” instead of “utilize”.
            match: utilize
            span:
              index: 75
              length: 7
              line: 3
              column: 44
            replacement: use
            link: https://watership.ca/style-guide/terminology/#term-use
          - check: LetsYou
            style: Watership
            rule_ids:
              - term-lets-you
            tier: avoid
            level: warning
            group: terms
            message: Use “lets you” instead of “allows you to”.
            match: allows you to
            span:
              index: 103
              length: 13
              line: 3
              column: 72
            replacement: lets you
            link: https://watership.ca/style-guide/terminology/#term-lets-you
          - check: BannedWords
            style: Watership
            rule_ids:
              - floor-banned-words
            tier: avoid
            level: warning
            group: slop
            message: “seamless” is on the slop guard’s banned list.
            match: seamless
            span:
              index: 128
              length: 8
              line: 3
              column: 97
            link: https://watership.ca/slop-guard/#floor-banned-words
          - check: Please
            style: Watership
            rule_ids:
              - term-please
            tier: avoid
            level: warning
            group: terms
            message: Don’t write “please” in documentation or interface text.
            match: Please
            span:
              index: 156
              length: 6
              line: 3
              column: 125
            link: https://watership.ca/style-guide/terminology/#term-please
          - check: SelectVerb
            style: Watership
            rule_ids:
              - ui-select-verb
            tier: avoid
            level: warning
            group: interface
            message: Use “select” instead of “click”.
            match: click
            span:
              index: 163
              length: 5
              line: 3
              column: 132
            replacement: select
            link: https://watership.ca/style-guide/ui-elements/#ui-select-verb
          - check: Semicolon
            style: Watership
            rule_ids:
              - punct-semicolon
            tier: prefer
            level: suggestion
            group: punctuation
            message: Prefer a period to a semicolon.
            match: ;
            span:
              index: 214
              length: 1
              line: 5
              column: 28
            link: https://watership.ca/style-guide/punctuation/#punct-semicolon
          - check: PronounContractions
            style: Watership
            rule_ids:
              - voice-contractions
            tier: prefer
            level: suggestion
            group: voice
            message: 'Write “it is rare” with a contraction: “it’s”, “you’re”, or “you’ll”.'
            match: it is rare
            span:
              index: 216
              length: 10
              line: 5
              column: 30
            link: https://watership.ca/style-guide/voice-and-person/#voice-contractions
          - check: SlashDates
            style: Watership
            rule_ids:
              - num-no-slash-dates
            tier: never
            level: error
            group: numbers
            message: Write the date “11/04/2026” with the month in full, such as September 15, 2026, or in the ISO form, such as 2026-09-15, where a machine reads it.
            match: 11/04/2026
            span:
              index: 275
              length: 10
              line: 5
              column: 89
            link: https://watership.ca/style-guide/numbers-dates-and-units/#num-no-slash-dates
    TermSignIn:
      summary: An entry with a prohibited alternative
      value:
        id: sign-in
        term: sign in
        status: preferred
        definition: To start a session in a product by proving who you are, such as with a password or a one-time code.
        usage:
          - Write “sign in,” not “log in,” “login,” or “log on.” Use two words as a verb (“sign in to your account”), and hyphenate only as a modifier, as in “the sign-in page.”
        examples:
          - instead: Login to Acme Cloud, then logout when you’re done.
            write: Sign in to Acme Cloud, then sign out when you’re done.
        alternatives:
          - term: log in
            status: prohibited
          - term: log-in
            status: prohibited
          - term: login
            status: prohibited
          - term: log on
            status: prohibited
          - term: logon
            status: prohibited
        rule:
          id: term-sign-in
          tier: avoid
          check: mechanical
        related:
          - sign-out
    VoicePlainspoken:
      summary: The Plainspoken voice
      value:
        id: plainspoken
        name: Plainspoken
        tagline: Direct, clear, helpful.
        default_for:
          - concept
          - task
          - tutorial
          - reference
          - interface guide
          - troubleshooting
          - migration guide
          - comparison
        personality:
          - trait: Direct
            not: blunt
          - trait: Clear
            not: simplistic
          - trait: Helpful
            not: hovering
        scales:
          register:
            rest: 50
            error: 50
            position: the center
          levity:
            rest: 32
            error: 24
            position: toward sober
          deference:
            rest: 52
            error: 60
            position: the center
          energy:
            rest: 40
            error: 28
            position: toward calm
          confidence:
            rest: 56
            error: 56
            position: toward assertive
          detail:
            rest: 50
            error: 50
            position: the center
