Skip to main content
Last updated: 13 Apr 2021

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'
> r.save!
  1. Once you’ve edited the route appropriately and saved it, your changes will be applied and visible shortly after.