Skip to main content
Table of contents


Edit an existing route in the Router

The Router API database is populated from the Publishing API, and also the deprecated router-data tool. Changes to routes should be made in the Publishing API as this is the authoritative source of the data, however, it can be helpful to make short term changes to routes manually, when going through the Publishing API would take too long, for example during an incident.

If there’s a need to edit a route in the database:

  1. Connect to a router-backend machine
gds govuk connect -e production ssh aws/router_backend
  1. Connect to router-api and get the route
govuk_app_console router-api
> r = Route.where(incoming_path: '/path-to-item').first
  1. Manipulate the r object directly (see the documentation for available options), for example:
> r.route_type = 'exact'
  1. Once you’ve edited the route appropriately and saved it, reload the router
> RouterReloader.reload
This page was last reviewed on 18 May 2020. It needs to be reviewed again on 18 November 2020 by the page owner #govuk-developers .
This page was set to be reviewed before 18 November 2020 by the page owner #govuk-developers. This might mean the content is out of date.