---
title: "Hand-written endpoint pages"
description: "Document an endpoint without a spec: write the page, and add the method bar with one line of frontmatter."
---

If you have no OpenAPI file, or an endpoint isn't in it, write the page yourself. Add `api` to its frontmatter, and the
page gets the method bar and a method badge in the sidebar.

```mdx guides/list-projects.mdx
---
title: "List projects"
api: "GET https://api.your-product.dev/v1/projects"
---

Returns the projects in your account.
```

- `api` (string): `"METHOD address"`. The method is get, put, post, delete, options, head, patch or trace. A full address is shown as
  written. A path that starts with `/` is added to the first address in `api.baseUrl` in `docs.json`.

The bar shows the method and address, with **Copy** for the whole address. There's no Try it on a hand-written page,
since there's no spec to build the form from.

## Write the rest

Everything after the frontmatter is your own. Use [API fields](/components/api-fields) to describe the parameters and
the response, and `RequestExample` and `ResponseExample` to show them beside the text:

````mdx Fields
<ParamField query="limit" type="integer" default="20">
  How many projects to return.
</ParamField>

<ResponseField name="projects" type="object[]">
  The projects, newest first.
</ResponseField>
````

````mdx Examples
<RequestExample>

```bash
curl -H "Authorization: Bearer $API_TOKEN" https://api.your-product.dev/v1/projects
```

</RequestExample>
````

## Mix the two

`api` and `openapi` do different jobs. Use `api` when no spec describes the endpoint. Use `openapi` to build the page from
a spec, and add your own text. To keep a spec operation out of the generated pages and write it by hand, mark it
`x-hidden` in the spec, then add a page with `api`. See [Set up OpenAPI](/api-docs/openapi).
