AI Agent Function
  • 18 Sep 2025
  • 4 Minutes to read
  • Dark
    Light

AI Agent Function

  • Dark
    Light

Article summary

Function

Function JSON Format

Function is represented as simple flat JSON objects with the following keys:

NameTypeDescription
idguidId of the function.
aiAgentIdguidId of the AI agent.
namestringName of the function.
descriptionstringDescription of the function.
isGlobalboolIf disabled, this function will not be called by AI Agent directly. But it can be used in Topics and can be called by AI Agent if the Topic is triggered.
usedInTopicsintegerNumber of topics using this function.
inputParametersFunction Input Parameter ArrayInput parameters for the function.
apiRequestFunction API RequestAPI request configuration.
responseMetasFunction Response To Variable ArrayResponse to variable mappings.

Function Input Parameter JSON Format

NameTypeDescription
idguidId of the parameter.
functionIdguidId of the function.
namestringA short name to describe what this parameter means.
typeenumAllowed values are String, Integer, Float, Boolean.
descriptionstringA detailed description explaining the meaning of this parameter.
isRequiredboolWhether this parameter is required.

Function API Request JSON Format

NameTypeDescription
functionIdguidId of the function.
httpMethodenumAllowed values are GET, POST, PUT, DELETE.
urlstringAPI Endpoint. Can use input parameters and dynamic info.
isAuthorizationRequiredboolWhether authorization is required.
authorizationCredentialIdguidAuthorization Credential Id.
httpHeadersFunction API Request Header ArrayHTTP Headers.
requestBodystringJSON Body. Can use input parameters and dynamic info.

Function API Request Header JSON Format

NameTypeDescription
idguidId of the header.
apiRequestIdguidId of the API request.
keystringHeader Name.
valuestringHeader Value.
orderintegerOrder of the header.

Function Response To Variable JSON Format

NameTypeDescription
idguidId of the response mapping.
functionIdguidId of the function.
responseKeystringThe JSON key name.
descriptionstringDescribe the meaning of this key, so that LLM can better understand it.
variableNamestringSave the value to a bot variable to use later.
orderintegerOrder of the mapping.

Get the list of Functions

GET aiagent/functions

Parameters:

NameTypeinRequiredDescription
siteIdintegerqueryyesSite Id.
aiAgentIdguidqueryyesFilter functions by AI agent ID.
namestringquerynoFilter functions by exact name match.
keywordsstringquerynoSearch for functions containing these keywords.
pageSizeintegerquerynoNumber of functions to return per page.
pageIndexintegerquerynoPage number to retrieve. Default is 1.

Response:

An array of Function

Example

Sample Request:

curl https://api11.comm100.io/aiagent/functions?siteId=10000&aiAgentId=ec9f351e-d7d7-45fc-81aa-2fdd9e706f17 \
    -X GET
    -H 'Authorization Bearer {access_token}'

Response:
HTTP/1.1 200 OK

[
    {
        "id": "5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d",
        "aiAgentId": "ec9f351e-d7d7-45fc-81aa-2fdd9e706f17",
        "name": "callback",
        "description": "",
        "isGlobal": true,
        "usedInTopics": 0,
        "inputParameters": [],
        "apiRequest": {
            "functionId": "5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d",
            "httpMethod": "get",
            "url": "https://en.wikipedia.org/wiki/Main_Page",
            "isAuthorizationRequired": false,
            "authorizationCredentialId": "00000000-0000-0000-0000-000000000000",
            "requestBody": "",
            "httpHeaders": []
        },
        "responseMetas": []
    }
]

Get a single Function

GET aiagent/functions/{id}

Parameters:

NameTypeinRequiredDescription
siteIdintegerqueryyesSite Id.
idguidpathyesID of the function to retrieve.

Response:

Function

Example

Sample Request:

curl https://api11.comm100.io/aiagent/functions/5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d?siteId=10000 \ 
    -X GET \
    -H 'Authorization Bearer {access_token}'

Response:
HTTP/1.1 200 OK

{
    "id": "5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d",
    "aiAgentId": "ec9f351e-d7d7-45fc-81aa-2fdd9e706f17",
    "name": "callback",
    "description": "",
    "isGlobal": true,
    "usedInTopics": 0,
    "inputParameters": [],
    "apiRequest": {
        "functionId": "5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d",
        "httpMethod": "get",
        "url": "https://en.wikipedia.org/wiki/Main_Page",
        "isAuthorizationRequired": false,
        "authorizationCredentialId": "00000000-0000-0000-0000-000000000000",
        "requestBody": "",
        "httpHeaders": []
    },
    "responseMetas": []
}

