---
title: "Get Custom Function"
method: GET
path: "/v1/custom_functions/{function_id}"
tags: ["API v1", "Custom Functions", "Custom Functions CRUD"]
---

# Get Custom Function

`GET /v1/custom_functions/{function_id}`

## Request

- Base URL: `https://api.xpander.ai` (the document declares no server; this is the origin it was published from)
- URL: `https://api.xpander.ai/v1/custom_functions/{function_id}`
- Auth: API key in header `x-api-key`

Get a custom function by ID, including its source code, input schema, and status.

## Path parameters

- `function_id` string, required

## Response `200`

Successful Response

- CustomFunctionItem: 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, nullable: Description of what the function does.
  - `technical_description` string, nullable: Auto-generated technical description from code analysis. Explains the function's logic, inputs, and outputs.
  - `status` string, nullable: 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: Resource limits for custom function execution.
    - `max_run_time` integer, nullable: Maximum execution time in seconds. The function will be terminated if it exceeds this limit. Default: 15 seconds.
  - `input_schema` object, nullable: Auto-detected JSON schema of the function's input parameters. Generated during analysis from the function signature and type hints.
  - `source_code` string, nullable: Python source code of the function. Only included in get-by-id responses, not in list.
  - `analysis_error_details` string, nullable: Error details if the function analysis failed. Only present when status is 'error'.
  - `organization_id` string, nullable: Organization that owns this function.
  - `project_id` string, nullable: The project the item belongs to; unset means the org's Default project on create.
  - `created_at` string, nullable: ISO timestamp of when the function was created.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/xpander/apis/xpander-ai-api-service.md) - [All operations](https://skmtc.dev/xpander/apis/xpander-ai-api-service/llms.txt) - [OpenAPI document](https://skmtc.dev/xpander/apis/xpander-ai-api-service/revisions/4389ec0875d0?raw)
