Hand-editing through the Admin API leaves no record of what changed. decK exports the running state to a file, diffs it against your repository, and applies only the difference.
# export what is running now
deck gateway dump -o kong.yaml
# see what would change
deck gateway diff -s kong.yaml
# apply it
deck gateway sync -s kong.yaml
# keep secrets out of the file
deck gateway sync -s kong.yaml --set-var 'redis_pw=$REDIS_PW'
# validate in CI without a running Kong
deck file validate kong.yaml
$ deck gateway diff -s kong.yaml
updating service billing
url: http://billing.internal:8080 -> http://billing.internal:9090
creating plugin rate-limiting for route billing-route
Summary:
Created: 1 Updated: 1 Deleted: 0
# deck sync deletes anything in Kong that is NOT in the file. That is the
# point, and it is also why the first sync against a hand-managed gateway
# should always be a diff.
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