Get Function by ID
Endpoint used to get functions by ID.
Request Example
Section titled “Request Example”curl --request GET \ --url https://chat.api.toolzz.com.br/api/v1/functions/{functionId} \ --header 'Authorization: Bearer TOKEN_HERE'Response Example
Section titled “Response Example”{ "id": "uuid", "institutionId": "uuid", "userId": "uuid", "unityId": "uuid", "name": "<string>", "description": "<string>", "code": "<javascript_code_string>", "iconFileId": "uuid", "status": true, "color": "<string>", "isActivated": true, "pluginIcon": { "id": "uuid", "institutionId": "uuid", "type": "PluginIcon", "fileName": "<string>", "url": "<url>", "extension": "<string>", "size": 123 }, "outputs": [ { "id": "uuid", "type": "number | string | boolean", "description": "<string>", "property": "<variable_name>", "required": false } ], "googleCalendarPlugin": [], "discordPlugin": [], "telegramPlugin": []}Request description
Section titled “Request description”Access Token
Section titled “Access Token”| Parameter | Type | Description | Required |
|---|---|---|---|
Authorization | String | Access token (“Bearer” must be before the token) | Yes |
URL Parameters (Path)
Section titled “URL Parameters (Path)”| Parameter | Type | Description | Required |
|---|---|---|---|
functionId | UUID | Unique function identifier. | Yes |
Response description
Section titled “Response description”| Key | Type | Description |
|---|---|---|
id | UUID | Unique identifier of the custom function. |
institutionId | UUID | ID of the institution owning the plugin. |
userId | UUID | ID of the user who created or manages the function. |
unityId | UUID | ID of the organizational unit where the plugin is available. |
name | String | Identification name of the function (e.g., “media2”). |
description | String | Explanation of the function behavior (used by AI to know when to call it). |
code | String | JavaScript (Node.js) code block that will be executed asynchronously. |
status | Boolean | Indicates if the function record is active in the database. |
isActivated | Boolean | Defines if the plugin is enabled for immediate use by the AI agent. |
color | String | Visual identification color of the plugin in the interface. |
pluginIcon | Object | Object containing metadata of the plugin’s icon image. |
pluginIcon.url | URL | Direct link to the icon image. |
pluginIcon.fileName | String | Physical file name stored in storage. |
outputs[] | Array | Definition of input/output variables that the function handles. |
outputs[].property | String | Name of the variable that will be accessed in the code via args.<property>. |
outputs[].type | String | Expected data type for the property (e.g., number). |
outputs[].description | String | Description of what that field represents. |
outputs[].required | Boolean | Defines if the property is mandatory for function execution. |
googleCalendarPlugin | Array | Specific integration settings for Google Calendar. |
discordPlugin | Array | Specific integration settings for Discord. |
telegramPlugin | Array | Specific integration settings for Telegram. |
Security
Section titled “Security”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:
- Log in to the ToolzzAI platform
- Click on “Settings”
- Click on “Access Token”
- Copy the access token
