# Public paths

###### A public path is a part of an app that answers without sign-in, such as a tracker script or a webhook. Everything else on the hostname needs a signed-in person or a service token.

Set them on the app in the dashboard, under **Public paths**. A preset fills in the paths its tool needs, and you can change them.

| Preset | Public paths |
| --- | --- |
| Umami | `/script.js`, `/api/send` (the tracker, so your sites keep counting) |
| n8n | `/webhook/`, `/webhook-waiting/`, `/form/` |
| Grafana | `/api/health` |
| Metabase OSS, Your own app | None |

#### How a path matches

- A path that ends in `/` covers everything below it. For example, `/webhook/` matches `/webhook/orders` and never `/webhooks`.
- Any other path matches only itself. For example, `/script.js` doesn't match `/script.js/x`.
- Matching is case-sensitive, and the query string doesn't count.
- A public path is public for every method, POST included.
- An app can have up to 16 public paths, each up to 256 characters. A lone `/` is refused.
- Requests on a public path reach your app without the [identity header](/docs/access/identity-header).

Some requests never count as public, even when they look like a match. They need sign-in like any other request:

- A path with `//`, or with a `.` or `..` segment
- A segment that ends in `.` or `%20`
- A raw `;` or `\`, any other character a URL path doesn't allow unescaped, a control character, or a byte outside ASCII
- A percent-escape of a letter, a digit, one of `-._~`, a control character, a byte outside ASCII, or one of `/`, `\`, `.`, `%`, `;`, `?` and `#`
- A percent-escape written in lowercase hex, such as `%2f`
- A path that starts with `/.localcan`, in any letter case (only the start counts: `/public/.localcan/x` is an ordinary path)
- A path longer than 256 characters

These are the spellings that different servers read differently, so a request can't reach a private page by dressing up as a public one.

#### Next.js apps

The path `/_next/` can't be public: it also covers each page's server-side data (`/_next/data/`) and the image optimizer (`/_next/image`), which fetches and serves images without sign-in. Make `/_next/static/` public instead, for the build files.

A page that is public is public for every method, so its Server Actions are public too: they post to the page's own path.

#### PHP apps

A front controller such as `index.php` routes whatever follows it (`/index.php/admin`, `/?rest_route=…`), so making `/index.php` public can make more than one page public. Make the route itself public instead.

#### MCP servers

Give MCP clients a [service token](/docs/access/service-tokens-and-mcp) where they can send one. Public paths are the fallback for a client that can't send custom headers. For an MCP server with its own OAuth sign-in, such as Metabase's, the fallback needs these paths public:

```plaintext
/api/metabase-mcp
/.well-known/oauth-protected-resource/
/.well-known/oauth-authorization-server
/oauth/register
/oauth/token
/oauth/revoke
```

The MCP server's own OAuth is then the only thing that protects them. The `/oauth/authorize` path stays behind sign-in, because it runs in the person's browser. Never make `/api/` public.

