Vendor knowledge for API catalogs¶
The vendor of an API can publish knowledge pages and automations for agents that use it: when to use the API, its limits, how to batch calls, and scripts that do the common jobs. An administrator gives an API catalog the address of the vendor's archive, and the platform imports it while a connection reading the catalog is trusted.
Trust decides everything¶
A connection's Trust level (trust_level in its configuration, Admin > Connections) is untrusted by default. While none of a catalog's connections is trusted:
- nothing is fetched or imported from the catalog's knowledge URL
- its pages are shown to nobody, and its templates are offered to nobody
- no automation can start loading one of its libraries
A person sees a catalog's vendor pages and templates only while a persona they hold reaches a trusted connection of the catalog. That applies to administrators too. Pages are visible through search, fetch, the portal's Knowledge list and page view, list_connections (each trusted connection lists the catalog's entry page first among the pages that document it), and api_discover on a trusted connection (the entry page and the other pages, as titles and references). A vendor page is never added to platform_info or to the agent instructions.
Setting a connection back to untrusted, or removing it, takes effect on the next request on every replica. Within a minute the platform also records the catalog as untrusted, posts to the API change notification channels, and emails the owner of each automation that loads one of the catalog's libraries. Those automations keep running the version they load.
Setting the knowledge URL¶
Open the catalog under Admin > API catalogs. Its Knowledge section holds:
- Knowledge URL: the archive's https address. It may carry a key in its query. The URL is stored as written and shown to administrators with each query value masked. It is never written to an error, an audit row, a change report or a notification; an error names the host and path alone.
- Updates: Apply as they arrive, or Hold each for an administrator to accept. A held update lists every page and automation it adds, changes or removes, with each changed page's diff, and waits for Accept or Discard.
- Check for updates: daily (the default), weekly, monthly, or only when an administrator selects Check now.
The section also lists the catalog's connections and which are trusted, every vendor page with its version and status, every automation with what the last import made of it, and the history of updates.
The archive is fetched with the same address checks as a spec fetched by URL: a private address is refused unless apigateway.catalog_fetch.allow_private_cidrs admits it (API Catalogs).
What an import checks¶
A check fetches the archive (sending the last ETag, so an unchanged archive is not read again), reads it, and applies it or holds it.
An archive is refused whole, and nothing from it applies, when it is over a limit, holds a member that is not one of the four kinds below or has an unsafe name, or its manifest does not read. A refused or failed check leaves the copy imported last serving, and the Knowledge section says what failed.
Every page and automation then passes these checks:
- invisible, bidirectional and control characters are removed
- an item that names a tool this deployment does not register is held, with the tools it names
- an item that holds a credential shape, or one of this deployment's own stored secret values, is held, with the kind of credential and the field it is in, never the value
A held item is listed with its reason and not imported. An automation must also pass the save gate every saved script passes (its tests, coverage and lint); one that fails is skipped and listed with the reason.
Pages¶
Vendor pages are knowledge pages marked with the vendor's name. They are read-only, and their slug is the catalog id, a slash and the vendor's slug (stripe-api-2025-01/overview), so a vendor page can never take a platform or deployment page's slug. Each import that changes a page records a new version authored by the catalog. A page the archive no longer holds leaves search and fetch with its history kept.
A vendor page's images are not loaded and its Mermaid diagrams are not drawn: the portal shows where each image would come from, and a diagram's source on request.
Hide on a page (on the page itself, or under the catalog's Knowledge section) removes it from search and fetch on this deployment, and later imports leave it hidden. Restore in the Knowledge section brings it back.
Automations: templates and libraries¶
An automation in the archive is a template or a library.
- A template is listed under Automations > Templates and in
manage_script command=help. It cannot be run. Use this saves a copy the person owns, through the same save gate as any automation they save, and the copy runs as them. A template's parameter markedui: {connection: catalog}becomes a choice of the catalog's trusted connections the person reaches. The page shows what the template touches and flags each step that reaches outside the catalog: a statement on a query engine, or a call on a connection the catalog does not hold. Recordings the template's tests replay are copied with it, unless this deployment holds a recording with that id and other content, which refuses the copy. - A library is loaded as
lib:<catalog>/<name>@<version>, for exampleload("lib:stripe-api-2025-01/pagination@3", "each_page"). A library version, once imported, cannot change: the vendor publishes a change as a new version. An automation's page says when a newer version is available, and when the library's catalog is no longer trusted. A person cannot name an automation of their ownlib:<catalog>/<name>.
The archive¶
The archive is a zip or a gzipped tar file holding:
| Member | What it is |
|---|---|
manifest.yaml |
The vendor's name, the entry page and what each automation is. |
pages/<slug>.md |
One page: YAML front matter (title, required; summary; tags) and a Markdown body. A slug is lowercase letters, digits and hyphens. |
automations/<name>.star |
One automation's source, exactly as a person would save it. |
recordings/<run id>.rec |
A recorded run an automation's tests replay (testing.replay("<run id>")). |
format: 1
vendor: Stripe
entry: overview
automations:
refund_report:
description: Lists yesterday's refunds by reason and saves them as a table.
params:
- name: connection
type: string
required: true
ui:
connection: catalog
pagination:
version: 3
A library names its version (automations.<name>.version); a template's versions are counted by the platform.
Limits¶
| Key | Default | What it bounds |
|---|---|---|
apigateway.catalog_fetch.knowledge.max_archive_bytes |
20 MiB | The archive as fetched. |
apigateway.catalog_fetch.knowledge.max_pages |
200 | Pages in one archive. |
apigateway.catalog_fetch.knowledge.max_page_bytes |
256 KiB | One page. |
apigateway.catalog_fetch.knowledge.max_automations |
100 | Automations in one archive (and four recordings each). |
apigateway.catalog_fetch.knowledge.max_automation_bytes |
256 KiB | One automation's source. |
A refusal names the key to raise.
REST API¶
Administrator routes, under /api/v1/admin/api-catalogs/{id}/knowledge. Each change is audited, with the catalog and whether the URL changed, never the URL.
| Method | Path | What it does |
|---|---|---|
GET |
/knowledge |
The settings (URL masked), connections and trust, pages, automations, the held update and history. |
PUT |
/knowledge |
Saves url (omit to keep it), hold and refresh_interval_seconds (0, or 3600 to 7776000). |
DELETE |
/knowledge |
Removes the knowledge URL. |
POST |
/knowledge/check |
Checks now. |
POST |
/knowledge/accept, /knowledge/discard |
Decides the held update. Accept is refused (409) while no connection is trusted. |
POST |
/knowledge/pages/{slug}/hide, /restore |
Hides or restores a vendor page. |
Portal routes, for anyone signed in, answer only for catalogs with a trusted connection the caller reaches:
| Method | Path | What it does |
|---|---|---|
GET |
/api/v1/portal/vendor-templates |
The templates the caller may copy. |
GET |
/api/v1/portal/vendor-templates/{catalog}/{name} |
One template: its source, parameters, flow, the steps outside its catalog and the connections the caller may choose. |
POST |
/api/v1/portal/vendor-templates/{catalog}/{name}/use |
Saves a copy (name, connection); a save gate refusal answers 422 with its reason. |
GET |
/api/v1/portal/scripts/{id}/vendor-libraries |
Each vendor library an automation loads and whether its catalog is trusted; the vendor's name and the newest version only for a catalog the caller sees. |