Execution error message, including the Python exception type and message
(e.g. "executing Python code: ZeroDivisionError('division by zero')").
Only present when execution fails. When set, output is null.
Dataframes created or modified during execution. May be empty even if
code creates dataframes — use GET /v2/sandcastles/{id} for the authoritative
list of loaded dataframes.
Show child attributes
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"TextQL Docs","colors":{"primary":"#0D9373","light":"#07C983","dark":"#0D9373"},"logo":{"light":"https://mintcdn.com/textql/9RDmZW4lVU96oHnJ/logo-textql/light.svg?fit=max\u0026auto=format\u0026n=9RDmZW4lVU96oHnJ\u0026q=85\u0026s=069d276e4ee2f256e061f8e2db9860a3","dark":"https://mintcdn.com/textql/9RDmZW4lVU96oHnJ/logo-textql/dark.svg?fit=max\u0026auto=format\u0026n=9RDmZW4lVU96oHnJ\u0026q=85\u0026s=1a728bc3acfd6eda203c49a45eac0355"},"favicon":"https://mintcdn.com/textql/jK3bTwZd_T-GaQ4j/favicon.svg?fit=max\u0026auto=format\u0026n=jK3bTwZd_T-GaQ4j\u0026q=85\u0026s=4f7feffa45a51a795a1b929f05a772bf","api":{"openapi":["api-reference/platform/chat.openapi.yaml","api-reference/platform/playbooks.openapi.yaml","api-reference/platform/agents.openapi.yaml","api-reference/platform/connectors.openapi.yaml","api-reference/platform/api_access_key.openapi.yaml","api-reference/platform/sandbox.openapi.yaml","api-reference/platform/v2.openapi.yaml","api-reference/speakeasy/textql-api-with-code-samples.yaml"],"mdx":{"auth":{"method":"bearer"},"server":"https://app.textql.com"}},"appearance":{"default":"light","strict":false},"navbar":{"links":[{"href":"mailto:support@textql.com","label":"Support"}],"primary":{"type":"button","label":"Dashboard","href":"https://app.textql.com"}},"footer":{"socials":{"x":"https://x.com/TextQL","github":"https://github.com/textqllabs","linkedin":"https://www.linkedin.com/company/textql"}},"styling":{"latex":true},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"textql","hasAudioNarration":false,"actualSubdomain":"textql","customDomains":["docs.textql.com"],"gitSource":{"type":"github","owner":"textqllabs","repo":"demo2","deployBranch":"main","contentDirectory":"docs/public","isPrivate":true,"mountPath":"","label":""},"entitlements":{},"buildId":"6aefe0c8ae7fce64eaeb4ba6","clientVersion":"0.0.4088","searchFilterCounts":[{"language":"default","tag":"v3 API (SDK)","count":454},{"language":"default","tag":"Workshops","count":202},{"language":"default","tag":"Documentation","count":164},{"language":"default","tag":"Ontology Management Service","count":70},{"language":"default","tag":"v2 API","count":56},{"language":"default","tag":"Set Up Your Data","count":56},{"language":"default","tag":"RBAC Service","count":41},{"language":"default","tag":"Chat Service","count":39},{"language":"default","tag":"Playbook Service","count":39},{"language":"default","tag":"How It Works","count":32}]},"assistantConfig":{},"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":"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":"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":"editor-metadata","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":[{"filePath":"style.css","content":"table{width:100%;border-collapse:collapse;margin:1rem 0}th,td{border:1px solid #e5e7eb;padding:0.6rem 0.85rem;text-align:left;vertical-align:top;line-height:1.45}th{background:#f9fafb;font-weight:600}th:first-child,td:first-child{white-space:nowrap}.dark th,.dark td{border-color:#2b2b2b}.dark th{background:#18181b}"}],"page":{"pagePath":"api-reference/v2/sandbox/execute-code","slug":"/api-reference/v2/sandbox/execute-code","pageMetadata":{"title":"Execute Code","openapi":"POST /v2/sandcastles/{id}/execute","description":"Execute Python code in a sandbox","href":"/api-reference/v2/sandbox/execute-code"},"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: \"Execute Python code in a sandbox\"\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}=arguments[0];const{useMDXComponents:_provideComponents}=arguments[0];function _createMdxContent(props){return _jsx(_Fragment,{})}function MDXContent(props={}){const{wrapper:MDXLayout}={..._provideComponents(),...props.components};return MDXLayout?_jsx(MDXLayout,{...props,children:_jsx(_createMdxContent,{...props})}):_createMdxContent(props)}return{default:MDXContent}","frontmatter":{},"scope":{"config":{},"pageMetadata":{"title":"Execute Code","openapi":"POST /v2/sandcastles/{id}/execute","description":"Execute Python code in a sandbox","href":"/api-reference/v2/sandbox/execute-code"}}},"mdxSourceWithNoJs":null},"mdxExtracts":{"tableOfContents":[],"codeExamples":{}},"jsLinks":[],"openApiReferenceData":{"operation":{"tags":["Sandcastles"],"summary":"Execute Code","description":"Execute Python code in a sandbox","operationId":"v2.executeCode","parameters":["83ad14dd-52d8-4ddb-abcf-97063bb889a3"],"requestBody":"70756e25-7fe5-4f1c-955f-11724efb7d57","responses":{"200":"7aaf0efe-42c5-4419-a066-b50879666e78","400":"e6fdea1d-ad2d-4042-8333-5cc83cbb71e0","401":"f08e3271-1cb1-4560-96b6-0ccda9b3cb24","403":"7f480a7d-54a2-4e97-897a-08a4337d573f","404":"e016c8f2-d94e-4899-9c9f-389bc18af673","429":"054e4cb7-75a8-4977-9360-57bb57641970","500":"6f045807-cc98-4016-9e52-a4dea21808e5"},"method":"post","type":"path","servers":["dbb201e3-b2a5-4b52-ac0d-d10c96ef3390"],"security":["993fdb74-0d24-438f-97b5-a90114b86d96"],"path":"/v2/sandcastles/{id}/execute","baseUrlOptions":["https://app.textql.com"],"title":"Execute Code","codeSamples":[],"requiredOnlyExamples":false,"requestExampleType":"generated","responseExampleType":"generated"},"dependencies":{"parameters":{"83ad14dd-52d8-4ddb-abcf-97063bb889a3":{"name":"id","in":"path","required":true,"schema":{"type":"string","isRequired":true,"description":"Sandbox ID","uniqueKey":"","typeLabel":"string"},"description":"Sandbox ID"}},"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","required":["code"],"properties":{"code":{"type":"string","description":"Python code to execute","isRequired":true,"uniqueKey":"code","typeLabel":"string"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"code":"\u003cstring>"}}},"exampleType":"generated"}},"exampleType":"generated"},"responses":{"7aaf0efe-42c5-4419-a066-b50879666e78":{"description":"Execution result","content":{"application/json":{"schema":{"type":"object","properties":{"output":{"oneOf":[{"type":"array","items":{"type":"string","uniqueKey":"output.oneOf.0.items.[INDEX]","typeLabel":"string"},"description":"Stdout/stderr output as an array of strings, one element per print call.\nNull when execution fails with an error.\n","uniqueKey":"output.oneOf.0","typeLabel":"string[]"},{"type":"null","items":{"type":"string"},"description":"Stdout/stderr output as an array of strings, one element per print call.\nNull when execution fails with an error.\n","uniqueKey":"output.oneOf.1","typeLabel":"null"}],"uniqueKey":"output","typeLabel":"string[] | null"},"error":{"type":"string","description":"Execution error message, including the Python exception type and message\n(e.g. \"executing Python code: ZeroDivisionError('division by zero')\").\nOnly present when execution fails. When set, output is null.\n","uniqueKey":"error","typeLabel":"string"},"execution_time_ms":{"type":"integer","format":"int64","description":"Execution duration in milliseconds","uniqueKey":"execution_time_ms","typeLabel":"integer\u003cint64>"},"files":{"type":"array","items":{"type":"object","properties":{"name":{"type":"string","uniqueKey":"files.items.[INDEX].name","typeLabel":"string"},"url":{"type":"string","uniqueKey":"files.items.[INDEX].url","typeLabel":"string"},"mime_type":{"type":"string","uniqueKey":"files.items.[INDEX].mime_type","typeLabel":"string"}},"uniqueKey":"files.items.[INDEX]","typeLabel":"object"},"uniqueKey":"files","typeLabel":"object[]"},"dataframes":{"type":"array","description":"Dataframes created or modified during execution. May be empty even if\ncode creates dataframes — use GET /v2/sandcastles/{id} for the authoritative\nlist of loaded dataframes.\n","items":{"type":"object","properties":{"name":{"type":"string","uniqueKey":"dataframes.items.[INDEX].name","typeLabel":"string"},"num_rows":{"type":"integer","format":"int64","uniqueKey":"dataframes.items.[INDEX].num_rows","typeLabel":"integer\u003cint64>"},"num_cols":{"type":"integer","format":"int64","uniqueKey":"dataframes.items.[INDEX].num_cols","typeLabel":"integer\u003cint64>"}},"uniqueKey":"dataframes.items.[INDEX]","typeLabel":"object"},"uniqueKey":"dataframes","typeLabel":"object[]"}},"uniqueKey":"","typeLabel":"object"},"examples":{"Example":{"title":"Example","value":{"output":["\u003cstring>"],"error":"\u003cstring>","execution_time_ms":123,"files":[{"name":"\u003cstring>","url":"\u003cstring>","mime_type":"\u003cstring>"}],"dataframes":[{"name":"\u003cstring>","num_rows":123,"num_cols":123}]}}},"exampleType":"generated"}},"exampleType":"generated"},"e6fdea1d-ad2d-4042-8333-5cc83cbb71e0":{"description":"Invalid request","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code","enum":["invalid_request","unauthenticated","permission_denied","not_found","conflict","rate_limit_exceeded","internal","timeout","cancelled","execution_failed","no_report"],"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"invalid_request","message":"Invalid request body"}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"invalid_request","message":"Invalid request body"}}}},"exampleType":"examples"}},"exampleType":"examples"},"f08e3271-1cb1-4560-96b6-0ccda9b3cb24":{"description":"Missing or invalid authentication","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code","enum":["invalid_request","unauthenticated","permission_denied","not_found","conflict","rate_limit_exceeded","internal","timeout","cancelled","execution_failed","no_report"],"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"unauthenticated","message":"Authentication required"}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"unauthenticated","message":"Authentication required"}}}},"exampleType":"examples"}},"exampleType":"examples"},"7f480a7d-54a2-4e97-897a-08a4337d573f":{"description":"Insufficient permissions","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code","enum":["invalid_request","unauthenticated","permission_denied","not_found","conflict","rate_limit_exceeded","internal","timeout","cancelled","execution_failed","no_report"],"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"permission_denied","message":"Insufficient permissions"}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"permission_denied","message":"Insufficient permissions"}}}},"exampleType":"examples"}},"exampleType":"examples"},"e016c8f2-d94e-4899-9c9f-389bc18af673":{"description":"Resource not found","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code","enum":["invalid_request","unauthenticated","permission_denied","not_found","conflict","rate_limit_exceeded","internal","timeout","cancelled","execution_failed","no_report"],"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"not_found","message":"Resource not found"}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"not_found","message":"Resource not found"}}}},"exampleType":"examples"}},"exampleType":"examples"},"054e4cb7-75a8-4977-9360-57bb57641970":{"description":"Rate limit exceeded","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code","enum":["invalid_request","unauthenticated","permission_denied","not_found","conflict","rate_limit_exceeded","internal","timeout","cancelled","execution_failed","no_report"],"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"rate_limit_exceeded","message":"Rate limit exceeded"}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"rate_limit_exceeded","message":"Rate limit exceeded"}}}},"exampleType":"examples"}},"exampleType":"examples"},"6f045807-cc98-4016-9e52-a4dea21808e5":{"description":"Internal server error","content":{"application/json":{"schema":{"type":"object","properties":{"error":{"type":"object","properties":{"code":{"type":"string","description":"Machine-readable error code","enum":["invalid_request","unauthenticated","permission_denied","not_found","conflict","rate_limit_exceeded","internal","timeout","cancelled","execution_failed","no_report"],"uniqueKey":"error.code","typeLabel":"enum\u003cstring>"},"message":{"type":"string","description":"Human-readable error message","uniqueKey":"error.message","typeLabel":"string"}},"uniqueKey":"error","typeLabel":"object"}},"uniqueKey":"","typeLabel":"object"},"example":{"error":{"code":"internal","message":"Internal server error"}},"examples":{"Example":{"title":"Example","value":{"error":{"code":"internal","message":"Internal server error"}}}},"exampleType":"examples"}},"exampleType":"examples"}},"security":{"993fdb74-0d24-438f-97b5-a90114b86d96":{"bearerAuth":{"type":"http","scheme":"bearer","description":"API key or JWT token","scopes":[],"schemeName":"bearerAuth"}}},"servers":{"dbb201e3-b2a5-4b52-ac0d-d10c96ef3390":{"url":"https://app.textql.com"}},"processedSecurityOptions":[{"schemes":[{"scheme":{"type":"http","scheme":"bearer","description":"API key or JWT token","scopes":[],"schemeName":"bearerAuth"},"schema":{"title":"Bearer Auth","type":"string","isRequired":true,"description":"API key or JWT token","format":"bearer","typeLabel":"string\u003cbearer>","deprecated":false},"schemeName":"bearerAuth","name":"Authorization"}],"title":"bearerAuth"}]},"originalFileLocation":"api-reference/platform/v2.openapi.yaml"},"subdomain":"textql","siteName":"TextQL Docs","title":"Execute Code - TextQL Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-05-11T18:31:07.099Z","originalFileLocation":"api-reference/v2/sandbox/execute-code.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=\"light\"}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=\"Execute Python code in a sandbox\">\u003cmeta data-mint-head name=\"application-name\" content=\"TextQL Docs\">\u003cmeta data-mint-head name=\"generator\" content=\"Mintlify\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"192x192\" href=\"/mintlify-assets/_mintlify/favicons/textql/UPDKEixAE9_oDjsV/_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/textql/UPDKEixAE9_oDjsV/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/textql/UPDKEixAE9_oDjsV/_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/textql/UPDKEixAE9_oDjsV/_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/textql/UPDKEixAE9_oDjsV/_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/textql/UPDKEixAE9_oDjsV/_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/textql/UPDKEixAE9_oDjsV/_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/textql/UPDKEixAE9_oDjsV/_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/textql/UPDKEixAE9_oDjsV/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Execute Code - TextQL Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Execute Python code in a sandbox\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"TextQL Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://docs.textql.com/api-reference/v2/sandbox/execute-code\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://textql.mintlify.site/_mintlify/api/og/v2?division=Sandcastles\u0026amp;title=Execute+Code\u0026amp;description=Execute+Python+code+in+a+sandbox\u0026amp;theme=a75e06317ec6b7e82a309c26\u0026amp;signature=5e05c3a8921cd1b821df1813adbe3a3f2c66f21999ffeff70f131d7fd2377a92\">\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=\"Execute Code - TextQL Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Execute Python code in a sandbox\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://textql.mintlify.site/_mintlify/api/og/v2?division=Sandcastles\u0026amp;title=Execute+Code\u0026amp;description=Execute+Python+code+in+a+sandbox\u0026amp;theme=a75e06317ec6b7e82a309c26\u0026amp;signature=5e05c3a8921cd1b821df1813adbe3a3f2c66f21999ffeff70f131d7fd2377a92\">\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/textql/UPDKEixAE9_oDjsV/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"TextQL Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#0D9373\">\u003clink data-mint-head rel=\"canonical\" href=\"https://docs.textql.com/api-reference/v2/sandbox/execute-code\">\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/sandbox/execute-code.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://docs.textql.com/#organization\",\"name\":\"TextQL Docs\",\"url\":\"https://docs.textql.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/textql/9RDmZW4lVU96oHnJ/logo-textql/light.svg?fit=max\u0026auto=format\u0026n=9RDmZW4lVU96oHnJ\u0026q=85\u0026s=069d276e4ee2f256e061f8e2db9860a3\"}},{\"@type\":\"WebSite\",\"@id\":\"https://docs.textql.com#website\",\"name\":\"TextQL Docs\",\"url\":\"https://docs.textql.com\",\"publisher\":{\"@id\":\"https://docs.textql.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://docs.textql.com/api-reference/v2/sandbox/execute-code#webpage\",\"url\":\"https://docs.textql.com/api-reference/v2/sandbox/execute-code\",\"name\":\"Execute Code\",\"description\":\"Execute Python code in a sandbox\",\"dateModified\":\"2026-05-11T18:31:07.099Z\",\"isPartOf\":{\"@id\":\"https://docs.textql.com#website\"},\"breadcrumb\":{\"@id\":\"https://docs.textql.com/api-reference/v2/sandbox/execute-code#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://docs.textql.com/api-reference/v2/sandbox/execute-code#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Sandcastles\",\"item\":\"https://docs.textql.com/api-reference/v2/sandbox/list-sandboxes\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Execute Code\",\"item\":\"https://docs.textql.com/api-reference/v2/sandbox/execute-code\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://docs.textql.com/api-reference/v2/sandbox/execute-code#apireference\",\"headline\":\"Execute Code\",\"name\":\"Execute Code\",\"description\":\"Execute Python code in a sandbox\",\"url\":\"https://docs.textql.com/api-reference/v2/sandbox/execute-code\",\"mainEntityOfPage\":{\"@id\":\"https://docs.textql.com/api-reference/v2/sandbox/execute-code#webpage\"},\"dateModified\":\"2026-05-11T18:31:07.099Z\",\"publisher\":{\"@id\":\"https://docs.textql.com/#organization\"},\"isPartOf\":{\"@id\":\"https://docs.textql.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"TextQL Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"TextQL Docs","nav":{"global":null,"tabs":[{"tab":"Documentation","pages":[{"title":"Documentation","href":"/core/get-started/quickstart"}]},{"tab":"Workshops","pages":[{"title":"Workshops","href":"/workshops"}]},{"tab":"v1 API (deprecated)","pages":[{"title":"v1 API (deprecated)","href":"/api-reference/introduction"}]},{"tab":"v2 API","groups":[{"group":"Getting Started","pages":[{"title":"v2 API Introduction","href":"/api-reference/v2/introduction"}]},{"group":"API Keys","pages":[{"title":"Create API Key","openapi":"POST /v2/api-keys","href":"/api-reference/v2/api-keys/create-api-key"},{"title":"List API Keys","openapi":"GET /v2/api-keys","href":"/api-reference/v2/api-keys/list-api-keys"},{"title":"Rotate API Key","openapi":"POST /v2/api-keys/{id}/rotate","href":"/api-reference/v2/api-keys/rotate-api-key"},{"title":"Revoke API Key","openapi":"DELETE /v2/api-keys/{id}","href":"/api-reference/v2/api-keys/revoke-api-key"}]},{"group":"Members","pages":[{"title":"List Members","openapi":"GET /v2/members","href":"/api-reference/v2/members/list-members"},{"title":"Invite Member","openapi":"POST /v2/members/invite","href":"/api-reference/v2/members/invite-member"},{"title":"Remove Member","openapi":"DELETE /v2/members/{id}","href":"/api-reference/v2/members/delete-member"},{"title":"Get Member Roles","openapi":"GET /v2/members/{id}/roles","href":"/api-reference/v2/members/get-member-roles"},{"title":"Assign Role to Member","openapi":"POST /v2/members/{id}/roles","href":"/api-reference/v2/members/assign-member-role"},{"title":"Remove Role from Member","openapi":"DELETE /v2/members/{id}/roles/{roleId}","href":"/api-reference/v2/members/remove-member-role"}]},{"group":"Roles","pages":[{"title":"List Roles","openapi":"GET /v2/roles","href":"/api-reference/v2/roles/list-roles"},{"title":"Create Role","openapi":"POST /v2/roles","href":"/api-reference/v2/roles/create-role"},{"title":"Update Role","openapi":"PATCH /v2/roles/{id}","href":"/api-reference/v2/roles/update-role"}]},{"group":"Chat","pages":[{"title":"List Chats","openapi":"GET /v2/chats","href":"/api-reference/v2/chat/list-chats"},{"title":"Create Chat","openapi":"POST /v2/chats","href":"/api-reference/v2/chat/create-chat"},{"title":"Stream Chat","openapi":"POST /v2/chats/stream","href":"/api-reference/v2/chat/stream-chat"},{"title":"Get Chat","openapi":"GET /v2/chats/{id}","href":"/api-reference/v2/chat/get-chat"},{"title":"Get Chat Cells","openapi":"GET /v2/chats/{id}/cells","href":"/api-reference/v2/chat/get-chat-cells"},{"title":"Get Chat Cell","openapi":"GET /v2/chats/{id}/cells/{cellId}","href":"/api-reference/v2/chat/get-chat-cell"},{"title":"Cancel Stream","openapi":"POST /v2/chats/{id}/cancel","href":"/api-reference/v2/chat/cancel-stream"}]},{"group":"Connectors","pages":[{"title":"List Connectors","openapi":"GET /v2/connectors","href":"/api-reference/v2/connectors/list-connectors"},{"title":"List Connector Types","openapi":"GET /v2/connectors/types","href":"/api-reference/v2/connectors/list-connector-types"},{"title":"Create Connector","openapi":"POST /v2/connectors","href":"/api-reference/v2/connectors/create-connector"},{"title":"Test Connector","openapi":"POST /v2/connectors/test","href":"/api-reference/v2/connectors/test-connector"},{"title":"Update Connector","openapi":"PATCH /v2/connectors/{id}","href":"/api-reference/v2/connectors/update-connector"},{"title":"Delete Connector","openapi":"DELETE /v2/connectors/{id}","href":"/api-reference/v2/connectors/delete-connector"},{"title":"Get Connector Access","openapi":"GET /v2/connectors/{id}/access","href":"/api-reference/v2/connectors/get-connector-access"},{"title":"Update Connector Access","openapi":"PUT /v2/connectors/{id}/access","href":"/api-reference/v2/connectors/update-connector-access"}]},{"group":"Playbooks","pages":[{"title":"List Playbooks","openapi":"GET /v2/playbooks","href":"/api-reference/v2/playbooks/list-playbooks"},{"title":"Create Playbook","openapi":"POST /v2/playbooks","href":"/api-reference/v2/playbooks/create-playbook"},{"title":"Get Playbook","openapi":"GET /v2/playbooks/{id}","href":"/api-reference/v2/playbooks/get-playbook"},{"title":"Update Playbook","openapi":"PATCH /v2/playbooks/{id}","href":"/api-reference/v2/playbooks/update-playbook"},{"title":"Run Playbook","openapi":"POST /v2/playbooks/{id}/run","href":"/api-reference/v2/playbooks/run-playbook"},{"title":"Deploy Playbook","openapi":"POST /v2/playbooks/{id}/deploy","href":"/api-reference/v2/playbooks/deploy-playbook"},{"title":"Delete Playbook","openapi":"DELETE /v2/playbooks/{id}","href":"/api-reference/v2/playbooks/delete-playbook"}]},{"group":"Dashboards","pages":[{"title":"Create Dashboard","openapi":"POST /v2/chats","href":"/api-reference/v2/dashboards/create-dashboard"},{"title":"List Chats with Dashboards","openapi":"GET /v2/chats","href":"/api-reference/v2/dashboards/list-dashboards"},{"title":"Get Dashboard","openapi":"GET /v2/chats/{id}","href":"/api-reference/v2/dashboards/get-dashboard"},{"title":"Stream Dashboard","openapi":"POST /v2/chats/stream","href":"/api-reference/v2/dashboards/stream-dashboard"},{"title":"Cancel Dashboard Stream","openapi":"POST /v2/chats/{id}/cancel","href":"/api-reference/v2/dashboards/cancel-dashboard"}]},{"group":"Sandcastles","pages":[{"title":"List Sandcastles","openapi":"GET /v2/sandcastles","href":"/api-reference/v2/sandbox/list-sandboxes"},{"title":"Start Sandcastle","openapi":"POST /v2/sandcastles","href":"/api-reference/v2/sandbox/start-sandbox"},{"title":"Get Sandcastle Status","openapi":"GET /v2/sandcastles/{id}","href":"/api-reference/v2/sandbox/get-sandbox-status"},{"title":"List Executions","openapi":"GET /v2/sandcastles/{id}/executions","href":"/api-reference/v2/sandbox/list-executions"},{"title":"Stop Sandcastle","openapi":"DELETE /v2/sandcastles/{id}","description":"Stop and destroy a running sandbox","href":"/api-reference/v2/sandbox/stop-sandbox"},{"title":"Execute Code","openapi":"POST /v2/sandcastles/{id}/execute","href":"/api-reference/v2/sandbox/execute-code"},{"title":"Load Connector Data","openapi":"POST /v2/sandcastles/{id}/query","description":"Load data from a connector into a sandbox dataframe","href":"/api-reference/v2/sandbox/load-connector-data"},{"title":"Upload File","openapi":"POST /v2/sandcastles/{id}/files","href":"/api-reference/v2/sandbox/upload-file"},{"title":"Diff Ontology (Dry Run)","openapi":"GET /v2/sandcastles/{id}/ontology/diff","href":"/api-reference/v2/sandbox/diff-ontology"},{"title":"Create Ontology Change (Writeback)","openapi":"POST /v2/sandcastles/{id}/ontology/changes","href":"/api-reference/v2/sandbox/create-ontology-change"}]},{"group":"Changes","pages":[{"title":"List Changes","openapi":"GET /v2/changes","href":"/api-reference/v2/changes/list-changes"},{"title":"Get Change","openapi":"GET /v2/changes/{id}","href":"/api-reference/v2/changes/get-change"},{"title":"Approve Change","openapi":"POST /v2/changes/{id}/approve","href":"/api-reference/v2/changes/approve-change"},{"title":"Deny Change","openapi":"POST /v2/changes/{id}/deny","href":"/api-reference/v2/changes/deny-change"},{"title":"Restore Change","openapi":"POST /v2/changes/{id}/restore","href":"/api-reference/v2/changes/restore-change"}]}]},{"tab":"v3 API (SDK)","pages":[{"title":"v3 API (SDK)","href":"/api-reference/sdk/changelog"}]},{"tab":"MCP Reference","pages":[{"title":"MCP Reference","href":"/core/how-it-works/mcp/ana-as-mcp-server"}]},{"tab":"Helm Charts","pages":[{"title":"Helm Charts","href":"/helm-charts/installation"}]},{"tab":"Changelog","pages":[{"title":"Changelog","href":"/product/changelog"}]}]},"basePath":"","title":"Execute Code - TextQL Docs","buildId":"dpl_DTau1J5HqS9UTgVSDwGksstFWtPa","deploymentId":"dpl_DTau1J5HqS9UTgVSDwGksstFWtPa","dynamics":["c2aa737661","2b790eda92","b0f84f53ff","a9bb46feb3"],"chunks":["OpenApiReferenceProvider-5FCzAcfS.js","utils-SLtAG4EZ.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-2DZi8ZMu.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-D7J3nkzE.js","snippetPresets-D0Alv0AH.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","conditional-requirements-CFM0id0Q.js","ApiExamples-BI4qNJ2c.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-BD3uyr8j.js","shallow-D8iEBr5z.js","getApiPlaygroundDisplay-CgNP4lzR.js","CodeSnippet-CX-QHuMs.js","CodeSnippets-VlXE-ZUf.js","Page-D9ithiIZ.js","getPastedJson-DYNQkZ1M.js","icon-CzacdwOi.js","MethodPill-2JVqoYKi.js","DuplicateIcon-_xVXs-U8.js","createIcon-BRHrweLo.js","DynamicMarkdown-mQG_iQiE.js","SectionHeading-DMpJzv8f.js","axios-vUo_bRtp.js","Markdown-5FGIym-8.js","clsx-D-TRO5q5.js","lib-DuNMoZ05.js","lib-B8HbPgcC.js","html-void-elements-mCSPHezU.js","dist-CdrJecqK.js","katex-YMM-FMeD.js","marked.esm-CZWythHk.js","AssistantPageLink-CHlcWBLM.js"]}