curl --request POST \
--url https://api.xpander.ai/v1/agents/{agent_id}/export \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"with_knowledge_bases": true
}
'{
"id": "<string>",
"name": "<string>",
"icon": "<string>",
"description": "<string>",
"organization_id": "<string>",
"agent_definition": {
"id": "<string>",
"name": "<string>",
"custom_functions": [
{
"id": "<string>",
"name": "<string>",
"input_schema": {},
"status": "draft",
"limits": {},
"source_code": "<string>",
"description": "<string>",
"technical_description": "<string>"
}
],
"connectors": [
{
"id": "<string>",
"open_api_spec_id": "<string>",
"name": "",
"description": "",
"general_params": [],
"operation_ids": [],
"operations_with_details": [],
"cc_id": "<string>",
"root_id": "<string>",
"code": "<string>",
"openapi_spec": "<string>",
"is_custom": false,
"owner": "<string>",
"version": 123,
"total_operations": 123,
"operations_map": {}
}
],
"description": "",
"unique_name": "",
"icon": "๐",
"avatar": "male-avatar",
"type": "manager",
"delegation_type": "router",
"delegation_memory_strategy": "summarization",
"created_by_prompt": "<string>",
"is_ai_employee": false,
"prompts": [],
"llm_settings": [],
"source_nodes": [],
"attached_tools": [],
"access_scope": "organizational",
"instructions": {
"role": [],
"goal": [],
"general": ""
},
"oas": {},
"graph": [],
"status": "ACTIVE",
"version": 1,
"model_provider": "openai",
"model_name": "gpt-4.1",
"sub_agents": [],
"knowledge_bases": []
}
}Export an AI agent as a reusable template with configuration and knowledge bases
curl --request POST \
--url https://api.xpander.ai/v1/agents/{agent_id}/export \
--header 'Content-Type: application/json' \
--header 'x-api-key: <api-key>' \
--data '
{
"name": "<string>",
"description": "<string>",
"icon": "<string>",
"with_knowledge_bases": true
}
'{
"id": "<string>",
"name": "<string>",
"icon": "<string>",
"description": "<string>",
"organization_id": "<string>",
"agent_definition": {
"id": "<string>",
"name": "<string>",
"custom_functions": [
{
"id": "<string>",
"name": "<string>",
"input_schema": {},
"status": "draft",
"limits": {},
"source_code": "<string>",
"description": "<string>",
"technical_description": "<string>"
}
],
"connectors": [
{
"id": "<string>",
"open_api_spec_id": "<string>",
"name": "",
"description": "",
"general_params": [],
"operation_ids": [],
"operations_with_details": [],
"cc_id": "<string>",
"root_id": "<string>",
"code": "<string>",
"openapi_spec": "<string>",
"is_custom": false,
"owner": "<string>",
"version": 123,
"total_operations": 123,
"operations_map": {}
}
],
"description": "",
"unique_name": "",
"icon": "๐",
"avatar": "male-avatar",
"type": "manager",
"delegation_type": "router",
"delegation_memory_strategy": "summarization",
"created_by_prompt": "<string>",
"is_ai_employee": false,
"prompts": [],
"llm_settings": [],
"source_nodes": [],
"attached_tools": [],
"access_scope": "organizational",
"instructions": {
"role": [],
"goal": [],
"general": ""
},
"oas": {},
"graph": [],
"status": "ACTIVE",
"version": 1,
"model_provider": "openai",
"model_name": "gpt-4.1",
"sub_agents": [],
"knowledge_bases": []
}
}true: Includes all knowledge bases with their documents and filesfalse: Exports only agent configuration without knowledge basesAgentTemplate object:
Show Agent Definition Object
curl -X POST -H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Customer Support Agent Template",
"description": "Pre-configured agent for customer support workflows",
"icon": "๐ง",
"with_knowledge_bases": true
}' \
https://api.xpander.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/export
curl -X POST -H "x-api-key: YOUR_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"name": "Support Agent Config",
"description": "Agent configuration only",
"icon": "๐ง",
"with_knowledge_bases": false
}' \
https://api.xpander.ai/v1/agents/550e8400-e29b-41d4-a716-446655440000/export
{
"id": "template-123",
"name": "Customer Support Agent Template",
"description": "Pre-configured agent for customer support workflows",
"icon": "๐ง",
"organization_id": "org-456",
"agent_definition": {
"id": "agent-789",
"name": "Support Agent",
"description": "Handles customer inquiries",
"instructions": {
"role": ["Customer support specialist"],
"goal": ["Resolve customer issues efficiently"],
"general": "Be helpful and professional"
},
"custom_functions": [],
"connectors": [],
"sub_agents": [],
"knowledge_bases": [
{
"name": "Product Documentation",
"description": "Product guides and FAQs",
"documents": [
{
"name": "User Guide",
"url": "https://...",
"content": "..."
}
]
}
]
}
}
with_knowledge_bases: true, the export includes all document content which may result in larger payloadsAPI Key for authentication
Successful Response
Show child attributes
Show child attributes
draft, analysing, ready, error Show child attributes
Show child attributes
path, query, header, cookie Enumeration of the agent types.
Attributes: Manager: marks the agent as a Managing agent. Regular: marks the agent as a regular agent. A2A: marks the agent as an external agent used via A2A protocol. Curl: marks the agent as an external agent used via a CURL.
manager, regular, a2a, curl Enumeration of the agent delegation types.
Attributes: Router: Marks the agent as a router agent - xpanderAI's LLM will decide which sub-agent to trigger. Sequence: Marks the agent as a sequence agent - sub-agents will delegate to other sub-agents.
router, sequence Enumeration of the agent delegation memory strategies.
Attributes: Full: The memory object will be passed completely between agents. Summarization: Between each sub-agent delegation, a summarization will occur, and a new thread will be created for each agent. OriginalInput: the sub agent will get the initial task with a fresh memory thread
full, summarization, original-input Show child attributes
Show child attributes
personal, organizational Show child attributes
source_node, agent, tool, human_in_the_loop, xpsleep-agent-delay, custom_agent, storage, coding_agent, mcp sdk, task, assistant, webhook, operation, custom_function, local_tool Show child attributes
Show child attributes
Show child attributes
slack Show child attributes
local, remote stdio, sse, streamable-http api_key, oauth2, custom_headers, none Show child attributes
before, after Enumeration of possible agent statuses.
Attributes: DRAFT: Agent is in a draft state. ACTIVE: Agent is active and operational. INACTIVE: Agent is inactive and not operational.
DRAFT, ACTIVE, INACTIVE openai, nim, amazon_bedrock, huggingFace, friendlyAI, anthropic, gemini, fireworks, google_ai_studio, helicone, open_router, nebius Show child attributes
Was this page helpful?