Routes

Change a page's URL

Moves a page's route from from to to. The whole route record moves (content key, layout, title, …), menu links and other redirects that pointed at the old path retarget automatically, and a 301 redirect is left at the old path unless leaveRedirect is false. The change is staged to the draft — publish to make it live.

It is safe to retry: resend the same call after any error and a partly finished move completes. If to already serves exactly the content from did, the move counts as already done and answers 200.

post/api/v1/sites/{slug}/routes/rename

Request

  • Base URL: https://api.dotsy.ai
  • URL: https://api.dotsy.ai/api/v1/sites/{slug}/routes/rename
  • Auth: HTTP bearer

Path parameters

slugstring required
Example:acme-studio

Site slug or site id (UUID). An old slug answers 301/308 and a site id 307 to the canonical slug path.

Request body

fromstring required

The page's current route path: a site path without ?, # or spaces.

tostring required

The new route path: a site path without ?, # or spaces.

leaveRedirectboolean

Leave a 301 redirect from from to to (default true). false removes the old path outright, so old links break.

Example request

{
  "from": "/old-page",
  "to": "/new-page"
}

Response

Moved (staged).

menuItemsUpdatedinteger required

Menu links that followed the page to its new URL.

redirectsRetargetedinteger required

Other redirects that pointed at the old path and now point at the new one.

publishedfalse required

Always false: a route change is staged until you publish.

hintstring required

Example response

{
  "route": {
    "path": "/about",
    "contentKey": "about.html",
    "layout": "layouts/main.html",
    "title": "About us"
  },
  "redirect": {
    "path": "/about",
    "contentKey": "about.html",
    "layout": "layouts/main.html",
    "title": "About us"
  },
  "hint": "Changes staged to draft — call publish_site to go live."
}

Changes

No recorded changes to this operation across all 1 revision of this API.