---
title: "Endpoint pages and Try it"
description: "Choose which operations get pages, add your own text to one, and decide whether readers can send requests."
---

Each operation in your spec becomes an endpoint page: a bar with the method and path, then the description, the
authorization, the parameters, the request body and the responses. Beside them, request examples in cURL, JavaScript,
Python and Go, and then each response.

## Pick the operations

A group with `openapi` and no `pages` lists the whole spec. To list operations yourself, name each one in `pages`, as
`"<spec> METHOD /path"`:

```json docs.json
{
  "group": "Deploys",
  "pages": [
    "openapi.yaml POST /api/sites/{id}/deploy",
    "openapi.yaml GET /api/sites/{id}/analytics"
  ]
}
```

When the group names its spec with `openapi`, or `api.openapi` sets one, leave the spec out: `"POST /api/sites/{id}/deploy"`.
The sidebar shows each operation's method as a badge.

## Add your own text to one

Give a page its own file, and point it at an operation with `openapi` in its frontmatter. What you write shows after
the bar and before the parameters.

```mdx guides/start-a-deploy.mdx
---
title: "Start a deploy"
openapi: "POST /api/sites/{id}/deploy"
---

Call this from CI after your docs merge.
```

List the page in `docs.json` like any other page. If the operation isn't in a spec, the page shows a notice with your
own content, and the build warns.

- `openapi` (string): `"[spec] METHOD /path"`. Leave out the spec when the site has one. To write the page without a spec, see
  [Hand-written endpoint pages](/api-docs/hand-written).

To show your own request and response examples, put `RequestExample` and `ResponseExample` in the page. They replace the
generated ones. See [API fields and examples](/components/api-fields).

## Try it

On an interactive page, **Try it** opens a dialog with a field for each parameter and for the authorization, and
sends the request to the API. The reader's browser sends it, straight to the spec's first server. Specly doesn't see it.

That has two limits:

- The server must be an `https://` or `http://` address. Without one, Try it says there's no server to send to.
- The API must answer requests from your docs site (CORS). If it doesn't, the browser blocks the call.

Choose how much readers get for the whole site in `docs.json`:

```json docs.json
{
  "api": { "playground": { "display": "simple" } }
}
```

- `api.playground.display` (string, default: `interactive`): `interactive` adds Try it. `simple` shows the endpoint page and the examples, with no Try it. `none` hides the
  playground. `auth` is read as `simple`, because readers aren't signed in to your API.

- `playground` (string): In a page's frontmatter: `interactive`, `simple` or `none`, for that page only. Anything else is ignored with a
  warning, and the site's setting applies.

A request that starts something real, like a deploy, is a good reason to choose `simple`. Specly's own API reference does:
a call from a browser would also fail the CORS check.

### Your values

If a request example holds a placeholder such as `{{ORG_ID}}` and you've listed it in `specly.placeholders`, readers fill
it in once with **Your values**, and Try it uses it. See [Runnable code](/write/runnable-code).
