Skip to main content
POST
/
v1
/
custom_functions
/
{function_id}
/
execute
Execute Custom Function
curl --request POST \
  --url https://api.example.com/v1/custom_functions/{function_id}/execute \
  --header 'x-api-key: <api-key>'
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>",
      "input": "<unknown>",
      "ctx": {}
    }
  ]
}
Execute a custom function directly with the provided parameters. The function must be in ready status. Parameters are passed as key-value pairs matching the function’s input_schema.

Path Parameters

function_id
string
required
Unique identifier of the custom function to execute

Request Body

Pass parameters as key-value pairs matching the function’s input_schema. The exact fields depend on the function definition.

Response

Returns the function execution result.

Example Request

curl -X POST "https://api.xpander.ai/v1/custom_functions/<function-id>/execute" \
  -H "Content-Type: application/json" \
  -H "x-api-key: <your-api-key>" \
  -d '{"city": "San Francisco"}'

Notes

  • The function must be in ready status — functions in analysing or error status cannot be executed
  • Parameters must match the function’s input_schema (see Get Custom Function)
  • Useful for testing functions before attaching them to agents

Authorizations

x-api-key
string
header
required

API Key for authentication

Path Parameters

function_id
string
required

Response

Successful Response