APIs can be associated with Catalog services, which allows API consumers and service owners to see which APIs and services are associated with each other. If you’ve already assigned API specs to a service from integrations, migrate them to APIs.
Note: After an API spec is migrated to an API, the API spec is unlinked from the integration and will instead be stored as a snapshot by Kong. Since APIs take a snapshot of the API spec when it’s linked, they do not update automatically. For example, if you update your ingested spec in AWS, it doesn’t automatically pull changes in to the API, you must re-upload the spec manually.
To link APIs with a Catalog service, you need the following Konnect roles at a minimum for the services and APIs:
- API viewer
- Service viewer
- Service admin
To link APIs to a service, do the following:
- In the Konnect sidebar, click Catalog.
- In the Catalog sidebar, click Services.
- Click a service you want to associate an API with.
- Click the APIs tab.
- Click Link API.
- Select the APIs you want to link.
- Click Link APIs.
You will now see the API with your API spec linked to the Catalog service. Users who view APIs will also be able to see any linked Catalog services.
To map a service to an API, send a POST request to the /catalog-services/{serviceId}/api-mappings endpoint:
curl -X POST "https://us.api.konghq.com/v1/catalog-services/$CATALOG_SERVICE_ID/api-mappings" \
--no-progress-meter --fail-with-body \
-H "Authorization: Bearer $KONNECT_TOKEN" \
--json '{
"api_id": "'$API_ID'"
}'