Boot one or more new sandboxes from a running, suspended, or resume-failed source, restoring filesystem, memory, and running processes so each copy warm-starts.
This path accepts either the sandbox ID or the sandbox name.
The source must be running, suspended, or resume_failed. Any other state returns 400 Bad Request. A retained checkpoint must still be available and usable for copying.
A running source is copied from the executor hosting it. A suspended or resume-failed source is copied from its retained checkpoint, so a copy does not leave a new checkpoint behind for you to clean up.
Copies inherit the source’s image, resources, entrypoint, network policy, exposed ports, and auto_resume setting. A copy with auto_resume: false starts running, but proxy traffic cannot wake it after a later suspension. Inspect the setting with Get Sandbox; the compact copy response does not include it.
The request takes no body. times and name are query parameters.
Copying a resume_failed sandbox does not retry it or clear its diagnosis. Copies have new IDs. Use Resume Sandbox to recover the original sandbox.
Sandbox names are unique per namespace, so copies cannot reuse the source’s name. Names are derived instead:
name
times
Source
Copy names
worker
1
any
worker
worker
3
any
worker-1, worker-2, worker-3
omitted
1
named build-env
build-env-copy
omitted
2
named build-env
build-env-copy-1, build-env-copy-2
omitted
any
unnamed
unnamed
curl -X POST "https://api.tensorlake.ai/sandboxes/<sandbox-id>/copy?times=3&name=worker" \ -H "Authorization: Bearer $TENSORLAKE_API_KEY"
Naming matters for lifecycle: only named sandboxes can be suspended and resumed. An unnamed copy terminates at its idle timeout instead. A named source therefore keeps its copies named by default, so a copy behaves like the sandbox it came from.Pass name explicitly to give an unnamed source’s copies a name.Derived names are validated before any copy is created:
400 if a derived name is malformed, or exceeds the 63-character DNS label limit once suffixed. A base that fits on its own can still overflow with -N appended.
409 if a derived name is already claimed by a live sandbox in the namespace. This is checked up front, so a rejected request creates nothing. Re-running the same named fan-out is safe and will not leave partial copies behind.
A 200 means every requested copy is running. Two other statuses return the same body shape, so inspect each entry’s status to see which copies succeeded:
422: one or more copies failed before becoming ready.
504: one or more copies did not become ready within the timeout.
Name for the copies. Used verbatim when times is 1, and suffixed -1..-N when it is greater, since sandbox names are unique per namespace. When omitted, a named source produces <source-name>-copy (suffixed the same way) and an unnamed source produces unnamed copies. Named copies can be suspended and resumed; unnamed ones terminate at their idle timeout.
One entry per requested copy, in creation order. On a 422 or 504 the entries report per-copy status, so inspect each one to see which copies became ready.
Show child attributes
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Tensorlake","colors":{"primary":"#047857","light":"#047857","dark":"#0D1117"},"logo":{"light":"https://mintcdn.com/tensorlake-35e9e726/pfTs6FweN5gDe2IY/logo/TL-Light.svg?fit=max\u0026auto=format\u0026n=pfTs6FweN5gDe2IY\u0026q=85\u0026s=de3c3b6e814425b1be6902f8af88b719","dark":"https://mintcdn.com/tensorlake-35e9e726/pfTs6FweN5gDe2IY/logo/TL-Dark.svg?fit=max\u0026auto=format\u0026n=pfTs6FweN5gDe2IY\u0026q=85\u0026s=b08c049d9fabd32c205f6e8d9f621ba3"},"favicon":"https://mintcdn.com/tensorlake-35e9e726/fVE8-oNRlpqs-U2A/logo/favicon.png?fit=max\u0026auto=format\u0026n=fVE8-oNRlpqs-U2A\u0026q=85\u0026s=15a7031809c3f949e46d8b9c926c28f4","api":{"openapi":"api-reference/openapi.yaml","playground":{"display":"interactive"},"mdx":{"auth":{"method":"bearer"},"server":"https://api.tensorlake.ai/"}},"appearance":{"default":"system"},"navbar":{"links":[{"href":"https://tensorlake.ai/blog","label":"Blog"},{"href":"https://join.slack.com/t/tensorlakecloud/shared_invite/zt-32fq4nmib-gO0OM5RIar3zLOBm~ZGqKg","label":"Slack"},{"href":"https://github.com/tensorlakeai/tensorlake","label":"GitHub"}],"primary":{"type":"button","label":"Dashboard","href":"https://cloud.tensorlake.ai/login"}},"footer":{"socials":{"website":"https://www.tensorlake.ai/","x":"https://x.com/tensorlake","github":"https://github.com/tensorlakeai","linkedin":"https://linkedin.com/company/tensorlake","bluesky":"https://bsky.app/profile/tensorlake.bsky.social"}},"seo":{"metatags":{"og:type":"website","og:site_name":"Tensorlake Documentation","og:title":"Tensorlake Documentation","og:description":"Build with Tensorlake: secure and stateful sandboxes for AI agents, durable orchestration for long-running workflows","og:url":"https://docs.tensorlake.ai","og:locale":"en_US","twitter:card":"summary_large_image","twitter:site":"@tensorlake","twitter:creator":"@tensorlake","twitter:title":"Tensorlake Documentation","twitter:description":"Sandboxes and orchestration for AI agents.","og:image":"https://docs.tensorlake.ai/images/og-preview.png","og:image:width":"2400","og:image:height":"1260","twitter:image":"https://docs.tensorlake.ai/images/og-preview.png","description":"Tensorlake Documentation— secure and stateful sandboxes for AI agents, durable workflow orchestration for long-running workflows, covers in Python and TypeScript SDKs plus CLI","keywords":"AI agents, sandboxes, stateful sandboxes, durable execution, agent orchestration, agentic workflows","author":"Tensorlake","robots":"index, follow, max-image-preview:large, max-snippet:-1","googlebot":"index, follow"},"indexing":"all"},"fonts":{"family":"Inter"},"integrations":{"ga4":{"measurementId":"G-EBFHHWKKQM"}},"contextual":{"options":["claude","chatgpt","cursor","grok","copy","view"],"display":"header"},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"tensorlake-35e9e726","hasAudioNarration":false,"actualSubdomain":"tensorlake-35e9e726","customDomains":["docs.tensorlake.ai"],"gitSource":{"type":"github","owner":"tensorlakeai","repo":"docs","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aecb4e049625e32dcdb288b","collectionId":"c7890fe8-b81c-4385-bf9d-9728f48c3df4","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aecb4e049625e32dcdb288b"},"feedback":{"thumbs":true,"edits":true,"issues":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aecf5ffcaa1870951856cdf","clientVersion":"0.0.4074","searchFilterCounts":[{"language":"default","tag":"Sandboxes","count":90},{"language":"default","tag":"API Reference","count":48},{"language":"default","tag":"Guides","count":41},{"language":"default","tag":"Overview","count":25},{"language":"default","tag":"Orchestrate","count":24},{"language":"default","tag":"Use Cases","count":23},{"language":"default","tag":"Process Management","count":15},{"language":"default","tag":"Life Cycle Management","count":13},{"language":"default","tag":"Platform Features","count":13},{"language":"default","tag":"Cloud Volumes","count":9}]},"assistantConfig":{},"basePath":"","hasChatPermissions":true,"hasWebMcpPermissions":true,"toggles":[{"name":"kill-isr","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-mintlify-slack","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"agent-integrations-settings","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"rbac-expansion","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-pr-grouping","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"custom-prefix","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"analytics-v7","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"user-flows-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"no-publish-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-onboarding","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving-live","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"stripTemperatureMiddleware","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"support-platform-pylon-zendesk","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"snapshot-serving","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"instant-rollback","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications-server","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"granular-notifications","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automations-fable","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fixed-ai-action-pricing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"automation-resolve-merge-conflict","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"scoped-publishing","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"mintql","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"page-level-analytics","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"editor-version-history-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"billing-page-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"full-page-search","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workspace-projects","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"assistant-v5","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"fork-pr-previews","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"revalidation-jwt","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-sso-scim","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"hobby-abuse-scan","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"dashboard-inbox","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-signup","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-dual-write","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"workos-enabled","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"approve-review-flow","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"sso-setup-deadline-banner","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"turbopuffer-serve","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"live-agents","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"comment-mode","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"googleFontsInlined":false},"customCss":[],"page":{"pagePath":"api-reference/v2/sandboxes/copy","slug":"/api-reference/v2/sandboxes/copy","pageMetadata":{"title":"Copy Sandbox","description":"Copy a sandbox with its state and automatic resume setting.","openapi":"post /sandboxes/{sandbox_id}/copy","og:image":"https://docs.tensorlake.ai/images/og/api-reference-v2-sandboxes-copy.png","twitter:image":"https://docs.tensorlake.ai/images/og/api-reference-v2-sandboxes-copy.png","href":"/api-reference/v2/sandboxes/copy"},"description":{"compiledSource":"\"use strict\";\nconst {jsx: _jsx} = arguments[0];\nconst {useMDXComponents: _provideComponents} = arguments[0];\nfunction _createMdxContent(props) {\n const _components = {\n p: \"p\",\n ..._provideComponents(),\n ...props.components\n };\n return _jsx(_components.p, {\n children: \"Copy a sandbox with its state and automatic resume setting.\"\n });\n}\nfunction MDXContent(props = {}) {\n const {wrapper: MDXLayout} = {\n ..._provideComponents(),\n ...props.components\n };\n return MDXLayout ? _jsx(MDXLayout, {\n ...props,\n children: _jsx(_createMdxContent, {\n ...props\n })\n }) : _createMdxContent(props);\n}\nreturn {\n default: MDXContent\n};\n","frontmatter":{},"scope":{}},"pageType":"default","mdx":{"mdxSource":{"compiledSource":"\"use strict\";const{Fragment:_Fragment,jsx:_jsx,jsxs:_jsxs}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){const _components={a:`a`,code:`code`,li:`li`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,ul:`ul`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Heading,Table}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Boot one or more new sandboxes from a running, suspended, or resume-failed source, restoring filesystem, memory, and running processes so each copy warm-starts.`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsx(_components.li,{children:`This path accepts either the sandbox ID or the sandbox name.`}),`\n`,_jsxs(_components.li,{children:[`The source must be `,_jsx(_components.code,{children:`running`}),`, `,_jsx(_components.code,{children:`suspended`}),`, or `,_jsx(_components.code,{children:`resume_failed`}),`. Any other state returns `,_jsx(_components.code,{children:`400 Bad Request`}),`. A retained checkpoint must still be available and usable for copying.`]}),`\n`,_jsx(_components.li,{children:`A running source is copied from the executor hosting it. A suspended or resume-failed source is copied from its retained checkpoint, so a copy does not leave a new checkpoint behind for you to clean up.`}),`\n`,_jsxs(_components.li,{children:[`Copies inherit the source’s image, resources, entrypoint, network policy, exposed ports, and `,_jsx(_components.code,{children:`auto_resume`}),` setting. A copy with `,_jsx(_components.code,{children:`auto_resume: false`}),` starts running, but proxy traffic cannot wake it after a later suspension. Inspect the setting with `,_jsx(_components.a,{href:`/api-reference/v2/sandboxes/get`,children:`Get Sandbox`}),`; the compact copy response does not include it.`]}),`\n`,_jsxs(_components.li,{children:[`The request takes no body. `,_jsx(_components.code,{children:`times`}),` and `,_jsx(_components.code,{children:`name`}),` are query parameters.`]}),`\n`]}),`\n`,_jsxs(_components.p,{children:[`Copying a `,_jsx(_components.code,{children:`resume_failed`}),` sandbox does not retry it or clear its diagnosis. Copies have new IDs. Use `,_jsx(_components.a,{href:`/api-reference/v2/sandboxes/resume`,children:`Resume Sandbox`}),` to recover the original sandbox.`]}),`\n`,_jsx(Heading,{level:`2`,id:`endpoint`,children:`Endpoint`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`1`,language:`http`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`http`,children:_jsxs(_components.code,{language:`http`,numberOfLines:`1`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`POST`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` /sandboxes/{sandbox_id}/copy`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`example-request`,children:`Example Request`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.tensorlake.ai/sandboxes/\u003csandbox-id>/copy?times=1\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TENSORLAKE_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`example-response`,children:`Example Response`}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`10`,language:`json`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`json`,children:_jsxs(_components.code,{language:`json`,numberOfLines:`10`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`{`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"source_sandbox_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sbx_01HK9ZA4MT\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sandboxes\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"sandbox_id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"sbx_01HKA1B7QP\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"running\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:` \"ingress_endpoint\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://sbx_01HKA1B7QP.sandbox.tensorlake.ai\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` ]`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`fanning-out`,children:`Fanning Out`}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`times`}),` to create several copies from the same source in one call. Each copy is an independent sandbox with its own ID.`]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.tensorlake.ai/sandboxes/\u003csandbox-id>/copy?times=4\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TENSORLAKE_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsx(Heading,{level:`2`,id:`naming-copies`,children:`Naming Copies`}),`\n`,_jsx(_components.p,{children:`Sandbox names are unique per namespace, so copies cannot reuse the source’s name. Names are derived instead:`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:_jsx(_components.code,{children:`name`})}),_jsx(_components.th,{children:_jsx(_components.code,{children:`times`})}),_jsx(_components.th,{children:`Source`}),_jsx(_components.th,{children:`Copy names`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`worker`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1`}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:_jsx(_components.code,{children:`worker`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`worker`})}),_jsx(_components.td,{\"data-numeric\":`true`,children:`3`}),_jsx(_components.td,{children:`any`}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`worker-1`}),`, `,_jsx(_components.code,{children:`worker-2`}),`, `,_jsx(_components.code,{children:`worker-3`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`omitted`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`1`}),_jsxs(_components.td,{children:[`named `,_jsx(_components.code,{children:`build-env`})]}),_jsx(_components.td,{children:_jsx(_components.code,{children:`build-env-copy`})})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`omitted`}),_jsx(_components.td,{\"data-numeric\":`true`,children:`2`}),_jsxs(_components.td,{children:[`named `,_jsx(_components.code,{children:`build-env`})]}),_jsxs(_components.td,{children:[_jsx(_components.code,{children:`build-env-copy-1`}),`, `,_jsx(_components.code,{children:`build-env-copy-2`})]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:`omitted`}),_jsx(_components.td,{children:`any`}),_jsx(_components.td,{children:`unnamed`}),_jsx(_components.td,{children:`unnamed`})]})]})]}),`\n`,_jsx(CodeBlock,{filename:``,numberOfLines:`2`,language:`shellscript`,children:_jsx(_components.pre,{className:`shiki shiki-themes github-light-default dark-plus`,style:{backgroundColor:`#ffffff`,\"--shiki-dark-bg\":`#0B0C0E`,color:`#1f2328`,\"--shiki-dark\":`#D4D4D4`},language:`shellscript`,children:_jsxs(_components.code,{language:`shellscript`,numberOfLines:`2`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#DCDCAA`},children:`curl`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -X`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` POST`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"https://api.tensorlake.ai/sandboxes/\u003csandbox-id>/copy?times=3\u0026name=worker\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:` \\\\`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` -H`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Authorization: Bearer `}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`$TENSORLAKE_API_KEY`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`]})})}),`\n`,_jsxs(_components.p,{children:[`Naming matters for lifecycle: only named sandboxes can be `,_jsx(_components.a,{href:`/sandboxes/lifecycle`,children:`suspended and resumed`}),`. An unnamed copy terminates at its idle timeout instead. A named source therefore keeps its copies named by default, so a copy behaves like the sandbox it came from.`]}),`\n`,_jsxs(_components.p,{children:[`Pass `,_jsx(_components.code,{children:`name`}),` explicitly to give an unnamed source’s copies a name.`]}),`\n`,_jsx(_components.p,{children:`Derived names are validated before any copy is created:`}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`400`}),` if a derived name is malformed, or exceeds the 63-character DNS label limit once suffixed. A base that fits on its own can still overflow with `,_jsx(_components.code,{children:`-N`}),` appended.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`409`}),` if a derived name is already claimed by a live sandbox in the namespace. This is checked up front, so a rejected request creates nothing. Re-running the same named fan-out is safe and will not leave partial copies behind.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`partial-failures`,children:`Partial Failures`}),`\n`,_jsxs(_components.p,{children:[`A `,_jsx(_components.code,{children:`200`}),` means every requested copy is running. Two other statuses return the same body shape, so inspect each entry’s `,_jsx(_components.code,{children:`status`}),` to see which copies succeeded:`]}),`\n`,_jsxs(_components.ul,{children:[`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`422`}),`: one or more copies failed before becoming ready.`]}),`\n`,_jsxs(_components.li,{children:[_jsx(_components.code,{children:`504`}),`: one or more copies did not become ready within the timeout.`]}),`\n`]}),`\n`,_jsx(Heading,{level:`2`,id:`related`,children:`Related`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Snapshot and Clone`,icon:`camera`,href:`/sandboxes/snapshots`,children:_jsx(_components.p,{children:`Capture a reusable artifact and restore it into new sandboxes later.`})}),_jsx(Card,{title:`Lifecycle`,icon:`arrows-spin`,href:`/sandboxes/lifecycle`,children:_jsx(_components.p,{children:`Create, suspend, resume, and terminate sandboxes.`})})]})]})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent};function _missingMdxReference(id,component){throw new Error(`Expected `+(component?`component`:`object`)+\" `\"+id+\"` to be defined: you likely forgot to import, pass, or provide it.\")}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Copy Sandbox","description":"Copy a sandbox with its state and automatic resume setting.","openapi":"post /sandboxes/{sandbox_id}/copy","og:image":"https://docs.tensorlake.ai/images/og/api-reference-v2-sandboxes-copy.png","twitter:image":"https://docs.tensorlake.ai/images/og/api-reference-v2-sandboxes-copy.png","href":"/api-reference/v2/sandboxes/copy"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Endpoint","slug":"endpoint","depth":2,"children":[]},{"title":"Example Request","slug":"example-request","depth":2,"children":[]},{"title":"Example Response","slug":"example-response","depth":2,"children":[]},{"title":"Fanning Out","slug":"fanning-out","depth":2,"children":[]},{"title":"Naming Copies","slug":"naming-copies","depth":2,"children":[]},{"title":"Partial Failures","slug":"partial-failures","depth":2,"children":[]},{"title":"Related","slug":"related","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":["/_mintlify/custom/tensorlake-35e9e726/1373ae293ad67675/plausible.js"],"openApiReferenceData":{"operation":{"tags":["sandboxes"],"summary":"Copy a sandbox","description":"Copy a sandbox with its state and automatic resume setting.","operationId":"copy_sandbox","parameters":["39f58968-cb3a-4d29-93af-0796780295b6","74e3fee1-012c-4c12-9bd5-5de994aa48c6"],"responses":{"200":"729ef402-9cfa-4170-af72-f766453bd27f","400":"16529ddc-b882-4e2f-b8f0-b23047a9c5b7","401":"739da408-e69e-46af-9841-87936e98a23a","403":"061cdf72-c0f0-47ab-852a-9d6c954f2649","404":"45f311c6-aa9c-44d7-8514-8733074840af","409":"f1ad52ec-ea9c-459d-a6b9-900acdfe0638","422":"9bbb8de6-126a-43f9-8614-3d46582d58dd","500":"8c1a91c6-3fb0-41d2-82cb-e83353b62591","504":"20613a38-1ff3-4177-8089-65520d9d8df1"},"method":"post","type":"path","servers":["04da1a97-9ddd-4cf2-9288-7addbccb3159"],"security":["025c894d-b1a2-4786-81ba-c0d9c07e2515"],"path":"/sandboxes/{sandbox_id}/copy","baseUrlOptions":["https://api.tensorlake.ai/"],"title":"Copy a sandbox","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"39f58968-cb3a-4d29-93af-0796780295b6":{"name":"times","in":"query","description":"Number of copies to create from the source sandbox. Defaults to 1.","required":false,"schema":{"type":"integer","minimum":1,"isRequired":false,"description":"Number of copies to create from the source sandbox. Defaults to 1.","uniqueKey":"","typeLabel":"integer"}},"74e3fee1-012c-4c12-9bd5-5de994aa48c6":{"name":"name","in":"query","description":"Name for the copies. Used verbatim when `times` is 1, and suffixed `-1`..`-N` when it is greater, since sandbox names are unique per namespace. When omitted, a named source produces `\u003csource-name>-copy` (suffixed the same way) and an unnamed source produces unnamed copies. Named copies can be suspended and resumed; unnamed ones terminate at their idle timeout.","required":false,"schema":{"type":"string","isRequired":false,"description":"Name for the copies. Used verbatim when `times` is 1, and suffixed `-1`..`-N` when it is greater, since sandbox names are unique per namespace. When omitted, a named source produces `\u003csource-name>-copy` (suffixed the same way) and an unnamed source produces unnamed copies. Named copies can be suspended and resumed; unnamed ones terminate at their idle timeout.","uniqueKey":"","typeLabel":"string"}},"aeaebf20-8c7b-4e99-a8dd-8b6b0634c382":{"name":"sandbox_id","in":"path","description":"The running, suspended, or resume_failed source sandbox ID or name.","required":true,"schema":{"type":"string","isRequired":true,"description":"The running, suspended, or resume_failed source sandbox ID or name.","uniqueKey":"","typeLabel":"string"}}},"responses":{"729ef402-9cfa-4170-af72-f766453bd27f":{"description":"All requested sandbox copies are running","content":{"application/json":{"schema":{"type":"object","required":["source_sandbox_id","sandboxes"],"properties":{"source_sandbox_id":{"type":"string","description":"The sandbox the copies were made from.","isRequired":true,"uniqueKey":"source_sandbox_id","typeLabel":"string"},"sandboxes":{"type":"array","description":"One entry per requested copy, in creation order. On a 422 or 504 the entries report per-copy status, so inspect each one to see which copies became ready.","items":{"type":"object","required":["sandbox_id","status"],"properties":{"sandbox_id":{"type":"string","isRequired":true,"uniqueKey":"sandboxes.items.[INDEX].sandbox_id","typeLabel":"string"},"status":{"type":"string","enum":["pending","running","snapshotting","suspending","suspended","terminated","resume_failed"],"isRequired":true,"uniqueKey":"sandboxes.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"pending_reason":{"type":"string","enum":["scheduling","waiting_for_container","no_executors_available","no_resources_available","pool_at_capacity","max_capacity_reached","no_executor_for_snapshot_location"],"uniqueKey":"sandboxes.items.[INDEX].pending_reason","typeLabel":"enum\u003cstring>"},"ingress_endpoint":{"oneOf":[{"type":"string","description":"Base ingress origin for this sandbox's current placement.","uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint.oneOf.0","typeLabel":"string"},{"type":"null","description":"Base ingress origin for this sandbox's current placement.","uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint.oneOf.1","typeLabel":"null"}],"uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint","typeLabel":"string | null"}},"uniqueKey":"sandboxes.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"sandboxes","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"source_sandbox_id":"\u003cstring>","sandboxes":[{"sandbox_id":"\u003cstring>","status":"pending","pending_reason":"scheduling","ingress_endpoint":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"16529ddc-b882-4e2f-b8f0-b23047a9c5b7":{"description":"Invalid request, unsupported source state, missing or unusable checkpoint, or a malformed derived copy name or one exceeding the 63-character limit.","content":{"text/plain":{}},"exampleType":"generated"},"739da408-e69e-46af-9841-87936e98a23a":{"description":"Unauthorized. Invalid or missing credentials","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"061cdf72-c0f0-47ab-852a-9d6c954f2649":{"description":"Forbidden. You do not have permission to access this resource","content":{"_mintlify/placeholder":{"schema":{"type":"object","description":""}}}},"45f311c6-aa9c-44d7-8514-8733074840af":{"description":"Source sandbox not found","content":{"text/plain":{}},"exampleType":"generated"},"f1ad52ec-ea9c-459d-a6b9-900acdfe0638":{"description":"A derived copy name is already claimed by a live sandbox in the namespace. Rejected before any copy is created.","content":{"text/plain":{}},"exampleType":"generated"},"9bbb8de6-126a-43f9-8614-3d46582d58dd":{"description":"One or more copies failed before becoming ready","content":{"application/json":{"schema":{"type":"object","required":["source_sandbox_id","sandboxes"],"properties":{"source_sandbox_id":{"type":"string","description":"The sandbox the copies were made from.","isRequired":true,"uniqueKey":"source_sandbox_id","typeLabel":"string"},"sandboxes":{"type":"array","description":"One entry per requested copy, in creation order. On a 422 or 504 the entries report per-copy status, so inspect each one to see which copies became ready.","items":{"type":"object","required":["sandbox_id","status"],"properties":{"sandbox_id":{"type":"string","isRequired":true,"uniqueKey":"sandboxes.items.[INDEX].sandbox_id","typeLabel":"string"},"status":{"type":"string","enum":["pending","running","snapshotting","suspending","suspended","terminated","resume_failed"],"isRequired":true,"uniqueKey":"sandboxes.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"pending_reason":{"type":"string","enum":["scheduling","waiting_for_container","no_executors_available","no_resources_available","pool_at_capacity","max_capacity_reached","no_executor_for_snapshot_location"],"uniqueKey":"sandboxes.items.[INDEX].pending_reason","typeLabel":"enum\u003cstring>"},"ingress_endpoint":{"oneOf":[{"type":"string","description":"Base ingress origin for this sandbox's current placement.","uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint.oneOf.0","typeLabel":"string"},{"type":"null","description":"Base ingress origin for this sandbox's current placement.","uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint.oneOf.1","typeLabel":"null"}],"uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint","typeLabel":"string | null"}},"uniqueKey":"sandboxes.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"sandboxes","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"source_sandbox_id":"\u003cstring>","sandboxes":[{"sandbox_id":"\u003cstring>","status":"pending","pending_reason":"scheduling","ingress_endpoint":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"},"8c1a91c6-3fb0-41d2-82cb-e83353b62591":{"description":"Internal server error","content":{"text/plain":{}},"exampleType":"generated"},"20613a38-1ff3-4177-8089-65520d9d8df1":{"description":"One or more copies did not become ready within the timeout","content":{"application/json":{"schema":{"type":"object","required":["source_sandbox_id","sandboxes"],"properties":{"source_sandbox_id":{"type":"string","description":"The sandbox the copies were made from.","isRequired":true,"uniqueKey":"source_sandbox_id","typeLabel":"string"},"sandboxes":{"type":"array","description":"One entry per requested copy, in creation order. On a 422 or 504 the entries report per-copy status, so inspect each one to see which copies became ready.","items":{"type":"object","required":["sandbox_id","status"],"properties":{"sandbox_id":{"type":"string","isRequired":true,"uniqueKey":"sandboxes.items.[INDEX].sandbox_id","typeLabel":"string"},"status":{"type":"string","enum":["pending","running","snapshotting","suspending","suspended","terminated","resume_failed"],"isRequired":true,"uniqueKey":"sandboxes.items.[INDEX].status","typeLabel":"enum\u003cstring>"},"pending_reason":{"type":"string","enum":["scheduling","waiting_for_container","no_executors_available","no_resources_available","pool_at_capacity","max_capacity_reached","no_executor_for_snapshot_location"],"uniqueKey":"sandboxes.items.[INDEX].pending_reason","typeLabel":"enum\u003cstring>"},"ingress_endpoint":{"oneOf":[{"type":"string","description":"Base ingress origin for this sandbox's current placement.","uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint.oneOf.0","typeLabel":"string"},{"type":"null","description":"Base ingress origin for this sandbox's current placement.","uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint.oneOf.1","typeLabel":"null"}],"uniqueKey":"sandboxes.items.[INDEX].ingress_endpoint","typeLabel":"string | null"}},"uniqueKey":"sandboxes.items.[INDEX]","typeLabel":"object"},"isRequired":true,"uniqueKey":"sandboxes","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"source_sandbox_id":"\u003cstring>","sandboxes":[{"sandbox_id":"\u003cstring>","status":"pending","pending_reason":"scheduling","ingress_endpoint":"\u003cstring>"}]}}},"exampleType":"generated"}},"exampleType":"generated"}},"security":{"025c894d-b1a2-4786-81ba-c0d9c07e2515":{"bearerAuth":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"04da1a97-9ddd-4cf2-9288-7addbccb3159":{"url":"https://api.tensorlake.ai/"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"Bearer authentication header of the form `Bearer \u003ctoken>`, where `\u003ctoken>` is your auth token.","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/openapi.yaml"},"subdomain":"tensorlake-35e9e726","siteName":"Tensorlake","title":"Tensorlake Documentation","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-31T04:55:13.431Z","originalFileLocation":"api-reference/v2/sandboxes/copy.mdx"},"headHtml":"\u003cscript data-mint-head>(function(){var d=document.documentElement,p=null;if(!p){try{p=localStorage.getItem(\"isDarkMode\")}catch(e){}if(p==='true')p='dark';else if(p==='false')p='light';if(p!=='light'\u0026\u0026p!=='dark'\u0026\u0026p!=='system')p=\"system\"}var r=p==='system'?(matchMedia(\"(prefers-color-scheme: dark)\").matches?'dark':'light'):p;d.classList.remove(r==='dark'?'light':'dark');d.classList.add(r);d.setAttribute(\"data-theme-preference\",p)})();\u003c/script>\u003cmeta data-mint-head name=\"description\" content=\"Copy a sandbox with its state and automatic resume setting.\">\u003cmeta data-mint-head name=\"keywords\" content=\"AI agents, sandboxes, stateful sandboxes, durable execution, agent orchestration, agentic workflows\">\u003cmeta data-mint-head name=\"application-name\" content=\"Tensorlake\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003cmeta data-mint-head name=\"robots\" content=\"index, follow, max-image-preview:large, max-snippet:-1\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon/android-chrome-192x192.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"apple-touch-icon\" type=\"image/png\" sizes=\"180x180\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon/favicon-16x16.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon/favicon-32x32.png\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon/favicon.ico\" media=\"(prefers-color-scheme: light)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon-dark/android-chrome-192x192.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon-dark/favicon-16x16.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"32x32\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon-dark/favicon-32x32.png\" media=\"(prefers-color-scheme: dark)\">\u003clink data-mint-head rel=\"shortcut icon\" type=\"image/x-icon\" href=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Tensorlake Documentation\">\u003cmeta data-mint-head property=\"og:description\" content=\"Build with Tensorlake: secure and stateful sandboxes for AI agents, durable orchestration for long-running workflows\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Tensorlake Documentation\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://docs.tensorlake.ai/images/og/api-reference-v2-sandboxes-copy.png\">\u003cmeta data-mint-head property=\"og:image:width\" content=\"1200\">\u003cmeta data-mint-head property=\"og:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"twitter:card\" content=\"summary_large_image\">\u003cmeta data-mint-head name=\"twitter:title\" content=\"Tensorlake Documentation\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Sandboxes and orchestration for AI agents.\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://docs.tensorlake.ai/images/og/api-reference-v2-sandboxes-copy.png\">\u003cmeta data-mint-head name=\"twitter:image:width\" content=\"1200\">\u003cmeta data-mint-head name=\"twitter:image:height\" content=\"630\">\u003cmeta data-mint-head name=\"msapplication-config\" content=\"/mintlify-assets/_mintlify/favicons/tensorlake-35e9e726/jzD554Nmq8Zqors6/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Tensorlake\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#047857\">\u003cmeta data-mint-head name=\"og:locale\" content=\"en_US\">\u003cmeta data-mint-head name=\"twitter:creator\" content=\"@tensorlake\">\u003cmeta data-mint-head name=\"author\" content=\"Tensorlake\">\u003cmeta data-mint-head name=\"googlebot\" content=\"index, follow\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/api-reference/v2/sandboxes/copy.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.tensorlake.ai/#organization\",\"name\":\"Tensorlake\",\"url\":\"https://docs.tensorlake.ai\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/tensorlake-35e9e726/pfTs6FweN5gDe2IY/logo/TL-Light.svg?fit=max\u0026auto=format\u0026n=pfTs6FweN5gDe2IY\u0026q=85\u0026s=de3c3b6e814425b1be6902f8af88b719\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.tensorlake.ai#website\",\"name\":\"Tensorlake\",\"url\":\"https://docs.tensorlake.ai\",\"publisher\":{\"@id\":\"https://docs.tensorlake.ai/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy#webpage\",\"url\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy\",\"name\":\"Copy Sandbox\",\"description\":\"Copy a sandbox with its state and automatic resume setting.\",\"dateModified\":\"2026-10-31T04:55:13.431Z\",\"isPartOf\":{\"@id\":\"https://docs.tensorlake.ai#website\"},\"breadcrumb\":{\"@id\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Sandboxes\",\"item\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/create\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Life Cycle Management\",\"item\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/create\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Copy Sandbox\",\"item\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy#apireference\",\"headline\":\"Copy Sandbox\",\"name\":\"Copy Sandbox\",\"description\":\"Copy a sandbox with its state and automatic resume setting.\",\"url\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy\",\"mainEntityOfPage\":{\"@id\":\"https://docs.tensorlake.ai/api-reference/v2/sandboxes/copy#webpage\"},\"image\":\"https://docs.tensorlake.ai/images/og/api-reference-v2-sandboxes-copy.png\",\"dateModified\":\"2026-10-31T04:55:13.431Z\",\"publisher\":{\"@id\":\"https://docs.tensorlake.ai/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.tensorlake.ai#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Tensorlake\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Tensorlake","nav":{"global":null,"tabs":[{"tab":"Sandboxes","pages":[{"title":"Sandboxes","href":"/sandboxes/introduction"}]},{"tab":"GitHub Actions","pages":[{"title":"GitHub Actions","href":"/github-actions/quickstart"}]},{"tab":"Cloud Volumes","pages":[{"title":"Cloud Volumes","href":"/filesystems/introduction"}]},{"tab":"Git Repositories","pages":[{"title":"Git Repositories","href":"/git/introduction"}]},{"tab":"Orchestrate","pages":[{"title":"Orchestrate","href":"/applications/introduction"}]},{"tab":"Platform Features","pages":[{"title":"Platform Features","href":"/platform/authentication"}]},{"tab":"API Reference","groups":[{"group":"API Documentation","pages":[{"title":"Introduction","href":"/api-reference/v2/introduction"}]},{"group":"Sandboxes","pages":[{"group":"Life Cycle Management","pages":[{"title":"Create Sandbox","openapi":"post /sandboxes","href":"/api-reference/v2/sandboxes/create"},{"title":"List sandboxes","sidebarTitle":"List Sandboxes","openapi":"get /sandboxes","href":"/api-reference/v2/sandboxes/list"},{"title":"Get Sandbox","openapi":"get /sandboxes/{sandbox_id}","href":"/api-reference/v2/sandboxes/get"},{"title":"Update Sandbox","openapi":"patch /sandboxes/{sandbox_id}","href":"/api-reference/v2/sandboxes/update"},{"title":"Delete Sandbox","openapi":"delete /sandboxes/{sandbox_id}","href":"/api-reference/v2/sandboxes/delete"},{"title":"Snapshot Sandbox","openapi":"post /sandboxes/{sandbox_id}/snapshot","description":"Create a snapshot of a running sandbox so you can restore the same filesystem and memory state later.","href":"/api-reference/v2/sandboxes/snapshot"},{"title":"Copy Sandbox","openapi":"post /sandboxes/{sandbox_id}/copy","href":"/api-reference/v2/sandboxes/copy"},{"title":"Restore Sandbox","description":"Restore a sandbox from a previously created snapshot by calling the create endpoint with a `snapshot_id`.","openapi":"post /sandboxes","href":"/api-reference/v2/sandboxes/restore"},{"title":"Suspend Sandbox","openapi":"post /sandboxes/{sandbox_id}/suspend","href":"/api-reference/v2/sandboxes/suspend"},{"title":"Resume Sandbox","openapi":"post /sandboxes/{sandbox_id}/resume","href":"/api-reference/v2/sandboxes/resume"},{"title":"Restart Sandbox","openapi":"post /sandboxes/{sandbox_id}/restart","href":"/api-reference/v2/sandboxes/restart"},{"title":"Attach Filesystem","openapi":"post /sandboxes/{sandbox_id}/file_systems","href":"/api-reference/v2/sandboxes/attach-filesystem"},{"title":"Detach Filesystem","openapi":"delete /sandboxes/{sandbox_id}/file_systems","href":"/api-reference/v2/sandboxes/detach-filesystem"}]},{"group":"Process Management","pages":[{"title":"Sandbox Processes API Overview","sidebarTitle":"Overview","href":"/api-reference/v2/processes/introduction"},{"title":"Start Process","openapi":"post /api/v1/processes","href":"/api-reference/v2/processes/start"},{"title":"Run Process","openapi":"post /api/v1/processes/run","href":"/api-reference/v2/processes/run"},{"title":"List Processes","openapi":"get /api/v1/processes","href":"/api-reference/v2/processes/list"},{"title":"Get Process","openapi":"get /api/v1/processes/{pid}","href":"/api-reference/v2/processes/get"},{"title":"Kill Process","openapi":"delete /api/v1/processes/{pid}","href":"/api-reference/v2/processes/kill"},{"title":"Send Signal","openapi":"post /api/v1/processes/{pid}/signal","href":"/api-reference/v2/processes/signal"},{"title":"Process Stdin","openapi":"post /api/v1/processes/{pid}/stdin","href":"/api-reference/v2/processes/stdin"},{"title":"Close Process Stdin","openapi":"post /api/v1/processes/{pid}/stdin/close","href":"/api-reference/v2/processes/close-stdin"},{"title":"Get Process Stdout","openapi":"get /api/v1/processes/{pid}/stdout","href":"/api-reference/v2/processes/stdout"},{"title":"Get Process Stderr","openapi":"get /api/v1/processes/{pid}/stderr","href":"/api-reference/v2/processes/stderr"},{"title":"Get Process Output","openapi":"get /api/v1/processes/{pid}/output","href":"/api-reference/v2/processes/output"},{"title":"Follow Process Stdout","openapi":"get /api/v1/processes/{pid}/stdout/follow","href":"/api-reference/v2/processes/follow-stdout"},{"title":"Follow Process Stderr","openapi":"get /api/v1/processes/{pid}/stderr/follow","href":"/api-reference/v2/processes/follow-stderr"},{"title":"Follow Process Output","openapi":"get /api/v1/processes/{pid}/output/follow","href":"/api-reference/v2/processes/follow-output"}]},{"group":"Runtime Metadata","pages":[{"title":"Runtime Health","openapi":"get /api/v1/health","href":"/api-reference/v2/runtime/health"},{"title":"Runtime Info","openapi":"get /api/v1/info","href":"/api-reference/v2/runtime/info"},{"title":"Get resource usage","sidebarTitle":"Get Resource Usage","openapi":"get /api/v1/resource-usage","href":"/api-reference/v2/runtime/resource-usage"}]},{"group":"File Management","pages":[{"title":"Sandbox Files API Overview","sidebarTitle":"Overview","href":"/api-reference/v2/sandbox-files/introduction"},{"title":"Read File","openapi":"get /api/v1/files","href":"/api-reference/v2/sandbox-files/read"},{"title":"Write File","openapi":"put /api/v1/files","href":"/api-reference/v2/sandbox-files/write"},{"title":"Delete File","openapi":"delete /api/v1/files","href":"/api-reference/v2/sandbox-files/delete"},{"title":"List Directory","openapi":"get /api/v1/files/list","href":"/api-reference/v2/sandbox-files/list"}]},{"group":"PTY Sessions","pages":[{"title":"Sandbox PTY API Overview","sidebarTitle":"Overview","href":"/api-reference/v2/pty/introduction"},{"title":"Create PTY Session","openapi":"post /api/v1/pty","href":"/api-reference/v2/pty/create"},{"title":"List PTY Sessions","openapi":"get /api/v1/pty","href":"/api-reference/v2/pty/list"},{"title":"Get PTY Session","openapi":"get /api/v1/pty/{session_id}","href":"/api-reference/v2/pty/get"},{"title":"Resize PTY Session","openapi":"post /api/v1/pty/{session_id}/resize","href":"/api-reference/v2/pty/resize"},{"title":"Attach PTY WebSocket","openapi":"get /api/v1/pty/{session_id}/ws","href":"/api-reference/v2/pty/websocket"},{"title":"Kill PTY Session","openapi":"delete /api/v1/pty/{session_id}","href":"/api-reference/v2/pty/kill"}]},{"group":"TCP Tunnels","pages":[{"title":"TCP Tunnel WebSocket","openapi":"get /api/v1/tunnels/tcp","href":"/api-reference/v2/tunnels/tcp"}]},{"group":"SSH Lifecycle","pages":[{"title":"SSH Status","openapi":"get /api/v1/ssh/status","href":"/api-reference/v2/ssh/status"},{"title":"Enable SSH","openapi":"post /api/v1/ssh/enable","href":"/api-reference/v2/ssh/enable"},{"title":"Disable SSH","openapi":"post /api/v1/ssh/disable","href":"/api-reference/v2/ssh/disable"}]}]}]},{"tab":"FAQ","pages":[{"title":"FAQ","href":"/faqs/sandboxes-faq"}]}]},"basePath":"","title":"Tensorlake Documentation","buildId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","deploymentId":"dpl_BLQvU86QFwq3AhPofSTw6q8dGWKm","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-Myd8dsju.js","utils-C2HkQgW0.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-8rSppmTv.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-B6MjiCFm.js","snippetPresets-DwrSAONL.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-1-a5UQKQ.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-C541m7wZ.js","shallow-CWELCZ77.js","getApiPlaygroundDisplay-CTo5Zn03.js","CodeSnippet-D--dzvnl.js","CodeSnippets-DM3cXEDh.js","Page-CxAy5y67.js","getPastedJson-C-VECgcL.js","icon-BPq2-Mg3.js","MethodPill-D9J5cUHd.js","DuplicateIcon-BqHaxUnD.js","createIcon-CIbcZHp9.js","DynamicMarkdown-BKiHAm_d.js","SectionHeading-DstQXt3H.js","axios-vUo_bRtp.js","Markdown-CpxgzsKA.js","clsx-C5EfhVm0.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CJ9Oly2E.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-Mk6P3qvh.js"]}