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.
Call through Alter
Section titled “Call through Alter”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 osfrom alter_sdk import Appfrom 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()| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
path | Model | Required within parent | Expand Publish a function — request body — path |
body | object | Optional | Multipart 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.code | object | Optional | Specify the binary file content of the function code package to upload. Additional keys: not allowed |
body.code.filename | string | Required within parent | Minimum length: 1 |
body.code.content_type | string | Required within parent | Minimum length: 1 |
body.code.content_base64 | string | Required within parent | |
body.metadata | object | Optional | JSON 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.functions | array or null | Optional | The list of function objects to include in the update request. Maximum items: 1 |
body.metadata.functions[] | Model | Each item | Expand Update a function by identifier — request body — body metadata functions item |
body.metadata.publish | object | Optional | Publish configuration with an optional changelog message. Additional keys: not allowed |
body.metadata.publish.changelog | string or null | Optional | Changelog 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
Section titled “Response”Response media type: application/json. The table describes the pinned successful response. Referenced models link to their complete fields.
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | JSON | Root | |
$ (anyOf 1) | Model | Alternative | Expand Update a function by identifier — response body — functions — Putfunctions Response200 |
$ (anyOf 2) | Model | Alternative | Expand 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
Schemas
Section titled “Schemas”Update a function by identifier — response body — functions — Putfunctions Response200
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | The response returned after a successful function update. Additional keys: not allowed |
functions | array | Required within parent | The list of function update result objects returned after the operation. Maximum items: 1 |
functions[] | Model | Each item | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents a partial success response for a function update operation. The **functions** array contains the result details for the updated function. Additional keys: not allowed |
functions | array | Required within parent | Represents the list of function update results included in the partial success response. Maximum items: 1 |
functions[] | Model | Each item | Expand 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Schema 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 |
_code | string or null | Optional | Inline 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_name | string or null | Optional | The unique programmatic identifier for the function. Maximum length: 100 Minimum length: 3 Pattern: ^[A-Za-z][A-Za-z0-9_-]*$ |
category | string or null | Optional | The 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 |
description | string or null | Optional | The description of the function's purpose and behavior. Maximum length: 3000 |
name | string or null | Optional | The display name of the function. Maximum length: 100 Minimum length: 3 Pattern: ^[A-Za-z][A-Za-z0-9 _-]*$ |
runtime | string or null | Optional | The 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Additional keys: not allowed |
fxIdentifier | string | Required within parent | Maximum length: 255 |
fxIdentifier (anyOf 1) | JSON | Alternative | Numeric identifier of the function. |
fxIdentifier (anyOf 1) (allOf 1) | string | All variants apply | Numeric identifier of the function. Format: int64 Maximum length: 19 Minimum length: 5 Pattern: ^[0-9]+$ |
fxIdentifier (anyOf 2) | JSON | Alternative | API name of the function. |
fxIdentifier (anyOf 2) (allOf 1) | string | All variants apply | API name of the function. Maximum length: 100 Pattern: ^[A-Za-z][A-Za-z0-9_-]*$ |
Function — functions delete Function — response body — functions item
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents 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 |
code | string | Required within parent | Represents the operation result code. Possible values: **SUCCESS** - The operation completed successfully. Known values: SUCCESS |
details | Model | Required within parent | Expand Publish a function — response body — publish item details |
message | string | Required within parent | Represents the message describing the outcome of the operation. Maximum length: 255 |
status | string | Required within parent | Represents 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents 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 |
code | string | Optional | Represents the operation result code for the partial-success response, indicating whether the draft save and publish steps succeeded or failed. Maximum length: 255 |
details | Model | Optional | Expand Update a function by identifier — response body — functions functions item details |
message | string | Optional | Represents the message describing the outcome of the operation, indicating that the draft was saved but the publish step failed. Maximum length: 255 |
status | string | Optional | Represents 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Details object returned in success responses, containing the unique identifier of the affected resource. Additional keys: not allowed |
id | string | Optional | Represents 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents 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 |
errors | Model | Optional | Expand Update a function by identifier — response body — functions functions item details errors |
id | string | Required within parent | Represents 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
| Field | Type | Presence | Description and constraints |
|---|---|---|---|
$ | object | Root | Represents 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 |
code | string | Required within parent | Represents the error code for the response. Possible values: **COMPILATION_ERROR** - Indicates the function's code failed to compile. Known values: COMPILATION_ERROR |
details | object | Required within parent | Represents the error details for the compilation failure, including the list of individual errors found in the code. Additional keys: not allowed |
details.errors | array | Required within parent | The list of compilation errors found in the function code. Maximum items: 5000 |
details.errors[] | object | Each item | Represents a single compilation error entry, containing the file path, line number, and error message. Additional keys: not allowed |
details.errors[].file | string | Optional | Relative file path within the code package where the error occurred. Maximum length: 5000 |
details.errors[].line | JSON | Optional | |
details.errors[].line (anyOf 1) | integer | Alternative | Line number in the source file where the error occurred. Format: int32 |
details.errors[].line (anyOf 2) | string | Alternative | Pattern: ^-?[0-9]+(?:\.[0-9]+)?(?:[eE][+-]?[0-9]+)?$ |
details.errors[].message | string | Required within parent | The description of the compilation error. Maximum length: 5000 |
message | string | Required within parent | The 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 |
status | string | Required within parent | The 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 |
Policy, approvals and errors
Section titled “Policy, approvals and errors”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.