---
title: "Clone a site (via background task)"
method: POST
path: "/v1/sites/{id}/clone"
tags: ["Sites"]
---

# Clone a site (via background task)

`POST /v1/sites/{id}/clone`

Creates a new site using all the contents, plugins, themes, etc from an existing site. The site's URL will be a new temporary URL

## Path parameters

- `id` integer, required

## Request body

- CloneSiteRequest
  - `location` integer — Which Rocket.net Point of Presence the cloned site should be created at. Use the List Site locations API to get the location ID.
  - `restricted_location` integer — If you have dedicated locations, you can use these by ID to add sites at those dedicated locations. (When passed, do not pass location). Use the List Site locations API to get the restricted location ID.
  - `label` string — Label for the cloned site
  - `metadata` SiteMetadata
  - `template_replacements` TemplateReplacement[] — Pass keys and values here and they will be replaced in the site's database
    - `key` string — Key which is already present in the database and should be replaced with value
    - `value` string — Value which the key will be set to

## Response `200`

OK

- TaskIDResponse — Information about the task that was created as a result of this API call
  - `success` boolean — whether the request succeeded
  - `errors` string[]
  - `messages` string[], nullable
  - `result` object
    - `task_id` string — Task ID of the task that is now running
    - `task_level` 'account' | 'site' — Level at which the task exists

## Other responses

- `400` — Bad Request
- `401` — Authentication failed
- `403` — Not authorized to access endpoint
- `404` — Given site not found for user
- `405` — Invalid input
- `500` — Internal error

---

[API](https://skmtc.net/rocket/apis/rocket-net-api.md) · [All operations](https://skmtc.net/rocket/apis/rocket-net-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/rocket/rocket-net-api/revisions/db0dcbbc5764/schema)
