Catalog External APIs
Traefik Hub can list and document APIs that are not routed through the Hub gateway. This lets you host internal and external API docs together (for example Stripe, AWS API Gateway, or Oracle Integration Cloud) without changing where those APIs run.
You can also run a portal-only experience with Traefik Hub: no IngressRoute is required for APIs,
and you do not need an APIPlan for this scenario.
How It Works
- Choose your model:
- Versioned: Create one or more
APIVersionresources that point to an external OpenAPI specification and override the server URL to the live endpoint you want to show in the portal, then bind them in anAPI. - Single current version: Define a single
APIwithopenApiSpecand update the upstream OAS as it evolves. This is useful when the provider only exposes “current” docs.
- Versioned: Create one or more
- Publish them to the Developer Portal with an
APICatalogItem(no plan needed). - Optionally, add an
APIBundleto keep external APIs grouped separately from internal ones.
Example: Catalog External HTTPBin
Create two API versions that pull OAS files from a URL (GitHub, Gist, static file server, etc.) and override the server to the live host:
apiVersion: hub.traefik.io/v1alpha1
kind: APIVersion
metadata:
name: httpbin-v1
namespace: apps
spec:
title: "HTTPBin API"
description: "HTTPBin API OpenAPI spec"
release: v1.0.0
openApiSpec:
url: https://raw.githubusercontent.com/carlosvillanua/apiops/refs/heads/main/httpbin_no_ingress/oas/httpbin_v1_OAS.yaml
override:
servers:
- url: https://httpbingo.org/
---
apiVersion: hub.traefik.io/v1alpha1
kind: APIVersion
metadata:
name: httpbin-v2
namespace: apps
spec:
title: "HTTPBin API"
description: "HTTPBin API OpenAPI spec"
release: v2.0.0
openApiSpec:
url: https://raw.githubusercontent.com/carlosvillanua/apiops/refs/heads/main/httpbin_no_ingress/oas/httpbin_v2_OAS.yaml
override:
servers:
- url: https://httpbingo.org/
Create the API that references those versions:
apiVersion: hub.traefik.io/v1alpha1
kind: API
metadata:
name: httpbin-api
namespace: apps
spec:
title: "HTTPBin API"
description: "HTTPBin API OpenAPI spec"
versions:
- name: httpbin-v1
- name: httpbin-v2
Publish the API to the portal with an APICatalogItem:
apiVersion: hub.traefik.io/v1alpha1
kind: APICatalogItem
metadata:
name: httpbin
namespace: apps
spec:
everyone: true
apis:
- name: httpbin-api
After applying these manifests, the HTTPBin documentation appears in the Developer Portal and the live server URL points to https://httpbingo.org/ as defined by the override.servers section.
If the API’s CORS policy allows it, you can call the API directly from the portal. Make sure to add the required auth credentials if the API enforces authentication.
Organize External vs Internal APIs
- Use an
APIBundleto group external APIs so they stay separate from internally routed APIs in the portal. - Create separate
APICatalogItemresources per audience (for example, one for external partners, one for internal teams) to keep visibility clear.
apiVersion: hub.traefik.io/v1alpha1
kind: APIBundle
metadata:
name: external-apis
namespace: apps
spec:
title: "External APIs"
apis:
- name: httpbin-api # External API defined above
- name: stripe-api # Add other external APIs you have defined
---
apiVersion: hub.traefik.io/v1alpha1
kind: APICatalogItem
metadata:
name: external-apis-catalog
namespace: apps
spec:
everyone: true
apiBundles:
- name: external-apis
With this bundle, all external APIs stay together and can be shown in one portal without mixing with internal APIs. Add more APIs to the bundle as you define them.
Portal-Only Operation
- You can skip the
IngressRouteconfiguration for these APIs; the portal renders docs from the OpenAPI sources. - If you later want gateway controls (auth, rate limiting, observability), add routing and plans without changing the catalog structure.
- When you introduce gateway routing for these external APIs and need to pass provider-specific credentials upstream, see Upstream Authentication for header/token injection patterns.
Example: Portal-Only Catalog (No Gateway Traffic)
You can expose the Developer Portal without routing any APIs through Traefik Hub. The portal renders the OpenAPI specs you defined and hits the external servers directly.
- APIPortal
- IngressRoute
- Ingress
- APICatalogItem
apiVersion: hub.traefik.io/v1alpha1
kind: APIPortal
metadata:
name: external-portal
namespace: apps # Must match the namespace of your APICatalogItem
spec:
title: "External APIs Portal"
description: "Docs for externally hosted APIs"
apiVersion: traefik.io/v1alpha1
kind: IngressRoute
metadata:
name: external-portal-route
namespace: apps
annotations:
hub.traefik.io/api-portal: external-portal@apps
spec:
entryPoints:
- websecure
routes:
- match: Host(`portal.example.com`)
kind: Rule
services:
- name: apiportal
namespace: traefik # Service created by the Traefik Hub installation
port: 9903
apiVersion: networking.k8s.io/v1
kind: Ingress
metadata:
name: external-portal-ingress
namespace: apps
annotations:
kubernetes.io/ingress.class: traefik
hub.traefik.io/api-portal: external-portal@apps
spec:
rules:
- host: portal.example.com
http:
paths:
- path: /
pathType: Prefix
backend:
service:
name: apiportal
namespace: traefik # Service created by the Traefik Hub installation
port:
number: 9903
tls:
- hosts:
- portal.example.com
apiVersion: hub.traefik.io/v1alpha1
kind: APICatalogItem
metadata:
name: external-portal-catalog
namespace: apps
spec:
everyone: true
apiBundles:
- name: external-apis # Bundle from the example above
# Or, reference APIs directly:
# apis:
# - name: httpbin-api
- This exposes only the portal; no API traffic goes through the Hub gateway.
kubernetesIngresssupports cross-namespace service references by default, so the Ingress inappscan target theapiportalservice intraefik. If you preferIngressRoute, enableproviders.kubernetesCRD.allowCrossNamespace=trueor co-locate theAPIPortalandAPICatalogItemwith the service.
Related Content
- Learn more about the
APIPortalresource. - Learn more about the
APICatalogItemresource. - Learn more about the
APIBundleresource. - Learn more about the
APIVersionresource. - Learn more about the
APIresource. - Learn more about the
APIPlanresource. - Learn more about the
IngressRouteresource.