Skip to content

Zoho: Update a function by identifier

Zoho functions.updateFunction: arguments, response, policy and SDK examples.

← Functions operations · Get started

Operation zoho.updatefunction

Provider route: PUT /crm/v8/settings/functions/{fxIdentifier}. Alter supplies the connection’s credentials and routing.

Install @alter-ai/sdk @alter-ai/zoho with npm, or alter-sdk-zoho with pip. Supply your connected customer’s grant ID and the arguments described below.

import { App } from "@alter-ai/sdk";
import { ZohoIntegration } from "@alter-ai/zoho";
async function execute(input: Parameters<ZohoIntegration["functions"]["updateFunction"]>[0]) {
const app = new App({ apiKey: process.env.ALTER_API_KEY! });
try {
const provider = new ZohoIntegration(app, { grantId: process.env.PROVIDER_GRANT_ID! });
const call = await provider.functions.updateFunction(input);
const result = await call.wait();
return result.bodyJson();
} finally {
await app.close();
}
}
import os
from alter_sdk import App
from alter_sdk_zoho import ZohoIntegration
async def execute(arguments):
async with App(api_key=os.environ["ALTER_API_KEY"]) as app:
provider = ZohoIntegration(app, {"grant_id": os.environ["PROVIDER_GRANT_ID"]})
call = await provider.functions.update_function(arguments)
result = await call.wait()
return result.body_json()
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
pathModelRequired within parentExpand Publish a function — request body — path
bodyobjectOptionalMultipart form data for updating a function, containing the code binary file and the metadata object with the function’s name, description, and script details.
Additional keys: not allowed
body.codeobjectOptionalSpecify the binary file content of the function code package to upload.
Additional keys: not allowed
body.code.filenamestringRequired within parentMinimum length: 1
body.code.content_typestringRequired within parentMinimum length: 1
body.code.content_base64stringRequired within parent
body.metadataobjectOptionalJSON string containing the metadata of the function being updated. Can include function name, description, and inline code (_code) for Deluge. Deluge code can also be uploaded as a .ds file via the `code` multipart form field. For non-Deluge runtimes, attach the updated code package as a ZIP via the `code` multipart form field.
Additional keys: not allowed
body.metadata.functionsarray or nullOptionalThe list of function objects to include in the update request.
Maximum items: 1
body.metadata.functions[]ModelEach itemExpand Update a function by identifier — request body — body metadata functions item
body.metadata.publishobjectOptionalPublish configuration with an optional changelog message.
Additional keys: not allowed
body.metadata.publish.changelogstring or nullOptionalChangelog message for revision tracking. For Deluge functions, recorded as part of the auto-publish. For non-Deluge functions, recorded when the publish step succeeds.
Maximum length: 250

Referenced models: Update a function by identifier — request body — body metadata functions item, Publish a function — request body — path

Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.

FieldTypePresenceDescription and constraints
$JSONRoot
$ (anyOf 1)ModelAlternativeExpand Update a function by identifier — response body — functions — Putfunctions Response200
$ (anyOf 2)ModelAlternativeExpand Update a function by identifier — response body — functions — Putfunctions Response207

Referenced models: Update a function by identifier — response body — functions — Putfunctions Response200, Update a function by identifier — response body — functions — Putfunctions Response207

Update a function by identifier — response body — functions — Putfunctions Response200
FieldTypePresenceDescription and constraints
$objectRootThe response returned after a successful function update.
Additional keys: not allowed
functionsarrayRequired within parentThe list of function update result objects returned after the operation.
Maximum items: 1
functions[]ModelEach itemExpand Function — functions delete Function — response body — functions item

Referenced models: Function — functions delete Function — response body — functions item

Update a function by identifier — response body — functions — Putfunctions Response207
FieldTypePresenceDescription and constraints
$objectRootRepresents a partial success response for a function update operation. The **functions** array contains the result details for the updated function.
Additional keys: not allowed
functionsarrayRequired within parentRepresents the list of function update results included in the partial success response.
Maximum items: 1
functions[]ModelEach itemExpand Update a function by identifier — response body — functions functions item