Create a new Function

POST aiagent/functions

Parameters:

NameTypeinRequiredDescription
aiAgentIdguidbodyyesID of the AI agent to which this function belongs.
namestringbodyyesName of the function. Must be unique within an AI agent.
descriptionstringbodynoDetailed description of what the function does.
isGlobalboolbodyyesIf true, this function can be called directly by AI Agent. If false, it can only be used in Topics.
inputParametersFunction Input Parameter ArraybodyyesList of parameters required by the function.
apiRequestFunction API RequestbodyyesAPI configuration for the function.
responseMetasFunction Response To Variable ArraybodyyesMappings for the function's response fields to variables.

Response:

Function

Example

Sample Request:

curl https://api11.comm100.io/aiagent/functions \ 
    -X POST \ 
    -H 'Authorization: Bearer {access_token}' \
    -H 'Content-Type: application/json' \
    -D '{"aiAgentId":"ec9f351e-d7d7-45fc-81aa-2fdd9e706f17","name":"callback","description":"","isGlobal":true,"inputParameters":[],"apiRequest":{"httpMethod":"get","url":"https://en.wikipedia.org/wiki/Main_Page","isAuthorizationRequired":false,"authorizationCredentialId":"00000000-0000-0000-0000-000000000000","requestBody":"","httpHeaders":[]},"responseMetas":[]}'

Response:
HTTP/1.1 200 OK

{
    "id": "5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d",
    "aiAgentId": "ec9f351e-d7d7-45fc-81aa-2fdd9e706f17",
    "name": "callback",
    "description": "",
    "isGlobal": true,
    "usedInTopics": 0,
    "inputParameters": [],
    "apiRequest": {
        "functionId": "5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d",
        "httpMethod": "get",
        "url": "https://en.wikipedia.org/wiki/Main_Page",
        "isAuthorizationRequired": false,
        "authorizationCredentialId": "00000000-0000-0000-0000-000000000000",
        "requestBody": "",
        "httpHeaders": []
    },
    "responseMetas": []
}

Update the Function

PUT aiagent/functions/{id}

Parameters:

NameTypeinRequiredDescription
siteIdintegerqueryyesSite Id.
idguidpathyesID of the function to update.
namestringbodynoUpdated name for the function. Must be unique within the AI agent.
descriptionstringbodynoUpdated description of what the function does.
isGlobalboolbodynoUpdated visibility setting for the function.
inputParametersFunction Input Parameter ArraybodynoUpdated list of parameters required by the function.
apiRequestFunction API RequestbodynoUpdated API configuration for the function.
responseMetasFunction Response To Variable ArraybodynoUpdated mappings for the function's response fields to variables.

Response:

Function

Example

Sample Request:

curl https://api11.comm100.io/aiagent/functions/5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d?siteId=10000 \ 
    -X PUT \
    -H 'Authorization Bearer {access_token}' \
    -H 'Content-Type: application/json' \
    -D '{"description":"Updated description of the function."}'

Response:
HTTP/1.1 200 OK

{
    "id": "5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d",
    "aiAgentId": "ec9f351e-d7d7-45fc-81aa-2fdd9e706f17",
    "name": "callback",
    "description": "Updated description of the function.",
    "isGlobal": true,
    "usedInTopics": 0,
    "inputParameters": [],
    "apiRequest": {
        "functionId": "5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d",
        "httpMethod": "get",
        "url": "https://en.wikipedia.org/wiki/Main_Page",
        "isAuthorizationRequired": false,
        "authorizationCredentialId": "00000000-0000-0000-0000-000000000000",
        "requestBody": "",
        "httpHeaders": []
    },
    "responseMetas": []
}

Delete the Function

DELETE aiagent/functions/{id}

Parameters:

NameTypeinRequiredDescription
siteIdintegerqueryyesSite Id.
idguidpathyesID of the function to delete.

Response:

No Content

Example

Sample Request:

curl https://api11.comm100.io/aiagent/functions/5f92bcfe-f223-4ea1-72a2-08dd5afb6d4d?siteId=10000 \ 
    -X DELETE
    -H 'Authorization Bearer {access_token}'

Response:
HTTP/1.1 204 No Content


Was this article helpful?

What's Next