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

Playground

The panel that sends a request to one endpoint from its reference page. Every element on it, what it does, its default, and what changes when you use it.

The playground lets you build a request to one endpoint, send it, and read the response without leaving the docs. To open it, go to an endpoint page under Endpoints in the sidebar, such as Check text, and select Try in playground beside the method and path.

The playground opens over the page, and on a narrow screen it fills the screen. It has four regions, read from the top: the title bar, the address bar, the request inputs on the left, and the request code and response on the right. On a narrow screen the inputs and the response share one space, and a Request and Response switch under the address bar chooses which one shows.

Who can see or change it. The playground runs in your browser. Anyone who can open the docs can use it, and nobody else sees what you enter or what comes back. A request goes only to the server you choose in the address bar. With the local mock server, nothing leaves your computer. The tables below say which values your browser keeps, and for how long.

Title bar

LabelWhat it doesDefaultWhen you use it
The endpoint name, such as Check textNames the endpoint the playground sends to.The endpoint of the page you opened it fromIt’s a heading, not an input. To try another endpoint, close the playground and open it from that endpoint’s page.
ExampleLists the named request examples in the spec for this endpoint. Only Check text has them: Check a Markdown draft and Report errors only. Other endpoints don’t show this list.Check a Markdown draftThe request inputs are replaced with the example’s values, including anything you changed in the body.
Close (×)Closes the playground.NoneThe page comes back. Your inputs and the last response stay until you leave or reload the page, so they’re still there when you open the playground again.

Address bar

LabelWhat it doesDefaultWhen you use it
Method, such as POST or GETShows the HTTP method of the endpoint.The endpoint’s methodIt can’t be changed.
Server URL, such as http://127.0.0.1:4010Opens the Server URL list, which has the servers in the spec: http://127.0.0.1:4010, the local mock server, and https://api.watership.ca, the planned hosted service.http://127.0.0.1:4010Requests go to the server you choose. Your browser saves the choice and uses it on every endpoint page, including on later visits. The hosted service isn’t live, so a request to it fails.
Path, such as /v1/checksShows the endpoint’s path. A path parameter, such as rule_id in /v1/rules/{rule_id}, appears as a box inside the path. The box and the parameter’s row under Path hold the same value.The path from the spec, with each path parameter set to the spec’s example, such as term-pleaseThe value you enter goes into the request address and the request code.
SendSends the request. The button shows its shortcut: Ctrl ↵ (Ctrl+Enter), or ⌘ ↵ on a Mac.NoneYour browser sends the request to the selected server, and the response region shows the result. The response region is dimmed until the response arrives. When it arrives, focus moves to the response, so a screen reader reads it and the keyboard continues from there. On a narrow screen, the switch changes to Response.

Request inputs

The left side lists every input the endpoint takes, in sections. A section appears only if the endpoint uses it.

Authorization

LabelWhat it doesDefaultWhen you use it
Authorization, with apiKeyNames the section and the security scheme in the spec.NoneIt’s a heading, not an input.
Authorization field, with headerHolds the value of the Authorization header. Enter your key after Bearer . The mock server accepts any key, such as wsk_test_example.Bearer with no keyThe header in the request code changes to match. Your browser keeps the value for this tab, so it’s filled in on every endpoint page until you close the tab. With no key, the mock server answers 401 Unauthorized.

Path, Query, and Body

Path holds the path parameters, Query the query parameters, and Body the JSON request body. Path and Query show how many parameters they hold, such as 7 on List rules. Only Check text has a Body, with these controls in its heading:

LabelWhat it doesDefaultWhen you use it
application/jsonShows the content type of the body.application/jsonIt can’t be changed.
FormShows the body as one row per field.SelectedThe body appears as rows.
JSONShows the body as JSON text that you can edit.Not selectedThe body appears as JSON. Edits in either view change the same body, so Form shows what you changed in JSON.

Each field or parameter is one row. The rows follow the spec, and the names match the API reference exactly.

