/v1/environments — reusable sandbox runtime, template, and dependency definitions
An environment is a named sandbox template. Multiple agents and sessions can reference the same one; edit it once and every referencing session picks it up on its next run.
Creating an environment provisions nothing. The sandbox is created when a session referencing it runs for the first time.
Create an environment
POST https://api.profy.cn/v1/environments
string
required
Environment name.
object
Sandbox template.
Show template fields
string
default:"python"
One of python, node, browser, custom.
string
Base image alias. Falls back to the platform default.
string[]
Packages installed after provisioning, max 50. python uses pip, node uses npm.
The environment is resolved before each run, and a session’s environment wins over the agent’s own sandbox config. You can iterate on dependencies without recreating the session.
Other operations
Method
Path
Notes
GET
/v1/environments?limit=
List your environments, max 100
GET
/v1/environments/{id}
Detail
PATCH
/v1/environments/{id}
Rename or update the template
DELETE
/v1/environments/{id}
Soft delete; running sandboxes are unaffected
Errors
Status
Meaning
400
Missing name, or invalid template (runtime value, dependency count, …)
401
Authentication failed
404
Environment not found or not yours
Next steps
Sessions
Create long-lived sessions and append events
Manage Agents
Create and publish Experts via API
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Profy","description":"Profy: Create, distribute, and monetize autonomous AI Experts","colors":{"primary":"#a8866a","light":"#c4a882","dark":"#8c6e54"},"logo":{"light":"https://mintcdn.com/profy-46233240/NYJmro4wi7xDFt2H/logo/light.png?fit=max\u0026auto=format\u0026n=NYJmro4wi7xDFt2H\u0026q=85\u0026s=ffc1ff6107891bf45491112c285c11a0","dark":"https://mintcdn.com/profy-46233240/NYJmro4wi7xDFt2H/logo/dark.png?fit=max\u0026auto=format\u0026n=NYJmro4wi7xDFt2H\u0026q=85\u0026s=7b54e1f376f1ff2c09e632a500e53662"},"favicon":"https://mintcdn.com/profy-46233240/NYJmro4wi7xDFt2H/favicon.png?fit=max\u0026auto=format\u0026n=NYJmro4wi7xDFt2H\u0026q=85\u0026s=56aea7fcf58bfa0eea34e8528d6a751c","api":{"playground":{"display":"interactive"}},"navbar":{"links":[{"icon":"arrow-up-right-from-square","href":"https://app.profy.cn","label":"控制台"}]},"footer":{"socials":{"website":"https://profy.cn"},"links":[{"header":"产品","items":[{"label":"控制台","href":"https://app.profy.cn"},{"label":"开放平台","href":"https://platform.profy.cn"}]},{"header":"文档","items":[{"label":"快速开始","href":"https://docs.profy.cn/zh/documentation/get-started/quickstart"},{"label":"开发者","href":"https://docs.profy.cn/zh/developers/overview"}]}]},"search":{},"seo":{"indexing":"navigable"},"contextual":{"options":["copy","view","chatgpt","claude"],"display":"header"},"styling":{"latex":true},"navigation":{"languages":[{"language":"zh","href":"zh/documentation/get-started/what-is-profy"},{"language":"en","href":"en/documentation/get-started/what-is-profy"}]}},"deployment":{"deploymentMetadataValue":{"subdomain":"profy-46233240","hasAudioNarration":false,"actualSubdomain":"profy-46233240","customDomains":["docs.profy.cn"],"gitSource":{"type":"github","owner":"autoagents-ai","repo":"profy","deployBranch":"main","contentDirectory":"docs","isPrivate":true,"mountPath":"","label":"","_id":"6b10e8429ffae5051c41430f"},"entitlements":{"AI_CHAT":{"status":"DISABLED"}},"buildId":"6b13ef2a6e4c9d2585379605","clientVersion":"0.0.4458","searchFilterCounts":[{"language":"zh","tag":"文档","count":92},{"language":"en","tag":"Documentation","count":91},{"language":"en","tag":"Guides","count":57},{"language":"zh","tag":"使用指南","count":57},{"language":"en","tag":"Developers","count":29},{"language":"zh","tag":"开发者","count":29},{"language":"zh","tag":"平台与账户","count":16},{"language":"en","tag":"API Reference","count":15},{"language":"en","tag":"Platform \u0026 Account","count":15},{"language":"zh","tag":"API 参考","count":15},{"language":"en","tag":"Creators","count":12},{"language":"en","tag":"Deep Dive","count":12},{"language":"en","tag":"Plugin Tools","count":12},{"language":"zh","tag":"创作者","count":12},{"language":"zh","tag":"深入了解","count":12},{"language":"zh","tag":"插件工具","count":12},{"language":"en","tag":"How It Works","count":11},{"language":"zh","tag":"技术揭秘","count":11},{"language":"en","tag":"Reference","count":10},{"language":"zh","tag":"参考","count":10}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableContextualStarterQuestions":false,"enableAskAiSearchBar":true},"basePath":"","hasChatPermissions":false,"hasWebMcpPermissions":false,"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":"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":"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":"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":"turbopuffer-dual-write","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":"editor-metadata","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":"starter-pricing","enabled":true,"variant":{"name":"control","enabled":true,"payload":{"type":"string","value":"control"},"feature_enabled":true},"impressionData":false},{"name":"llms-txt-v2","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false},{"name":"auth-vite-origin","enabled":true,"variant":{"name":"disabled","enabled":false,"feature_enabled":true},"impressionData":false}],"starterQuestions":[],"googleFontsInlined":false},"customCss":[]}
{"page":{"pagePath":"en/developers/api/environments","slug":"/en/developers/api/environments","pageMetadata":{"title":"Environments","description":"/v1/environments — reusable sandbox runtime, template, and dependency definitions","href":"/en/developers/api/environments"},"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: \"/v1/environments — reusable sandbox runtime, template, and dependency definitions\"\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={code:`code`,p:`p`,pre:`pre`,span:`span`,tbody:`tbody`,td:`td`,th:`th`,thead:`thead`,tr:`tr`,..._provideComponents(),...props.components},{Card,CardGroup,CodeBlock,Expandable,Heading,Note,ParamField,Table}=_components;if(!Card)_missingMdxReference(`Card`,true);if(!CardGroup)_missingMdxReference(`CardGroup`,true);if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Expandable)_missingMdxReference(`Expandable`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!Table)_missingMdxReference(`Table`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`An environment is a named sandbox template. Multiple agents and sessions can reference the same one; edit it once and every referencing session picks it up on its next run.`}),`\n`,_jsx(Note,{children:_jsx(_components.p,{children:`Creating an environment provisions nothing. The sandbox is created when a session referencing it runs for the first time.`})}),`\n`,_jsx(Heading,{level:`2`,id:`create-an-environment`,children:`Create an environment`}),`\n`,_jsx(CodeBlock,{numberOfLines:`2`,language:`text`,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:`text`,children:_jsxs(_components.code,{language:`text`,numberOfLines:`2`,children:[_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{children:`POST https://api.profy.cn/v1/environments`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{})})]})})}),`\n`,_jsx(ParamField,{body:`name`,type:`string`,required:true,id:`param-name`,children:_jsx(_components.p,{children:`Environment name.`})}),`\n`,_jsx(ParamField,{body:`template`,type:`object`,id:`param-template`,children:_jsx(_components.p,{children:`Sandbox template.`})}),`\n`,_jsxs(Expandable,{title:`template fields`,children:[_jsx(ParamField,{body:`runtime`,type:`string`,default:`python`,id:`param-runtime`,children:_jsxs(_components.p,{children:[`One of `,_jsx(_components.code,{children:`python`}),`, `,_jsx(_components.code,{children:`node`}),`, `,_jsx(_components.code,{children:`browser`}),`, `,_jsx(_components.code,{children:`custom`}),`.`]})}),_jsx(ParamField,{body:`templateId`,type:`string`,id:`param-template-id`,children:_jsx(_components.p,{children:`Base image alias. Falls back to the platform default.`})}),_jsx(ParamField,{body:`dependencies`,type:`string[]`,id:`param-dependencies`,children:_jsxs(_components.p,{children:[`Packages installed after provisioning, max 50. `,_jsx(_components.code,{children:`python`}),` uses `,_jsx(_components.code,{children:`pip`}),`, `,_jsx(_components.code,{children:`node`}),` uses `,_jsx(_components.code,{children:`npm`}),`.`]})}),_jsx(ParamField,{body:`capabilities`,type:`string[]`,id:`param-capabilities`,children:_jsx(_components.p,{children:`Capability declarations.`})}),_jsx(ParamField,{body:`resource_limits`,type:`object`,id:`param-resource-limits`,children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`cpu`}),` / `,_jsx(_components.code,{children:`memory`}),` / `,_jsx(_components.code,{children:`timeout_seconds`}),`.`]})})]}),`\n`,_jsx(CodeBlock,{filename:`curl`,numberOfLines:`11`,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:`11`,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.profy.cn/v1/environments`}),_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 sk-pro-your-key\"`}),_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:` \"Content-Type: application/json\"`}),_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:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"name\": \"Customs processing\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"template\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"runtime\": \"python\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"dependencies\": [\"pandas\", \"openpyxl\"],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"resource_limits\": { \"timeout_seconds\": 600 }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` }'`})}),`\n`]})})}),`\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:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#B5CEA8`},children:`0`}),_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:` \"data\"`}),_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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"env_abc\"`}),_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:` \"name\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Customs processing\"`}),_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:` \"template\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: { `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"runtime\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"python\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#116329`,\"--shiki-dark\":`#9CDCFE`},children:`\"dependencies\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"pandas\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"openpyxl\"`}),_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:` \"created_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},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:` \"updated_at\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},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:`bind-it-to-a-session`,children:`Bind it to a session`}),`\n`,_jsx(CodeBlock,{filename:`curl`,numberOfLines:`4`,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:`4`,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.profy.cn/v1/sessions`}),_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 sk-pro-your-key\"`}),_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:` \"Content-Type: application/json\"`}),_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:` -d`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '{\"agent\": \"my-expert\", \"environment_id\": \"env_abc\"}'`})]}),`\n`]})})}),`\n`,_jsx(_components.p,{children:`The environment is resolved before each run, and a session’s environment wins over the agent’s own sandbox config. You can iterate on dependencies without recreating the session.`}),`\n`,_jsx(Heading,{level:`2`,id:`other-operations`,children:`Other operations`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Method`}),_jsx(_components.th,{children:`Path`}),_jsx(_components.th,{children:`Notes`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/v1/environments?limit=`})}),_jsx(_components.td,{children:`List your environments, max 100`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`GET`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/v1/environments/{id}`})}),_jsx(_components.td,{children:`Detail`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`PATCH`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/v1/environments/{id}`})}),_jsx(_components.td,{children:`Rename or update the template`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{children:_jsx(_components.code,{children:`DELETE`})}),_jsx(_components.td,{children:_jsx(_components.code,{children:`/v1/environments/{id}`})}),_jsx(_components.td,{children:`Soft delete; running sandboxes are unaffected`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsxs(Table,{children:[_jsx(_components.thead,{children:_jsxs(_components.tr,{children:[_jsx(_components.th,{children:`Status`}),_jsx(_components.th,{children:`Meaning`})]})}),_jsxs(_components.tbody,{children:[_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`400`})}),_jsxs(_components.td,{children:[`Missing `,_jsx(_components.code,{children:`name`}),`, or invalid `,_jsx(_components.code,{children:`template`}),` (runtime value, dependency count, …)`]})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`401`})}),_jsx(_components.td,{children:`Authentication failed`})]}),_jsxs(_components.tr,{children:[_jsx(_components.td,{\"data-numeric\":`true`,children:_jsx(_components.code,{children:`404`})}),_jsx(_components.td,{children:`Environment not found or not yours`})]})]})]}),`\n`,_jsx(Heading,{level:`2`,id:`next-steps`,children:`Next steps`}),`\n`,_jsxs(CardGroup,{cols:2,children:[_jsx(Card,{title:`Sessions`,icon:`comments`,href:`/en/developers/api/sessions`,children:_jsx(_components.p,{children:`Create long-lived sessions and append events`})}),_jsx(Card,{title:`Manage Agents`,icon:`robot`,href:`/en/developers/api/agents`,children:_jsx(_components.p,{children:`Create and publish Experts via API`})})]})]})}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":"Environments","description":"/v1/environments — reusable sandbox runtime, template, and dependency definitions","href":"/en/developers/api/environments"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[{"title":"Create an environment","slug":"create-an-environment","depth":2,"children":[]},{"title":"Bind it to a session","slug":"bind-it-to-a-session","depth":2,"children":[]},{"title":"Other operations","slug":"other-operations","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]},{"title":"Next steps","slug":"next-steps","depth":2,"children":[]}],"codeExamples":{}},"jsLinks":[],"subdomain":"profy-46233240","siteName":"Profy","title":"Environments - Profy","contextualStarterQuestions":[],"navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{"zh":{"href":"/zh/developers/api/environments","matchLevel":1},"en":{"href":"/en/developers/api/environments","matchLevel":0}}},"lastModified":"2026-11-12T10:34:25.634Z","originalFileLocation":"en/developers/api/environments.mdx","locale":"en"},"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=\"/v1/environments — reusable sandbox runtime, template, and dependency definitions\">\u003cmeta data-mint-head name=\"application-name\" content=\"Profy\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_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/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/profy-46233240/Hu41mXn7o8AF7da4/_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/profy-46233240/Hu41mXn7o8AF7da4/_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/profy-46233240/Hu41mXn7o8AF7da4/_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/profy-46233240/Hu41mXn7o8AF7da4/_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/profy-46233240/Hu41mXn7o8AF7da4/_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/profy-46233240/Hu41mXn7o8AF7da4/_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/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Environments - Profy\">\u003cmeta data-mint-head property=\"og:description\" content=\"/v1/environments — reusable sandbox runtime, template, and dependency definitions\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Profy\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.profy.cn/en/developers/api/environments\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://profy-46233240.mintlify.site/_mintlify/api/og/v2?division=API+Guides\u0026amp;title=Environments\u0026amp;description=%2Fv1%2Fenvironments+%E2%80%94+reusable+sandbox+runtime%2C+template%2C+and+dependency+definitions\u0026amp;theme=21fcbde36f00c72e0b79908e\u0026amp;signature=8ef08335bc61cced24ef8146fcd7d63e03f1ed5efe9c110c1e9c065e380626a9\">\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=\"Environments - Profy\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"/v1/environments — reusable sandbox runtime, template, and dependency definitions\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://profy-46233240.mintlify.site/_mintlify/api/og/v2?division=API+Guides\u0026amp;title=Environments\u0026amp;description=%2Fv1%2Fenvironments+%E2%80%94+reusable+sandbox+runtime%2C+template%2C+and+dependency+definitions\u0026amp;theme=21fcbde36f00c72e0b79908e\u0026amp;signature=8ef08335bc61cced24ef8146fcd7d63e03f1ed5efe9c110c1e9c065e380626a9\">\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/profy-46233240/Hu41mXn7o8AF7da4/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Profy\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#a8866a\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.profy.cn/en/developers/api/environments\">\u003clink data-mint-head rel=\"alternate\" type=\"application/xml\" href=\"/sitemap.xml\">\u003clink data-mint-head rel=\"alternate\" type=\"text/markdown\" href=\"/en/developers/api/environments.md\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"en\" href=\"https://docs.profy.cn/en/developers/api/environments\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"zh\" href=\"https://docs.profy.cn/zh/developers/api/environments\">\u003clink data-mint-head rel=\"alternate\" hreflang=\"x-default\" href=\"https://docs.profy.cn/zh/developers/api/environments\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.profy.cn/#organization\",\"name\":\"Profy\",\"url\":\"https://docs.profy.cn\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/profy-46233240/NYJmro4wi7xDFt2H/logo/light.png?fit=max\u0026auto=format\u0026n=NYJmro4wi7xDFt2H\u0026q=85\u0026s=ffc1ff6107891bf45491112c285c11a0\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.profy.cn#website\",\"name\":\"Profy\",\"url\":\"https://docs.profy.cn\",\"publisher\":{\"@id\":\"https://docs.profy.cn/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.profy.cn/en/developers/api/environments#webpage\",\"url\":\"https://docs.profy.cn/en/developers/api/environments\",\"name\":\"Environments\",\"description\":\"/v1/environments — reusable sandbox runtime, template, and dependency definitions\",\"dateModified\":\"2026-11-12T10:34:25.634Z\",\"isPartOf\":{\"@id\":\"https://docs.profy.cn#website\"},\"breadcrumb\":{\"@id\":\"https://docs.profy.cn/en/developers/api/environments#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.profy.cn/en/developers/api/environments#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"API Guides\",\"item\":\"https://docs.profy.cn/en/developers/api/agents-run\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Environments\",\"item\":\"https://docs.profy.cn/en/developers/api/environments\"}]},{\"@type\":[\"Article\",\"TechArticle\"],\"@id\":\"https://docs.profy.cn/en/developers/api/environments#article\",\"headline\":\"Environments\",\"name\":\"Environments\",\"description\":\"/v1/environments — reusable sandbox runtime, template, and dependency definitions\",\"url\":\"https://docs.profy.cn/en/developers/api/environments\",\"mainEntityOfPage\":{\"@id\":\"https://docs.profy.cn/en/developers/api/environments#webpage\"},\"dateModified\":\"2026-11-12T10:34:25.634Z\",\"publisher\":{\"@id\":\"https://docs.profy.cn/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.profy.cn#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Profy\",\"publisher\":{\"@type\":\"Organization\",\"name\":\"Profy\"},\"provider\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","agentPointerHref":"/en/developers/api/environments.md","siteName":"Profy","nav":{"global":null,"languages":[{"language":"zh","pages":[{"title":"zh","href":"/zh/developers/api/environments"}]},{"language":"en","tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/en/documentation/get-started/what-is-profy"}]},{"tab":"Creators","pages":[{"title":"Creators","href":"/en/creators/overview"}]},{"tab":"Developers","groups":[{"group":"Get Started","pages":[{"title":"Developer Platform Overview","href":"/en/developers/overview"},{"title":"Quickstart","href":"/en/developers/quickstart"}]},{"group":"Authentication \u0026 Keys","pages":[{"title":"Authentication","href":"/en/developers/authentication"},{"title":"API Key Management","href":"/en/developers/api-key-management"},{"title":"OAuth Integration","href":"/en/developers/oauth-integration"}]},{"group":"API Guides","pages":[{"title":"Run Expert","href":"/en/developers/api/agents-run"},{"title":"Offline eval","href":"/en/developers/api/eval"},{"title":"Sessions","href":"/en/developers/api/sessions"},{"title":"Manage Agents","description":"/v1/agents — create, update, and publish Experts via API","href":"/en/developers/api/agents"},{"title":"Environments","href":"/en/developers/api/environments"},{"title":"Upload File","description":"POST /v1/files — Upload a file and get an id the Expert can read in its sandbox","href":"/en/developers/api/files"},{"title":"Chat Completions","href":"/en/developers/api/chat-completions"},{"title":"List Models","href":"/en/developers/api/models"}]},{"group":"Integrations","pages":[{"title":"Platform Console","href":"/en/developers/platform-console"},{"title":"MCP Server","href":"/en/developers/mcp-server"},{"title":"Publish a connector","href":"/en/developers/connector-publishing"},{"title":"App Development Guide","href":"/en/developers/app-development"},{"title":"Integrate with Claude Code / Codex / Cursor","href":"/en/developers/claude-code-integration"}]},{"group":"Cookbook","pages":[{"title":"Next.js Full-Stack Integration","href":"/en/developers/cookbook/nextjs-fullstack"},{"title":"Building a Token-Metered AI Tool","href":"/en/developers/cookbook/ai-metered-billing"},{"title":"Invoking Expert Agents","href":"/en/developers/cookbook/expert-invoke"},{"title":"Webhook Event Handling","href":"/en/developers/cookbook/webhook-events"},{"title":"Python FastAPI Full-Stack Integration","href":"/en/developers/cookbook/python-fastapi"},{"title":"Token Management Best Practices","href":"/en/developers/cookbook/token-management"}]},{"group":"Reference","pages":[{"title":"Error Codes","href":"/en/developers/error-codes"},{"title":"Endpoint Reference","href":"/en/developers/reference/endpoints"},{"title":"SSE Events","href":"/en/developers/reference/sse-events"},{"title":"MCP Tools","href":"/en/developers/reference/mcp-tools"},{"title":"Environment Variables","href":"/en/developers/reference/environment-variables"}]}]},{"tab":"API Reference","pages":[{"title":"API Reference","href":"/en/api/agents-run"}]},{"tab":"SDK Reference","pages":[{"title":"SDK Reference","href":"/en/developers/sdk-typescript"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/en/changelog"}]}]}]},"basePath":"","title":"Environments - Profy","deploymentId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","buildId":"dpl_HZVV42MMRSo9WnNHfTGZvby5jph9","dynamics":[],"chunks":[]}