---
search:
  tags:
    - Tenants
    - POST
seo:
  description: >-
    Copies the lunas of a tenant into another tenant, as they are now or as…
    Reference for the POST /_luna/tenants/{tenant}/fork-all endpoint in the Luna
    API.
sidebar:
  label: Copy every luna to another tenant
  badge: POST
title: Copy every luna to another tenant
type: openapi-operation
---
Copies the lunas of a tenant into another tenant, as they are now or as they were at an earlier moment. A destination with nothing deployed gets the source's code and settings first. One request copies one page of lunas. Send the `cursor` it returns to copy the next page, until the cursor is null. Reading the source needs `data:read` on its tenant, and writing the copies needs `data:write` on the destination.

`POST /_luna/tenants/{tenant}/fork-all`

**Request body** (`application/json`, required)

- `to` (string, required) — The tenant to copy into, by its full name.
- `at` (integer<int64> | null) — The moment to copy the lunas as of, in milliseconds since the Unix epoch. Now when left out.
- `schedules` (boolean) — Whether each copy keeps the schedules its source has.
- `cursor` (object | null) — The \`cursor\` of the last page, to copy the next one.
- `limit` (integer<int32> | null) — How many lunas to copy in this request. 64 when left out, 1000 at most.

Request body example:

```json
{
  "to": "string",
  "at": 0,
  "schedules": true,
  "cursor": {},
  "limit": 0
}
```

**Responses**

- `200` — What this page copied.
- `default` — The request failed. The status says how and \`error.message\` says why.

Response example, 200:

```json
{
  "copied": 0,
  "skipped": 0,
  "cursor": {
    "type": "string",
    "after": {}
  }
}
```
