Skip to main content

Plugins API

This page documents the 2 gateway endpoints tagged plugins in the gateway's OpenAPI document. Every example targets a gateway on http://localhost:4000 and authenticates with the SPANWAY_API_KEY environment variable, which holds the master key or a virtual key that has access to the route. Request and response fields are taken from the schema the running gateway publishes at /openapi.json, and the same document is bundled with this site as openapi.json.

MethodPathSummary
GET/api/pluginsList the Admin UI plugins
GET/api/plugins/auth-tokenIssue a plugin session claim

Endpoints​

GET /api/plugins​

List the Admin UI plugins

The plugins registered under general_settings.plugins, with name, display name and URL, for the Admin UI view switcher. The plugin credential is never returned, the gateway adds it itself on reverse proxied calls. Any signed in user or key may read the list.

Docs (https://docs.spanway.ai/docs/proxy/ui_plugins)

Example request:

curl -X GET "http://localhost:4000/api/plugins" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200The registered pluginsapplication/json array of PluginSummary
401No valid key or Admin UI session was presentedapplication/json ProxyError

GET /api/plugins/auth-token​

Issue a plugin session claim

A short lived identity claim the Admin UI passes to a plugin iframe. It carries the viewer's user id and role, the plugin name and an expiry 30 seconds out, encrypted with a key derived from SPANWAY_SALT_KEY and the plugin name, so each plugin can read only its own claims. It never carries a gateway credential. Any signed in user or key may ask for one.

Docs (https://docs.spanway.ai/docs/proxy/ui_plugins)

Parameters:

NameInTypeRequiredDescription
plugin_namequerystringNo

Example request:

curl -X GET "http://localhost:4000/api/plugins/auth-token" \
-H "Authorization: Bearer $SPANWAY_API_KEY"

Responses:

StatusDescriptionBody
200A claim for the named plugin that expires in 30 secondsapplication/json PluginSessionClaim
404No plugin has that nameapplication/json ErrorDetail
422Validation Errorapplication/json HTTPValidationError
503SPANWAY_SALT_KEY is not set, so no claim can be encryptedapplication/json ErrorDetail

Response fields (200):

FieldTypeRequiredDescription
session_claimstringYesOpaque token the plugin decrypts with its own derived key, valid 30 s