Skip to content

Update Function

Endpoint used to update a custom function.

Terminal window
curl --request PUT \
--url https://chat.api.toolzz.com.br/api/v1/functions/{functionId} \
--header 'Authorization: Bearer TOKEN_HERE' \
--header 'Content-Type: application/json' \
--data '
{
"name": "string",
"description": "string",
"code": "string",
"iconFileId": "uuid",
"iconFile": "string",
"userId": "uuid",
"outputs": [
{
"property": "string",
"type": "string",
"description": "string",
"required": false,
"creating": false
}
],
"unityId": "uuid"
}
'
{
"id": "uuid",
"institutionId": "uuid",
"userId": "uuid",
"unityId": "uuid",
"code": "string",
"description": "string",
"iconFileId": "uuid",
"status": true,
"name": "string",
"pluginIcon": {
"id": "uuid",
"institutionId": "uuid",
"type": "string",
"fileName": "string",
"internalStorageUrl": "string",
"url": "string",
"maskName": "string",
"createdAt": "date",
"updatedAt": "date",
"extension": "string",
"size": 123,
"numberWords": null
},
"color": "string",
"outputs": [
{
"required": false,
"id": "uuid",
"type": "string",
"description": "string",
"customFunctionId": "uuid",
"property": "string"
},
{
"required": false,
"id": "uuid",
"type": "string",
"description": "string",
"customFunctionId": "uuid",
"property": "string"
}
],
"isActivated": true,
"type": null,
"googleCalendarPlugin": [],
"discordPlugin": [],
"telegramPlugin": []
}
ParameterTypeDescriptionRequired
AuthorizationStringAccess token (“Bearer” must be before the token)Yes
ParameterTypeDescription
nameStringIdentification name of the custom function.
descriptionStringText describing what the function does and when it should be called.
codeStringThe JavaScript (asynchronous) code that will be executed by the engine.
iconFileIdUUIDUnique identifier of the icon file already existing in the system.
iconFileStringURL or reference path for the icon file.
userIdUUIDIdentifier of the user creating the function.
unityIdUUIDIdentifier of the organizational unit to which the function belongs.
outputsArrayList of objects that define the input/output parameters of the function.
outputs[].propertyStringName of the variable that will be accessed via args in the code.
outputs[].typeStringExpected data type for the property (e.g., number, string).
outputs[].descriptionStringBrief explanation of what that specific parameter represents.
outputs[].requiredBooleanDefines if the parameter is mandatory for function execution.
outputs[].creatingBooleanInternal flag for state control during parameter creation.
KeyTypeDescription
idUUIDUnique identifier of the main record.
institutionIdUUIDOwner institution identifier.
userIdUUIDCreating user identifier.
unityIdUUIDOrganizational unit identifier.
codeStringScript or source code of the custom function.
descriptionStringPurpose description of the plugin/function.
iconFileIdUUIDReference to the icon file ID.
statusBooleanDefines if the record is active in the system.
nameStringFunction identification name.
colorStringColor reference for visual interface.
isActivatedBooleanIndicates if the plugin is enabled for immediate use.
typeNullReserved field for future typing.
pluginIconObjectObject with icon metadata (contains: id, url, size, createdAt, etc.).
pluginIcon.urlStringPublic link for viewing the icon image.
pluginIcon.extensionStringFile extension (e.g., “jpeg”, “png”).
pluginIcon.sizeNumberIcon file size in bytes.
outputsArrayList of objects defining the output variables.
outputs[].idUUIDUnique identifier of the output parameter.
outputs[].propertyStringName of the variable used in the code.
outputs[].typeStringExpected data type (e.g., “number”, “string”).
outputs[].requiredBooleanDefines if filling this field is mandatory.
googleCalendarPluginArrayList of settings for Google Calendar integration.
discordPluginArrayList of settings for Discord integration.
telegramPluginArrayList of settings for Telegram integration.

To access this endpoint, it is necessary to send a valid access token through the authorization header (Authorization) of the request. Additionally, the API is protected by other security measures to safeguard user data.

To access your access token, follow these steps:

  1. Log in to the ToolzzAI platform
  2. Click on “Settings”
  3. Click on “Access Token”
  4. Copy the access token

Access token page