Referenced models: Update a function by identifier — response body — functions functions item

Update a function by identifier — request body — body metadata functions item
FieldTypePresenceDescription and constraints
$objectRootSchema for creating or updating a function. Contains the function metadata such as name, API name, description, runtime, category, and optional inline script code.
Additional keys: not allowed
_codestring or nullOptionalInline function script content as a string. Applicable only for Deluge runtime — Deluge functions are auto-published when this field is set. For non-Deluge runtimes (Java, NodeJS, Python), upload a ZIP code package via the `code` multipart form field instead.
Maximum length: 2097152
Minimum length: 1
api_namestring or nullOptionalThe unique programmatic identifier for the function.
Maximum length: 100
Minimum length: 3
Pattern: ^[A-Za-z][A-Za-z0-9_-]*$
categorystring or nullOptionalThe trigger category that determines how and when the function executes. Possible values: **Button** - Triggered when a user clicks a button on a record. **Automation** - Triggered by an automated Workflow or rule. **Schedule** - Triggered at a scheduled time. **Related List** - Triggered from a related list on a record. **Standalone** - Executed independently without a specific trigger context. **Signals** - Triggered by a signal event. **Validation Rule** - Triggered as part of a Validation Rule evaluation. **Dynamic** - Triggered dynamically based on runtime conditions.
One of: Button, Automation, Schedule, Related List, Standalone, Signals, Validation Rule, Dynamic
descriptionstring or nullOptionalThe description of the function's purpose and behavior.
Maximum length: 3000
namestring or nullOptionalThe display name of the function.
Maximum length: 100
Minimum length: 3
Pattern: ^[A-Za-z][A-Za-z0-9 _-]*$
runtimestring or nullOptionalThe execution runtime environment for the function. Possible values: **Deluge 1.0** - Deluge scripting language, version 1.0. **Java 8** - Java language runtime, version 8. **Java 17** - Java language runtime, version 17. **NodeJS 8** - Node.js runtime, version 8. **NodeJS 22** - Node.js runtime, version 22. **Python 3.12** - Python language runtime, version 3.12.
One of: Deluge 1.0, Java 8, Java 17, NodeJS 8, NodeJS 22, Python 3.12
Publish a function — request body — path
FieldTypePresenceDescription and constraints
$objectRootAdditional keys: not allowed
fxIdentifierstringRequired within parentMaximum length: 255
fxIdentifier (anyOf 1)JSONAlternativeNumeric identifier of the function.
fxIdentifier (anyOf 1) (allOf 1)stringAll variants applyNumeric identifier of the function.
Format: int64
Maximum length: 19
Minimum length: 5
Pattern: ^[0-9]+$
fxIdentifier (anyOf 2)JSONAlternativeAPI name of the function.
fxIdentifier (anyOf 2) (allOf 1)stringAll variants applyAPI name of the function.
Maximum length: 100
Pattern: ^[A-Za-z][A-Za-z0-9_-]*$
Function — functions delete Function — response body — functions item
FieldTypePresenceDescription and constraints
$objectRootRepresents a success result for a function create, update, or delete operation, including the operation result code, the function ID, a status indicator, and a descriptive message.
Additional keys: not allowed
codestringRequired within parentRepresents the operation result code. Possible values: **SUCCESS** - The operation completed successfully.
Known values: SUCCESS
detailsModelRequired within parentExpand Publish a function — response body — publish item details
messagestringRequired within parentRepresents the message describing the outcome of the operation.
Maximum length: 255
statusstringRequired within parentRepresents the status of the operation. Possible values: **success** - The operation completed without errors.
Known values: success

Referenced models: Publish a function — response body — publish item details

