Functions
Functions are reusable code blocks that perform specialized tasks. Agents or external calls can invoke these functions to automate complex operations effortlessly.
Retrieve all functions created on the platform. Functions can be linked to agents to enable specialized operations.
List of functions retrieved successfully.
Server error while listing functions.
GET /v1/functions HTTP/1.1
Host: api.aver.co
Accept: */*
[
{
"id": "function_abcde",
"name": "analyzeMarket",
"description": "Analyzes market data and returns insights.",
"code": "function analyzeMarket(data) { /* ... */ }"
}
]
Add a new function that can be executed by an agent.
Actual code for the function.
Function created successfully.
Invalid function data.
Server error while creating the function.
POST /v1/functions HTTP/1.1
Host: api.aver.co
Content-Type: application/json
Accept: */*
Content-Length: 50
{
"name": "text",
"description": "text",
"code": "text"
}
{
"id": "function_abcde",
"name": "analyzeMarket",
"description": "Analyzes market data and returns insights.",
"code": "function analyzeMarket(data) { /* ... */ }"
}
Retrieve details about a specific function, including its code, parameters, and usage statistics.
The unique identifier of the function.
Function details retrieved successfully.
Function not found.
Server error while fetching function details.
GET /v1/functions/{id} HTTP/1.1
Host: api.aver.co
Accept: */*
{
"id": "function_abcde",
"name": "analyzeMarket",
"description": "Analyzes market data and returns insights.",
"code": "function analyzeMarket(data) { /* ... */ }"
}
Edit the metadata or code of an existing function.
The unique identifier of the function.
Function updated successfully.
Invalid update payload.
Function not found.
Server error while updating the function.
PATCH /v1/functions/{id} HTTP/1.1
Host: api.aver.co
Content-Type: application/json
Accept: */*
Content-Length: 36
{
"description": "text",
"code": "text"
}
{
"id": "function_abcde",
"name": "analyzeMarket",
"description": "Analyzes market data and returns insights.",
"code": "function analyzeMarket(data) { /* ... */ }"
}
Remove a function by its unique identifier.
The unique identifier of the function.
Function deleted successfully. No content in response.
Function not found.
Server error while deleting the function.
DELETE /v1/functions/{id} HTTP/1.1
Host: api.aver.co
Accept: */*
No content
Execute the specified function without linking it to an agent. Useful for quick testing or external usage.
The unique identifier of the function.
Input needed for the function.
Function invoked successfully.
Invalid input data.
Function not found.
Server error while invoking the function.
POST /v1/functions/{id}/invoke HTTP/1.1
Host: api.aver.co
Content-Type: application/json
Accept: */*
Content-Length: 16
{
"inputData": {}
}
{
"result": {},
"message": "Function executed successfully."
}
Last updated