LabelWhat it doesDefaultWhen you use it
Field name, such as text or min_levelNames the field. A red * after the name marks a required field.NoneIt’s a label, not an input.
Field info (ⓘ)Opens a card with the field’s type, its description from the spec, and its limits, such as the 100,000-character limit on text. The card also opens while you hover over the icon.ClosedThe card opens. Select anywhere else to close it.
The valueHolds the field’s value. A field with a fixed set of values, such as format, min_level, mode, or tier, opens a list of those values. A true-or-false field, such as automated, shows true and false. Other fields take text.The selected example’s value, or the spec’s example for the parameter. Otherwise empty, or Unset for a list of values.The request code changes to match.
Type, such as string or integerShows the field’s type from the spec.NoneIt’s a label, not an input.
Unset (×)Removes the field from the request. It appears on any optional field once it has a value.NoneThe field is left out of the request, and the API uses its default.

A list field, such as groups, shows Not set, 1 item, or the number of items, beside its type, array<Group>. Selecting it opens the list in place of the other inputs:

LabelWhat it doesDefaultWhen you use it
Back (←) and the path, such as Body › groupsReturns to the full list of inputs. Selecting Body does the same.NoneThe full list comes back, and the field shows how many items it has.
UnsetRemoves the whole list from the request.NoneThe field is left out, and the API runs every group.
Item, such as [0]Holds one value in the list.The first allowed value, such as voice. Opening an empty list adds one item.The request code changes to match.
Remove item (trash can)Removes that item.NoneThe items after it move up.
Add itemAdds another item.NoneA new row appears at the end.

Request code

The top of the right side shows the request you’ve built, as code you can run somewhere else.

LabelWhat it doesDefaultWhen you use it
RequestNames the region.NoneIt’s a heading, not an input.
Language, such as cURLChooses the language of the code: cURL, JavaScript, Go, Python, Java, C#, or Rust.cURLThe code changes to that language. Your browser keeps the choice for this tab, and the code samples on the endpoint pages use it too.
Copy code (clipboard)Copies the code, including your key.NoneThe icon changes to a check mark to confirm the copy.

Response

The bottom of the right side shows the spec’s example responses until you send a request, then the real response.

Before you send

LabelWhat it doesDefaultWhen you use it
ResponseNames the region.NoneIt’s a heading, not an input.
Status codes, such as 200, 400, and 429Shows one tab for each response the spec documents for this endpoint.200The description and the example change to that status.
Example listChooses between examples when one status has more than one, such as the two 400 examples for Check text. It doesn’t appear otherwise.The first exampleThe example changes.
Description, such as “The check ran. The findings may be empty.”Says what the status means for this endpoint, from the spec.The 200 descriptionIt changes with the status tab.
Example body, with Copy codeShows the example response from the spec.The first 200 exampleCopy code copies it.

The examples are the same ones the mock server responds with. For Check text, the 200 example is the real check engine’s output, generated when the docs are built, for the Check a Markdown draft example.

After you send

LabelWhat it doesDefaultWhen you use it
Status, such as 200 OK or 400 Bad RequestShows the status code and its name. Its dot is green for a success, amber for a 4xx code, and red for a 5xx code.NoneIt’s a label, not an input.
Time and size, such as 25 ms · 3.8 kBShows how long the request took and how large the response body is. It’s hidden when the response region is narrow.NoneIt’s a label, not an input.
BodyShows the response body. JSON is formatted.SelectedThe body appears.
Headers, with a countShows the response headers, such as Watership-Release and the RateLimit- headers. The count is the number of headers.Not selectedThe headers appear in place of the body.
DownloadSaves the response body as a file.NoneYour browser downloads the file.
Clear (×)Removes the response.NoneThe example responses come back.

If a request gets no response at all, the region shows Request failed and a message that suggests checking the server URL. The usual causes are that the mock server isn’t running, or that https://api.watership.ca is selected.

Tasks that use the playground

On this page