Those two objects are the whole model. A Service points at your backend; one or more Routes decide which incoming requests are sent to it.
curl -i -X POST http://localhost:8001/services \
--data name=billing \
--data url=http://billing.internal:8080
curl -i -X POST http://localhost:8001/services/billing/routes \
--data name=billing-route \
--data 'paths[]=/billing'
curl -i http://localhost:8000/billing/invoices/42
HTTP/1.1 201 Created (service)
HTTP/1.1 201 Created (route)
HTTP/1.1 200 OK (proxied to billing.internal:8080/invoices/42)
# A Service with no Route is unreachable. A Route must belong to a Service
# (or, from Kong 3.x, it can point straight at an upstream via `service`).
Run this yourself in the Online Java Compiler, spin up a live REST API in the API Sandbox, or practise with Java interview questions.
Published 2026-08-25