-
Notifications
You must be signed in to change notification settings - Fork 7
Document RFC 9727 API catalog discovery endpoint #5291
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| --- | ||
| title: API catalog discovery | ||
| description: Fern docs sites expose a standards-based API catalog endpoint so AI agents, MCP clients, and API catalog crawlers can discover your APIs automatically. | ||
| --- | ||
|
|
||
| Fern docs sites implement [RFC 9727](https://www.rfc-editor.org/rfc/rfc9727) to let AI agents, MCP clients, and API catalog crawlers discover your APIs without scraping HTML. Every docs site automatically serves a `/.well-known/api-catalog` endpoint and advertises it via a [`Link`](https://www.rfc-editor.org/rfc/rfc8288) response header on every page. | ||
|
|
||
| No configuration is required — the catalog is generated from your visible [API Reference](/learn/docs/api-references/overview) navigation. | ||
|
|
||
| ## How it works | ||
|
|
||
| Every page response includes a `Link` header pointing to the catalog: | ||
|
|
||
| ```http | ||
| Link: </.well-known/api-catalog>; rel="api-catalog" | ||
| ``` | ||
|
|
||
| A `GET` or `HEAD` request to `/.well-known/api-catalog` returns an [RFC 9264](https://www.rfc-editor.org/rfc/rfc9264) Linkset document (`application/linkset+json`) listing each visible API. Each entry contains: | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [vale] reported by reviewdog 🐶 |
||
|
|
||
| - **`anchor`** — the URL of the human-readable API Reference page | ||
| - **`service-desc`** — the machine-readable [OpenAPI spec](/learn/docs/developer-tools/openapi-spec) (`/openapi.yaml?api=<id>`) | ||
| - **`service-doc`** — the same reference page as the anchor | ||
|
|
||
| ```json title="Example response" | ||
| { | ||
| "linkset": [ | ||
| { | ||
| "anchor": "https://example.docs.com/api-reference", | ||
| "service-desc": [ | ||
| { | ||
| "href": "https://example.docs.com/openapi.yaml?api=abc123", | ||
| "type": "application/yaml" | ||
| } | ||
| ], | ||
| "service-doc": [ | ||
| { | ||
| "href": "https://example.docs.com/api-reference", | ||
| "type": "text/html" | ||
| } | ||
| ] | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| Hidden API references (set with `hidden: true` or with all endpoints hidden) are excluded from the catalog. | ||
|
|
||
| ## Trying it out | ||
|
|
||
| You can test the endpoint on any Fern docs site: | ||
|
|
||
| ```bash | ||
| curl -s https://your-docs-site.com/.well-known/api-catalog | jq . | ||
| ``` | ||
|
|
||
| For sites with a basepath like `/docs`, the endpoint is at `/.well-known/api-catalog` under that basepath: | ||
|
|
||
| ```bash | ||
| curl -s https://your-docs-site.com/docs/.well-known/api-catalog | jq . | ||
| ``` | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| --- | ||
| tags: ["ai"] | ||
| --- | ||
|
|
||
| ## API catalog discovery | ||
|
|
||
| Your docs site exposes an [RFC 9727](https://www.rfc-editor.org/rfc/rfc9727) `/.well-known/api-catalog` endpoint and advertises it via `Link` response headers, enabling AI agents, MCP clients, and API catalog crawlers to discover your APIs automatically. The catalog is generated from your visible API Reference navigation and requires no configuration. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 📝 [vale] reported by reviewdog 🐶 |
||
|
|
||
| <Button intent="none" outlined rightIcon="arrow-right" href="/learn/docs/ai-features/api-catalog">Read the docs</Button> | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Acronyms] 'RFC' has no definition.