Traefik Enterprise includes an API Portal which groups all of the API specifications from your services into a web UI, if they support the OpenAPI format (formerly known as Swagger).
It works by looking for a JSON file on the service endpoint, which should match the file name defined in the configuration, and making it available on the API Portal web app. It does this for all services that expose an API specification file.
In order to enable the API Portal, a
path property must be defined in the static configuration.
API Portal Options¶
path option must be a string representing the name of the specification file to look for on the service endpoint. For example, if
spec.json is defined as
path, the API Portal will try to get this file under the service URL. Thus, the path
<service-url>/spec.json must point to the specification file.
apiportal: path: spec.json
[apiportal] path = "spec.json"
Enabling the API Portal¶
Where is the API Portal served?
Just like the Dashboard, the API Portal is served by Ingress proxies.
This example shows how to enable the API Portal on port
8888 of the domain
To do so, create a router through the dynamic configuration that routes all requests coming through the
internal entrypoint to the
In our case, the entrypoint
internal is listening to the address
First, the applied static configuration should contain the following elements:
# [...] entrypoints: # [...] internal: address: ":8888" apiportal: path: spec.json
# [...] [entryPoints] # [...] [entryPoints.internal] address = ":8888" [apiportal] path = "spec.json"
teectl apply command:
teectl apply --file=static.yaml
teectl apply --file=static.toml
Then, apply the following dynamic configuration:
--- http: routers: apiportal: rule: Host(`apiportal.domain.org`) service: apiportal@internal entryPoints: - internal
[http.routers.apiportal] rule = "Host(`apiportal.domain.org`)" service = "apiportal@internal" entryPoints = ["internal"]
teectl apply command:
teectl apply --file=dynamic.yaml
teectl apply --file=dynamic.toml
At this point, the API Portal is ready to expose specifications from any service on your network, and the web app is available at
There are some examples of valid JSON files on the OpenAPI specification repository.