Create Custom Function
Create a new custom function with Python source code
xpander_run_action(...) that will be executed when the function is invoked. After creation, the function is automatically analyzed for safety and input schema extraction.
Request Body
Response
Returns{"status": "created", "id": "<function-id>"}. The function is then analyzed, and Get Custom Function shows status: "analysing" until it changes to ready, usually within a few seconds.
Example Request
Notes
- The
xpander_run_actionfunction is the entry point — it must be defined in the source code - After creation, the function is automatically analyzed for safety and input schema extraction
- Status transitions:
analysing→ready(success) oranalysing→error(analysis failed) - Check
analysis_error_detailsif the function moves toerrorstatus
Body
Request model for creating a new custom function.
The source code must define a function called xpander_run_action(...).
This is the entry point that will be called when the function is invoked
by an agent or via the execute endpoint.
After creation, the function is automatically analyzed for:
- Safety (no malicious patterns)
- Input schema extraction (parameters are auto-detected)
- Runnability (syntax validation)
The function status starts as 'analysing' and transitions to 'ready' once analysis completes successfully.
Python source code for the custom function. Must define a function called xpander_run_action(...) (or the name specified in function_name).
The function receives keyword arguments matching its parameter signature. It should return a dict or string result.
Example:
The function runs in a secure Python 3.12 sandbox with common libraries available (requests, json, re, datetime, etc.). Do NOT use: file system access, subprocess, os.system, eval/exec, or network access to internal services.
Response
Successful Response

