Content

Rename a content key (and optionally its URL)

Re-keys a page: the last path segment becomes newSlug, the directory and extension stay. Works on a draft page and on a published static page. key is sent in the body, so a nested key such as blog/post.html needs no percent-encoding. The change is staged — publish to make it live.

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

Request

  • Base URL: https://api.dotsy.ai
  • URL: https://api.dotsy.ai/api/v1/sites/{slug}/content/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

keystring required

The content key to rename. Send it raw: it may contain / (for example blog/post.html).

newSlugstring required

The new last path segment. It is slugified (lowercased, hyphenated) and replaces the file name; the directory and extension are kept.

movePathboolean

Published pages only: move the page's route to the new URL (menu links follow) instead of dropping the route and serving the page at its key-derived URL. A draft rename ignores it.

leaveRedirectboolean

With movePath: true on a published page, leave a 301 redirect at the old URL. Default true. A draft rename ignores it.

Example request

{
  "key": "blog/untitled.html",
  "newSlug": "my-first-post"
}

Response

Renamed (staged).

keystring required

The content key after the rename.

pathstring

The route path the page now serves at, when it has one.

oldKeystring

The key before the rename.

oldPathstring

The route path before the rename.

writtenstring[] required

Every content key the rename staged: the new key and the old key's removal — for a shared section (fragments/<name>.html) also each page, layout and section that places it. Publish exactly these to make it live.

publishedfalse required

Always false: a rename is staged until you publish.

hintstring required

Reminder that the change is staged.

Example response

{
  "key": "blog/my-first-post.html",
  "path": "/blog/my-first-post",
  "oldKey": "blog/untitled.html"
}

Changes

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