Skip to content
Design preview: examples use a local mock server.
EndpointsRules

List rules

GET
/v1/rules

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.

Authorization

apiKey
headerAuthorizationBearer <API key>

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.

Query parameters

limit?integer

The most items to return in one page.

Range1 <= value <= 100
Default25
cursor?string

The next_cursor from the previous page. Leave it out for the first page.

Lengthlength <= 200
guide?string

Only rules from this guide.

Value in"style-guide""ux-writing""slop-guard"
tier?string

Only rules of this tier.

Value in"never""avoid""prefer"
check?string

Only rules of this check type.

Value in"mechanical""judgment"
automated?boolean

true for only the rules the automated checks cover, false for only the rules they don’t.

q?string

Words to look for in rule ids, names, and text. Every word must match.

Length1 <= length <= 200

Response body

One page of rules.

application/json
  1. response
data*array<>
has_more*boolean

true if there is another page.

next_cursor*|

Pass this as cursor to get the next page. null on the last page.

Example request
curl -X GET 'http://127.0.0.1:4010/v1/rules?q=semicolon'
Example response
{  "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"}