curl "https://api.magpipe.ai/functions/v1/custom-functions?agent_id=123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_API_KEY"
[
{
"id": "789e0123-e89b-12d3-a456-426614174000",
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "check_order_status",
"description": "Look up customer order status by order ID",
"http_method": "POST",
"endpoint_url": "https://api.yourstore.com/orders/status",
"headers": [],
"body_schema": [
{
"name": "order_id",
"type": "string",
"description": "The customer order ID",
"required": true
}
],
"response_variables": [
{"name": "status", "json_path": "$.data.status"}
],
"timeout_ms": 120000,
"max_retries": 2,
"is_active": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "abc12345-e89b-12d3-a456-426614174000",
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "get_account_balance",
"description": "Check customer account balance",
"http_method": "GET",
"endpoint_url": "https://api.yourservice.com/balance",
"headers": [],
"body_schema": [
{
"name": "account_number",
"type": "string",
"description": "Customer account number",
"required": true
}
],
"response_variables": [
{"name": "balance", "json_path": "$.balance"}
],
"timeout_ms": 120000,
"max_retries": 2,
"is_active": true,
"created_at": "2024-01-14T09:00:00Z",
"updated_at": "2024-01-14T09:00:00Z"
}
]
Custom Functions
List Custom Functions
List all custom functions for an agent
GET
/
custom-functions
curl "https://api.magpipe.ai/functions/v1/custom-functions?agent_id=123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_API_KEY"
[
{
"id": "789e0123-e89b-12d3-a456-426614174000",
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "check_order_status",
"description": "Look up customer order status by order ID",
"http_method": "POST",
"endpoint_url": "https://api.yourstore.com/orders/status",
"headers": [],
"body_schema": [
{
"name": "order_id",
"type": "string",
"description": "The customer order ID",
"required": true
}
],
"response_variables": [
{"name": "status", "json_path": "$.data.status"}
],
"timeout_ms": 120000,
"max_retries": 2,
"is_active": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "abc12345-e89b-12d3-a456-426614174000",
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "get_account_balance",
"description": "Check customer account balance",
"http_method": "GET",
"endpoint_url": "https://api.yourservice.com/balance",
"headers": [],
"body_schema": [
{
"name": "account_number",
"type": "string",
"description": "Customer account number",
"required": true
}
],
"response_variables": [
{"name": "balance", "json_path": "$.balance"}
],
"timeout_ms": 120000,
"max_retries": 2,
"is_active": true,
"created_at": "2024-01-14T09:00:00Z",
"updated_at": "2024-01-14T09:00:00Z"
}
]
Retrieve all custom functions configured for a specific agent.
Query Parameters
UUID of the agent to list functions for
Response
Returns an array of custom function objects.UUID of the function
UUID of the agent
Function name
Function description
HTTP method (GET, POST, etc.)
Webhook URL
Whether the function is active
ISO 8601 timestamp
curl "https://api.magpipe.ai/functions/v1/custom-functions?agent_id=123e4567-e89b-12d3-a456-426614174000" \
-H "Authorization: Bearer YOUR_API_KEY"
[
{
"id": "789e0123-e89b-12d3-a456-426614174000",
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "check_order_status",
"description": "Look up customer order status by order ID",
"http_method": "POST",
"endpoint_url": "https://api.yourstore.com/orders/status",
"headers": [],
"body_schema": [
{
"name": "order_id",
"type": "string",
"description": "The customer order ID",
"required": true
}
],
"response_variables": [
{"name": "status", "json_path": "$.data.status"}
],
"timeout_ms": 120000,
"max_retries": 2,
"is_active": true,
"created_at": "2024-01-15T10:30:00Z",
"updated_at": "2024-01-15T10:30:00Z"
},
{
"id": "abc12345-e89b-12d3-a456-426614174000",
"agent_id": "123e4567-e89b-12d3-a456-426614174000",
"name": "get_account_balance",
"description": "Check customer account balance",
"http_method": "GET",
"endpoint_url": "https://api.yourservice.com/balance",
"headers": [],
"body_schema": [
{
"name": "account_number",
"type": "string",
"description": "Customer account number",
"required": true
}
],
"response_variables": [
{"name": "balance", "json_path": "$.balance"}
],
"timeout_ms": 120000,
"max_retries": 2,
"is_active": true,
"created_at": "2024-01-14T09:00:00Z",
"updated_at": "2024-01-14T09:00:00Z"
}
]
⌘I