Skip to content

Copy the space into another

POST
/{resource}/copy
curl --request POST \
--url https://example.com/v1/example/copy \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "destination": "example", "commits": true, "overwrite": false }'

Starts copying the space into destination, replacing what’s there. The token needs access to both. The copy runs in the background: poll GET /{destination}/copy for when it’s done. Until then, the destination can’t be opened or used through the API (duplicating).

The copy isn’t public or discoverable, and has no navigation mesh regeneration running, whatever the source’s state. If the destination already has a space, a commit of it is made first.

resource
required
string
/^\d+$/

The project ID of the space

Media typeapplication/json
object
destination
required

The project id of the space to copy into.

string
/^\d+$/
commits

Copy the source’s commits too. The destination’s own are kept, archived.

boolean
default: true
overwrite

Replace the destination if it already has a space.

boolean

The copy has started

Media typeapplication/json
object
destination
string
status
required
string
Allowed values: copying complete failed
source
required

The project id of the space copied from.

string
commits
required

Whether its commits were copied.

boolean
startedAt
required

When the copy started, in milliseconds since the Unix epoch.

integer
finishedAt

When it finished.

integer
error

Why it failed.

string

Example

{
"status": "copying"
}

The body is invalid. issues describes what was wrong.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

The token is missing or invalid.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

The token has no access to this space.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

The destination already has a space and overwrite wasn’t given (destinationNotEmpty), or something is already being copied into it (duplicating)

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

The body isn’t in a format this operation accepts.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

Too many requests. Retry after Retry-After seconds.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}
Retry-After
integer

Seconds to wait before retrying

Something upstream failed.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}

The space is moving between servers. Retry after Retry-After seconds.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}
Retry-After
integer

Seconds to wait before retrying

Something upstream timed out.

Media typeapplication/json
object
error
required

A description of the error

string
code
required

A stable identifier for the kind of error

string
issues

For invalidBody: what failed validation, and where

Array<object>
object

Example generated

{
"error": "example",
"code": "example",
"issues": [
{}
]
}