{ "id": "{CODE_ID}", "name": "Normalize Text", "description": "Collapses runs of whitespace and lowercases the result", "versionId": "{NEW_CODE_VERSION_ID}"}
Revise a code node your organization owns.Every field is optional — omitted fields keep their current value. Each call cuts a new code version rather than editing in place, so the previous state stays addressable.Use the id returned by Create a Code Node as {codeId}.Requires the Code: Full permission at organization level, and a verified organization.
sourceCode, inputs and outputs are replaced wholesale, not merged field by field. Send the complete value you want stored — a partial inputs map drops every variable you left out.
Omitting sourceCode carries the current version’s source forward unchanged, so you can revise metadata without resending the module.
Replacement Python source. Must define main(inputs). Replaces the stored source wholesale. Maximum 262144 bytes when UTF-8 encoded. Omit to carry the current source forward.
Invalid body, a codeId that is not a UUID, an inputs/outputs entry that is not a valid variable, or source that failed the security scan. A scan failure carries a violations array.
The code node belongs to another organization, your organization is not verified to author code, the API key is not org-scoped, or the key owner lacks the Code: Full permission in the organization.
{ "id": "{CODE_ID}", "name": "Normalize Text", "description": "Collapses runs of whitespace and lowercases the result", "versionId": "{NEW_CODE_VERSION_ID}"}
Was this page helpful?
{"docsConfig":{"theme":"mint","$schema":"https://mintlify.com/docs.json","name":"Opus Docs","description":"Welcome to the Opus Developer Hub, where you can learn more about building on the Opus platform.","colors":{"primary":"#2B5DDC","light":"#4A7AE8","dark":"#2B5DDC"},"logo":{"light":"https://mintcdn.com/appliedai-7127e5be/wVwGgyXIDQyL0wYc/images/light-logo.svg?fit=max\u0026auto=format\u0026n=wVwGgyXIDQyL0wYc\u0026q=85\u0026s=48326fd6749a2f78fa038e3460082611","dark":"https://mintcdn.com/appliedai-7127e5be/wVwGgyXIDQyL0wYc/images/dark-logo2.svg?fit=max\u0026auto=format\u0026n=wVwGgyXIDQyL0wYc\u0026q=85\u0026s=c54f70c148f8c84e4e26bcd6c138d0ca","href":"https://developer.opus.com"},"favicon":{"light":"https://mintcdn.com/appliedai-7127e5be/wVwGgyXIDQyL0wYc/images/opus-logo-black.svg?fit=max\u0026auto=format\u0026n=wVwGgyXIDQyL0wYc\u0026q=85\u0026s=67d85bd5b1728b436ffd8f1aed7e3569","dark":"https://mintcdn.com/appliedai-7127e5be/wVwGgyXIDQyL0wYc/images/opus-logo-white.svg?fit=max\u0026auto=format\u0026n=wVwGgyXIDQyL0wYc\u0026q=85\u0026s=0a31436012d29178b51969a0d34b86f9"},"api":{"playground":{"display":"interactive"}},"appearance":{"default":"dark"},"background":{"decoration":"grid","color":{"light":"#f9f9f9","dark":"#020202"}},"navbar":{"links":[{"href":"https://www.opus.com/blog/2026-enterprise-ais-make-or-break-year","label":"Blog"},{"href":"mailto:support@opus.com","label":"Support "},{"href":"https://status.opus.com/","label":"Status"}]},"footer":{"socials":{"x":"https://x.com/AppliedAICo","linkedin":"https://www.linkedin.com/company/appliedaico","discord":"https://discord.com/invite/M5nBqhkUYH","youtube":"https://www.youtube.com/@AppliedAICo","website":"https://opus.com"}},"search":{"prompt":"Search or Ask Opus Docs..."},"contextual":{"options":["copy","view","chatgpt","claude","perplexity","mcp","cursor","vscode"],"display":"header"},"styling":{"latex":false},"navigation":{"pages":[]}},"deployment":{"deploymentMetadataValue":{"subdomain":"appliedai-7127e5be","hasAudioNarration":false,"actualSubdomain":"appliedai-7127e5be","customDomains":["developer.opus.com"],"gitSource":{"type":"github","owner":"aaico","repo":"opus-dev-docs-mintlify","deployBranch":"main","contentDirectory":"","isPrivate":true,"mountPath":"","label":""},"chroma":{"liveDeploymentHistoryId":"6aead870e8213df27adcfa98","collectionId":"dd304aed-7271-4287-b01d-64fd09ee3671","schemaVersion":"v3","latestBuiltDeploymentHistoryId":"6aead870e8213df27adcfa98"},"feedback":{"thumbs":true},"entitlements":{"AI_CHAT":{"status":"ENABLED"},"WEB_MCP":{"status":"ENABLED"},"NARRATION":{"status":"ENABLED"}},"buildId":"6aedb25904d689b727c8958a","clientVersion":"0.0.4076","searchFilterCounts":[{"language":"default","tag":"API Reference","count":50},{"language":"default","tag":"Release Notes","count":35},{"language":"default","tag":"Releases","count":35},{"language":"default","tag":"Guides","count":25},{"language":"default","tag":"Deprecated","count":18},{"language":"default","tag":"Workflows","count":15},{"language":"default","tag":"Tasks","count":14},{"language":"default","tag":"Integrations","count":9},{"language":"default","tag":"Cases","count":6},{"language":"default","tag":"Node Reference","count":6}]},"assistantConfig":{"enableAskAiButton":false,"enableStarterQuestions":false,"enableAskAiSearchBar":true},"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":"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/v1-code/update-code","slug":"/api-reference/v1-code/update-code","pageMetadata":{"title":"Update a Code Node","api":"PATCH https://operator.opus.com/api/v1/code/{codeId}","description":"Revise a code node your organization owns, cutting a new version","href":"/api-reference/v1-code/update-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: \"Revise a code node your organization owns, cutting a new version\"\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`,p:`p`,strong:`strong`,..._provideComponents(),...props.components},{Heading,Note,ParamField,ResponseField,Warning}=_components;if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Revise a code node your organization owns.`}),`\n`,_jsx(_components.p,{children:`Every field is optional — omitted fields keep their current value. Each call cuts a new code version rather than editing in place, so the previous state stays addressable.`}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.code,{children:`id`}),` returned by `,_jsx(_components.a,{href:`/api-reference/v1-code/create-code`,children:`Create a Code Node`}),` as `,_jsx(_components.code,{children:`{codeId}`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Requires the `,_jsx(_components.strong,{children:`Code: Full`}),` permission at organization level, and a verified organization.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`sourceCode`}),`, `,_jsx(_components.code,{children:`inputs`}),` and `,_jsx(_components.code,{children:`outputs`}),` are replaced `,_jsx(_components.strong,{children:`wholesale`}),`, not merged field by field. Send the complete value you want stored — a partial `,_jsx(_components.code,{children:`inputs`}),` map drops every variable you left out.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Omitting `,_jsx(_components.code,{children:`sourceCode`}),` carries the current version’s source forward unchanged, so you can revise metadata without resending the module.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`x-service-key`,type:`string`,required:true,id:`param-x-service-key`,children:_jsx(_components.p,{children:`Your API authentication key`})}),`\n`,_jsx(Heading,{level:`2`,id:`path-parameters`,children:`Path Parameters`}),`\n`,_jsx(ParamField,{path:`codeId`,type:`string`,required:true,id:`param-code-id`,children:_jsxs(_components.p,{children:[`The code node to revise. This is `,_jsx(_components.code,{children:`id`}),` from `,_jsx(_components.a,{href:`/api-reference/v1-code/create-code`,children:`Create a Code Node`}),` — not its `,_jsx(_components.code,{children:`versionId`}),`. Must be a UUID.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsxs(_components.p,{children:[`The code node is nested under a `,_jsx(_components.code,{children:`code`}),` key.`]}),`\n`,_jsx(ParamField,{body:`code`,type:`object`,required:true,id:`param-code`,children:_jsx(_components.p,{children:`The fields to change. All of them are optional.`})}),`\n`,_jsx(ParamField,{body:`code.name`,type:`string`,id:`param-code-name`,children:_jsx(_components.p,{children:`Code node display name. Maximum 255 characters.`})}),`\n`,_jsx(ParamField,{body:`code.description`,type:`string`,id:`param-code-description`,children:_jsx(_components.p,{children:`What the code does, shown under its name. Maximum 2048 characters.`})}),`\n`,_jsx(ParamField,{body:`code.icon`,type:`string`,id:`param-code-icon`,children:_jsxs(_components.p,{children:[`Code icon as a base64-encoded SVG (or PNG) — a plain string, with no `,_jsx(_components.code,{children:`data:`}),` prefix. Maximum 65535 characters.`]})}),`\n`,_jsx(ParamField,{body:`code.sourceCode`,type:`string`,id:`param-code-source-code`,children:_jsxs(_components.p,{children:[`Replacement Python source. Must define `,_jsx(_components.code,{children:`main(inputs)`}),`. Replaces the stored source wholesale. Maximum 262144 bytes when UTF-8 encoded. Omit to carry the current source forward.`]})}),`\n`,_jsx(ParamField,{body:`code.inputs`,type:`object`,id:`param-code-inputs`,children:_jsxs(_components.p,{children:[`Replacement input schema, keyed by each variable’s `,_jsx(_components.code,{children:`variableName`}),`. Same shape and limits as on create — see `,_jsx(_components.a,{href:`/api-reference/v1-code/create-code#variable-object`,children:`Variable object`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code.outputs`,type:`object`,id:`param-code-outputs`,children:_jsxs(_components.p,{children:[`Replacement output schema. Same shape and limits as `,_jsx(_components.code,{children:`inputs`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code.categories`,type:`string[]`,id:`param-code-categories`,children:_jsxs(_components.p,{children:[`Replacement category list. Maximum 5 entries. See `,_jsx(_components.a,{href:`/api-reference/v1-code/create-code#categories`,children:`Categories`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code.status`,type:`string`,id:`param-code-status`,children:_jsxs(_components.p,{children:[`Code status — `,_jsx(_components.code,{children:`active`}),`, `,_jsx(_components.code,{children:`inactive`}),`, `,_jsx(_components.code,{children:`soon`}),` or `,_jsx(_components.code,{children:`deprecated`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code.isNew`,type:`boolean`,id:`param-code-is-new`,children:_jsx(_components.p,{children:`Show the “new” badge on the code tile.`})}),`\n`,_jsx(ParamField,{body:`code.isPopular`,type:`boolean`,id:`param-code-is-popular`,children:_jsx(_components.p,{children:`Show the “popular” badge on the code tile.`})}),`\n`,_jsx(ParamField,{body:`code.isBeta`,type:`boolean`,id:`param-code-is-beta`,children:_jsx(_components.p,{children:`Show the “beta” badge on the code tile.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`The code id, unchanged.`})}),`\n`,_jsx(ResponseField,{name:`name`,type:`string`,required:true,id:`param-name`,children:_jsx(_components.p,{children:`Code node display name.`})}),`\n`,_jsx(ResponseField,{name:`description`,type:`string`,id:`param-description`,children:_jsx(_components.p,{children:`Code node description.`})}),`\n`,_jsx(ResponseField,{name:`versionId`,type:`string`,id:`param-version-id`,children:_jsx(_components.p,{children:`Id of the new version this call created. Differs on every successful call, including one that changes only a badge.`})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The response echoes only these four fields. `,_jsx(_components.code,{children:`icon`}),`, `,_jsx(_components.code,{children:`categories`}),`, `,_jsx(_components.code,{children:`status`}),` and the badge flags are stored but not returned.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsx(ResponseField,{name:`400`,type:`Bad Request`,id:`param-400`,children:_jsxs(_components.p,{children:[`Invalid body, a `,_jsx(_components.code,{children:`codeId`}),` that is not a UUID, an `,_jsx(_components.code,{children:`inputs`}),`/`,_jsx(_components.code,{children:`outputs`}),` entry that is not a valid variable, or source that failed the security scan. A scan failure carries a `,_jsx(_components.code,{children:`violations`}),` array.`]})}),`\n`,_jsx(ResponseField,{name:`401`,type:`Unauthorized`,id:`param-401`,children:_jsx(_components.p,{children:`Missing, invalid, or expired API key.`})}),`\n`,_jsx(ResponseField,{name:`403`,type:`Forbidden`,id:`param-403`,children:_jsxs(_components.p,{children:[`The code node belongs to another organization, your organization is not verified to author code, the API key is not org-scoped, or the key owner lacks the `,_jsx(_components.strong,{children:`Code: Full`}),` permission in the organization.`]})}),`\n`,_jsx(ResponseField,{name:`404`,type:`Not Found`,id:`param-404`,children:_jsx(_components.p,{children:`No code node with that id.`})})]})}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":"Update a Code Node","api":"PATCH https://operator.opus.com/api/v1/code/{codeId}","description":"Revise a code node your organization owns, cutting a new version","href":"/api-reference/v1-code/update-code"}}},"mdxSourceWithNoJs":{"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`,p:`p`,pre:`pre`,span:`span`,strong:`strong`,..._provideComponents(),...props.components},{CodeBlock,Heading,Note,ParamField,RequestExample,ResponseExample,ResponseField,Warning}=_components;if(!CodeBlock)_missingMdxReference(`CodeBlock`,true);if(!Heading)_missingMdxReference(`Heading`,true);if(!Note)_missingMdxReference(`Note`,true);if(!ParamField)_missingMdxReference(`ParamField`,true);if(!RequestExample)_missingMdxReference(`RequestExample`,true);if(!ResponseExample)_missingMdxReference(`ResponseExample`,true);if(!ResponseField)_missingMdxReference(`ResponseField`,true);if(!Warning)_missingMdxReference(`Warning`,true);return _jsxs(_Fragment,{children:[_jsx(_components.p,{children:`Revise a code node your organization owns.`}),`\n`,_jsx(_components.p,{children:`Every field is optional — omitted fields keep their current value. Each call cuts a new code version rather than editing in place, so the previous state stays addressable.`}),`\n`,_jsxs(_components.p,{children:[`Use the `,_jsx(_components.code,{children:`id`}),` returned by `,_jsx(_components.a,{href:`/api-reference/v1-code/create-code`,children:`Create a Code Node`}),` as `,_jsx(_components.code,{children:`{codeId}`}),`.`]}),`\n`,_jsxs(_components.p,{children:[`Requires the `,_jsx(_components.strong,{children:`Code: Full`}),` permission at organization level, and a verified organization.`]}),`\n`,_jsx(Warning,{children:_jsxs(_components.p,{children:[_jsx(_components.code,{children:`sourceCode`}),`, `,_jsx(_components.code,{children:`inputs`}),` and `,_jsx(_components.code,{children:`outputs`}),` are replaced `,_jsx(_components.strong,{children:`wholesale`}),`, not merged field by field. Send the complete value you want stored — a partial `,_jsx(_components.code,{children:`inputs`}),` map drops every variable you left out.`]})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`Omitting `,_jsx(_components.code,{children:`sourceCode`}),` carries the current version’s source forward unchanged, so you can revise metadata without resending the module.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`headers`,children:`Headers`}),`\n`,_jsx(ParamField,{header:`x-service-key`,type:`string`,required:true,id:`param-x-service-key`,children:_jsx(_components.p,{children:`Your API authentication key`})}),`\n`,_jsx(Heading,{level:`2`,id:`path-parameters`,children:`Path Parameters`}),`\n`,_jsx(ParamField,{path:`codeId`,type:`string`,required:true,id:`param-code-id`,children:_jsxs(_components.p,{children:[`The code node to revise. This is `,_jsx(_components.code,{children:`id`}),` from `,_jsx(_components.a,{href:`/api-reference/v1-code/create-code`,children:`Create a Code Node`}),` — not its `,_jsx(_components.code,{children:`versionId`}),`. Must be a UUID.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`body-parameters`,children:`Body Parameters`}),`\n`,_jsxs(_components.p,{children:[`The code node is nested under a `,_jsx(_components.code,{children:`code`}),` key.`]}),`\n`,_jsx(ParamField,{body:`code`,type:`object`,required:true,id:`param-code`,children:_jsx(_components.p,{children:`The fields to change. All of them are optional.`})}),`\n`,_jsx(ParamField,{body:`code.name`,type:`string`,id:`param-code-name`,children:_jsx(_components.p,{children:`Code node display name. Maximum 255 characters.`})}),`\n`,_jsx(ParamField,{body:`code.description`,type:`string`,id:`param-code-description`,children:_jsx(_components.p,{children:`What the code does, shown under its name. Maximum 2048 characters.`})}),`\n`,_jsx(ParamField,{body:`code.icon`,type:`string`,id:`param-code-icon`,children:_jsxs(_components.p,{children:[`Code icon as a base64-encoded SVG (or PNG) — a plain string, with no `,_jsx(_components.code,{children:`data:`}),` prefix. Maximum 65535 characters.`]})}),`\n`,_jsx(ParamField,{body:`code.sourceCode`,type:`string`,id:`param-code-source-code`,children:_jsxs(_components.p,{children:[`Replacement Python source. Must define `,_jsx(_components.code,{children:`main(inputs)`}),`. Replaces the stored source wholesale. Maximum 262144 bytes when UTF-8 encoded. Omit to carry the current source forward.`]})}),`\n`,_jsx(ParamField,{body:`code.inputs`,type:`object`,id:`param-code-inputs`,children:_jsxs(_components.p,{children:[`Replacement input schema, keyed by each variable’s `,_jsx(_components.code,{children:`variableName`}),`. Same shape and limits as on create — see `,_jsx(_components.a,{href:`/api-reference/v1-code/create-code#variable-object`,children:`Variable object`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code.outputs`,type:`object`,id:`param-code-outputs`,children:_jsxs(_components.p,{children:[`Replacement output schema. Same shape and limits as `,_jsx(_components.code,{children:`inputs`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code.categories`,type:`string[]`,id:`param-code-categories`,children:_jsxs(_components.p,{children:[`Replacement category list. Maximum 5 entries. See `,_jsx(_components.a,{href:`/api-reference/v1-code/create-code#categories`,children:`Categories`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code.status`,type:`string`,id:`param-code-status`,children:_jsxs(_components.p,{children:[`Code status — `,_jsx(_components.code,{children:`active`}),`, `,_jsx(_components.code,{children:`inactive`}),`, `,_jsx(_components.code,{children:`soon`}),` or `,_jsx(_components.code,{children:`deprecated`}),`.`]})}),`\n`,_jsx(ParamField,{body:`code.isNew`,type:`boolean`,id:`param-code-is-new`,children:_jsx(_components.p,{children:`Show the “new” badge on the code tile.`})}),`\n`,_jsx(ParamField,{body:`code.isPopular`,type:`boolean`,id:`param-code-is-popular`,children:_jsx(_components.p,{children:`Show the “popular” badge on the code tile.`})}),`\n`,_jsx(ParamField,{body:`code.isBeta`,type:`boolean`,id:`param-code-is-beta`,children:_jsx(_components.p,{children:`Show the “beta” badge on the code tile.`})}),`\n`,_jsx(Heading,{level:`2`,id:`response`,children:`Response`}),`\n`,_jsx(ResponseField,{name:`id`,type:`string`,required:true,id:`param-id`,children:_jsx(_components.p,{children:`The code id, unchanged.`})}),`\n`,_jsx(ResponseField,{name:`name`,type:`string`,required:true,id:`param-name`,children:_jsx(_components.p,{children:`Code node display name.`})}),`\n`,_jsx(ResponseField,{name:`description`,type:`string`,id:`param-description`,children:_jsx(_components.p,{children:`Code node description.`})}),`\n`,_jsx(ResponseField,{name:`versionId`,type:`string`,id:`param-version-id`,children:_jsx(_components.p,{children:`Id of the new version this call created. Differs on every successful call, including one that changes only a badge.`})}),`\n`,_jsx(Note,{children:_jsxs(_components.p,{children:[`The response echoes only these four fields. `,_jsx(_components.code,{children:`icon`}),`, `,_jsx(_components.code,{children:`categories`}),`, `,_jsx(_components.code,{children:`status`}),` and the badge flags are stored but not returned.`]})}),`\n`,_jsx(Heading,{level:`2`,id:`errors`,children:`Errors`}),`\n`,_jsx(ResponseField,{name:`400`,type:`Bad Request`,id:`param-400`,children:_jsxs(_components.p,{children:[`Invalid body, a `,_jsx(_components.code,{children:`codeId`}),` that is not a UUID, an `,_jsx(_components.code,{children:`inputs`}),`/`,_jsx(_components.code,{children:`outputs`}),` entry that is not a valid variable, or source that failed the security scan. A scan failure carries a `,_jsx(_components.code,{children:`violations`}),` array.`]})}),`\n`,_jsx(ResponseField,{name:`401`,type:`Unauthorized`,id:`param-401`,children:_jsx(_components.p,{children:`Missing, invalid, or expired API key.`})}),`\n`,_jsx(ResponseField,{name:`403`,type:`Forbidden`,id:`param-403`,children:_jsxs(_components.p,{children:[`The code node belongs to another organization, your organization is not verified to author code, the API key is not org-scoped, or the key owner lacks the `,_jsx(_components.strong,{children:`Code: Full`}),` permission in the organization.`]})}),`\n`,_jsx(ResponseField,{name:`404`,type:`Not Found`,id:`param-404`,children:_jsx(_components.p,{children:`No code node with that id.`})}),`\n`,_jsxs(RequestExample,{children:[_jsx(CodeBlock,{filename:`cURL`,numberOfLines:`13`,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:`13`,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:` --request`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` PATCH`}),_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:` --url`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` https://operator.opus.com/api/v1/code/{CODE_ID}`}),_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:` --header`}),_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:` --header`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` 'x-service-key: {YOUR_SERVICE_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:` --data`}),_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:` \"code\": {`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\": \"Collapses runs of whitespace and lowercases the result\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sourceCode\": \"import re\\\\n\\\\n\\\\ndef main(inputs):\\\\n raw_text = inputs.get(\\\\\"raw_text\\\\\") or \\\\\"\\\\\"\\\\n\\\\n return {\\\\\"clean_text\\\\\": re.sub(r\\\\\"\\\\\\\\s+\\\\\", \\\\\" \\\\\", raw_text).strip().lower()}\\\\n\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"categories\": [\"text_processing\", \"validation_and_normalization\"],`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"status\": \"active\",`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"isNew\": false`})}),`\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`]})})}),_jsx(CodeBlock,{filename:`Python`,numberOfLines:`28`,language:`python`,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:`python`,children:_jsxs(_components.code,{language:`python`,numberOfLines:`28`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:`import`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`code_id `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{CODE_ID}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`url `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:` f`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"https://operator.opus.com/api/v1/code/`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`code_id`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`}`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`headers `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-service-key\"`}),_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:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`{YOUR_SERVICE_KEY}`}),_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`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`source `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` '''import re`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`def main(inputs):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` raw_text = inputs.get(\"raw_text\") or \"\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return {\"clean_text\": re.sub(r\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\\\\`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`s+\", \" \", raw_text).strip().lower()}`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`'''`})}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`payload `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"code\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Collapses runs of whitespace and lowercases the result\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"sourceCode\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: source,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"categories\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"text_processing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"validation_and_normalization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"status\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"isNew\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:`False`}),_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`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`response `}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` requests.patch(url, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`json`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`payload, `}),_jsx(_components.span,{style:{color:`#953800`,\"--shiki-dark\":`#9CDCFE`},children:`headers`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:`=`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`headers)`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#DCDCAA`},children:`print`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(response.json())`})]}),`\n`]})})}),_jsx(CodeBlock,{filename:`JavaScript`,numberOfLines:`29`,language:`javascript`,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:`javascript`,children:_jsxs(_components.code,{language:`javascript`,numberOfLines:`29`,children:[_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` codeId`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"{CODE_ID}\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` source`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\" `import re\"})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`def main(inputs):`})}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` raw_text = inputs.get(\"raw_text\") or \"\"`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` return {\"clean_text\": re.sub(r\"`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D7BA7D`},children:`\\\\\\\\`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`s+\", \" \", raw_text).strip().lower()}`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`;`})]}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` response`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:` fetch`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:\"`https://operator.opus.com/api/v1/code/\"}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},children:\"${\"}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`codeId`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#569CD6`},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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` method:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"PATCH\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` headers:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Content-Type\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"application/json\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"x-service-key\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"{YOUR_SERVICE_KEY}\"`}),_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:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` body:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` JSON`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`stringify`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`({`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` code:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` {`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` description:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"Collapses runs of whitespace and lowercases the result\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` sourceCode:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` source`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` categories:`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:` [`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"text_processing\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`, `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"validation_and_normalization\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`],`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` status:`}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:` \"active\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`,`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` isNew:`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#569CD6`},children:` false`}),_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`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`});`})}),`\n`,_jsx(_components.span,{className:`line`}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#569CD6`},children:`const`}),_jsx(_components.span,{style:{color:`#0550AE`,\"--shiki-dark\":`#4FC1FF`},children:` data`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#D4D4D4`},children:` =`}),_jsx(_components.span,{style:{color:`#CF222E`,\"--shiki-dark\":`#C586C0`},children:` await`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:` response`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`json`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`();`})]}),`\n`,_jsxs(_components.span,{className:`line`,children:[_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`console`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`.`}),_jsx(_components.span,{style:{color:`#8250DF`,\"--shiki-dark\":`#DCDCAA`},children:`log`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`(`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#9CDCFE`},children:`data`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`);`})]}),`\n`]})})})]}),`\n`,_jsx(ResponseExample,{children:_jsx(CodeBlock,{filename:`200 Response`,numberOfLines:`6`,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:`6`,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:` \"id\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{CODE_ID}\"`}),_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:`\"Normalize Text\"`}),_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:` \"description\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"Collapses runs of whitespace and lowercases the result\"`}),_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:` \"versionId\"`}),_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`: `}),_jsx(_components.span,{style:{color:`#0A3069`,\"--shiki-dark\":`#CE9178`},children:`\"{NEW_CODE_VERSION_ID}\"`})]}),`\n`,_jsx(_components.span,{className:`line`,children:_jsx(_components.span,{style:{color:`#1F2328`,\"--shiki-dark\":`#D4D4D4`},children:`}`})}),`\n`]})})})})]})}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":"Update a Code Node","api":"PATCH https://operator.opus.com/api/v1/code/{codeId}","description":"Revise a code node your organization owns, cutting a new version","href":"/api-reference/v1-code/update-code"}}}},"mdxExtracts":{"tableOfContents":[{"title":"Headers","slug":"headers","depth":2,"children":[]},{"title":"Path Parameters","slug":"path-parameters","depth":2,"children":[]},{"title":"Body Parameters","slug":"body-parameters","depth":2,"children":[]},{"title":"Response","slug":"response","depth":2,"children":[]},{"title":"Errors","slug":"errors","depth":2,"children":[]}],"codeExamples":{"request":{"type":"RequestExample","children":[{"filename":"cURL","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"shellscript\">\u003ccode language=\"shellscript\" numberOfLines=\"13\">\u003cspan class=\"line\">\u003cspan style=\"color:#953800;--shiki-dark:#DCDCAA\">curl\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --request\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> PATCH\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --url\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> https://operator.opus.com/api/v1/code/{CODE_ID}\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --header\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'Content-Type: application/json'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --header\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> 'x-service-key: {YOUR_SERVICE_KEY}'\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\"> \\\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> --data\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"code\": {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"description\": \"Collapses runs of whitespace and lowercases the result\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"sourceCode\": \"import re\\n\\n\\ndef main(inputs):\\n raw_text = inputs.get(\\\"raw_text\\\") or \\\"\\\"\\n\\n return {\\\"clean_text\\\": re.sub(r\\\"\\\\s+\\\", \\\" \\\", raw_text).strip().lower()}\\n\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"categories\": [\"text_processing\", \"validation_and_normalization\"],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"status\": \"active\",\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"isNew\": false\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> }'\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"Python","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"python\">\u003ccode language=\"python\" numberOfLines=\"28\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\">import\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">code_id \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{CODE_ID}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">url \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\"> f\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"https://operator.opus.com/api/v1/code/\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">code_id\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">headers \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"application/json\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"x-service-key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">{YOUR_SERVICE_KEY}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">source \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> '''import re\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">def main(inputs):\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> raw_text = inputs.get(\"raw_text\") or \"\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> return {\"clean_text\": re.sub(r\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\\\\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">s+\", \" \", raw_text).strip().lower()}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">'''\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">payload \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"code\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"description\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Collapses runs of whitespace and lowercases the result\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"sourceCode\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: source,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"categories\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: [\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"text_processing\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"validation_and_normalization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"status\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"active\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"isNew\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\">False\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">response \u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> requests.patch(url, \u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">json\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">payload, \u003c/span>\u003cspan style=\"color:#953800;--shiki-dark:#9CDCFE\">headers\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\">=\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">headers)\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0550AE;--shiki-dark:#DCDCAA\">print\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(response.json())\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"},{"filename":"JavaScript","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"javascript\">\u003ccode language=\"javascript\" numberOfLines=\"29\">\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> codeId\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"{CODE_ID}\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">;\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> source\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> `import re\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">def main(inputs):\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> raw_text = inputs.get(\"raw_text\") or \"\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> return {\"clean_text\": re.sub(r\"\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D7BA7D\">\\\\\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">s+\", \" \", raw_text).strip().lower()}\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">;\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> response\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\"> fetch\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`https://operator.opus.com/api/v1/code/\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">${\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">codeId\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#569CD6\">}\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">`\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> method:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"PATCH\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> headers:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Content-Type\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"application/json\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"x-service-key\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"{YOUR_SERVICE_KEY}\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> body:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> JSON\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">stringify\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">({\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> code:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> {\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> description:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"Collapses runs of whitespace and lowercases the result\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> sourceCode:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> source\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> categories:\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> [\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"text_processing\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">, \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"validation_and_normalization\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">],\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> status:\u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\"> \"active\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> isNew:\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#569CD6\"> false\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> },\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\"> }),\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">});\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#CF222E;--shiki-dark:#569CD6\">const\u003c/span>\u003cspan style=\"color:#0550AE;--shiki-dark:#4FC1FF\"> data\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#D4D4D4\"> =\u003c/span>\u003cspan style=\"color:#CF222E;--shiki-dark:#C586C0\"> await\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\"> response\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">json\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">();\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">console\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">.\u003c/span>\u003cspan style=\"color:#8250DF;--shiki-dark:#DCDCAA\">log\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">(\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#9CDCFE\">data\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">);\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]},"response":{"type":"ResponseExample","children":[{"filename":"200 Response","html":"\u003cpre class=\"shiki shiki-themes github-light-default dark-plus\" style=\"background-color:#ffffff;--shiki-dark-bg:#0B0C0E;color:#1f2328;--shiki-dark:#D4D4D4\" language=\"json\">\u003ccode language=\"json\" numberOfLines=\"6\">\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">{\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"id\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"{CODE_ID}\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"name\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Normalize Text\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"description\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"Collapses runs of whitespace and lowercases the result\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">,\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#116329;--shiki-dark:#9CDCFE\"> \"versionId\"\u003c/span>\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">: \u003c/span>\u003cspan style=\"color:#0A3069;--shiki-dark:#CE9178\">\"{NEW_CODE_VERSION_ID}\"\u003c/span>\u003c/span>\n\u003cspan class=\"line\">\u003cspan style=\"color:#1F2328;--shiki-dark:#D4D4D4\">}\u003c/span>\u003c/span>\n\u003c/code>\u003c/pre>"}],"attributes":[]}},"endpoint":{"title":"Update a Code Node","path":"/api/v1/code/{codeId}","servers":[{"url":"https://operator.opus.com"}],"method":"patch","request":{"security":[],"parameters":{"query":{},"header":{"x-service-key":{"schema":[{"type":"string","description":"Your API authentication key","required":true}]}},"cookie":{},"path":{"codeId":{"schema":[{"type":"string","description":"The code node to revise. This is `id` from Create a Code Node — not its `versionId` . Must be a UUID.","required":true}]}}},"body":{"application/json":{"schemaArray":[{"type":"object","properties":{"code":[{"type":"object","properties":{},"description":"The fields to change. All of them are optional.","required":true}],"code.name":[{"type":"string","description":"Code node display name. Maximum 255 characters."}],"code.description":[{"type":"string","description":"What the code does, shown under its name. Maximum 2048 characters."}],"code.icon":[{"type":"string","description":"Code icon as a base64-encoded SVG (or PNG) — a plain string, with no `data:` prefix. Maximum 65535 characters."}],"code.sourceCode":[{"type":"string","description":"Replacement Python source. Must define `main(inputs)` . Replaces the stored source wholesale. Maximum 262144 bytes when UTF-8 encoded. Omit to carry the current source forward."}],"code.inputs":[{"type":"object","properties":{},"description":"Replacement input schema, keyed by each variable’s `variableName` . Same shape and limits as on create — see Variable object ."}],"code.outputs":[{"type":"object","properties":{},"description":"Replacement output schema. Same shape and limits as `inputs` ."}],"code.categories":[{"type":"array","items":[{"type":"string"}],"description":"Replacement category list. Maximum 5 entries. See Categories ."}],"code.status":[{"type":"string","description":"Code status — `active` , `inactive` , `soon` or `deprecated` ."}],"code.isNew":[{"type":"boolean","description":"Show the “new” badge on the code tile."}],"code.isPopular":[{"type":"boolean","description":"Show the “popular” badge on the code tile."}],"code.isBeta":[{"type":"boolean","description":"Show the “beta” badge on the code tile."}]}}],"examples":{"example":{"value":{"code":{},"code.name":"\u003cstring>","code.description":"\u003cstring>","code.icon":"\u003cstring>","code.sourceCode":"\u003cstring>","code.inputs":{},"code.outputs":{},"code.categories":["\u003cstring>"],"code.status":"\u003cstring>","code.isNew":true,"code.isPopular":true,"code.isBeta":true}}}}}},"response":{"200":{"application/json":{"schemaArray":[{"type":"object","properties":{"400":[{"type":"object","properties":{},"description":"Invalid body, a `codeId` that is not a UUID, an `inputs` / `outputs` entry that is not a valid variable, or source that failed the security scan. A scan failure carries a `violations` array."}],"401":[{"type":"object","properties":{},"description":"Missing, invalid, or expired API key."}],"403":[{"type":"object","properties":{},"description":"The code node belongs to another organization, your organization is not verified to author code, the API key is not org-scoped, or the key owner lacks the Code: Full permission in the organization."}],"404":[{"type":"object","properties":{},"description":"No code node with that id."}],"id":[{"type":"string","description":"The code id, unchanged.","required":true}],"name":[{"type":"string","description":"Code node display name.","required":true}],"description":[{"type":"string","description":"Code node description."}],"versionId":[{"type":"string","description":"Id of the new version this call created. Differs on every successful call, including one that changes only a badge."}]}}],"examples":{"example":{"value":{"400":{},"401":{},"403":{},"404":{},"id":"\u003cstring>","name":"\u003cstring>","description":"\u003cstring>","versionId":"\u003cstring>"}}}}}},"deprecated":false}},"jsLinks":[],"subdomain":"appliedai-7127e5be","siteName":"Opus Docs","title":"Update a Code Node - Opus Docs","navMaps":{"firstHrefInVersion":{},"firstHrefInLanguage":{}},"lastModified":"2026-10-16T09:50:02.078Z","originalFileLocation":"api-reference/v1-code/update-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=\"dark\"}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=\"Revise a code node your organization owns, cutting a new version\">\u003cmeta data-mint-head name=\"application-name\" content=\"Opus 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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_generated/favicon/apple-touch-icon.png\">\u003clink data-mint-head rel=\"icon\" type=\"image/png\" sizes=\"16x16\" href=\"/mintlify-assets/_mintlify/favicons/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_generated/favicon-dark/favicon.ico\" media=\"(prefers-color-scheme: dark)\">\u003cmeta data-mint-head property=\"og:title\" content=\"Update a Code Node - Opus Docs\">\u003cmeta data-mint-head property=\"og:description\" content=\"Revise a code node your organization owns, cutting a new version\">\u003cmeta data-mint-head property=\"og:site_name\" content=\"Opus Docs\">\u003cmeta data-mint-head property=\"og:url\" content=\"https://developer.opus.com/api-reference/v1-code/update-code\">\u003cmeta data-mint-head property=\"og:type\" content=\"website\">\u003cmeta data-mint-head property=\"og:image\" content=\"https://appliedai-7127e5be.mintlify.site/_mintlify/api/og/v2?division=Code\u0026amp;title=Update+a+Code+Node\u0026amp;description=Revise+a+code+node+your+organization+owns%2C+cutting+a+new+version\u0026amp;theme=c3944e83abed772600fd1258\u0026amp;signature=aadb8c9470773c313d148c10540a322802e5f390423819547f210b4df484f59b\">\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=\"Update a Code Node - Opus Docs\">\u003cmeta data-mint-head name=\"twitter:description\" content=\"Revise a code node your organization owns, cutting a new version\">\u003cmeta data-mint-head name=\"twitter:image\" content=\"https://appliedai-7127e5be.mintlify.site/_mintlify/api/og/v2?division=Code\u0026amp;title=Update+a+Code+Node\u0026amp;description=Revise+a+code+node+your+organization+owns%2C+cutting+a+new+version\u0026amp;theme=c3944e83abed772600fd1258\u0026amp;signature=aadb8c9470773c313d148c10540a322802e5f390423819547f210b4df484f59b\">\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/appliedai-7127e5be/izBgmHq5AgpZ-DmU/_generated/favicon/browserconfig.xml\">\u003cmeta data-mint-head name=\"apple-mobile-web-app-title\" content=\"Opus Docs\">\u003cmeta data-mint-head name=\"msapplication-TileColor\" content=\"#2B5DDC\">\u003clink data-mint-head rel=\"canonical\" href=\"https://developer.opus.com/api-reference/v1-code/update-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/v1-code/update-code.md\">\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@graph\":[{\"@type\":\"Organization\",\"@id\":\"https://developer.opus.com/#organization\",\"name\":\"Opus Docs\",\"url\":\"https://developer.opus.com\",\"logo\":{\"@type\":\"ImageObject\",\"url\":\"https://mintcdn.com/appliedai-7127e5be/wVwGgyXIDQyL0wYc/images/light-logo.svg?fit=max\u0026auto=format\u0026n=wVwGgyXIDQyL0wYc\u0026q=85\u0026s=48326fd6749a2f78fa038e3460082611\"}},{\"@type\":\"WebSite\",\"@id\":\"https://developer.opus.com#website\",\"name\":\"Opus Docs\",\"url\":\"https://developer.opus.com\",\"publisher\":{\"@id\":\"https://developer.opus.com/#organization\"}},{\"@type\":\"WebPage\",\"@id\":\"https://developer.opus.com/api-reference/v1-code/update-code#webpage\",\"url\":\"https://developer.opus.com/api-reference/v1-code/update-code\",\"name\":\"Update a Code Node\",\"description\":\"Revise a code node your organization owns, cutting a new version\",\"dateModified\":\"2026-10-16T09:50:02.078Z\",\"isPartOf\":{\"@id\":\"https://developer.opus.com#website\"},\"breadcrumb\":{\"@id\":\"https://developer.opus.com/api-reference/v1-code/update-code#breadcrumb\"}},{\"@type\":\"BreadcrumbList\",\"@id\":\"https://developer.opus.com/api-reference/v1-code/update-code#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Code\",\"item\":\"https://developer.opus.com/api-reference/v1-code/code-introduction\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Update a Code Node\",\"item\":\"https://developer.opus.com/api-reference/v1-code/update-code\"}]},{\"@type\":[\"TechArticle\",\"APIReference\"],\"@id\":\"https://developer.opus.com/api-reference/v1-code/update-code#apireference\",\"headline\":\"Update a Code Node\",\"name\":\"Update a Code Node\",\"description\":\"Revise a code node your organization owns, cutting a new version\",\"url\":\"https://developer.opus.com/api-reference/v1-code/update-code\",\"mainEntityOfPage\":{\"@id\":\"https://developer.opus.com/api-reference/v1-code/update-code#webpage\"},\"dateModified\":\"2026-10-16T09:50:02.078Z\",\"publisher\":{\"@id\":\"https://developer.opus.com/#organization\"},\"isPartOf\":{\"@id\":\"https://developer.opus.com#website\"}}]}\u003c/script>\u003cscript data-mint-head type=\"application/ld+json\">{\"@context\":\"https://schema.org\",\"@type\":\"WebSite\",\"name\":\"Opus Docs\",\"creator\":{\"@type\":\"Organization\",\"name\":\"Mintlify\",\"url\":\"https://mintlify.com\"}}\u003c/script>","siteName":"Opus Docs","nav":{"global":null,"tabs":[{"tab":"Guides","pages":[{"title":"Guides","href":""}]},{"tab":"API Reference","groups":[{"group":"Get Started","pages":[{"title":"Introduction","href":"/api-reference/introduction"},{"title":"API Quickstart","href":"/api-reference/quickstart"}]},{"group":"Workflows","pages":[{"title":"Introduction","href":"/api-reference/v1-workflow-generation/workflow-generation-introduction"},{"title":"Create a Workflow","api":"POST https://operator.opus.com/api/v1/workflow","playground":"simple","href":"/api-reference/v1-workflow-generation/create-workflow"},{"title":"Get Workflow Details","api":"GET https://operator.opus.com/api/v1/workflow/{workflowId}","href":"/api-reference/v1-workflow-generation/get-workflow-details"},{"title":"Update a Workflow","api":"PUT https://operator.opus.com/api/v1/workflow/{workflowId}","playground":"simple","href":"/api-reference/v1-workflow-generation/update-workflow"},{"title":"Archive a Workflow","api":"DELETE https://operator.opus.com/api/v1/workflow/{workflowId}","playground":"simple","href":"/api-reference/v1-workflow-generation/archive-workflow"},{"title":"Restore a Workflow","api":"POST https://operator.opus.com/api/v1/workflow/{workflowId}/restore","playground":"simple","href":"/api-reference/v1-workflow-generation/restore-workflow"},{"title":"Generate a Workflow","api":"POST https://operator.opus.com/api/v1/workflow/generate","playground":"simple","href":"/api-reference/v1-workflow-generation/generate-headless"},{"title":"Get Run Status","api":"GET https://operator.opus.com/api/v1/workflow/{workflowId}/run","playground":"simple","href":"/api-reference/v1-workflow-generation/get-run-status"},{"title":"Cancel a Run","api":"POST https://operator.opus.com/api/v1/workflow/{workflowId}/run/cancel","playground":"simple","href":"/api-reference/v1-workflow-generation/cancel-run"},{"group":"Node Reference","pages":[{"title":"Node Process Types","href":"/api-reference/v1-workflow-generation/node-process-types"},{"title":"Agent Node","href":"/api-reference/v1-workflow-generation/agent-node"},{"title":"Code Node","href":"/api-reference/v1-workflow-generation/code-node"},{"title":"Human Node","href":"/api-reference/v1-workflow-generation/human-node"},{"title":"Integration Node","href":"/api-reference/v1-workflow-generation/integration-node"},{"title":"Variable Schemas","href":"/api-reference/v1-workflow-generation/variable-schemas"}]}]},{"group":"Cases","pages":[{"title":"Introduction","href":"/api-reference/v1-case/case-introduction"},{"title":"Initiate Case","api":"POST https://operator.opus.com/api/v1/case","href":"/api-reference/v1-case/initiate-case"},{"title":"Execute Case","api":"POST https://operator.opus.com/api/v1/case/{caseId}/execute","playground":"simple","href":"/api-reference/v1-case/execute-case"},{"title":"Get Case Status","api":"GET https://operator.opus.com/api/v1/case/{caseId}/status","href":"/api-reference/v1-case/get-case-status"},{"title":"Get Case Results","api":"GET https://operator.opus.com/api/v1/case/{caseId}/results","href":"/api-reference/v1-case/get-case-results"},{"title":"Case Audit Log","api":"GET https://operator.opus.com/api/v1/case/{caseId}/audit","href":"/api-reference/v1-case/case-audit-log"}]},{"group":"Files","pages":[{"title":"Introduction","href":"/api-reference/v1-file/file-introduction"},{"title":"Get Upload URL","api":"POST https://operator.opus.com/api/v1/file/upload/presigned","href":"/api-reference/v1-file/get-upload-url"},{"title":"Upload File","api":"PUT {presignedUrl}","playground":"simple","href":"/api-reference/v1-file/upload-file"}]},{"group":"Business Process Discovery","pages":[{"title":"Introduction","href":"/api-reference/v1-discovery/discovery-introduction"},{"title":"Get a Process","api":"GET https://operator.opus.com/api/v1/discovery/process/{processId}","href":"/api-reference/v1-discovery/get-process-details"}]},{"group":"Integrations","pages":[{"title":"Introduction","href":"/api-reference/v1-integration/integration-introduction"},{"title":"Create a Provider","api":"POST https://operator.opus.com/api/v1/integration/provider","href":"/api-reference/v1-integration/create-provider"},{"title":"Create an Integration","api":"POST https://operator.opus.com/api/v1/integration","href":"/api-reference/v1-integration/create-integration"},{"title":"Add an Action","api":"POST https://operator.opus.com/api/v1/integration/v/{integrationVersionId}/action","href":"/api-reference/v1-integration/add-action"},{"title":"Add a Credential","api":"POST https://operator.opus.com/api/v1/integration/v/{integrationVersionId}/credential","href":"/api-reference/v1-integration/create-credential"},{"title":"Connect an Integration","api":"POST https://operator.opus.com/api/v1/integration/connect","href":"/api-reference/v1-integration/connect-integration"},{"title":"Check a Connection","api":"GET https://operator.opus.com/api/v1/integration/connect/{connectionToken}","href":"/api-reference/v1-integration/connection-status"}]},{"group":"Code","pages":[{"title":"Introduction","href":"/api-reference/v1-code/code-introduction"},{"title":"Create a Code Node","api":"POST https://operator.opus.com/api/v1/code","description":"Register a Python code node with its source and IO schema","href":"/api-reference/v1-code/create-code"},{"title":"Update a Code Node","api":"PATCH https://operator.opus.com/api/v1/code/{codeId}","href":"/api-reference/v1-code/update-code"}]},{"group":"Agents","pages":[{"title":"Introduction","description":"Author agents for your organization entirely through the API","href":"/api-reference/v1-agent/agent-introduction"},{"title":"Create an Agent","api":"POST https://operator.opus.com/api/v1/agent","href":"/api-reference/v1-agent/create-agent"},{"title":"Update an Agent","api":"PATCH https://operator.opus.com/api/v1/agent/{agentId}","href":"/api-reference/v1-agent/update-agent"}]},{"group":"Deprecated","pages":[{"group":"Deprecated","expanded":false,"pages":[{"title":"Get Workflow Details","api":"GET https://operator.opus.com/workflow/{workflowId}","href":"/api-reference/v0-jobs/get-workflow-details"},{"title":"Initiate Job","api":"POST https://operator.opus.com/job/initiate","href":"/api-reference/v0-jobs/initiate-job"},{"title":"Get Upload URL","api":"POST https://operator.opus.com/job/file/upload","href":"/api-reference/v0-jobs/get-upload-url"},{"title":"Upload File","api":"PUT {presignedUrl}","playground":"simple","href":"/api-reference/v0-jobs/upload-file"},{"title":"Execute Job","api":"POST https://operator.opus.com/job/execute","playground":"simple","href":"/api-reference/v0-jobs/execute-job"},{"title":"Get Job Execution Status","api":"GET https://operator.opus.com/job/{jobExecutionId}/status","playground":"simple","href":"/api-reference/v0-jobs/get-job-status"},{"title":"Get Job Execution Results","api":"GET https://operator.opus.com/job/{jobExecutionId}/results","playground":"simple","href":"/api-reference/v0-jobs/get-job-results"},{"title":"Job Audit Log","api":"GET https://operator.opus.com/job/{jobExecutionId}/audit","playground":"simple","href":"/api-reference/v0-jobs/job-audit-log"},{"title":"Postman Collection","icon":"rectangle-list","href":"/api-reference/v0-jobs/postman-collection"}]}]}]},{"tab":"Opus SDK","pages":[{"title":"Opus SDK","href":"/opus-sdk/overview"}]},{"tab":"Release Notes","pages":[{"title":"Release Notes","href":"/release-notes/opus-v2-9-2"}]}]},"basePath":"","title":"Update a Code Node - Opus Docs","buildId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","deploymentId":"dpl_8LJbrAiZvr1K98WQNZXCyY5AvT34","dynamics":["c2aa737661","2b790eda92","b0f84f53ff"],"chunks":["OpenApiReferenceProvider-i2a3QZ8E.js","utils-ChLwp8m0.js","cloneDeep-izs3Hzxb.js","_Uint8Array-BVIqJ90l.js","isObjectLike-C8vmzPEN.js","isArray-Dcu1dQ5t.js","utils-DRktVTDc.js","toString-BX-iyh8G.js","isSymbol-CSH9U2Gm.js","addUniqueKeysToSchema-CA2pEs4T.js","snippetPresets-ClQ6XrKD.js","style-to-object-BY3JEAdk.js","v4-DIgz8zy6.js","ApiExamples-Ct_Lv36y.js","isEqual-BfaiBbcl.js","usePlaygroundInputsStore-Cn2PYw9e.js","shallow-rkyymjXQ.js","getApiPlaygroundDisplay-BB9vkXtE.js","CodeSnippet-Bm5RU7m1.js","CodeSnippets-BgU9Deuz.js","Page-BUDYNlhG.js","getPastedJson-BD-6NNum.js","icon-8Z6tud2e.js","MethodPill-Tuzr4g3V.js","DuplicateIcon-0ceWFYhN.js","createIcon-FBXow_ST.js","DynamicMarkdown-CD8713Yy.js","SectionHeading-7zgzQbH-.js","axios-vUo_bRtp.js"]}