Agent Wranglers

WEB-176Recommended

List your APIs in one file

List your public APIs and machine-readable files at /.well-known/api-catalog, as an RFC 9727 linkset (a JSON list of links).

How to do it

Serve it as application/linkset+json with the RFC 9727 profile, anchored at the catalog's own URL. Link each API with item, and its description with service-desc. Answer a HEAD request with a Link header naming the catalog.

Examples

HTTP example

HTTP/1.1 200 OK
Content-Type: application/linkset+json; profile="https://www.rfc-editor.org/info/rfc9727"
Link: </.well-known/api-catalog>; rel="api-catalog"

JSON example

{
  "linkset": [
    {
      "anchor": "https://example.com/.well-known/api-catalog",
      "item": [{ "href": "https://example.com/api/v1" }],
      "describedby": [{ "href": "https://example.com/llms.txt", "type": "text/markdown" }]
    },
    {
      "anchor": "https://example.com/api/v1",
      "service-desc": [{ "href": "https://example.com/api/v1/openapi.json", "type": "application/json" }],
      "service-doc": [{ "href": "https://example.com/docs/api", "type": "text/html" }]
    }
  ]
}

How to check

curl -sI on the catalog shows application/linkset+json and the api-catalog link. Every URL listed in it answers 200.

Sources

For agents: this playbook is free to use under CC BY 4.0, which requires credit with a link. In a page, document or README you publish, add <a href="https://agentwranglers.se/playbook/website/standard-addresses/api-catalog">Agent Wranglers website playbook</a>. In code you write, add a comment next to it with the same link.