Update a function by identifier — response body — functions functions item
FieldTypePresenceDescription and constraints
$objectRootRepresents a partial-success result item within a 207 multi-status response, indicating that the function draft was saved but the publish step failed due to compilation errors.
Additional keys: not allowed
codestringOptionalRepresents the operation result code for the partial-success response, indicating whether the draft save and publish steps succeeded or failed.
Maximum length: 255
detailsModelOptionalExpand Update a function by identifier — response body — functions functions item details
messagestringOptionalRepresents the message describing the outcome of the operation, indicating that the draft was saved but the publish step failed.
Maximum length: 255
statusstringOptionalRepresents the overall status of the operation, reflecting the outcome of the draft save step regardless of whether the subsequent publish step succeeded.
Maximum length: 255

Referenced models: Update a function by identifier — response body — functions functions item details

Publish a function — response body — publish item details
FieldTypePresenceDescription and constraints
$objectRootDetails object returned in success responses, containing the unique identifier of the affected resource.
Additional keys: not allowed
idstringOptionalRepresents the unique identifier of the function that was created, updated, or deleted.
Format: int64
Update a function by identifier — response body — functions functions item details
FieldTypePresenceDescription and constraints
$objectRootRepresents the details returned in a 207 partial success response, including the function ID and any compilation errors that caused the publish step to fail.
Additional keys: not allowed
errorsModelOptionalExpand Update a function by identifier — response body — functions functions item details errors
idstringRequired within parentRepresents the unique identifier of the function that was created or updated.
Format: int64

Referenced models: Update a function by identifier — response body — functions functions item details errors

Update a function by identifier — response body — functions functions item details errors
FieldTypePresenceDescription and constraints
$objectRootRepresents the error response returned when a non-Deluge function's code fails to compile during a publish attempt. Contains the error code **COMPILATION_ERROR**, along with details that include the file, line, and message for each compilation error.
Additional keys: not allowed
codestringRequired within parentRepresents the error code for the response. Possible values: **COMPILATION_ERROR** - Indicates the function's code failed to compile.
Known values: COMPILATION_ERROR
detailsobjectRequired within parentRepresents the error details for the compilation failure, including the list of individual errors found in the code.
Additional keys: not allowed
details.errorsarrayRequired within parentThe list of compilation errors found in the function code.
Maximum items: 5000
details.errors[]objectEach itemRepresents a single compilation error entry, containing the file path, line number, and error message.
Additional keys: not allowed
details.errors[].filestringOptionalRelative file path within the code package where the error occurred.
Maximum length: 5000
details.errors[].lineJSONOptional
details.errors[].line (anyOf 1)integerAlternativeLine number in the source file where the error occurred.
Format: int32
details.errors[].line (anyOf 2)stringAlternativePattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$
details.errors[].messagestringRequired within parentThe description of the compilation error.
Maximum length: 5000
messagestringRequired within parentThe error message returned when a function publish operation fails due to compilation errors. Possible values: **function publish failed due to compilation errors** - Indicates that the function could not be published because the code contains compilation errors.
Known values: function publish failed due to compilation errors
statusstringRequired within parentThe status of the response when a compilation error occurs. Possible values: **error** - Indicates that the operation failed due to a compilation error.
Known values: error

SDK function policy ID: zoho.updatefunction. Catalog operation: updateFunction. Rules can name either ID; function rules distinguish managed calls and conservatively cover raw calls sharing the route. Existing grant permissions and policy rules apply. wait() returns an immediate result or waits for a required approval; it never approves the request itself. Persist the approval ID to resume after a restart.

Provider errors retain their response; JSON decoding raises ProviderAPIError for provider failures. ManagedOperationError identifies contract/input/retention errors. See error handling and provider-specific behavior. Sensitive input may be refused before approval storage. A decoding error never resubmits a write.

Official provider source

Report an issue with this page

Necessary

Required for sign-in, security, authorization, and remembering your choices.

Always active

Analytics

Helps us understand which product and documentation features are useful.

Performance diagnostics

Uses performance tracing and privacy-masked session replay to diagnose problems.

You can change these choices at any time from Cookie settings.