Copy the space into another
const url = 'https://example.com/v1/example/copy';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"destination":"example","commits":true,"overwrite":false}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}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.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”The project ID of the space
Request Bodyrequired
Section titled “Request Bodyrequired”object
The project id of the space to copy into.
Copy the source’s commits too. The destination’s own are kept, archived.
Replace the destination if it already has a space.
Responses
Section titled “Responses”The copy has started
object
The project id of the space copied from.
Whether its commits were copied.
When the copy started, in milliseconds since the Unix epoch.
When it finished.
Why it failed.
Example
{ "status": "copying"}The body is invalid. issues describes what was wrong.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token is missing or invalid.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The token has no access to this space.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
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)
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The body isn’t in a format this operation accepts.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Too many requests. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream failed.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}The space is moving between servers. Retry after Retry-After seconds.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}Headers
Section titled “Headers”Seconds to wait before retrying
Something upstream timed out.
object
A description of the error
A stable identifier for the kind of error
For invalidBody: what failed validation, and where
object
Example generated
{ "error": "example", "code": "example", "issues": [ {} ]}