Skip to main content
GET
/
v1
/
custom_functions
/
{function_id}
Get Custom Function
curl --request GET \
  --url https://api.example.com/v1/custom_functions/{function_id} \
  --header 'x-api-key: <api-key>'
{
  "id": "<string>",
  "name": "<string>",
  "description": "<string>",
  "technical_description": "<string>",
  "status": "<string>",
  "limits": {
    "max_run_time": 15
  },
  "input_schema": {},
  "source_code": "<string>",
  "analysis_error_details": "<string>",
  "organization_id": "<string>",
  "created_at": "<string>"
}
Retrieve a custom function by its ID, including the full source code, auto-extracted input schema, and current status.

Path Parameters

function_id
string
required
Unique identifier of the custom function

Response

Returns the full CustomFunctionItem object.

Example Request

curl -X GET -H "x-api-key: <your-api-key>" \
  "https://api.xpander.ai/v1/custom_functions/<function-id>"

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

function_id
string
required

Response

Successful Response

Public-facing custom function response model.

Returned by list and get endpoints. Contains function metadata, status, auto-detected input schema, and source code.

To use a custom function as an agent tool:

  1. Add to attached_tools: {"id": "xpander-custom-functions", "operation_ids": ["<function_id>"]}
  2. Add to graph: {"item_id": "<function_id>", "name": "<function_name>", "type": "tool", "targets": []}
id
string
required

Unique identifier of the custom function.

name
string
required

Human-readable name of the function.

description
string | null

Description of what the function does.

technical_description
string | null

Auto-generated technical description from code analysis. Explains the function's logic, inputs, and outputs.

status
string | null

Current function status. 'analysing' = being analyzed after create/update, 'ready' = available for execution, 'error' = analysis failed (check analysis_error_details), 'draft' = not yet analyzed.

limits
CustomFunctionLimitsModel · object

Resource limits for execution.

input_schema
Input Schema · object

Auto-detected JSON schema of the function's input parameters. Generated during analysis from the function signature and type hints.

source_code
string | null

Python source code of the function. Only included in get-by-id responses, not in list.

analysis_error_details
string | null

Error details if the function analysis failed. Only present when status is 'error'.

organization_id
string | null

Organization that owns this function.

created_at
string | null

ISO timestamp of when the function was created.